@notmrabhi/flowforge 0.1.52 → 0.1.54
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-CrgczPYJ.js → GatewayBranchEdge-BWz43Sat.js} +99 -102
- package/dist/GatewayBranchEdge-BWz43Sat.js.map +1 -0
- package/dist/GatewayBranchEdge-Ukfp7i1Q.js +2 -0
- package/dist/GatewayBranchEdge-Ukfp7i1Q.js.map +1 -0
- package/dist/{templateSkeletons-f-XQQvyE.js → WorkflowExecutionHistory-B0OiFCyi.js} +804 -858
- package/dist/WorkflowExecutionHistory-B0OiFCyi.js.map +1 -0
- package/dist/{templateSkeletons-gOva2Xus.js → WorkflowExecutionHistory-BHb6-2lt.js} +2 -2
- package/dist/WorkflowExecutionHistory-BHb6-2lt.js.map +1 -0
- package/dist/buildBackendPayload-4SwOp7St.js +316 -0
- package/dist/buildBackendPayload-4SwOp7St.js.map +1 -0
- package/dist/buildBackendPayload-BvrjW1uM.js +2 -0
- package/dist/buildBackendPayload-BvrjW1uM.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +0 -61
- package/dist/canvas.js +21 -25
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +163 -24
- package/dist/core.js +11 -9
- package/dist/core.js.map +1 -1
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/form.d.ts +0 -35
- package/dist/index-B-D9UuLO.js.map +1 -1
- package/dist/index-DUbQPmIx.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -43
- package/dist/index.js +123 -443
- package/dist/index.js.map +1 -1
- package/dist/nodeRegistry.d.ts +0 -24
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-CMY30xhz.js +0 -2
- package/dist/GatewayBranchEdge-CMY30xhz.js.map +0 -1
- package/dist/GatewayBranchEdge-CrgczPYJ.js.map +0 -1
- package/dist/templateSkeletons-f-XQQvyE.js.map +0 -1
- package/dist/templateSkeletons-gOva2Xus.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import Dn, { useStore as
|
|
1
|
+
import { jsxs as v, jsx as u, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import B, { useRef as _t, useEffect as re, useState as M, useCallback as Y, useMemo as K } from "react";
|
|
3
|
+
import Dn, { useStore as Bn, useReactFlow as An, Background as Wn, Controls as $n, MiniMap as Gn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Yn, G as Kn, E as
|
|
6
|
-
import { Dialog as Jn, Box as Q, Drawer as Zn, IconButton as
|
|
5
|
+
import { e as Yn, G as Kn, E as Hn, P as Vn, L as Un, d as Xn, f as qn } from "./GatewayBranchEdge-BWz43Sat.js";
|
|
6
|
+
import { Dialog as Jn, Box as Q, Drawer as Zn, IconButton as St, Button as Ne, CircularProgress as Qn } from "@mui/material";
|
|
7
7
|
import er from "react-select";
|
|
8
|
-
import { MdClose as tr, MdCalendarToday as nr, MdBolt as rr, MdArrowBack as Kt, MdChevronRight as
|
|
8
|
+
import { MdClose as tr, MdCalendarToday as nr, MdBolt as rr, MdArrowBack as Kt, MdChevronRight as Ht, MdAddCircleOutline as or, MdApps as ir, MdErrorOutline as sr, MdAccountTree as lr, MdAdd as dr, MdSearch as ar, MdCategory as cr, MdCancel as Vt, MdError as Ut, MdCheckCircle as Xt, MdPlayArrow as qt, MdHourglassEmpty as fr, MdSchedule as Nt, MdPerson as ur, MdExpandLess as hr, MdExpandMore as gr } from "react-icons/md";
|
|
9
9
|
import { GrTrigger as pr } from "react-icons/gr";
|
|
10
10
|
import { BiCollapse as br, BiExpand as yr } from "react-icons/bi";
|
|
11
|
-
import { j as mr, b as
|
|
11
|
+
import { j as mr, b as vr, O as wr } from "./index-B-D9UuLO.js";
|
|
12
12
|
import { m as Er } from "./messages-CO299wPN.js";
|
|
13
|
-
import { T as
|
|
14
|
-
var Jt = Object.defineProperty,
|
|
13
|
+
import { T as xr, E as ee } from "./canvasTokens-CAD6G24b.js";
|
|
14
|
+
var Jt = Object.defineProperty, kr = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, _r = (e, t) => {
|
|
15
15
|
for (var n in t) Jt(e, n, { get: t[n], enumerable: !0 });
|
|
16
|
-
},
|
|
17
|
-
|
|
16
|
+
}, Sr = (e, t, n) => kr(e, t + "", n), Zt = {};
|
|
17
|
+
_r(Zt, { Graph: () => H, alg: () => Ze, json: () => en, version: () => Cr });
|
|
18
18
|
var Nr = Object.defineProperty, Qt = (e, t) => {
|
|
19
19
|
for (var n in t) Nr(e, n, { get: t[n], enumerable: !0 });
|
|
20
|
-
},
|
|
20
|
+
}, H = class {
|
|
21
21
|
constructor(e) {
|
|
22
22
|
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 = () => {
|
|
23
23
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -148,14 +148,14 @@ var Nr = Object.defineProperty, Qt = (e, t) => {
|
|
|
148
148
|
return e.reduce((n, r) => (t !== void 0 ? this.setEdge(n, r, t) : this.setEdge(n, r), r)), this;
|
|
149
149
|
}
|
|
150
150
|
setEdge(e, t, n, r) {
|
|
151
|
-
let o, i, s, l,
|
|
152
|
-
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t,
|
|
153
|
-
let
|
|
154
|
-
if (
|
|
151
|
+
let o, i, s, l, a = !1;
|
|
152
|
+
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 = r, arguments.length > 2 && (l = n, a = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
153
|
+
let d = pe(this._isDirected, o, i, s);
|
|
154
|
+
if (d in this._edgeLabels) return a && (this._edgeLabels[d] = l), this;
|
|
155
155
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
156
|
-
this.setNode(o), this.setNode(i), this._edgeLabels[
|
|
157
|
-
let c =
|
|
158
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[
|
|
156
|
+
this.setNode(o), this.setNode(i), this._edgeLabels[d] = a ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
157
|
+
let c = Tr(this._isDirected, o, i, s);
|
|
158
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[d] = c, Tt(this._preds[i], o), Tt(this._sucs[o], i), this._in[i][d] = c, this._out[o][d] = c, this._edgeCount++, this;
|
|
159
159
|
}
|
|
160
160
|
edge(e, t, n) {
|
|
161
161
|
let r = arguments.length === 1 ? De(this._isDirected, e) : pe(this._isDirected, e, t, n);
|
|
@@ -194,7 +194,7 @@ var Nr = Object.defineProperty, Qt = (e, t) => {
|
|
|
194
194
|
return n ? r.filter((o) => o.v === t && o.w === n || o.v === n && o.w === t) : r;
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
function
|
|
197
|
+
function Tt(e, t) {
|
|
198
198
|
e[t] ? e[t]++ : e[t] = 1;
|
|
199
199
|
}
|
|
200
200
|
function Ct(e, t) {
|
|
@@ -208,7 +208,7 @@ function pe(e, t, n, r) {
|
|
|
208
208
|
}
|
|
209
209
|
return o + "" + i + "" + (r === void 0 ? "\0" : r);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Tr(e, t, n, r) {
|
|
212
212
|
let o = "" + t, i = "" + n;
|
|
213
213
|
if (!e && o > i) {
|
|
214
214
|
let l = o;
|
|
@@ -221,9 +221,9 @@ function De(e, t) {
|
|
|
221
221
|
return pe(e, t.v, t.w, t.name);
|
|
222
222
|
}
|
|
223
223
|
var Cr = "4.0.1", en = {};
|
|
224
|
-
Qt(en, { read: () =>
|
|
224
|
+
Qt(en, { read: () => jr, write: () => Ir });
|
|
225
225
|
function Ir(e) {
|
|
226
|
-
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: Or(e), edges:
|
|
226
|
+
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: Or(e), edges: Mr(e) }, n = e.graph();
|
|
227
227
|
return n !== void 0 && (t.value = structuredClone(n)), t;
|
|
228
228
|
}
|
|
229
229
|
function Or(e) {
|
|
@@ -232,14 +232,14 @@ function Or(e) {
|
|
|
232
232
|
return n !== void 0 && (o.value = n), r !== void 0 && (o.parent = r), o;
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Mr(e) {
|
|
236
236
|
return e.edges().map((t) => {
|
|
237
237
|
let n = e.edge(t), r = { v: t.v, w: t.w };
|
|
238
238
|
return t.name !== void 0 && (r.name = t.name), n !== void 0 && (r.value = n), r;
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
let t = new
|
|
241
|
+
function jr(e) {
|
|
242
|
+
let t = new H(e.options);
|
|
243
243
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((n) => {
|
|
244
244
|
t.setNode(n.v, n.value), n.parent && t.setParent(n.v, n.parent);
|
|
245
245
|
}), e.edges.forEach((n) => {
|
|
@@ -247,22 +247,22 @@ function Mr(e) {
|
|
|
247
247
|
}), t;
|
|
248
248
|
}
|
|
249
249
|
var Ze = {};
|
|
250
|
-
Qt(Ze, { CycleException: () => Ce, bellmanFord: () => tn, components: () =>
|
|
250
|
+
Qt(Ze, { CycleException: () => Ce, bellmanFord: () => tn, components: () => Pr, dijkstra: () => Te, dijkstraAll: () => Dr, findCycles: () => Br, floydWarshall: () => Wr, isAcyclic: () => Gr, postorder: () => Kr, preorder: () => Hr, prim: () => Vr, shortestPaths: () => Ur, tarjan: () => rn, topsort: () => on });
|
|
251
251
|
var zr = () => 1;
|
|
252
252
|
function tn(e, t, n, r) {
|
|
253
|
-
return
|
|
253
|
+
return Lr(e, String(t), n || zr, r || function(o) {
|
|
254
254
|
return e.outEdges(o);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let o = {}, i, s = 0, l = e.nodes(),
|
|
257
|
+
function Lr(e, t, n, r) {
|
|
258
|
+
let o = {}, i, s = 0, l = e.nodes(), a = function(f) {
|
|
259
259
|
let h = n(f);
|
|
260
260
|
o[f.v].distance + h < o[f.w].distance && (o[f.w] = { distance: o[f.v].distance + h, predecessor: f.v }, i = !0);
|
|
261
|
-
},
|
|
261
|
+
}, d = function() {
|
|
262
262
|
l.forEach(function(f) {
|
|
263
263
|
r(f).forEach(function(h) {
|
|
264
264
|
let g = h.v === f ? h.v : h.w, p = g === h.v ? h.w : h.v;
|
|
265
|
-
|
|
265
|
+
a({ v: g, w: p });
|
|
266
266
|
});
|
|
267
267
|
});
|
|
268
268
|
};
|
|
@@ -271,11 +271,11 @@ function Fr(e, t, n, r) {
|
|
|
271
271
|
o[f] = { distance: h, predecessor: "" };
|
|
272
272
|
});
|
|
273
273
|
let c = l.length;
|
|
274
|
-
for (let f = 1; f < c && (i = !1, s++,
|
|
275
|
-
if (s === c - 1 && (i = !1,
|
|
274
|
+
for (let f = 1; f < c && (i = !1, s++, d(), !!i); f++) ;
|
|
275
|
+
if (s === c - 1 && (i = !1, d(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
276
276
|
return o;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function Pr(e) {
|
|
279
279
|
let t = {}, n = [], r;
|
|
280
280
|
function o(i) {
|
|
281
281
|
i in t || (t[i] = !0, r.push(i), e.successors(i).forEach(o), e.predecessors(i).forEach(o));
|
|
@@ -337,74 +337,74 @@ var nn = class {
|
|
|
337
337
|
let n = this._arr, r = this._keyIndices, o = n[e], i = n[t];
|
|
338
338
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
339
339
|
}
|
|
340
|
-
},
|
|
341
|
-
function
|
|
340
|
+
}, Rr = () => 1;
|
|
341
|
+
function Te(e, t, n, r) {
|
|
342
342
|
let o = function(i) {
|
|
343
343
|
return e.outEdges(i);
|
|
344
344
|
};
|
|
345
|
-
return
|
|
345
|
+
return Fr(e, String(t), n || Rr, r || o);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
let o = {}, i = new nn(), s, l,
|
|
349
|
-
let c =
|
|
350
|
-
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " +
|
|
347
|
+
function Fr(e, t, n, r) {
|
|
348
|
+
let o = {}, i = new nn(), s, l, a = function(d) {
|
|
349
|
+
let c = d.v !== s ? d.v : d.w, f = o[c], h = n(d), g = l.distance + h;
|
|
350
|
+
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + d + " Weight: " + h);
|
|
351
351
|
g < f.distance && (f.distance = g, f.predecessor = s, i.decrease(c, g));
|
|
352
352
|
};
|
|
353
|
-
for (e.nodes().forEach(function(
|
|
354
|
-
let c =
|
|
355
|
-
o[
|
|
356
|
-
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) r(s).forEach(
|
|
353
|
+
for (e.nodes().forEach(function(d) {
|
|
354
|
+
let c = d === t ? 0 : Number.POSITIVE_INFINITY;
|
|
355
|
+
o[d] = { distance: c, predecessor: "" }, i.add(d, c);
|
|
356
|
+
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) r(s).forEach(a);
|
|
357
357
|
return o;
|
|
358
358
|
}
|
|
359
359
|
function Dr(e, t, n) {
|
|
360
360
|
return e.nodes().reduce(function(r, o) {
|
|
361
|
-
return r[o] =
|
|
361
|
+
return r[o] = Te(e, o, t, n), r;
|
|
362
362
|
}, {});
|
|
363
363
|
}
|
|
364
364
|
function rn(e) {
|
|
365
365
|
let t = 0, n = [], r = {}, o = [];
|
|
366
366
|
function i(s) {
|
|
367
367
|
let l = r[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
368
|
-
if (n.push(s), e.successors(s).forEach(function(
|
|
369
|
-
|
|
368
|
+
if (n.push(s), e.successors(s).forEach(function(a) {
|
|
369
|
+
a in r ? r[a].onStack && (l.lowlink = Math.min(l.lowlink, r[a].index)) : (i(a), l.lowlink = Math.min(l.lowlink, r[a].lowlink));
|
|
370
370
|
}), l.lowlink === l.index) {
|
|
371
|
-
let
|
|
371
|
+
let a = [], d;
|
|
372
372
|
do
|
|
373
|
-
|
|
374
|
-
while (s !==
|
|
375
|
-
o.push(
|
|
373
|
+
d = n.pop(), r[d].onStack = !1, a.push(d);
|
|
374
|
+
while (s !== d);
|
|
375
|
+
o.push(a);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return e.nodes().forEach(function(s) {
|
|
379
379
|
s in r || i(s);
|
|
380
380
|
}), o;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Br(e) {
|
|
383
383
|
return rn(e).filter(function(t) {
|
|
384
384
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
var
|
|
387
|
+
var Ar = () => 1;
|
|
388
388
|
function Wr(e, t, n) {
|
|
389
|
-
return
|
|
389
|
+
return $r(e, t || Ar, n || function(r) {
|
|
390
390
|
return e.outEdges(r);
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function $r(e, t, n) {
|
|
394
394
|
let r = {}, o = e.nodes();
|
|
395
395
|
return o.forEach(function(i) {
|
|
396
396
|
r[i] = {}, r[i][i] = { distance: 0, predecessor: "" }, o.forEach(function(s) {
|
|
397
397
|
i !== s && (r[i][s] = { distance: Number.POSITIVE_INFINITY, predecessor: "" });
|
|
398
398
|
}), n(i).forEach(function(s) {
|
|
399
|
-
let l = s.v === i ? s.w : s.v,
|
|
400
|
-
r[i][l] = { distance:
|
|
399
|
+
let l = s.v === i ? s.w : s.v, a = t(s);
|
|
400
|
+
r[i][l] = { distance: a, predecessor: i };
|
|
401
401
|
});
|
|
402
402
|
}), o.forEach(function(i) {
|
|
403
403
|
let s = r[i];
|
|
404
404
|
o.forEach(function(l) {
|
|
405
|
-
let
|
|
406
|
-
o.forEach(function(
|
|
407
|
-
let c =
|
|
405
|
+
let a = r[l];
|
|
406
|
+
o.forEach(function(d) {
|
|
407
|
+
let c = a[i], f = s[d], h = a[d], g = c.distance + f.distance;
|
|
408
408
|
g < h.distance && (h.distance = g, h.predecessor = f.predecessor);
|
|
409
409
|
});
|
|
410
410
|
});
|
|
@@ -424,7 +424,7 @@ function on(e) {
|
|
|
424
424
|
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Ce();
|
|
425
425
|
return r;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Gr(e) {
|
|
428
428
|
try {
|
|
429
429
|
on(e);
|
|
430
430
|
} catch (t) {
|
|
@@ -436,8 +436,8 @@ function $r(e) {
|
|
|
436
436
|
function Yr(e, t, n, r, o) {
|
|
437
437
|
Array.isArray(t) || (t = [t]);
|
|
438
438
|
let i = (l) => {
|
|
439
|
-
var
|
|
440
|
-
return (
|
|
439
|
+
var a;
|
|
440
|
+
return (a = e.isDirected() ? e.successors(l) : e.neighbors(l)) != null ? a : [];
|
|
441
441
|
}, s = {};
|
|
442
442
|
return t.forEach(function(l) {
|
|
443
443
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
@@ -457,21 +457,21 @@ function ln(e, t, n) {
|
|
|
457
457
|
function Kr(e, t) {
|
|
458
458
|
return ln(e, t, "post");
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Hr(e, t) {
|
|
461
461
|
return ln(e, t, "pre");
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
let n = new
|
|
465
|
-
function s(
|
|
466
|
-
let
|
|
463
|
+
function Vr(e, t) {
|
|
464
|
+
let n = new H(), r = {}, o = new nn(), i;
|
|
465
|
+
function s(a) {
|
|
466
|
+
let d = a.v === i ? a.w : a.v, c = o.priority(d);
|
|
467
467
|
if (c !== void 0) {
|
|
468
|
-
let f = t(
|
|
469
|
-
f < c && (r[
|
|
468
|
+
let f = t(a);
|
|
469
|
+
f < c && (r[d] = i, o.decrease(d, f));
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
if (e.nodeCount() === 0) return n;
|
|
473
|
-
e.nodes().forEach(function(
|
|
474
|
-
o.add(
|
|
473
|
+
e.nodes().forEach(function(a) {
|
|
474
|
+
o.add(a, Number.POSITIVE_INFINITY), n.setNode(a);
|
|
475
475
|
}), o.decrease(e.nodes()[0], 0);
|
|
476
476
|
let l = !1;
|
|
477
477
|
for (; o.size() > 0; ) {
|
|
@@ -484,39 +484,39 @@ function Hr(e, t) {
|
|
|
484
484
|
}
|
|
485
485
|
return n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return
|
|
487
|
+
function Ur(e, t, n, r) {
|
|
488
|
+
return Xr(e, t, n, r ?? ((o) => {
|
|
489
489
|
let i = e.outEdges(o);
|
|
490
490
|
return i ?? [];
|
|
491
491
|
}));
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
if (n === void 0) return
|
|
493
|
+
function Xr(e, t, n, r) {
|
|
494
|
+
if (n === void 0) return Te(e, t, n, r);
|
|
495
495
|
let o = !1, i = e.nodes();
|
|
496
496
|
for (let s = 0; s < i.length; s++) {
|
|
497
497
|
let l = r(i[s]);
|
|
498
|
-
for (let
|
|
499
|
-
let
|
|
498
|
+
for (let a = 0; a < l.length; a++) {
|
|
499
|
+
let d = l[a], c = d.v === i[s] ? d.v : d.w, f = c === d.v ? d.w : d.v;
|
|
500
500
|
n({ v: c, w: f }) < 0 && (o = !0);
|
|
501
501
|
}
|
|
502
502
|
if (o) return tn(e, t, n, r);
|
|
503
503
|
}
|
|
504
|
-
return
|
|
504
|
+
return Te(e, t, n, r);
|
|
505
505
|
}
|
|
506
506
|
function ue(e, t, n, r) {
|
|
507
507
|
let o = r;
|
|
508
508
|
for (; e.hasNode(o); ) o = Qe(r);
|
|
509
509
|
return n.dummy = t, e.setNode(o, n), o;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
let t = new
|
|
511
|
+
function qr(e) {
|
|
512
|
+
let t = new H().setGraph(e.graph());
|
|
513
513
|
return e.nodes().forEach((n) => t.setNode(n, e.node(n))), e.edges().forEach((n) => {
|
|
514
514
|
let r = t.edge(n.v, n.w) || { weight: 0, minlen: 1 }, o = e.edge(n);
|
|
515
515
|
t.setEdge(n.v, n.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen) });
|
|
516
516
|
}), t;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
let t = new
|
|
518
|
+
function dn(e) {
|
|
519
|
+
let t = new H({ multigraph: e.isMultigraph() }).setGraph(e.graph());
|
|
520
520
|
return e.nodes().forEach((n) => {
|
|
521
521
|
e.children(n).length || t.setNode(n, e.node(n));
|
|
522
522
|
}), e.edges().forEach((n) => {
|
|
@@ -526,10 +526,10 @@ function an(e) {
|
|
|
526
526
|
function It(e, t) {
|
|
527
527
|
let n = e.x, r = e.y, o = t.x - n, i = t.y - r, s = e.width / 2, l = e.height / 2;
|
|
528
528
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
529
|
-
let
|
|
530
|
-
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l),
|
|
529
|
+
let a, d;
|
|
530
|
+
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: n + a, y: r + d };
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function ve(e) {
|
|
533
533
|
let t = ye(cn(e) + 1).map(() => []);
|
|
534
534
|
return e.nodes().forEach((n) => {
|
|
535
535
|
let r = e.node(n), o = r.rank;
|
|
@@ -540,28 +540,28 @@ function Jr(e) {
|
|
|
540
540
|
let t = e.nodes().map((r) => {
|
|
541
541
|
let o = e.node(r).rank;
|
|
542
542
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
543
|
-
}), n =
|
|
543
|
+
}), n = q(Math.min, t);
|
|
544
544
|
e.nodes().forEach((r) => {
|
|
545
545
|
let o = e.node(r);
|
|
546
546
|
Object.hasOwn(o, "rank") && (o.rank -= n);
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
function Zr(e) {
|
|
550
|
-
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n =
|
|
550
|
+
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n = q(Math.min, t), r = [];
|
|
551
551
|
e.nodes().forEach((s) => {
|
|
552
552
|
let l = e.node(s).rank - n;
|
|
553
553
|
r[l] || (r[l] = []), r[l].push(s);
|
|
554
554
|
});
|
|
555
555
|
let o = 0, i = e.graph().nodeRankFactor;
|
|
556
556
|
Array.from(r).forEach((s, l) => {
|
|
557
|
-
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((
|
|
557
|
+
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((a) => e.node(a).rank += o);
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
function Ot(e, t, n, r) {
|
|
561
561
|
let o = { width: 0, height: 0 };
|
|
562
562
|
return arguments.length >= 4 && (o.rank = n, o.order = r), ue(e, "border", o, t);
|
|
563
563
|
}
|
|
564
|
-
function Qr(e, t =
|
|
564
|
+
function Qr(e, t = an) {
|
|
565
565
|
let n = [];
|
|
566
566
|
for (let r = 0; r < e.length; r += t) {
|
|
567
567
|
let o = e.slice(r, r + t);
|
|
@@ -569,9 +569,9 @@ function Qr(e, t = dn) {
|
|
|
569
569
|
}
|
|
570
570
|
return n;
|
|
571
571
|
}
|
|
572
|
-
var
|
|
573
|
-
function
|
|
574
|
-
if (t.length >
|
|
572
|
+
var an = 65535;
|
|
573
|
+
function q(e, t) {
|
|
574
|
+
if (t.length > an) {
|
|
575
575
|
let n = Qr(t);
|
|
576
576
|
return e(...n.map((r) => e(...r)));
|
|
577
577
|
} else return e(...t);
|
|
@@ -581,7 +581,7 @@ function cn(e) {
|
|
|
581
581
|
let r = e.node(n).rank;
|
|
582
582
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
583
583
|
});
|
|
584
|
-
return
|
|
584
|
+
return q(Math.max, t);
|
|
585
585
|
}
|
|
586
586
|
function eo(e, t) {
|
|
587
587
|
let n = { lhs: [], rhs: [] };
|
|
@@ -625,19 +625,19 @@ function Oe(e, t) {
|
|
|
625
625
|
function no(e, t) {
|
|
626
626
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
627
627
|
}
|
|
628
|
-
var
|
|
628
|
+
var Me = "\0", ro = "3.0.0", oo = class {
|
|
629
629
|
constructor() {
|
|
630
|
-
|
|
630
|
+
Sr(this, "_sentinel");
|
|
631
631
|
let e = {};
|
|
632
632
|
e._next = e._prev = e, this._sentinel = e;
|
|
633
633
|
}
|
|
634
634
|
dequeue() {
|
|
635
635
|
let e = this._sentinel, t = e._prev;
|
|
636
|
-
if (t !== e) return
|
|
636
|
+
if (t !== e) return Mt(t), t;
|
|
637
637
|
}
|
|
638
638
|
enqueue(e) {
|
|
639
639
|
let t = this._sentinel;
|
|
640
|
-
e._prev && e._next &&
|
|
640
|
+
e._prev && e._next && Mt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
641
641
|
}
|
|
642
642
|
toString() {
|
|
643
643
|
let e = [], t = this._sentinel, n = t._prev;
|
|
@@ -645,7 +645,7 @@ var je = "\0", ro = "3.0.0", oo = class {
|
|
|
645
645
|
return "[" + e.join(", ") + "]";
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
|
-
function
|
|
648
|
+
function Mt(e) {
|
|
649
649
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
650
650
|
}
|
|
651
651
|
function io(e, t) {
|
|
@@ -661,43 +661,43 @@ function co(e, t, n) {
|
|
|
661
661
|
var r;
|
|
662
662
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
663
663
|
for (; e.nodeCount(); ) {
|
|
664
|
-
for (; l = s.dequeue(); )
|
|
665
|
-
for (; l = i.dequeue(); )
|
|
664
|
+
for (; l = s.dequeue(); ) Be(e, t, n, l);
|
|
665
|
+
for (; l = i.dequeue(); ) Be(e, t, n, l);
|
|
666
666
|
if (e.nodeCount()) {
|
|
667
|
-
for (let
|
|
668
|
-
o = o.concat(
|
|
667
|
+
for (let a = t.length - 2; a > 0; --a) if (l = (r = t[a]) == null ? void 0 : r.dequeue(), l) {
|
|
668
|
+
o = o.concat(Be(e, t, n, l, !0) || []);
|
|
669
669
|
break;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
return o;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Be(e, t, n, r, o) {
|
|
676
676
|
let i = [], s = o ? i : void 0;
|
|
677
677
|
return (e.inEdges(r.v) || []).forEach((l) => {
|
|
678
|
-
let
|
|
679
|
-
o && i.push({ v: l.v, w: l.w }),
|
|
678
|
+
let a = e.edge(l), d = e.node(l.v);
|
|
679
|
+
o && i.push({ v: l.v, w: l.w }), d.out -= a, Ve(t, n, d);
|
|
680
680
|
}), (e.outEdges(r.v) || []).forEach((l) => {
|
|
681
|
-
let
|
|
682
|
-
c.in -=
|
|
681
|
+
let a = e.edge(l), d = l.w, c = e.node(d);
|
|
682
|
+
c.in -= a, Ve(t, n, c);
|
|
683
683
|
}), e.removeNode(r.v), s;
|
|
684
684
|
}
|
|
685
685
|
function fo(e, t) {
|
|
686
|
-
let n = new
|
|
686
|
+
let n = new H(), r = 0, o = 0;
|
|
687
687
|
e.nodes().forEach((l) => {
|
|
688
688
|
n.setNode(l, { v: l, in: 0, out: 0 });
|
|
689
689
|
}), e.edges().forEach((l) => {
|
|
690
|
-
let
|
|
690
|
+
let a = n.edge(l.v, l.w) || 0, d = t(l), c = a + d;
|
|
691
691
|
n.setEdge(l.v, l.w, c);
|
|
692
692
|
let f = n.node(l.v), h = n.node(l.w);
|
|
693
|
-
o = Math.max(o, f.out +=
|
|
693
|
+
o = Math.max(o, f.out += d), r = Math.max(r, h.in += d);
|
|
694
694
|
});
|
|
695
695
|
let i = uo(o + r + 3).map(() => new so()), s = r + 1;
|
|
696
696
|
return n.nodes().forEach((l) => {
|
|
697
|
-
|
|
697
|
+
Ve(i, s, n.node(l));
|
|
698
698
|
}), { graph: n, buckets: i, zeroIdx: s };
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Ve(e, t, n) {
|
|
701
701
|
var r, o, i;
|
|
702
702
|
n.out ? n.in ? (i = e[n.out - n.in + t]) == null || i.enqueue(n) : (o = e[e.length - 1]) == null || o.enqueue(n) : (r = e[0]) == null || r.enqueue(n);
|
|
703
703
|
}
|
|
@@ -738,11 +738,11 @@ function bo(e) {
|
|
|
738
738
|
e.graph().dummyChains = [], e.edges().forEach((t) => yo(e, t));
|
|
739
739
|
}
|
|
740
740
|
function yo(e, t) {
|
|
741
|
-
let n = t.v, r = e.node(n).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t),
|
|
741
|
+
let n = t.v, r = e.node(n).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), a = l.labelRank;
|
|
742
742
|
if (i === r + 1) return;
|
|
743
743
|
e.removeEdge(t);
|
|
744
|
-
let
|
|
745
|
-
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r },
|
|
744
|
+
let d, c, f;
|
|
745
|
+
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, d = ue(e, "edge", c, "_d"), r === a && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(n, d, { weight: l.weight }, s), f === 0 && e.graph().dummyChains.push(d), n = d;
|
|
746
746
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
747
747
|
}
|
|
748
748
|
function mo(e) {
|
|
@@ -757,7 +757,7 @@ function et(e) {
|
|
|
757
757
|
let o = e.node(r);
|
|
758
758
|
if (Object.hasOwn(t, r)) return o.rank;
|
|
759
759
|
t[r] = !0;
|
|
760
|
-
let i = e.outEdges(r), s = i ? i.map((
|
|
760
|
+
let i = e.outEdges(r), s = i ? i.map((a) => a == null ? Number.POSITIVE_INFINITY : n(a.w) - e.edge(a).minlen) : [], l = q(Math.min, s);
|
|
761
761
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
762
762
|
}
|
|
763
763
|
e.sources().forEach(n);
|
|
@@ -765,17 +765,17 @@ function et(e) {
|
|
|
765
765
|
function fe(e, t) {
|
|
766
766
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
767
767
|
}
|
|
768
|
-
var hn =
|
|
769
|
-
function
|
|
770
|
-
let t = new
|
|
768
|
+
var hn = vo;
|
|
769
|
+
function vo(e) {
|
|
770
|
+
let t = new H({ directed: !1 }), n = e.nodes();
|
|
771
771
|
if (n.length === 0) throw new Error("Graph must have at least one node");
|
|
772
772
|
let r = n[0], o = e.nodeCount();
|
|
773
773
|
t.setNode(r, {});
|
|
774
774
|
let i, s;
|
|
775
|
-
for (;
|
|
775
|
+
for (; wo(t, e) < o && (i = Eo(t, e), !!i); ) s = t.hasNode(i.v) ? fe(e, i) : -fe(e, i), xo(t, e, s);
|
|
776
776
|
return t;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function wo(e, t) {
|
|
779
779
|
function n(r) {
|
|
780
780
|
let o = t.nodeEdges(r);
|
|
781
781
|
o && o.forEach((i) => {
|
|
@@ -791,25 +791,25 @@ function Eo(e, t) {
|
|
|
791
791
|
return e.hasNode(r.v) !== e.hasNode(r.w) && (o = fe(t, r)), o < n[0] ? [o, r] : n;
|
|
792
792
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function xo(e, t, n) {
|
|
795
795
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
796
796
|
}
|
|
797
|
-
var { preorder:
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
function
|
|
805
|
-
e =
|
|
797
|
+
var { preorder: ko, postorder: _o } = Ze, So = de;
|
|
798
|
+
de.initLowLimValues = nt;
|
|
799
|
+
de.initCutValues = tt;
|
|
800
|
+
de.calcCutValue = gn;
|
|
801
|
+
de.leaveEdge = bn;
|
|
802
|
+
de.enterEdge = yn;
|
|
803
|
+
de.exchangeEdges = mn;
|
|
804
|
+
function de(e) {
|
|
805
|
+
e = qr(e), et(e);
|
|
806
806
|
let t = hn(e);
|
|
807
807
|
nt(t), tt(t, e);
|
|
808
808
|
let n, r;
|
|
809
809
|
for (; n = bn(t); ) r = yn(t, e, n), mn(t, e, n, r);
|
|
810
810
|
}
|
|
811
811
|
function tt(e, t) {
|
|
812
|
-
let n =
|
|
812
|
+
let n = _o(e, e.nodes());
|
|
813
813
|
n = n.slice(0, n.length - 1), n.forEach((r) => No(e, t, r));
|
|
814
814
|
}
|
|
815
815
|
function No(e, t, n) {
|
|
@@ -820,10 +820,10 @@ function gn(e, t, n) {
|
|
|
820
820
|
let r = e.node(n).parent, o = !0, i = t.edge(n, r), s = 0;
|
|
821
821
|
i || (o = !1, i = t.edge(r, n)), s = i.weight;
|
|
822
822
|
let l = t.nodeEdges(n);
|
|
823
|
-
return l && l.forEach((
|
|
824
|
-
let
|
|
823
|
+
return l && l.forEach((a) => {
|
|
824
|
+
let d = a.v === n, c = d ? a.w : a.v;
|
|
825
825
|
if (c !== r) {
|
|
826
|
-
let f =
|
|
826
|
+
let f = d === o, h = t.edge(a).weight;
|
|
827
827
|
if (s += f ? h : -h, Co(e, n, c)) {
|
|
828
828
|
let g = e.edge(n, c).cutvalue;
|
|
829
829
|
s += f ? -g : g;
|
|
@@ -838,8 +838,8 @@ function pn(e, t, n, r, o) {
|
|
|
838
838
|
let i = n, s = e.node(r);
|
|
839
839
|
t[r] = !0;
|
|
840
840
|
let l = e.neighbors(r);
|
|
841
|
-
return l && l.forEach((
|
|
842
|
-
Object.hasOwn(t,
|
|
841
|
+
return l && l.forEach((a) => {
|
|
842
|
+
Object.hasOwn(t, a) || (n = pn(e, t, n, a, r));
|
|
843
843
|
}), s.low = i, s.lim = n++, o ? s.parent = o : delete s.parent, n;
|
|
844
844
|
}
|
|
845
845
|
function bn(e) {
|
|
@@ -848,17 +848,17 @@ function bn(e) {
|
|
|
848
848
|
function yn(e, t, n) {
|
|
849
849
|
let r = n.v, o = n.w;
|
|
850
850
|
t.hasEdge(r, o) || (r = n.w, o = n.v);
|
|
851
|
-
let i = e.node(r), s = e.node(o), l = i,
|
|
852
|
-
return i.lim > s.lim && (l = s,
|
|
851
|
+
let i = e.node(r), s = e.node(o), l = i, a = !1;
|
|
852
|
+
return i.lim > s.lim && (l = s, a = !0), t.edges().filter((d) => a === jt(e, e.node(d.v), l) && a !== jt(e, e.node(d.w), l)).reduce((d, c) => fe(t, c) < fe(t, d) ? c : d);
|
|
853
853
|
}
|
|
854
854
|
function mn(e, t, n, r) {
|
|
855
855
|
let o = n.v, i = n.w;
|
|
856
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), nt(e), tt(e, t),
|
|
856
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), nt(e), tt(e, t), To(e, t);
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function To(e, t) {
|
|
859
859
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
860
860
|
if (!n) return;
|
|
861
|
-
let r =
|
|
861
|
+
let r = ko(e, [n]);
|
|
862
862
|
r = r.slice(1), r.forEach((o) => {
|
|
863
863
|
let i = e.node(o).parent, s = t.edge(o, i), l = !1;
|
|
864
864
|
s || (s = t.edge(i, o), l = !0), t.node(o).rank = t.node(i).rank + (l ? s.minlen : -s.minlen);
|
|
@@ -867,7 +867,7 @@ function So(e, t) {
|
|
|
867
867
|
function Co(e, t, n) {
|
|
868
868
|
return e.hasEdge(t, n);
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function jt(e, t, n) {
|
|
871
871
|
return n.low <= t.lim && t.lim <= n.lim;
|
|
872
872
|
}
|
|
873
873
|
var Io = Oo;
|
|
@@ -879,10 +879,10 @@ function Oo(e) {
|
|
|
879
879
|
zt(e);
|
|
880
880
|
break;
|
|
881
881
|
case "tight-tree":
|
|
882
|
-
|
|
882
|
+
jo(e);
|
|
883
883
|
break;
|
|
884
884
|
case "longest-path":
|
|
885
|
-
|
|
885
|
+
Mo(e);
|
|
886
886
|
break;
|
|
887
887
|
case "none":
|
|
888
888
|
break;
|
|
@@ -890,69 +890,69 @@ function Oo(e) {
|
|
|
890
890
|
zt(e);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
var
|
|
894
|
-
function
|
|
893
|
+
var Mo = et;
|
|
894
|
+
function jo(e) {
|
|
895
895
|
et(e), hn(e);
|
|
896
896
|
}
|
|
897
897
|
function zt(e) {
|
|
898
|
-
|
|
898
|
+
So(e);
|
|
899
899
|
}
|
|
900
|
-
var zo =
|
|
901
|
-
function
|
|
902
|
-
let t =
|
|
900
|
+
var zo = Lo;
|
|
901
|
+
function Lo(e) {
|
|
902
|
+
let t = Ro(e);
|
|
903
903
|
e.graph().dummyChains.forEach((n) => {
|
|
904
|
-
let r = e.node(n), o = r.edgeObj, i =
|
|
904
|
+
let r = e.node(n), o = r.edgeObj, i = Po(e, t, o.v, o.w), s = i.path, l = i.lca, a = 0, d = s[a], c = !0;
|
|
905
905
|
for (; n !== o.w; ) {
|
|
906
906
|
if (r = e.node(n), c) {
|
|
907
|
-
for (; (
|
|
908
|
-
|
|
907
|
+
for (; (d = s[a]) !== l && e.node(d).maxRank < r.rank; ) a++;
|
|
908
|
+
d === l && (c = !1);
|
|
909
909
|
}
|
|
910
910
|
if (!c) {
|
|
911
|
-
for (;
|
|
912
|
-
|
|
911
|
+
for (; a < s.length - 1 && e.node(s[a + 1]).minRank <= r.rank; ) a++;
|
|
912
|
+
d = s[a];
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
d !== void 0 && e.setParent(n, d), n = e.successors(n)[0];
|
|
915
915
|
}
|
|
916
916
|
});
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
let o = [], i = [], s = Math.min(t[n].low, t[r].low), l = Math.max(t[n].lim, t[r].lim),
|
|
920
|
-
|
|
918
|
+
function Po(e, t, n, r) {
|
|
919
|
+
let o = [], i = [], s = Math.min(t[n].low, t[r].low), l = Math.max(t[n].lim, t[r].lim), a;
|
|
920
|
+
a = n;
|
|
921
921
|
do
|
|
922
|
-
|
|
923
|
-
while (
|
|
924
|
-
let
|
|
925
|
-
for (; (c = e.parent(c)) !==
|
|
926
|
-
return { path: o.concat(i.reverse()), lca:
|
|
922
|
+
a = e.parent(a), o.push(a);
|
|
923
|
+
while (a && (t[a].low > s || l > t[a].lim));
|
|
924
|
+
let d = a, c = r;
|
|
925
|
+
for (; (c = e.parent(c)) !== d; ) i.push(c);
|
|
926
|
+
return { path: o.concat(i.reverse()), lca: d };
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Ro(e) {
|
|
929
929
|
let t = {}, n = 0;
|
|
930
930
|
function r(o) {
|
|
931
931
|
let i = n;
|
|
932
932
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
933
933
|
}
|
|
934
|
-
return e.children(
|
|
934
|
+
return e.children(Me).forEach(r), t;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
let t = ue(e, "root", {}, "_root"), n = Do(e), r = Object.values(n), o =
|
|
936
|
+
function Fo(e) {
|
|
937
|
+
let t = ue(e, "root", {}, "_root"), n = Do(e), r = Object.values(n), o = q(Math.max, r) - 1, i = 2 * o + 1;
|
|
938
938
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
939
|
-
let s =
|
|
940
|
-
e.children(
|
|
939
|
+
let s = Bo(e) + 1;
|
|
940
|
+
e.children(Me).forEach((l) => vn(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function vn(e, t, n, r, o, i, s) {
|
|
943
943
|
var l;
|
|
944
|
-
let
|
|
945
|
-
if (!
|
|
944
|
+
let a = e.children(s);
|
|
945
|
+
if (!a.length) {
|
|
946
946
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: n });
|
|
947
947
|
return;
|
|
948
948
|
}
|
|
949
|
-
let
|
|
950
|
-
e.setParent(
|
|
949
|
+
let d = Ot(e, "_bt"), c = Ot(e, "_bb"), f = e.node(s);
|
|
950
|
+
e.setParent(d, s), f.borderTop = d, e.setParent(c, s), f.borderBottom = c, a.forEach((h) => {
|
|
951
951
|
var g;
|
|
952
|
-
|
|
953
|
-
let p = e.node(h), E = p.borderTop ? p.borderTop : h, b = p.borderBottom ? p.borderBottom : h,
|
|
954
|
-
e.setEdge(
|
|
955
|
-
}), e.parent(s) || e.setEdge(t,
|
|
952
|
+
vn(e, t, n, r, o, i, h);
|
|
953
|
+
let p = e.node(h), E = p.borderTop ? p.borderTop : h, b = p.borderBottom ? p.borderBottom : h, k = p.borderTop ? r : 2 * r, N = E !== b ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
954
|
+
e.setEdge(d, E, { weight: k, minlen: N, nestingEdge: !0 }), e.setEdge(b, c, { weight: k, minlen: N, nestingEdge: !0 });
|
|
955
|
+
}), e.parent(s) || e.setEdge(t, d, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
956
956
|
}
|
|
957
957
|
function Do(e) {
|
|
958
958
|
let t = {};
|
|
@@ -960,60 +960,60 @@ function Do(e) {
|
|
|
960
960
|
let i = e.children(r);
|
|
961
961
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
962
962
|
}
|
|
963
|
-
return e.children(
|
|
963
|
+
return e.children(Me).forEach((r) => n(r, 1)), t;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Bo(e) {
|
|
966
966
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Ao(e) {
|
|
969
969
|
let t = e.graph();
|
|
970
970
|
e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((n) => {
|
|
971
971
|
e.edge(n).nestingEdge && e.removeEdge(n);
|
|
972
972
|
});
|
|
973
973
|
}
|
|
974
|
-
var Wo =
|
|
975
|
-
function
|
|
974
|
+
var Wo = $o;
|
|
975
|
+
function $o(e) {
|
|
976
976
|
function t(n) {
|
|
977
977
|
let r = e.children(n), o = e.node(n);
|
|
978
978
|
if (r.length && r.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
979
979
|
o.borderLeft = [], o.borderRight = [];
|
|
980
|
-
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i)
|
|
980
|
+
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) Lt(e, "borderLeft", "_bl", n, o, i), Lt(e, "borderRight", "_br", n, o, i);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
e.children(
|
|
983
|
+
e.children(Me).forEach(t);
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1],
|
|
987
|
-
o[t][i] =
|
|
985
|
+
function Lt(e, t, n, r, o, i) {
|
|
986
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], a = ue(e, "border", s, n);
|
|
987
|
+
o[t][i] = a, e.setParent(a, r), l && e.setEdge(l, a, { weight: 1 });
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function Go(e) {
|
|
990
990
|
var t;
|
|
991
991
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
992
|
-
(n === "lr" || n === "rl") &&
|
|
992
|
+
(n === "lr" || n === "rl") && wn(e);
|
|
993
993
|
}
|
|
994
994
|
function Yo(e) {
|
|
995
995
|
var t;
|
|
996
996
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
997
|
-
(n === "bt" || n === "rl") && Ko(e), (n === "lr" || n === "rl") && (
|
|
997
|
+
(n === "bt" || n === "rl") && Ko(e), (n === "lr" || n === "rl") && (Ho(e), wn(e));
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
e.nodes().forEach((t) =>
|
|
999
|
+
function wn(e) {
|
|
1000
|
+
e.nodes().forEach((t) => Pt(e.node(t))), e.edges().forEach((t) => Pt(e.edge(t)));
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function Pt(e) {
|
|
1003
1003
|
let t = e.width;
|
|
1004
1004
|
e.width = e.height, e.height = t;
|
|
1005
1005
|
}
|
|
1006
1006
|
function Ko(e) {
|
|
1007
|
-
e.nodes().forEach((t) =>
|
|
1007
|
+
e.nodes().forEach((t) => Ae(e.node(t))), e.edges().forEach((t) => {
|
|
1008
1008
|
var n;
|
|
1009
1009
|
let r = e.edge(t);
|
|
1010
|
-
(n = r.points) == null || n.forEach(
|
|
1010
|
+
(n = r.points) == null || n.forEach(Ae), Object.hasOwn(r, "y") && Ae(r);
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function Ae(e) {
|
|
1014
1014
|
e.y = -e.y;
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1016
|
+
function Ho(e) {
|
|
1017
1017
|
e.nodes().forEach((t) => We(e.node(t))), e.edges().forEach((t) => {
|
|
1018
1018
|
var n;
|
|
1019
1019
|
let r = e.edge(t);
|
|
@@ -1024,48 +1024,48 @@ function We(e) {
|
|
|
1024
1024
|
let t = e.x;
|
|
1025
1025
|
e.x = e.y, e.y = t;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o =
|
|
1027
|
+
function Vo(e) {
|
|
1028
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = q(Math.max, r), i = ye(o + 1).map(() => []);
|
|
1029
1029
|
function s(l) {
|
|
1030
1030
|
if (t[l]) return;
|
|
1031
1031
|
t[l] = !0;
|
|
1032
|
-
let
|
|
1033
|
-
i[
|
|
1034
|
-
let
|
|
1035
|
-
|
|
1032
|
+
let a = e.node(l);
|
|
1033
|
+
i[a.rank].push(l);
|
|
1034
|
+
let d = e.successors(l);
|
|
1035
|
+
d && d.forEach(s);
|
|
1036
1036
|
}
|
|
1037
|
-
return n.sort((l,
|
|
1037
|
+
return n.sort((l, a) => e.node(l).rank - e.node(a).rank).forEach(s), i;
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Uo(e, t) {
|
|
1040
1040
|
let n = 0;
|
|
1041
|
-
for (let r = 1; r < t.length; ++r) n +=
|
|
1041
|
+
for (let r = 1; r < t.length; ++r) n += Xo(e, t[r - 1], t[r]);
|
|
1042
1042
|
return n;
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
let r = no(n, n.map((
|
|
1046
|
-
let c = e.outEdges(
|
|
1044
|
+
function Xo(e, t, n) {
|
|
1045
|
+
let r = no(n, n.map((d, c) => c)), o = t.flatMap((d) => {
|
|
1046
|
+
let c = e.outEdges(d);
|
|
1047
1047
|
return c ? c.map((f) => ({ pos: r[f.w], weight: e.edge(f).weight })).sort((f, h) => f.pos - h.pos) : [];
|
|
1048
1048
|
}), i = 1;
|
|
1049
1049
|
for (; i < n.length; ) i <<= 1;
|
|
1050
1050
|
let s = 2 * i - 1;
|
|
1051
1051
|
i -= 1;
|
|
1052
|
-
let l = new Array(s).fill(0),
|
|
1053
|
-
return o.forEach((
|
|
1054
|
-
let c =
|
|
1055
|
-
l[c] +=
|
|
1052
|
+
let l = new Array(s).fill(0), a = 0;
|
|
1053
|
+
return o.forEach((d) => {
|
|
1054
|
+
let c = d.pos + i;
|
|
1055
|
+
l[c] += d.weight;
|
|
1056
1056
|
let f = 0;
|
|
1057
|
-
for (; c > 0; ) c % 2 && (f += l[c + 1]), c = c - 1 >> 1, l[c] +=
|
|
1058
|
-
|
|
1059
|
-
}),
|
|
1057
|
+
for (; c > 0; ) c % 2 && (f += l[c + 1]), c = c - 1 >> 1, l[c] += d.weight;
|
|
1058
|
+
a += d.weight * f;
|
|
1059
|
+
}), a;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function qo(e, t = []) {
|
|
1062
1062
|
return t.map((n) => {
|
|
1063
1063
|
let r = e.inEdges(n);
|
|
1064
1064
|
if (!r || !r.length) return { v: n };
|
|
1065
1065
|
{
|
|
1066
1066
|
let o = r.reduce((i, s) => {
|
|
1067
|
-
let l = e.edge(s),
|
|
1068
|
-
return { sum: i.sum + l.weight *
|
|
1067
|
+
let l = e.edge(s), a = e.node(s.v);
|
|
1068
|
+
return { sum: i.sum + l.weight * a.order, weight: i.weight + l.weight };
|
|
1069
1069
|
}, { sum: 0, weight: 0 });
|
|
1070
1070
|
return { v: n, barycenter: o.sum / o.weight, weight: o.weight };
|
|
1071
1071
|
}
|
|
@@ -1106,14 +1106,14 @@ function Qo(e, t) {
|
|
|
1106
1106
|
e.weight && (n += e.barycenter * e.weight, r += e.weight), t.weight && (n += t.barycenter * t.weight, r += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = n / r, e.weight = r, e.i = Math.min(t.i, e.i), t.merged = !0;
|
|
1107
1107
|
}
|
|
1108
1108
|
function ei(e, t) {
|
|
1109
|
-
let n = eo(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c, f) => f.i - c.i), i = [], s = 0, l = 0,
|
|
1110
|
-
r.sort(ti(!!t)),
|
|
1111
|
-
|
|
1109
|
+
let n = eo(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c, f) => f.i - c.i), i = [], s = 0, l = 0, a = 0;
|
|
1110
|
+
r.sort(ti(!!t)), a = Rt(i, o, a), r.forEach((c) => {
|
|
1111
|
+
a += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, a = Rt(i, o, a);
|
|
1112
1112
|
});
|
|
1113
|
-
let
|
|
1114
|
-
return l && (
|
|
1113
|
+
let d = { vs: i.flat(1) };
|
|
1114
|
+
return l && (d.barycenter = s / l, d.weight = l), d;
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function Rt(e, t, n) {
|
|
1117
1117
|
let r;
|
|
1118
1118
|
for (; t.length && (r = t[t.length - 1]).i <= n; ) t.pop(), e.push(r.vs), n++;
|
|
1119
1119
|
return n;
|
|
@@ -1122,17 +1122,17 @@ function ti(e) {
|
|
|
1122
1122
|
return (t, n) => t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
|
|
1123
1123
|
}
|
|
1124
1124
|
function En(e, t, n, r) {
|
|
1125
|
-
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0,
|
|
1125
|
+
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, a = {};
|
|
1126
1126
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1127
|
-
let
|
|
1128
|
-
|
|
1127
|
+
let d = qo(e, o);
|
|
1128
|
+
d.forEach((h) => {
|
|
1129
1129
|
if (e.children(h.v).length) {
|
|
1130
1130
|
let g = En(e, h.v, n, r);
|
|
1131
|
-
|
|
1131
|
+
a[h.v] = g, Object.hasOwn(g, "barycenter") && ri(h, g);
|
|
1132
1132
|
}
|
|
1133
1133
|
});
|
|
1134
|
-
let c = Jo(
|
|
1135
|
-
ni(c,
|
|
1134
|
+
let c = Jo(d, n);
|
|
1135
|
+
ni(c, a);
|
|
1136
1136
|
let f = ei(c, r);
|
|
1137
1137
|
if (s && l) {
|
|
1138
1138
|
f.vs = [s, f.vs, l].flat(1);
|
|
@@ -1154,13 +1154,13 @@ function ri(e, t) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
function oi(e, t, n, r) {
|
|
1156
1156
|
r || (r = e.nodes());
|
|
1157
|
-
let o = ii(e), i = new
|
|
1157
|
+
let o = ii(e), i = new H({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1158
1158
|
return r.forEach((s) => {
|
|
1159
|
-
let l = e.node(s),
|
|
1159
|
+
let l = e.node(s), a = e.parent(s);
|
|
1160
1160
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
1161
|
-
i.setNode(s), i.setParent(s,
|
|
1162
|
-
let
|
|
1163
|
-
|
|
1161
|
+
i.setNode(s), i.setParent(s, a || o);
|
|
1162
|
+
let d = e[n](s);
|
|
1163
|
+
d && d.forEach((c) => {
|
|
1164
1164
|
let f = c.v === s ? c.w : c.v, h = i.edge(f, s), g = h !== void 0 ? h.weight : 0;
|
|
1165
1165
|
i.setEdge(f, s, { weight: e.edge(c).weight + g });
|
|
1166
1166
|
}), Object.hasOwn(l, "minRank") && i.setNode(s, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
@@ -1175,32 +1175,32 @@ function ii(e) {
|
|
|
1175
1175
|
function si(e, t, n) {
|
|
1176
1176
|
let r = {}, o;
|
|
1177
1177
|
n.forEach((i) => {
|
|
1178
|
-
let s = e.parent(i), l,
|
|
1178
|
+
let s = e.parent(i), l, a;
|
|
1179
1179
|
for (; s; ) {
|
|
1180
|
-
if (l = e.parent(s), l ? (
|
|
1181
|
-
t.setEdge(
|
|
1180
|
+
if (l = e.parent(s), l ? (a = r[l], r[l] = s) : (a = o, o = s), a && a !== s) {
|
|
1181
|
+
t.setEdge(a, s);
|
|
1182
1182
|
return;
|
|
1183
1183
|
}
|
|
1184
1184
|
s = l;
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function xn(e, t = {}) {
|
|
1189
1189
|
if (typeof t.customOrder == "function") {
|
|
1190
|
-
t.customOrder(e,
|
|
1190
|
+
t.customOrder(e, xn);
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
|
-
let n = cn(e), r =
|
|
1193
|
+
let n = cn(e), r = Ft(e, ye(1, n + 1), "inEdges"), o = Ft(e, ye(n - 1, -1, -1), "outEdges"), i = Vo(e);
|
|
1194
1194
|
if (Dt(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1195
|
-
let s = Number.POSITIVE_INFINITY, l,
|
|
1196
|
-
for (let
|
|
1197
|
-
li(
|
|
1198
|
-
let f =
|
|
1195
|
+
let s = Number.POSITIVE_INFINITY, l, a = t.constraints || [];
|
|
1196
|
+
for (let d = 0, c = 0; c < 4; ++d, ++c) {
|
|
1197
|
+
li(d % 2 ? r : o, d % 4 >= 2, a), i = ve(e);
|
|
1198
|
+
let f = Uo(e, i);
|
|
1199
1199
|
f < s ? (c = 0, l = Object.assign({}, i), s = f) : f === s && (l = structuredClone(i));
|
|
1200
1200
|
}
|
|
1201
1201
|
Dt(e, l);
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function Ft(e, t, n) {
|
|
1204
1204
|
let r = /* @__PURE__ */ new Map(), o = (i, s) => {
|
|
1205
1205
|
r.has(i) || r.set(i, []), r.get(i).push(s);
|
|
1206
1206
|
};
|
|
@@ -1213,36 +1213,36 @@ function Rt(e, t, n) {
|
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
1215
|
function li(e, t, n) {
|
|
1216
|
-
let r = new
|
|
1216
|
+
let r = new H();
|
|
1217
1217
|
e.forEach(function(o) {
|
|
1218
1218
|
n.forEach((l) => r.setEdge(l.left, l.right));
|
|
1219
1219
|
let i = o.graph().root, s = En(o, i, r, t);
|
|
1220
|
-
s.vs.forEach((l,
|
|
1220
|
+
s.vs.forEach((l, a) => o.node(l).order = a), si(o, r, s.vs);
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
function Dt(e, t) {
|
|
1224
1224
|
Object.values(t).forEach((n) => n.forEach((r, o) => e.node(r).order = o));
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function di(e, t) {
|
|
1227
1227
|
let n = {};
|
|
1228
1228
|
function r(o, i) {
|
|
1229
|
-
let s = 0, l = 0,
|
|
1229
|
+
let s = 0, l = 0, a = o.length, d = i[i.length - 1];
|
|
1230
1230
|
return i.forEach((c, f) => {
|
|
1231
|
-
let h = ci(e, c), g = h ? e.node(h).order :
|
|
1232
|
-
(h || c ===
|
|
1231
|
+
let h = ci(e, c), g = h ? e.node(h).order : a;
|
|
1232
|
+
(h || c === d) && (i.slice(l, f + 1).forEach((p) => {
|
|
1233
1233
|
let E = e.predecessors(p);
|
|
1234
1234
|
E && E.forEach((b) => {
|
|
1235
|
-
let
|
|
1236
|
-
(N < s || g < N) && !(
|
|
1235
|
+
let k = e.node(b), N = k.order;
|
|
1236
|
+
(N < s || g < N) && !(k.dummy && e.node(p).dummy) && kn(n, b, p);
|
|
1237
1237
|
});
|
|
1238
1238
|
}), l = f + 1, s = g);
|
|
1239
1239
|
}), i;
|
|
1240
1240
|
}
|
|
1241
1241
|
return t.length && t.reduce(r), n;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function ai(e, t) {
|
|
1244
1244
|
let n = {};
|
|
1245
|
-
function r(i, s, l,
|
|
1245
|
+
function r(i, s, l, a, d) {
|
|
1246
1246
|
ye(s, l).forEach((c) => {
|
|
1247
1247
|
let f = i[c];
|
|
1248
1248
|
if (f !== void 0 && e.node(f).dummy) {
|
|
@@ -1250,23 +1250,23 @@ function di(e, t) {
|
|
|
1250
1250
|
h && h.forEach((g) => {
|
|
1251
1251
|
if (g === void 0) return;
|
|
1252
1252
|
let p = e.node(g);
|
|
1253
|
-
p.dummy && (p.order <
|
|
1253
|
+
p.dummy && (p.order < a || p.order > d) && kn(n, g, f);
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
});
|
|
1257
1257
|
}
|
|
1258
1258
|
function o(i, s) {
|
|
1259
|
-
let l = -1,
|
|
1259
|
+
let l = -1, a = -1, d = 0;
|
|
1260
1260
|
return s.forEach((c, f) => {
|
|
1261
1261
|
if (e.node(c).dummy === "border") {
|
|
1262
1262
|
let h = e.predecessors(c);
|
|
1263
1263
|
if (h && h.length) {
|
|
1264
1264
|
let g = h[0];
|
|
1265
1265
|
if (g === void 0) return;
|
|
1266
|
-
|
|
1266
|
+
a = e.node(g).order, r(s, d, f, l, a), d = f, l = a;
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
|
-
r(s,
|
|
1269
|
+
r(s, d, s.length, a, i.length);
|
|
1270
1270
|
}), s;
|
|
1271
1271
|
}
|
|
1272
1272
|
return t.length && t.reduce(o), n;
|
|
@@ -1277,7 +1277,7 @@ function ci(e, t) {
|
|
|
1277
1277
|
if (n) return n.find((r) => e.node(r).dummy);
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function kn(e, t, n) {
|
|
1281
1281
|
if (t > n) {
|
|
1282
1282
|
let o = t;
|
|
1283
1283
|
t = n, n = o;
|
|
@@ -1296,13 +1296,13 @@ function fi(e, t, n) {
|
|
|
1296
1296
|
function ui(e, t, n, r) {
|
|
1297
1297
|
let o = {}, i = {}, s = {};
|
|
1298
1298
|
return t.forEach((l) => {
|
|
1299
|
-
l.forEach((
|
|
1300
|
-
o[
|
|
1299
|
+
l.forEach((a, d) => {
|
|
1300
|
+
o[a] = a, i[a] = a, s[a] = d;
|
|
1301
1301
|
});
|
|
1302
1302
|
}), t.forEach((l) => {
|
|
1303
|
-
let
|
|
1304
|
-
l.forEach((
|
|
1305
|
-
let c = r(
|
|
1303
|
+
let a = -1;
|
|
1304
|
+
l.forEach((d) => {
|
|
1305
|
+
let c = r(d);
|
|
1306
1306
|
if (c && c.length) {
|
|
1307
1307
|
let f = c.sort((g, p) => {
|
|
1308
1308
|
let E = s[g], b = s[p];
|
|
@@ -1312,9 +1312,9 @@ function ui(e, t, n, r) {
|
|
|
1312
1312
|
let E = f[g];
|
|
1313
1313
|
if (E === void 0) continue;
|
|
1314
1314
|
let b = s[E];
|
|
1315
|
-
if (b !== void 0 && i[
|
|
1316
|
-
let
|
|
1317
|
-
|
|
1315
|
+
if (b !== void 0 && i[d] === d && a < b && !fi(n, d, E)) {
|
|
1316
|
+
let k = o[E];
|
|
1317
|
+
k !== void 0 && (i[E] = d, i[d] = o[d] = k, a = b);
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
@@ -1323,30 +1323,30 @@ function ui(e, t, n, r) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
function hi(e, t, n, r, o = !1) {
|
|
1325
1325
|
let i = {}, s = gi(e, t, n, o), l = o ? "borderLeft" : "borderRight";
|
|
1326
|
-
function
|
|
1327
|
-
let E = s.nodes().slice(), b = {},
|
|
1328
|
-
for (;
|
|
1329
|
-
if (b[
|
|
1326
|
+
function a(g, p) {
|
|
1327
|
+
let E = s.nodes().slice(), b = {}, k = E.pop();
|
|
1328
|
+
for (; k; ) {
|
|
1329
|
+
if (b[k]) g(k);
|
|
1330
1330
|
else {
|
|
1331
|
-
b[
|
|
1332
|
-
for (let N of p(
|
|
1331
|
+
b[k] = !0, E.push(k);
|
|
1332
|
+
for (let N of p(k)) E.push(N);
|
|
1333
1333
|
}
|
|
1334
|
-
|
|
1334
|
+
k = E.pop();
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function d(g) {
|
|
1338
1338
|
let p = s.inEdges(g);
|
|
1339
1339
|
p ? i[g] = p.reduce((E, b) => {
|
|
1340
|
-
var
|
|
1341
|
-
let N = (
|
|
1340
|
+
var k;
|
|
1341
|
+
let N = (k = i[b.v]) != null ? k : 0, O = s.edge(b);
|
|
1342
1342
|
return Math.max(E, N + (O !== void 0 ? O : 0));
|
|
1343
1343
|
}, 0) : i[g] = 0;
|
|
1344
1344
|
}
|
|
1345
1345
|
function c(g) {
|
|
1346
1346
|
let p = s.outEdges(g), E = Number.POSITIVE_INFINITY;
|
|
1347
|
-
p && (E = p.reduce((
|
|
1348
|
-
let O = i[N.w],
|
|
1349
|
-
return Math.min(
|
|
1347
|
+
p && (E = p.reduce((k, N) => {
|
|
1348
|
+
let O = i[N.w], j = s.edge(N);
|
|
1349
|
+
return Math.min(k, (O !== void 0 ? O : 0) - (j !== void 0 ? j : 0));
|
|
1350
1350
|
}, Number.POSITIVE_INFINITY));
|
|
1351
1351
|
let b = e.node(g);
|
|
1352
1352
|
E !== Number.POSITIVE_INFINITY && b.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, E));
|
|
@@ -1357,27 +1357,27 @@ function hi(e, t, n, r, o = !1) {
|
|
|
1357
1357
|
function h(g) {
|
|
1358
1358
|
return s.successors(g) || [];
|
|
1359
1359
|
}
|
|
1360
|
-
return d
|
|
1360
|
+
return a(d, f), a(c, h), Object.keys(r).forEach((g) => {
|
|
1361
1361
|
var p;
|
|
1362
1362
|
let E = n[g];
|
|
1363
1363
|
E !== void 0 && (i[g] = (p = i[E]) != null ? p : 0);
|
|
1364
1364
|
}), i;
|
|
1365
1365
|
}
|
|
1366
1366
|
function gi(e, t, n, r) {
|
|
1367
|
-
let o = new
|
|
1367
|
+
let o = new H(), i = e.graph(), s = vi(i.nodesep, i.edgesep, r);
|
|
1368
1368
|
return t.forEach((l) => {
|
|
1369
|
-
let
|
|
1370
|
-
l.forEach((
|
|
1371
|
-
let c = n[
|
|
1369
|
+
let a;
|
|
1370
|
+
l.forEach((d) => {
|
|
1371
|
+
let c = n[d];
|
|
1372
1372
|
if (c !== void 0) {
|
|
1373
|
-
if (o.setNode(c),
|
|
1374
|
-
let f = n[
|
|
1373
|
+
if (o.setNode(c), a !== void 0) {
|
|
1374
|
+
let f = n[a];
|
|
1375
1375
|
if (f !== void 0) {
|
|
1376
1376
|
let h = o.edge(f, c);
|
|
1377
|
-
o.setEdge(f, c, Math.max(s(e,
|
|
1377
|
+
o.setEdge(f, c, Math.max(s(e, d, a), h || 0));
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
|
-
|
|
1380
|
+
a = d;
|
|
1381
1381
|
}
|
|
1382
1382
|
});
|
|
1383
1383
|
}), o;
|
|
@@ -1385,22 +1385,22 @@ function gi(e, t, n, r) {
|
|
|
1385
1385
|
function pi(e, t) {
|
|
1386
1386
|
return Object.values(t).reduce((n, r) => {
|
|
1387
1387
|
let o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
1388
|
-
Object.entries(r).forEach(([l,
|
|
1389
|
-
let
|
|
1390
|
-
o = Math.max(
|
|
1388
|
+
Object.entries(r).forEach(([l, a]) => {
|
|
1389
|
+
let d = wi(e, l) / 2;
|
|
1390
|
+
o = Math.max(a + d, o), i = Math.min(a - d, i);
|
|
1391
1391
|
});
|
|
1392
1392
|
let s = o - i;
|
|
1393
1393
|
return s < n[0] && (n = [s, r]), n;
|
|
1394
1394
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1395
1395
|
}
|
|
1396
1396
|
function bi(e, t) {
|
|
1397
|
-
let n = Object.values(t), r =
|
|
1397
|
+
let n = Object.values(t), r = q(Math.min, n), o = q(Math.max, n);
|
|
1398
1398
|
["u", "d"].forEach((i) => {
|
|
1399
1399
|
["l", "r"].forEach((s) => {
|
|
1400
|
-
let l = i + s,
|
|
1401
|
-
if (!
|
|
1402
|
-
let
|
|
1403
|
-
s !== "l" && (c = o -
|
|
1400
|
+
let l = i + s, a = e[l];
|
|
1401
|
+
if (!a || a === t) return;
|
|
1402
|
+
let d = Object.values(a), c = r - q(Math.min, d);
|
|
1403
|
+
s !== "l" && (c = o - q(Math.max, d)), c && (e[l] = Oe(a, (f) => f + c));
|
|
1404
1404
|
});
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
@@ -1409,81 +1409,81 @@ function yi(e, t = void 0) {
|
|
|
1409
1409
|
return n ? Oe(n, (r, o) => {
|
|
1410
1410
|
var i, s;
|
|
1411
1411
|
if (t) {
|
|
1412
|
-
let
|
|
1413
|
-
if (
|
|
1412
|
+
let a = t.toLowerCase(), d = e[a];
|
|
1413
|
+
if (d && d[o] !== void 0) return d[o];
|
|
1414
1414
|
}
|
|
1415
|
-
let l = Object.values(e).map((
|
|
1416
|
-
let
|
|
1417
|
-
return
|
|
1418
|
-
}).sort((
|
|
1415
|
+
let l = Object.values(e).map((a) => {
|
|
1416
|
+
let d = a[o];
|
|
1417
|
+
return d !== void 0 ? d : 0;
|
|
1418
|
+
}).sort((a, d) => a - d);
|
|
1419
1419
|
return (((i = l[1]) != null ? i : 0) + ((s = l[2]) != null ? s : 0)) / 2;
|
|
1420
1420
|
}) : {};
|
|
1421
1421
|
}
|
|
1422
1422
|
function mi(e) {
|
|
1423
|
-
let t =
|
|
1423
|
+
let t = ve(e), n = Object.assign(di(e, t), ai(e, t)), r = {}, o;
|
|
1424
1424
|
["u", "d"].forEach((s) => {
|
|
1425
1425
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1426
1426
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1427
|
-
let
|
|
1428
|
-
l === "r" && (
|
|
1427
|
+
let a = ui(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), d = hi(e, o, a.root, a.align, l === "r");
|
|
1428
|
+
l === "r" && (d = Oe(d, (c) => -c)), r[s + l] = d;
|
|
1429
1429
|
});
|
|
1430
1430
|
});
|
|
1431
1431
|
let i = pi(e, r);
|
|
1432
1432
|
return bi(r, i), yi(r, e.graph().align);
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function vi(e, t, n) {
|
|
1435
1435
|
return (r, o, i) => {
|
|
1436
|
-
let s = r.node(o), l = r.node(i),
|
|
1437
|
-
if (
|
|
1436
|
+
let s = r.node(o), l = r.node(i), a = 0, d;
|
|
1437
|
+
if (a += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
|
|
1438
1438
|
case "l":
|
|
1439
|
-
|
|
1439
|
+
d = -s.width / 2;
|
|
1440
1440
|
break;
|
|
1441
1441
|
case "r":
|
|
1442
|
-
|
|
1442
|
+
d = s.width / 2;
|
|
1443
1443
|
break;
|
|
1444
1444
|
}
|
|
1445
|
-
if (
|
|
1445
|
+
if (d && (a += n ? 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()) {
|
|
1446
1446
|
case "l":
|
|
1447
|
-
|
|
1447
|
+
d = l.width / 2;
|
|
1448
1448
|
break;
|
|
1449
1449
|
case "r":
|
|
1450
|
-
|
|
1450
|
+
d = -l.width / 2;
|
|
1451
1451
|
break;
|
|
1452
1452
|
}
|
|
1453
|
-
return
|
|
1453
|
+
return d && (a += n ? d : -d), a;
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function wi(e, t) {
|
|
1457
1457
|
return e.node(t).width;
|
|
1458
1458
|
}
|
|
1459
1459
|
function Ei(e) {
|
|
1460
|
-
e =
|
|
1460
|
+
e = dn(e), xi(e), Object.entries(mi(e)).forEach(([t, n]) => e.node(t).x = n);
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1463
|
-
let t =
|
|
1462
|
+
function xi(e) {
|
|
1463
|
+
let t = ve(e), n = e.graph(), r = n.ranksep, o = n.rankalign, i = 0;
|
|
1464
1464
|
t.forEach((s) => {
|
|
1465
|
-
let l = s.reduce((
|
|
1465
|
+
let l = s.reduce((a, d) => {
|
|
1466
1466
|
var c;
|
|
1467
|
-
let f = (c = e.node(
|
|
1468
|
-
return
|
|
1467
|
+
let f = (c = e.node(d).height) != null ? c : 0;
|
|
1468
|
+
return a > f ? a : f;
|
|
1469
1469
|
}, 0);
|
|
1470
|
-
s.forEach((
|
|
1471
|
-
let
|
|
1472
|
-
o === "top" ?
|
|
1470
|
+
s.forEach((a) => {
|
|
1471
|
+
let d = e.node(a);
|
|
1472
|
+
o === "top" ? d.y = i + d.height / 2 : o === "bottom" ? d.y = i + l - d.height / 2 : d.y = i + l / 2;
|
|
1473
1473
|
}), i += l + r;
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function ki(e, t = {}) {
|
|
1477
1477
|
let n = t.debugTiming ? fn : un;
|
|
1478
1478
|
return n("layout", () => {
|
|
1479
1479
|
let r = n(" buildLayoutGraph", () => zi(e));
|
|
1480
|
-
return n(" runLayout", () =>
|
|
1480
|
+
return n(" runLayout", () => _i(r, n, t)), n(" updateInputGraph", () => Si(e, r)), r;
|
|
1481
1481
|
});
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
t(" makeSpaceForEdgeLabels", () =>
|
|
1483
|
+
function _i(e, t, n) {
|
|
1484
|
+
t(" makeSpaceForEdgeLabels", () => Li(e)), t(" removeSelfEdges", () => Gi(e)), t(" acyclic", () => ho(e)), t(" nestingGraph.run", () => Fo(e)), t(" rank", () => Io(dn(e))), t(" injectEdgeLabelProxies", () => Pi(e)), t(" removeEmptyRanks", () => Zr(e)), t(" nestingGraph.cleanup", () => Ao(e)), t(" normalizeRanks", () => Jr(e)), t(" assignRankMinMax", () => Ri(e)), t(" removeEdgeLabelProxies", () => Fi(e)), t(" normalize.run", () => bo(e)), t(" parentDummyChains", () => zo(e)), t(" addBorderSegments", () => Wo(e)), t(" order", () => xn(e, n)), t(" insertSelfEdges", () => Yi(e)), t(" adjustCoordinateSystem", () => Go(e)), t(" position", () => Ei(e)), t(" positionSelfEdges", () => Ki(e)), t(" removeBorderNodes", () => $i(e)), t(" normalize.undo", () => mo(e)), t(" fixupEdgeLabelCoords", () => Ai(e)), t(" undoCoordinateSystem", () => Yo(e)), t(" translateGraph", () => Di(e)), t(" assignNodeIntersects", () => Bi(e)), t(" reversePoints", () => Wi(e)), t(" acyclic.undo", () => po(e));
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function Si(e, t) {
|
|
1487
1487
|
e.nodes().forEach((n) => {
|
|
1488
1488
|
let r = e.node(n), o = t.node(n);
|
|
1489
1489
|
r && (r.x = o.x, r.y = o.y, r.order = o.order, r.rank = o.rank, t.children(n).length && (r.width = o.width, r.height = o.height));
|
|
@@ -1492,29 +1492,29 @@ function _i(e, t) {
|
|
|
1492
1492
|
r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
|
|
1493
1493
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1494
1494
|
}
|
|
1495
|
-
var Ni = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"],
|
|
1495
|
+
var Ni = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], Ti = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, Ci = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Ii = ["width", "height", "rank"], Bt = { width: 0, height: 0 }, Oi = ["minlen", "weight", "width", "height", "labeloffset"], Mi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, ji = ["labelpos"];
|
|
1496
1496
|
function zi(e) {
|
|
1497
|
-
let t = new
|
|
1498
|
-
return t.setGraph(Object.assign({},
|
|
1499
|
-
let o =
|
|
1500
|
-
Object.keys(
|
|
1501
|
-
i[l] === void 0 && (i[l] =
|
|
1497
|
+
let t = new H({ multigraph: !0, compound: !0 }), n = Ge(e.graph());
|
|
1498
|
+
return t.setGraph(Object.assign({}, Ti, $e(n, Ni), Ie(n, Ci))), e.nodes().forEach((r) => {
|
|
1499
|
+
let o = Ge(e.node(r)), i = $e(o, Ii);
|
|
1500
|
+
Object.keys(Bt).forEach((l) => {
|
|
1501
|
+
i[l] === void 0 && (i[l] = Bt[l]);
|
|
1502
1502
|
}), t.setNode(r, i);
|
|
1503
1503
|
let s = e.parent(r);
|
|
1504
1504
|
s !== void 0 && t.setParent(r, s);
|
|
1505
1505
|
}), e.edges().forEach((r) => {
|
|
1506
|
-
let o =
|
|
1507
|
-
t.setEdge(r, Object.assign({},
|
|
1506
|
+
let o = Ge(e.edge(r));
|
|
1507
|
+
t.setEdge(r, Object.assign({}, Mi, $e(o, Oi), Ie(o, ji)));
|
|
1508
1508
|
}), t;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function Li(e) {
|
|
1511
1511
|
let t = e.graph();
|
|
1512
1512
|
t.ranksep /= 2, e.edges().forEach((n) => {
|
|
1513
1513
|
let r = e.edge(n);
|
|
1514
1514
|
r.minlen *= 2, r.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? r.width += r.labeloffset : r.height += r.labeloffset);
|
|
1515
1515
|
});
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function Pi(e) {
|
|
1518
1518
|
e.edges().forEach((t) => {
|
|
1519
1519
|
let n = e.edge(t);
|
|
1520
1520
|
if (n.width && n.height) {
|
|
@@ -1523,14 +1523,14 @@ function Li(e) {
|
|
|
1523
1523
|
}
|
|
1524
1524
|
});
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1526
|
+
function Ri(e) {
|
|
1527
1527
|
let t = 0;
|
|
1528
1528
|
e.nodes().forEach((n) => {
|
|
1529
1529
|
let r = e.node(n);
|
|
1530
1530
|
r.borderTop && (r.minRank = e.node(r.borderTop).rank, r.maxRank = e.node(r.borderBottom).rank, t = Math.max(t, r.maxRank));
|
|
1531
1531
|
}), e.graph().maxRank = t;
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function Fi(e) {
|
|
1534
1534
|
e.nodes().forEach((t) => {
|
|
1535
1535
|
let n = e.node(t);
|
|
1536
1536
|
if (n.dummy === "edge-proxy") {
|
|
@@ -1541,30 +1541,30 @@ function Ri(e) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
function Di(e) {
|
|
1543
1543
|
let t = Number.POSITIVE_INFINITY, n = 0, r = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1544
|
-
function d
|
|
1545
|
-
let c =
|
|
1544
|
+
function a(d) {
|
|
1545
|
+
let c = d.x, f = d.y, h = d.width, g = d.height;
|
|
1546
1546
|
t = Math.min(t, c - h / 2), n = Math.max(n, c + h / 2), r = Math.min(r, f - g / 2), o = Math.max(o, f + g / 2);
|
|
1547
1547
|
}
|
|
1548
|
-
e.nodes().forEach((
|
|
1549
|
-
let c = e.edge(
|
|
1550
|
-
Object.hasOwn(c, "x") &&
|
|
1551
|
-
}), t -= s, r -= l, e.nodes().forEach((
|
|
1552
|
-
let c = e.node(
|
|
1548
|
+
e.nodes().forEach((d) => a(e.node(d))), e.edges().forEach((d) => {
|
|
1549
|
+
let c = e.edge(d);
|
|
1550
|
+
Object.hasOwn(c, "x") && a(c);
|
|
1551
|
+
}), t -= s, r -= l, e.nodes().forEach((d) => {
|
|
1552
|
+
let c = e.node(d);
|
|
1553
1553
|
c.x -= t, c.y -= r;
|
|
1554
|
-
}), e.edges().forEach((
|
|
1555
|
-
let c = e.edge(
|
|
1554
|
+
}), e.edges().forEach((d) => {
|
|
1555
|
+
let c = e.edge(d);
|
|
1556
1556
|
c.points.forEach((f) => {
|
|
1557
1557
|
f.x -= t, f.y -= r;
|
|
1558
1558
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= r);
|
|
1559
1559
|
}), i.width = n - t + s, i.height = o - r + l;
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Bi(e) {
|
|
1562
1562
|
e.edges().forEach((t) => {
|
|
1563
1563
|
let n = e.edge(t), r = e.node(t.v), o = e.node(t.w), i, s;
|
|
1564
1564
|
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(It(r, i)), n.points.push(It(o, s));
|
|
1565
1565
|
});
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function Ai(e) {
|
|
1568
1568
|
e.edges().forEach((t) => {
|
|
1569
1569
|
let n = e.edge(t);
|
|
1570
1570
|
if (Object.hasOwn(n, "x")) switch ((n.labelpos === "l" || n.labelpos === "r") && (n.width -= n.labeloffset), n.labelpos) {
|
|
@@ -1583,7 +1583,7 @@ function Wi(e) {
|
|
|
1583
1583
|
n.reversed && n.points.reverse();
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function $i(e) {
|
|
1587
1587
|
e.nodes().forEach((t) => {
|
|
1588
1588
|
if (e.children(t).length) {
|
|
1589
1589
|
let n = e.node(t), r = e.node(n.borderTop), o = e.node(n.borderBottom), i = e.node(n.borderLeft[n.borderLeft.length - 1]), s = e.node(n.borderRight[n.borderRight.length - 1]);
|
|
@@ -1593,7 +1593,7 @@ function Gi(e) {
|
|
|
1593
1593
|
e.node(t).dummy === "border" && e.removeNode(t);
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1596
|
+
function Gi(e) {
|
|
1597
1597
|
e.edges().forEach((t) => {
|
|
1598
1598
|
if (t.v === t.w) {
|
|
1599
1599
|
let n = e.node(t.v);
|
|
@@ -1602,7 +1602,7 @@ function $i(e) {
|
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
1604
|
function Yi(e) {
|
|
1605
|
-
|
|
1605
|
+
ve(e).forEach((t) => {
|
|
1606
1606
|
let n = 0;
|
|
1607
1607
|
t.forEach((r, o) => {
|
|
1608
1608
|
let i = e.node(r);
|
|
@@ -1616,22 +1616,22 @@ function Ki(e) {
|
|
|
1616
1616
|
e.nodes().forEach((t) => {
|
|
1617
1617
|
let n = e.node(t);
|
|
1618
1618
|
if (n.dummy === "selfedge") {
|
|
1619
|
-
let r = n, o = e.node(r.e.v), i = o.x + o.width / 2, s = o.y, l = n.x - i,
|
|
1620
|
-
e.setEdge(r.e, r.label), e.removeNode(t), r.label.points = [{ x: i + 2 * l / 3, y: s -
|
|
1619
|
+
let r = n, o = e.node(r.e.v), i = o.x + o.width / 2, s = o.y, l = n.x - i, a = o.height / 2;
|
|
1620
|
+
e.setEdge(r.e, r.label), e.removeNode(t), r.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 }], r.label.x = n.x, r.label.y = n.y;
|
|
1621
1621
|
}
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function $e(e, t) {
|
|
1625
1625
|
return Oe(Ie(e, t), Number);
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function Ge(e) {
|
|
1628
1628
|
let t = {};
|
|
1629
1629
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
1630
1630
|
typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
|
|
1631
1631
|
}), t;
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let t =
|
|
1633
|
+
function Hi(e) {
|
|
1634
|
+
let t = ve(e), n = new H({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1635
1635
|
return e.nodes().forEach((r) => {
|
|
1636
1636
|
n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
|
|
1637
1637
|
}), e.edges().forEach((r) => n.setEdge(r.v, r.w, {}, r.name)), t.forEach((r, o) => {
|
|
@@ -1639,25 +1639,25 @@ function Ui(e) {
|
|
|
1639
1639
|
n.setNode(i, { rank: "same" }), r.reduce((s, l) => (n.setEdge(s, l, { style: "invis" }), l));
|
|
1640
1640
|
}), n;
|
|
1641
1641
|
}
|
|
1642
|
-
var
|
|
1642
|
+
var Vi = { graphlib: Zt, version: ro, layout: ki, debug: Hi, util: { time: fn, notime: un } }, At = Vi;
|
|
1643
1643
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1644
|
-
const
|
|
1644
|
+
const Ui = (e) => {
|
|
1645
1645
|
const t = [];
|
|
1646
1646
|
return e.nodeInternals.forEach((n, r) => t.push(`${r}:${n.height ?? 0}`)), t.join(",");
|
|
1647
|
-
},
|
|
1648
|
-
const n =
|
|
1649
|
-
|
|
1650
|
-
const { fitView: o } =
|
|
1647
|
+
}, Xi = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1648
|
+
const n = Bn(Ui), r = _t("");
|
|
1649
|
+
_t(0);
|
|
1650
|
+
const { fitView: o } = An();
|
|
1651
1651
|
return re(() => {
|
|
1652
1652
|
if (!n || n === r.current) return;
|
|
1653
1653
|
const i = {};
|
|
1654
1654
|
for (const s of n.split(",")) {
|
|
1655
|
-
const [l,
|
|
1656
|
-
l &&
|
|
1655
|
+
const [l, a] = s.split(":"), d = Number(a);
|
|
1656
|
+
l && d > 0 && (i[l] = d);
|
|
1657
1657
|
}
|
|
1658
1658
|
Object.keys(i).length !== 0 && (r.current = n, e(i));
|
|
1659
1659
|
}, [n]), null;
|
|
1660
|
-
},
|
|
1660
|
+
}, qi = {
|
|
1661
1661
|
gray: { bg: "#f1f5f9", fg: "#475569" },
|
|
1662
1662
|
green: { bg: "#dcfce7", fg: "#166534" },
|
|
1663
1663
|
amber: { bg: "#fef3c7", fg: "#92400e" },
|
|
@@ -1673,24 +1673,24 @@ function Ji({
|
|
|
1673
1673
|
saveLabel: s = "Save",
|
|
1674
1674
|
saveDisabled: l = !1
|
|
1675
1675
|
}) {
|
|
1676
|
-
const [
|
|
1677
|
-
|
|
1676
|
+
const [a, d] = B.useState(!1), [c, f] = B.useState(!1), [h, g] = B.useState(e ?? "");
|
|
1677
|
+
B.useEffect(() => {
|
|
1678
1678
|
g(e ?? "");
|
|
1679
1679
|
}, [e]);
|
|
1680
1680
|
const p = async () => {
|
|
1681
|
-
if (!(!o ||
|
|
1682
|
-
|
|
1681
|
+
if (!(!o || a || l)) {
|
|
1682
|
+
d(!0);
|
|
1683
1683
|
try {
|
|
1684
1684
|
await o();
|
|
1685
1685
|
} finally {
|
|
1686
|
-
|
|
1686
|
+
d(!1);
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
1689
|
-
}, E =
|
|
1689
|
+
}, E = qi[r] ?? {
|
|
1690
1690
|
bg: r,
|
|
1691
1691
|
fg: "#fff"
|
|
1692
1692
|
};
|
|
1693
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ v(
|
|
1694
1694
|
"div",
|
|
1695
1695
|
{
|
|
1696
1696
|
style: {
|
|
@@ -1703,7 +1703,7 @@ function Ji({
|
|
|
1703
1703
|
flexShrink: 0
|
|
1704
1704
|
},
|
|
1705
1705
|
children: [
|
|
1706
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 }, children: [
|
|
1707
1707
|
c && t ? /* @__PURE__ */ u(
|
|
1708
1708
|
"input",
|
|
1709
1709
|
{
|
|
@@ -1762,13 +1762,13 @@ function Ji({
|
|
|
1762
1762
|
}
|
|
1763
1763
|
)
|
|
1764
1764
|
] }),
|
|
1765
|
-
/* @__PURE__ */
|
|
1765
|
+
/* @__PURE__ */ v("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1766
1766
|
i && /* @__PURE__ */ u(
|
|
1767
1767
|
"button",
|
|
1768
1768
|
{
|
|
1769
1769
|
type: "button",
|
|
1770
1770
|
onClick: i,
|
|
1771
|
-
disabled:
|
|
1771
|
+
disabled: a,
|
|
1772
1772
|
style: {
|
|
1773
1773
|
padding: "6px 14px",
|
|
1774
1774
|
fontSize: 13,
|
|
@@ -1777,8 +1777,8 @@ function Ji({
|
|
|
1777
1777
|
background: "#fff",
|
|
1778
1778
|
color: "#475569",
|
|
1779
1779
|
borderRadius: 6,
|
|
1780
|
-
cursor:
|
|
1781
|
-
opacity:
|
|
1780
|
+
cursor: a ? "not-allowed" : "pointer",
|
|
1781
|
+
opacity: a ? 0.6 : 1
|
|
1782
1782
|
},
|
|
1783
1783
|
children: "Cancel"
|
|
1784
1784
|
}
|
|
@@ -1788,7 +1788,7 @@ function Ji({
|
|
|
1788
1788
|
{
|
|
1789
1789
|
type: "button",
|
|
1790
1790
|
onClick: p,
|
|
1791
|
-
disabled:
|
|
1791
|
+
disabled: a || l,
|
|
1792
1792
|
style: {
|
|
1793
1793
|
padding: "6px 16px",
|
|
1794
1794
|
fontSize: 13,
|
|
@@ -1797,14 +1797,14 @@ function Ji({
|
|
|
1797
1797
|
background: l ? "#94a3b8" : "var(--ff-primary, #1dbf60)",
|
|
1798
1798
|
color: "#fff",
|
|
1799
1799
|
borderRadius: 6,
|
|
1800
|
-
cursor:
|
|
1800
|
+
cursor: a || l ? "not-allowed" : "pointer",
|
|
1801
1801
|
display: "inline-flex",
|
|
1802
1802
|
alignItems: "center",
|
|
1803
1803
|
gap: 6,
|
|
1804
1804
|
minWidth: 80,
|
|
1805
1805
|
justifyContent: "center"
|
|
1806
1806
|
},
|
|
1807
|
-
children:
|
|
1807
|
+
children: a ? "Saving…" : s
|
|
1808
1808
|
}
|
|
1809
1809
|
)
|
|
1810
1810
|
] })
|
|
@@ -1812,18 +1812,18 @@ function Ji({
|
|
|
1812
1812
|
}
|
|
1813
1813
|
);
|
|
1814
1814
|
}
|
|
1815
|
-
const
|
|
1816
|
-
const [l,
|
|
1815
|
+
const je = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 600 }) => {
|
|
1816
|
+
const [l, a] = M(!1), d = () => a((h) => !h), c = () => /* @__PURE__ */ v(Q, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1817
1817
|
r && /* @__PURE__ */ u(Q, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1818
1818
|
/* @__PURE__ */ u("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1819
|
-
/* @__PURE__ */ u(
|
|
1820
|
-
/* @__PURE__ */ u(
|
|
1819
|
+
/* @__PURE__ */ u(St, { onClick: d, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ u(br, {}) : /* @__PURE__ */ u(yr, {}) }),
|
|
1820
|
+
/* @__PURE__ */ u(St, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ u(tr, {}) })
|
|
1821
1821
|
] }), f = () => i ? /* @__PURE__ */ u(Q, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1822
|
-
return l ? /* @__PURE__ */
|
|
1822
|
+
return l ? /* @__PURE__ */ v(Jn, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1823
1823
|
/* @__PURE__ */ u(c, {}),
|
|
1824
1824
|
/* @__PURE__ */ u(Q, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1825
1825
|
/* @__PURE__ */ u(f, {})
|
|
1826
|
-
] }) : /* @__PURE__ */
|
|
1826
|
+
] }) : /* @__PURE__ */ v(
|
|
1827
1827
|
Zn,
|
|
1828
1828
|
{
|
|
1829
1829
|
anchor: "right",
|
|
@@ -1862,33 +1862,33 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1862
1862
|
onClose: o,
|
|
1863
1863
|
loadTriggerSources: i
|
|
1864
1864
|
}) => {
|
|
1865
|
-
const [s, l] =
|
|
1865
|
+
const [s, l] = M("trigger"), [a, d] = M(null), [c, f] = M([]), [h, g] = M([]), [p, E] = M(!1), [b, k] = M(null);
|
|
1866
1866
|
re(() => {
|
|
1867
|
-
e || (l("trigger"),
|
|
1867
|
+
e || (l("trigger"), d(null), f([]), g([]), E(!1), k(null));
|
|
1868
1868
|
}, [e]);
|
|
1869
|
-
const N = Y(async (
|
|
1869
|
+
const N = Y(async (L) => {
|
|
1870
1870
|
if (!i) {
|
|
1871
|
-
r(
|
|
1871
|
+
r(L);
|
|
1872
1872
|
return;
|
|
1873
1873
|
}
|
|
1874
|
-
|
|
1874
|
+
d(L), E(!0), k(null);
|
|
1875
1875
|
try {
|
|
1876
|
-
const D = await i(
|
|
1876
|
+
const D = await i(L.triggerKey);
|
|
1877
1877
|
if (!D || D.length === 0) {
|
|
1878
|
-
r(
|
|
1878
|
+
r(L);
|
|
1879
1879
|
return;
|
|
1880
1880
|
}
|
|
1881
1881
|
f(D), l("sources");
|
|
1882
1882
|
} catch (D) {
|
|
1883
|
-
|
|
1883
|
+
k(D instanceof Error ? D.message : "Failed to load sources.");
|
|
1884
1884
|
} finally {
|
|
1885
1885
|
E(!1);
|
|
1886
1886
|
}
|
|
1887
1887
|
}, [i, r]), O = () => {
|
|
1888
|
-
l("trigger"),
|
|
1889
|
-
},
|
|
1890
|
-
|
|
1891
|
-
}, z = s === "sources" &&
|
|
1888
|
+
l("trigger"), d(null), f([]), g([]), k(null);
|
|
1889
|
+
}, j = () => {
|
|
1890
|
+
a && r(a, h);
|
|
1891
|
+
}, z = s === "sources" && a, W = z ? /* @__PURE__ */ v(be, { children: [
|
|
1892
1892
|
/* @__PURE__ */ u(Ne, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
|
|
1893
1893
|
/* @__PURE__ */ u(
|
|
1894
1894
|
Ne,
|
|
@@ -1896,35 +1896,35 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1896
1896
|
type: "button",
|
|
1897
1897
|
variant: "contained",
|
|
1898
1898
|
size: "small",
|
|
1899
|
-
onClick:
|
|
1899
|
+
onClick: j,
|
|
1900
1900
|
disabled: h.length === 0,
|
|
1901
1901
|
children: n.save ?? "Continue"
|
|
1902
1902
|
}
|
|
1903
1903
|
)
|
|
1904
1904
|
] }) : null;
|
|
1905
1905
|
return /* @__PURE__ */ u(
|
|
1906
|
-
|
|
1906
|
+
je,
|
|
1907
1907
|
{
|
|
1908
1908
|
isOpen: e,
|
|
1909
1909
|
onClose: o,
|
|
1910
|
-
title: z ?
|
|
1910
|
+
title: z ? a.label : n.addTriggerTitle,
|
|
1911
1911
|
icon: /* @__PURE__ */ u(pr, {}),
|
|
1912
1912
|
width: 500,
|
|
1913
1913
|
footer: W,
|
|
1914
|
-
children: /* @__PURE__ */
|
|
1915
|
-
!z && /* @__PURE__ */
|
|
1914
|
+
children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
|
|
1915
|
+
!z && /* @__PURE__ */ v(be, { children: [
|
|
1916
1916
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
t.map((
|
|
1917
|
+
/* @__PURE__ */ v("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1918
|
+
t.map((L) => /* @__PURE__ */ v(
|
|
1919
1919
|
"div",
|
|
1920
1920
|
{
|
|
1921
1921
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1922
1922
|
style: { cursor: p ? "wait" : "pointer", transition: "background 0.15s", opacity: p ? 0.6 : 1 },
|
|
1923
|
-
onClick: () => !p && N(
|
|
1923
|
+
onClick: () => !p && N(L),
|
|
1924
1924
|
role: "button",
|
|
1925
1925
|
tabIndex: 0,
|
|
1926
1926
|
onKeyDown: (D) => {
|
|
1927
|
-
D.key === "Enter" && !p && N(
|
|
1927
|
+
D.key === "Enter" && !p && N(L);
|
|
1928
1928
|
},
|
|
1929
1929
|
onMouseEnter: (D) => {
|
|
1930
1930
|
p || (D.currentTarget.style.background = "#f5f5f5");
|
|
@@ -1933,32 +1933,32 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1933
1933
|
D.currentTarget.style.background = "";
|
|
1934
1934
|
},
|
|
1935
1935
|
children: [
|
|
1936
|
-
/* @__PURE__ */ u("div", { style: { color:
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children:
|
|
1939
|
-
|
|
1936
|
+
/* @__PURE__ */ u("div", { style: { color: L.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: L.triggerCategory === "scheduler" ? /* @__PURE__ */ u(nr, { size: 18 }) : /* @__PURE__ */ u(rr, { size: 18 }) }),
|
|
1937
|
+
/* @__PURE__ */ v("div", { children: [
|
|
1938
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: L.label }),
|
|
1939
|
+
L.description && /* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: L.description })
|
|
1940
1940
|
] })
|
|
1941
1941
|
]
|
|
1942
1942
|
},
|
|
1943
|
-
|
|
1943
|
+
L.triggerKey
|
|
1944
1944
|
)),
|
|
1945
1945
|
t.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1946
1946
|
] }),
|
|
1947
|
-
p && /* @__PURE__ */
|
|
1947
|
+
p && /* @__PURE__ */ v(Q, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1948
1948
|
/* @__PURE__ */ u(Qn, { size: 14 }),
|
|
1949
1949
|
/* @__PURE__ */ u("span", { children: "Loading sources for the selected trigger…" })
|
|
1950
1950
|
] }),
|
|
1951
1951
|
b && /* @__PURE__ */ u("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: b })
|
|
1952
1952
|
] }),
|
|
1953
|
-
z && /* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
1953
|
+
z && /* @__PURE__ */ v(be, { children: [
|
|
1954
|
+
/* @__PURE__ */ v(
|
|
1955
1955
|
"div",
|
|
1956
1956
|
{
|
|
1957
1957
|
role: "button",
|
|
1958
1958
|
tabIndex: 0,
|
|
1959
1959
|
onClick: O,
|
|
1960
|
-
onKeyDown: (
|
|
1961
|
-
|
|
1960
|
+
onKeyDown: (L) => {
|
|
1961
|
+
L.key === "Enter" && O();
|
|
1962
1962
|
},
|
|
1963
1963
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1964
1964
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
@@ -1968,9 +1968,9 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1968
1968
|
]
|
|
1969
1969
|
}
|
|
1970
1970
|
),
|
|
1971
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ v("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
|
|
1972
1972
|
"Pick one or more sources for ",
|
|
1973
|
-
/* @__PURE__ */ u("strong", { children:
|
|
1973
|
+
/* @__PURE__ */ u("strong", { children: a.label }),
|
|
1974
1974
|
":"
|
|
1975
1975
|
] }),
|
|
1976
1976
|
/* @__PURE__ */ u(
|
|
@@ -1979,7 +1979,7 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1979
1979
|
isMulti: !0,
|
|
1980
1980
|
options: c,
|
|
1981
1981
|
value: h,
|
|
1982
|
-
onChange: (
|
|
1982
|
+
onChange: (L) => g(L ?? []),
|
|
1983
1983
|
placeholder: "Select sources…",
|
|
1984
1984
|
menuPosition: "fixed",
|
|
1985
1985
|
menuPortalTarget: typeof document < "u" ? document.body : void 0,
|
|
@@ -2009,30 +2009,30 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2009
2009
|
} else
|
|
2010
2010
|
h.push(g);
|
|
2011
2011
|
return { apps: [...f.values()], ungrouped: h };
|
|
2012
|
-
}, [t]), [l,
|
|
2012
|
+
}, [t]), [l, a] = M(null), d = l ? i.find((f) => f.key === l) ?? null : null;
|
|
2013
2013
|
re(() => {
|
|
2014
|
-
e ||
|
|
2014
|
+
e || a(null);
|
|
2015
2015
|
}, [e]), re(() => {
|
|
2016
|
-
|
|
2016
|
+
a(null);
|
|
2017
2017
|
}, [t]);
|
|
2018
|
-
const c = !
|
|
2018
|
+
const c = !d;
|
|
2019
2019
|
return /* @__PURE__ */ u(
|
|
2020
|
-
|
|
2020
|
+
je,
|
|
2021
2021
|
{
|
|
2022
2022
|
isOpen: e,
|
|
2023
2023
|
onClose: o,
|
|
2024
|
-
title: c ? n.addStepTitle :
|
|
2025
|
-
icon: c ? /* @__PURE__ */ u(or, {}) :
|
|
2024
|
+
title: c ? n.addStepTitle : d.label,
|
|
2025
|
+
icon: c ? /* @__PURE__ */ u(or, {}) : d.icon ?? /* @__PURE__ */ u(ir, {}),
|
|
2026
2026
|
width: 500,
|
|
2027
|
-
children: /* @__PURE__ */
|
|
2028
|
-
!c && /* @__PURE__ */
|
|
2027
|
+
children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
|
|
2028
|
+
!c && /* @__PURE__ */ v(
|
|
2029
2029
|
"div",
|
|
2030
2030
|
{
|
|
2031
2031
|
role: "button",
|
|
2032
2032
|
tabIndex: 0,
|
|
2033
|
-
onClick: () =>
|
|
2033
|
+
onClick: () => a(null),
|
|
2034
2034
|
onKeyDown: (f) => {
|
|
2035
|
-
f.key === "Enter" &&
|
|
2035
|
+
f.key === "Enter" && a(null);
|
|
2036
2036
|
},
|
|
2037
2037
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
2038
2038
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
@@ -2042,18 +2042,18 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2042
2042
|
]
|
|
2043
2043
|
}
|
|
2044
2044
|
),
|
|
2045
|
-
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${
|
|
2046
|
-
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */
|
|
2047
|
-
i.map((f) => /* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${d.label}` }),
|
|
2046
|
+
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ v(be, { children: [
|
|
2047
|
+
i.map((f) => /* @__PURE__ */ v(
|
|
2048
2048
|
"div",
|
|
2049
2049
|
{
|
|
2050
2050
|
className: Ke,
|
|
2051
2051
|
style: Ye,
|
|
2052
|
-
onClick: () =>
|
|
2052
|
+
onClick: () => a(f.key),
|
|
2053
2053
|
role: "button",
|
|
2054
2054
|
tabIndex: 0,
|
|
2055
2055
|
onKeyDown: (h) => {
|
|
2056
|
-
h.key === "Enter" &&
|
|
2056
|
+
h.key === "Enter" && a(f.key);
|
|
2057
2057
|
},
|
|
2058
2058
|
onMouseEnter: (h) => {
|
|
2059
2059
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -2063,16 +2063,16 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2063
2063
|
},
|
|
2064
2064
|
children: [
|
|
2065
2065
|
f.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0 }, children: f.icon }),
|
|
2066
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2067
2067
|
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label }),
|
|
2068
2068
|
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: f.description ?? `${f.descriptors.length} action${f.descriptors.length === 1 ? "" : "s"}` })
|
|
2069
2069
|
] }),
|
|
2070
|
-
/* @__PURE__ */ u(
|
|
2070
|
+
/* @__PURE__ */ u(Ht, { size: 18, color: "#9e9e9e" })
|
|
2071
2071
|
]
|
|
2072
2072
|
},
|
|
2073
2073
|
`app-${f.key}`
|
|
2074
2074
|
)),
|
|
2075
|
-
s.map((f) => /* @__PURE__ */
|
|
2075
|
+
s.map((f) => /* @__PURE__ */ v(
|
|
2076
2076
|
"div",
|
|
2077
2077
|
{
|
|
2078
2078
|
className: Ke,
|
|
@@ -2099,7 +2099,7 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2099
2099
|
i.length === 0 && s.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noActions })
|
|
2100
2100
|
] }) : (
|
|
2101
2101
|
/* Stage 2 — actions for the selected app */
|
|
2102
|
-
|
|
2102
|
+
d.descriptors.map((f) => /* @__PURE__ */ v(
|
|
2103
2103
|
"div",
|
|
2104
2104
|
{
|
|
2105
2105
|
className: Ke,
|
|
@@ -2128,43 +2128,43 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2128
2128
|
}
|
|
2129
2129
|
);
|
|
2130
2130
|
}, Wt = "_conditionConfig", es = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2131
|
-
const [l,
|
|
2131
|
+
const [l, a] = M([]), [d, c] = M(!1), [f, h] = M(null), [g, p] = M({});
|
|
2132
2132
|
re(() => {
|
|
2133
2133
|
p((r == null ? void 0 : r[Wt]) ?? {});
|
|
2134
2134
|
}, [r, t]), re(() => {
|
|
2135
2135
|
let N = !1;
|
|
2136
2136
|
if (h(null), !n || !t) {
|
|
2137
|
-
|
|
2137
|
+
a([]), c(!1);
|
|
2138
2138
|
return;
|
|
2139
2139
|
}
|
|
2140
2140
|
const O = n.formSchema;
|
|
2141
|
-
return typeof O == "function" ? (c(!0), O(t).then((
|
|
2142
|
-
N || (
|
|
2143
|
-
}).catch((
|
|
2144
|
-
N || (
|
|
2145
|
-
})) : (
|
|
2141
|
+
return typeof O == "function" ? (c(!0), O(t).then((j) => {
|
|
2142
|
+
N || (a(j), c(!1));
|
|
2143
|
+
}).catch((j) => {
|
|
2144
|
+
N || (a([]), h(j instanceof Error ? j.message : "Unable to load configuration."), c(!1));
|
|
2145
|
+
})) : (a(O), c(!1)), () => {
|
|
2146
2146
|
N = !0;
|
|
2147
2147
|
};
|
|
2148
2148
|
}, [n, t]);
|
|
2149
|
-
const E = t ? `node-config-form-${t}` : "node-config-form", b = !
|
|
2149
|
+
const E = t ? `node-config-form-${t}` : "node-config-form", b = !d && !f && l.length > 0, k = b ? /* @__PURE__ */ v(be, { children: [
|
|
2150
2150
|
/* @__PURE__ */ u(Ne, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
|
|
2151
2151
|
/* @__PURE__ */ u(Ne, { type: "submit", form: E, variant: "contained", size: "small", children: o.save })
|
|
2152
2152
|
] }) : null;
|
|
2153
2153
|
return /* @__PURE__ */ u(
|
|
2154
|
-
|
|
2154
|
+
je,
|
|
2155
2155
|
{
|
|
2156
2156
|
isOpen: e,
|
|
2157
2157
|
onClose: s,
|
|
2158
2158
|
title: (n == null ? void 0 : n.label) ?? o.configureStep,
|
|
2159
2159
|
icon: n == null ? void 0 : n.icon,
|
|
2160
2160
|
width: 500,
|
|
2161
|
-
footer:
|
|
2162
|
-
children: /* @__PURE__ */
|
|
2163
|
-
|
|
2164
|
-
!
|
|
2165
|
-
!
|
|
2161
|
+
footer: k,
|
|
2162
|
+
children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
|
|
2163
|
+
d && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2164
|
+
!d && f && /* @__PURE__ */ u("p", { style: { fontSize: 13, color: "#d32f2f" }, children: f }),
|
|
2165
|
+
!d && !f && l.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2166
2166
|
b && /* @__PURE__ */ u(
|
|
2167
|
-
|
|
2167
|
+
vr,
|
|
2168
2168
|
{
|
|
2169
2169
|
schema: { layout: "flat", fields: l },
|
|
2170
2170
|
initialValues: r ?? {},
|
|
@@ -2188,7 +2188,7 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2188
2188
|
workflowLabel: r,
|
|
2189
2189
|
onFetchWorkflow: o
|
|
2190
2190
|
}) => {
|
|
2191
|
-
const [i, s] =
|
|
2191
|
+
const [i, s] = M({ status: "idle" });
|
|
2192
2192
|
return re(() => {
|
|
2193
2193
|
if (!e || !n) {
|
|
2194
2194
|
s({ status: "idle" });
|
|
@@ -2196,21 +2196,21 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2196
2196
|
}
|
|
2197
2197
|
s({ status: "loading" }), o(n).then((l) => s({ status: "loaded", state: l })).catch((l) => s({ status: "error", message: (l == null ? void 0 : l.message) ?? "Failed to load workflow" }));
|
|
2198
2198
|
}, [e, n, o]), /* @__PURE__ */ u(
|
|
2199
|
-
|
|
2199
|
+
je,
|
|
2200
2200
|
{
|
|
2201
2201
|
isOpen: e,
|
|
2202
2202
|
onClose: t,
|
|
2203
2203
|
title: r ? `Preview: ${r}` : "Sub-Workflow Preview",
|
|
2204
2204
|
icon: /* @__PURE__ */ u(lr, { size: 18, color: "#00695c" }),
|
|
2205
2205
|
width: 700,
|
|
2206
|
-
children: /* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ v("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
2207
2207
|
i.status === "idle" && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
2208
|
-
i.status === "loading" && /* @__PURE__ */
|
|
2208
|
+
i.status === "loading" && /* @__PURE__ */ v("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
|
|
2209
2209
|
/* @__PURE__ */ u("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
|
|
2210
2210
|
/* @__PURE__ */ u("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
|
|
2211
2211
|
/* @__PURE__ */ u("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
2212
2212
|
] }),
|
|
2213
|
-
i.status === "error" && /* @__PURE__ */
|
|
2213
|
+
i.status === "error" && /* @__PURE__ */ v("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
2214
2214
|
/* @__PURE__ */ u(sr, { size: 32, style: { marginBottom: 8 } }),
|
|
2215
2215
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
2216
2216
|
] }),
|
|
@@ -2219,10 +2219,10 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2219
2219
|
}
|
|
2220
2220
|
);
|
|
2221
2221
|
}, ns = ({ state: e }) => {
|
|
2222
|
-
const [t, n] =
|
|
2222
|
+
const [t, n] = M(null), [r, o] = M(null);
|
|
2223
2223
|
return re(() => {
|
|
2224
2224
|
Promise.all([
|
|
2225
|
-
Promise.resolve().then(() =>
|
|
2225
|
+
Promise.resolve().then(() => ds).then((i) => i.default),
|
|
2226
2226
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
2227
2227
|
import("./templateRegistry.js").then((i) => i.templateRegistry)
|
|
2228
2228
|
]).then(([i, s, l]) => {
|
|
@@ -2237,7 +2237,7 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2237
2237
|
readOnly: !0
|
|
2238
2238
|
}
|
|
2239
2239
|
) });
|
|
2240
|
-
}, me = 350,
|
|
2240
|
+
}, me = 350, Ue = 70, Xe = 60, qe = {
|
|
2241
2241
|
startNode: 40,
|
|
2242
2242
|
endNode: 40,
|
|
2243
2243
|
addTriggerNode: 56,
|
|
@@ -2248,13 +2248,13 @@ const Me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2248
2248
|
delayNode: 80,
|
|
2249
2249
|
notificationNode: 80
|
|
2250
2250
|
}, rs = {
|
|
2251
|
-
plusEdge:
|
|
2252
|
-
labelPlusEdge:
|
|
2253
|
-
plainEdge:
|
|
2254
|
-
edgeWithPlusLabel:
|
|
2251
|
+
plusEdge: Xn,
|
|
2252
|
+
labelPlusEdge: Un,
|
|
2253
|
+
plainEdge: Vn,
|
|
2254
|
+
edgeWithPlusLabel: Hn,
|
|
2255
2255
|
gatewayBranchEdge: Kn
|
|
2256
2256
|
};
|
|
2257
|
-
function
|
|
2257
|
+
function $t() {
|
|
2258
2258
|
return [
|
|
2259
2259
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2260
2260
|
{ id: "addTrigger", kind: "addTrigger", reactFlowType: "addTriggerNode" },
|
|
@@ -2262,56 +2262,56 @@ function Gt() {
|
|
|
2262
2262
|
];
|
|
2263
2263
|
}
|
|
2264
2264
|
function os(e, t, n, r = "TB") {
|
|
2265
|
-
const o = new
|
|
2265
|
+
const o = new At.graphlib.Graph();
|
|
2266
2266
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2267
|
-
const s = n[i.id] ?? { width: me, height:
|
|
2267
|
+
const s = n[i.id] ?? { width: me, height: qe[i.type ?? ""] ?? 80 };
|
|
2268
2268
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2269
|
-
}), t.forEach((i) => o.setEdge(i.source, i.target)),
|
|
2270
|
-
var
|
|
2271
|
-
const s = o.node(i.id), l = ((
|
|
2272
|
-
return { ...i, position: { x: s.x - l / 2, y: s.y -
|
|
2269
|
+
}), t.forEach((i) => o.setEdge(i.source, i.target)), At.layout(o), e.map((i) => {
|
|
2270
|
+
var d, c;
|
|
2271
|
+
const s = o.node(i.id), l = ((d = n[i.id]) == null ? void 0 : d.width) ?? me, a = ((c = n[i.id]) == null ? void 0 : c.height) ?? qe[i.type ?? ""] ?? 80;
|
|
2272
|
+
return { ...i, position: { x: s.x - l / 2, y: s.y - a / 2 } };
|
|
2273
2273
|
});
|
|
2274
2274
|
}
|
|
2275
2275
|
const le = (e) => e === "filter" || e === "approval";
|
|
2276
2276
|
function is(e, t, n, r) {
|
|
2277
|
-
const s =
|
|
2277
|
+
const s = Ue, l = 30, a = 30, d = {}, c = {}, f = /* @__PURE__ */ new Map();
|
|
2278
2278
|
for (const b of e) f.set(b.id, b);
|
|
2279
2279
|
for (const b of Object.values(t))
|
|
2280
|
-
for (const
|
|
2281
|
-
for (const N of
|
|
2282
|
-
const h = (b,
|
|
2280
|
+
for (const k of Object.values(b))
|
|
2281
|
+
for (const N of k) f.set(N.id, N);
|
|
2282
|
+
const h = (b, k, N) => {
|
|
2283
2283
|
const O = r[b] ?? { width: me, height: 80 };
|
|
2284
|
-
return
|
|
2285
|
-
}, g = (b,
|
|
2284
|
+
return d[b] = { x: k - O.width / 2, y: N }, N + O.height;
|
|
2285
|
+
}, g = (b, k, N) => {
|
|
2286
2286
|
let O = N;
|
|
2287
|
-
for (const
|
|
2288
|
-
O = h(
|
|
2287
|
+
for (const j of b)
|
|
2288
|
+
O = h(j.id, k, O) + s, le(j.kind) && t[j.id] && (O = p(j.id, k, O));
|
|
2289
2289
|
return O;
|
|
2290
|
-
}, p = (b,
|
|
2291
|
-
const O =
|
|
2290
|
+
}, p = (b, k, N) => {
|
|
2291
|
+
const O = k + 180, j = t[b], z = Object.keys(j), W = f.get(b), L = (W == null ? void 0 : W.branchLabels) ?? { pass: "Pass", fail: "Fail" }, D = d[b], $ = r[b] ?? { height: 80 }, we = D.y + $.height, Ee = [];
|
|
2292
2292
|
let te = N;
|
|
2293
|
-
return z.forEach((he,
|
|
2294
|
-
const ze =
|
|
2293
|
+
return z.forEach((he, xe) => {
|
|
2294
|
+
const ze = j[he], Le = te;
|
|
2295
2295
|
Ee.push({
|
|
2296
|
-
y:
|
|
2297
|
-
label:
|
|
2298
|
-
isPass:
|
|
2299
|
-
}), te = g(ze, O, te +
|
|
2296
|
+
y: Le - we,
|
|
2297
|
+
label: L[he] ?? he,
|
|
2298
|
+
isPass: xe === 0
|
|
2299
|
+
}), te = g(ze, O, te + a), xe < z.length - 1 && (te += l);
|
|
2300
2300
|
}), c[b] = {
|
|
2301
2301
|
branches: Ee,
|
|
2302
|
-
height: te -
|
|
2302
|
+
height: te - we,
|
|
2303
2303
|
indent: 180
|
|
2304
2304
|
}, te;
|
|
2305
2305
|
};
|
|
2306
|
-
let E =
|
|
2306
|
+
let E = Xe;
|
|
2307
2307
|
for (const b of e)
|
|
2308
2308
|
E = h(b.id, 400, E) + s, le(b.kind) && t[b.id] && (E = p(b.id, 400, E));
|
|
2309
2309
|
return {
|
|
2310
|
-
nodes: n.map((b) =>
|
|
2310
|
+
nodes: n.map((b) => d[b.id] ? { ...b, position: d[b.id] } : b),
|
|
2311
2311
|
railSpecs: c
|
|
2312
2312
|
};
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2314
|
+
function Gt(e) {
|
|
2315
2315
|
return {
|
|
2316
2316
|
id: e.id,
|
|
2317
2317
|
type: e.reactFlowType,
|
|
@@ -2336,41 +2336,41 @@ function ss(e, t, n, r, o) {
|
|
|
2336
2336
|
};
|
|
2337
2337
|
}
|
|
2338
2338
|
function ls(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
2339
|
-
const l = o.edgeColor ?? "#b0bec5",
|
|
2339
|
+
const l = o.edgeColor ?? "#b0bec5", a = [], d = [], c = (p, E) => {
|
|
2340
2340
|
const b = t[p];
|
|
2341
2341
|
if (!b) return;
|
|
2342
|
-
const N = E ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(b),
|
|
2342
|
+
const N = E ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(b), j = (z, W, L, D) => {
|
|
2343
2343
|
if (z.length !== 0) {
|
|
2344
|
-
z.forEach((
|
|
2344
|
+
z.forEach(($) => a.push(Gt($))), d.push({
|
|
2345
2345
|
id: `e-${p}-${W}-start`,
|
|
2346
2346
|
source: p,
|
|
2347
2347
|
target: z[0].id,
|
|
2348
2348
|
type: "gatewayBranchEdge",
|
|
2349
2349
|
style: { stroke: l },
|
|
2350
|
-
data: { branch: W, filterId: p, label:
|
|
2350
|
+
data: { branch: W, filterId: p, label: L, isFirst: D === 0, onAddStepClick: n, verticalRouting: s === "vertical" }
|
|
2351
2351
|
});
|
|
2352
|
-
for (let
|
|
2353
|
-
le(z[
|
|
2354
|
-
for (const
|
|
2355
|
-
le(
|
|
2352
|
+
for (let $ = 1; $ < z.length; $++)
|
|
2353
|
+
le(z[$ - 1].kind) || d.push(ss(z[$ - 1], z[$], l, n, { filterId: p, branch: W }));
|
|
2354
|
+
for (const $ of z)
|
|
2355
|
+
le($.kind) && t[$.id] && c($.id, $.branchLabels);
|
|
2356
2356
|
}
|
|
2357
2357
|
};
|
|
2358
2358
|
O.forEach((z, W) => {
|
|
2359
|
-
|
|
2359
|
+
j(b[z], z, N[z] ?? z, W);
|
|
2360
2360
|
});
|
|
2361
2361
|
};
|
|
2362
2362
|
for (let p = 0; p < e.length; p++) {
|
|
2363
2363
|
const E = e[p];
|
|
2364
|
-
if (
|
|
2365
|
-
const b = e[p - 1],
|
|
2364
|
+
if (a.push(Gt(E)), p > 0) {
|
|
2365
|
+
const b = e[p - 1], k = b.kind === "start" || b.kind === "addTrigger";
|
|
2366
2366
|
if (b.kind === "filter" || b.kind === "approval") continue;
|
|
2367
|
-
|
|
2367
|
+
d.push({
|
|
2368
2368
|
id: `e-${b.id}-${E.id}`,
|
|
2369
2369
|
source: b.id,
|
|
2370
2370
|
target: E.id,
|
|
2371
|
-
type:
|
|
2371
|
+
type: k ? "plainEdge" : "plusEdge",
|
|
2372
2372
|
style: { stroke: l },
|
|
2373
|
-
data:
|
|
2373
|
+
data: k ? {} : {
|
|
2374
2374
|
onAddStepClick: n,
|
|
2375
2375
|
referenceNodeType: b.reactFlowType
|
|
2376
2376
|
}
|
|
@@ -2379,33 +2379,33 @@ function ls(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
|
2379
2379
|
(E.kind === "filter" || E.kind === "approval") && t[E.id] && c(E.id, E.branchLabels);
|
|
2380
2380
|
}
|
|
2381
2381
|
const f = {};
|
|
2382
|
-
if (
|
|
2382
|
+
if (a.forEach((p) => {
|
|
2383
2383
|
f[p.id] = {
|
|
2384
2384
|
width: me,
|
|
2385
|
-
height: r[p.id] ??
|
|
2385
|
+
height: r[p.id] ?? qe[p.type ?? ""] ?? 80
|
|
2386
2386
|
};
|
|
2387
2387
|
}), !(Object.keys(t).length > 0)) {
|
|
2388
2388
|
if (i === "LR") {
|
|
2389
|
-
let N =
|
|
2390
|
-
return { nodes:
|
|
2391
|
-
const z = f[
|
|
2392
|
-
return N += z +
|
|
2393
|
-
}), edges:
|
|
2389
|
+
let N = Xe;
|
|
2390
|
+
return { nodes: a.map((j) => {
|
|
2391
|
+
const z = f[j.id].width, W = f[j.id].height, L = { ...j, position: { x: N, y: 300 - W / 2 } };
|
|
2392
|
+
return N += z + Ue, L;
|
|
2393
|
+
}), edges: d };
|
|
2394
2394
|
}
|
|
2395
2395
|
const p = 400;
|
|
2396
|
-
let E =
|
|
2397
|
-
return { nodes:
|
|
2398
|
-
const N = f[
|
|
2399
|
-
return E += N +
|
|
2400
|
-
}), edges:
|
|
2396
|
+
let E = Xe;
|
|
2397
|
+
return { nodes: a.map((k) => {
|
|
2398
|
+
const N = f[k.id].height, O = { ...k, position: { x: p - me / 2, y: E } };
|
|
2399
|
+
return E += N + Ue, O;
|
|
2400
|
+
}), edges: d };
|
|
2401
2401
|
}
|
|
2402
2402
|
if (s === "vertical") {
|
|
2403
|
-
const { nodes: p, railSpecs: E } = is(e, t,
|
|
2403
|
+
const { nodes: p, railSpecs: E } = is(e, t, a, f);
|
|
2404
2404
|
return { nodes: p.map(
|
|
2405
|
-
(
|
|
2406
|
-
), edges:
|
|
2405
|
+
(k) => E[k.id] ? { ...k, data: { ...k.data, _branchRail: E[k.id] } } : k
|
|
2406
|
+
), edges: d };
|
|
2407
2407
|
}
|
|
2408
|
-
return { nodes: os(
|
|
2408
|
+
return { nodes: os(a, d, f, i), edges: d };
|
|
2409
2409
|
}
|
|
2410
2410
|
const Yt = ({
|
|
2411
2411
|
nodeRegistry: e,
|
|
@@ -2416,8 +2416,8 @@ const Yt = ({
|
|
|
2416
2416
|
onSave: i,
|
|
2417
2417
|
readOnly: s = !1,
|
|
2418
2418
|
theme: l = {},
|
|
2419
|
-
messages:
|
|
2420
|
-
canvasOptions:
|
|
2419
|
+
messages: a,
|
|
2420
|
+
canvasOptions: d = {},
|
|
2421
2421
|
renderTriggerSelector: c,
|
|
2422
2422
|
loadTriggerSources: f,
|
|
2423
2423
|
renderNodePicker: h,
|
|
@@ -2425,104 +2425,104 @@ const Yt = ({
|
|
|
2425
2425
|
onNodeClick: p,
|
|
2426
2426
|
maxNodes: E,
|
|
2427
2427
|
layoutDirection: b = "TB",
|
|
2428
|
-
executionRecord:
|
|
2428
|
+
executionRecord: k,
|
|
2429
2429
|
onFetchWorkflow: N,
|
|
2430
2430
|
hideHeader: O = !1,
|
|
2431
|
-
workflowName:
|
|
2431
|
+
workflowName: j,
|
|
2432
2432
|
onWorkflowNameChange: z,
|
|
2433
2433
|
onCancel: W,
|
|
2434
|
-
workflowStatus:
|
|
2434
|
+
workflowStatus: L,
|
|
2435
2435
|
workflowStatusColor: D,
|
|
2436
|
-
saveLabel:
|
|
2437
|
-
optionsResolvers:
|
|
2436
|
+
saveLabel: $,
|
|
2437
|
+
optionsResolvers: we
|
|
2438
2438
|
}) => {
|
|
2439
2439
|
const {
|
|
2440
2440
|
fitView: Ee = !0,
|
|
2441
2441
|
fitViewPadding: te = 0.3,
|
|
2442
2442
|
showControls: he = !0,
|
|
2443
|
-
showMiniMap:
|
|
2443
|
+
showMiniMap: xe = !1,
|
|
2444
2444
|
panOnScroll: ze = !0,
|
|
2445
|
-
zoomOnScroll:
|
|
2446
|
-
minZoom:
|
|
2445
|
+
zoomOnScroll: Le = !1,
|
|
2446
|
+
minZoom: Sn = 0.25,
|
|
2447
2447
|
maxZoom: Nn = 2,
|
|
2448
|
-
snapToGrid:
|
|
2448
|
+
snapToGrid: Tn = !1,
|
|
2449
2449
|
snapGrid: Cn = [15, 15],
|
|
2450
2450
|
branchLayout: rt = "horizontal",
|
|
2451
2451
|
nodeBody: ot = "full"
|
|
2452
|
-
} =
|
|
2453
|
-
const y = n == null ? void 0 : n.slots.find((
|
|
2454
|
-
return
|
|
2455
|
-
}), [
|
|
2452
|
+
} = d, ge = K(() => Er(a), [a]), [P, oe] = M(() => (n == null ? void 0 : n.slots) ?? $t()), [G, J] = M(() => (n == null ? void 0 : n.branches) ?? {}), [ae, V] = M(null), [Pe, it] = M(null), [U, ke] = M(null), [ie, st] = M(null), [_e, lt] = M(null), [X, dt] = M(() => {
|
|
2453
|
+
const y = n == null ? void 0 : n.slots.find((S) => S.kind === "triggerFixed"), w = y != null && y.id.startsWith("trigger-") ? y.id.slice(8) : void 0;
|
|
2454
|
+
return w ? t.lookup(w) ?? null : null;
|
|
2455
|
+
}), [at, In] = M({}), On = Y((y) => {
|
|
2456
2456
|
In(y);
|
|
2457
|
-
}, []),
|
|
2458
|
-
const y =
|
|
2459
|
-
return y +
|
|
2460
|
-
}, [
|
|
2461
|
-
const
|
|
2462
|
-
if (
|
|
2463
|
-
for (const
|
|
2464
|
-
const
|
|
2465
|
-
if (
|
|
2457
|
+
}, []), Mn = K(() => ({ ...Yn, ...r }), [r]), jn = K(() => ({ ...rs, ...o }), [o]), zn = K(() => {
|
|
2458
|
+
const y = P.filter((S) => S.kind === "userTask").length, w = Object.values(G).flatMap((S) => Object.values(S).flat()).filter((S) => S.kind === "userTask").length;
|
|
2459
|
+
return y + w;
|
|
2460
|
+
}, [P, G]), ct = E ?? (X == null ? void 0 : X.maxTasks), ft = ct !== void 0 && zn >= ct, se = Y((y) => {
|
|
2461
|
+
const w = P.find((S) => S.id === y);
|
|
2462
|
+
if (w) return w;
|
|
2463
|
+
for (const S of Object.values(G)) {
|
|
2464
|
+
const x = Object.values(S).flat().find((I) => I.id === y);
|
|
2465
|
+
if (x) return x;
|
|
2466
2466
|
}
|
|
2467
2467
|
return null;
|
|
2468
|
-
}, [
|
|
2469
|
-
s || (it(y),
|
|
2468
|
+
}, [P, G]), Re = Y((y) => {
|
|
2469
|
+
s || (it(y), V("nodeConfig"));
|
|
2470
2470
|
}, [s]), ut = Y((y) => {
|
|
2471
2471
|
if (!s) {
|
|
2472
|
-
if (
|
|
2473
|
-
const
|
|
2474
|
-
if ((
|
|
2475
|
-
oe(
|
|
2472
|
+
if (P.some((w) => w.id === y)) {
|
|
2473
|
+
const w = P.find((S) => S.id === y);
|
|
2474
|
+
if ((w == null ? void 0 : w.kind) === "triggerFixed") {
|
|
2475
|
+
oe($t()), J({}), dt(null);
|
|
2476
2476
|
return;
|
|
2477
2477
|
}
|
|
2478
|
-
oe((
|
|
2479
|
-
const
|
|
2480
|
-
return le((
|
|
2481
|
-
}), J((
|
|
2482
|
-
const
|
|
2483
|
-
|
|
2478
|
+
oe((S) => {
|
|
2479
|
+
const x = S.filter((I) => I.id !== y);
|
|
2480
|
+
return le((w == null ? void 0 : w.kind) ?? "") && !x.some((I) => I.kind === "end") ? [...x, { id: "end", kind: "end", reactFlowType: "endNode" }] : x;
|
|
2481
|
+
}), J((S) => {
|
|
2482
|
+
const x = { ...S }, I = (m) => {
|
|
2483
|
+
x[m] && (Object.values(x[m]).flat().filter((_) => le(_.kind)).forEach((_) => I(_.id)), delete x[m]);
|
|
2484
2484
|
};
|
|
2485
|
-
return I(y),
|
|
2485
|
+
return I(y), x;
|
|
2486
2486
|
});
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
J((
|
|
2490
|
-
const
|
|
2491
|
-
const
|
|
2489
|
+
J((w) => {
|
|
2490
|
+
const S = (I, m) => {
|
|
2491
|
+
const _ = [];
|
|
2492
2492
|
for (const C of I)
|
|
2493
|
-
le(C.kind) && m[C.id] && (
|
|
2494
|
-
return
|
|
2495
|
-
},
|
|
2496
|
-
for (const I of Object.keys(
|
|
2497
|
-
for (const m of Object.keys(
|
|
2498
|
-
const
|
|
2499
|
-
if (C === -1 ||
|
|
2500
|
-
const
|
|
2501
|
-
let
|
|
2502
|
-
return
|
|
2493
|
+
le(C.kind) && m[C.id] && (_.push(C.id), Object.values(m[C.id]).forEach((T) => _.push(...S(T, m))));
|
|
2494
|
+
return _;
|
|
2495
|
+
}, x = { ...w };
|
|
2496
|
+
for (const I of Object.keys(x))
|
|
2497
|
+
for (const m of Object.keys(x[I])) {
|
|
2498
|
+
const _ = x[I][m], C = _.findIndex((R) => R.id === y);
|
|
2499
|
+
if (C === -1 || _[C].kind === "end") continue;
|
|
2500
|
+
const T = _[C];
|
|
2501
|
+
let F = _.filter((R) => R.id !== y);
|
|
2502
|
+
return T.kind === "filter" && ((T.id in x ? S([T], x) : []).forEach((A) => delete x[A]), delete x[T.id], F.some((A) => A.kind === "end") || (F = [...F, { id: `end-${I}-${m}`, kind: "end", reactFlowType: "endNode" }])), x[I] = { ...x[I], [m]: F }, x;
|
|
2503
2503
|
}
|
|
2504
|
-
return
|
|
2504
|
+
return x;
|
|
2505
2505
|
});
|
|
2506
2506
|
}
|
|
2507
|
-
}, [s,
|
|
2508
|
-
s ||
|
|
2509
|
-
}, [s]), ht = Y((y,
|
|
2510
|
-
s || ft || (
|
|
2511
|
-
}, [s, ft]), gt = Y((y,
|
|
2512
|
-
if (
|
|
2513
|
-
const
|
|
2507
|
+
}, [s, P]), Fe = Y(() => {
|
|
2508
|
+
s || V("triggerSelect");
|
|
2509
|
+
}, [s]), ht = Y((y, w) => {
|
|
2510
|
+
s || ft || (ke(y), st(w.filterId && w.branch ? { filterId: w.filterId, branch: w.branch } : null), V("nodePicker"));
|
|
2511
|
+
}, [s, ft]), gt = Y((y, w) => {
|
|
2512
|
+
if (dt(y), V(null), y.skeletonState) {
|
|
2513
|
+
const x = Array.isArray(w) && w.length > 0, I = (y.skeletonState.slots ?? []).map((m) => m.kind !== "triggerFixed" ? m : {
|
|
2514
2514
|
...m,
|
|
2515
2515
|
nodeData: {
|
|
2516
2516
|
label: y.label,
|
|
2517
2517
|
...m.nodeData ?? {},
|
|
2518
|
-
...
|
|
2518
|
+
...x && { sources: w }
|
|
2519
2519
|
}
|
|
2520
2520
|
});
|
|
2521
2521
|
J(y.skeletonState.branches ?? {}), oe(I);
|
|
2522
2522
|
return;
|
|
2523
2523
|
}
|
|
2524
2524
|
J({});
|
|
2525
|
-
const
|
|
2525
|
+
const S = Array.isArray(w) && w.length > 0;
|
|
2526
2526
|
oe([
|
|
2527
2527
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2528
2528
|
{
|
|
@@ -2534,150 +2534,150 @@ const Yt = ({
|
|
|
2534
2534
|
source: y.source,
|
|
2535
2535
|
eventType: y.triggerKey,
|
|
2536
2536
|
type: y.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2537
|
-
...
|
|
2537
|
+
...S && { sources: w }
|
|
2538
2538
|
},
|
|
2539
2539
|
deletable: !1
|
|
2540
2540
|
},
|
|
2541
2541
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2542
2542
|
]);
|
|
2543
2543
|
}, []), pt = Y(() => {
|
|
2544
|
-
var
|
|
2544
|
+
var S;
|
|
2545
2545
|
const y = {
|
|
2546
2546
|
insertAfterSlot: null,
|
|
2547
2547
|
upstreamSlots: [],
|
|
2548
2548
|
downstreamSlots: [],
|
|
2549
2549
|
branch: ie,
|
|
2550
|
-
template:
|
|
2550
|
+
template: X
|
|
2551
2551
|
};
|
|
2552
|
-
if (!
|
|
2552
|
+
if (!U) return y;
|
|
2553
2553
|
if (ie) {
|
|
2554
|
-
const { filterId:
|
|
2555
|
-
return y.upstreamSlots = [...
|
|
2554
|
+
const { filterId: x, branch: I } = ie, m = P.findIndex((R) => R.id === x), _ = m >= 0 ? P.slice(0, m + 1) : [], C = ((S = G[x]) == null ? void 0 : S[I]) ?? [], T = C.findIndex((R) => R.id === U), F = T >= 0 ? C.slice(0, T + 1) : [];
|
|
2555
|
+
return y.upstreamSlots = [..._, ...F], y.downstreamSlots = T >= 0 ? C.slice(T + 1) : C, y.insertAfterSlot = F[F.length - 1] ?? null, y;
|
|
2556
2556
|
}
|
|
2557
|
-
const
|
|
2558
|
-
return y.upstreamSlots =
|
|
2559
|
-
}, [
|
|
2560
|
-
const y = e.list(),
|
|
2561
|
-
return
|
|
2562
|
-
(m) =>
|
|
2563
|
-
) ||
|
|
2564
|
-
(m) =>
|
|
2557
|
+
const w = P.findIndex((x) => x.id === U);
|
|
2558
|
+
return y.upstreamSlots = w >= 0 ? P.slice(0, w + 1) : [], y.downstreamSlots = w >= 0 ? P.slice(w + 1) : [], y.insertAfterSlot = y.upstreamSlots[y.upstreamSlots.length - 1] ?? null, y;
|
|
2559
|
+
}, [P, G, U, ie, X]), bt = (y, w) => y.descriptorType === w || y.id === w || y.kind === w, yt = Y(() => {
|
|
2560
|
+
const y = e.list(), w = X != null && X.availableTasks ? y.filter((x) => X.availableTasks.includes(x.type)) : y, S = pt();
|
|
2561
|
+
return w.filter((x) => x.maxPerWorkflow !== void 0 && P.filter((m) => m.descriptorType === x.type).length + Object.values(G).flatMap((m) => Object.values(m).flat()).filter((m) => m.descriptorType === x.type).length >= x.maxPerWorkflow ? !1 : x.canInsert ? x.canInsert(S) : !(x.insertAfter && x.insertAfter.length > 0 && !S.upstreamSlots.some(
|
|
2562
|
+
(m) => x.insertAfter.some((_) => bt(m, _))
|
|
2563
|
+
) || x.insertBefore && x.insertBefore.length > 0 && !S.downstreamSlots.some(
|
|
2564
|
+
(m) => x.insertBefore.some((_) => bt(m, _))
|
|
2565
2565
|
)));
|
|
2566
|
-
}, [e,
|
|
2567
|
-
if (!
|
|
2568
|
-
const
|
|
2569
|
-
id:
|
|
2570
|
-
kind:
|
|
2566
|
+
}, [e, X, P, G, pt]), mt = Y((y) => {
|
|
2567
|
+
if (!U) return;
|
|
2568
|
+
const w = `${y.type}-${Date.now()}`, S = y.reactFlowType === "filterNode" || y.reactFlowType === "approvalNode" || y.reactFlowType === "conditionBranchNode", x = y.branchLabels ?? { pass: "Pass", fail: "Fail" }, I = {
|
|
2569
|
+
id: w,
|
|
2570
|
+
kind: S ? y.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2571
2571
|
reactFlowType: y.reactFlowType,
|
|
2572
2572
|
descriptorType: y.type,
|
|
2573
2573
|
formData: {},
|
|
2574
2574
|
nodeData: { title: y.label },
|
|
2575
2575
|
deletable: !0,
|
|
2576
|
-
branchLabels:
|
|
2576
|
+
branchLabels: x
|
|
2577
2577
|
};
|
|
2578
2578
|
if (ie) {
|
|
2579
|
-
const { filterId: m, branch:
|
|
2579
|
+
const { filterId: m, branch: _ } = ie;
|
|
2580
2580
|
J((C) => {
|
|
2581
|
-
const
|
|
2582
|
-
if (
|
|
2583
|
-
const ne =
|
|
2584
|
-
return ne.splice(
|
|
2581
|
+
const T = [...C[m][_]];
|
|
2582
|
+
if (S) {
|
|
2583
|
+
const ne = T.filter((ce) => ce.kind !== "end"), kt = ne.findIndex((ce) => ce.id === U), Fn = kt === -1 ? ne.length : kt + 1;
|
|
2584
|
+
return ne.splice(Fn, 0, I), {
|
|
2585
2585
|
...C,
|
|
2586
|
-
[m]: { ...C[m], [
|
|
2587
|
-
[
|
|
2588
|
-
Object.keys(
|
|
2586
|
+
[m]: { ...C[m], [_]: ne },
|
|
2587
|
+
[w]: Object.fromEntries(
|
|
2588
|
+
Object.keys(x).map((ce) => [ce, [{ id: `end-${w}-${ce}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2589
2589
|
)
|
|
2590
2590
|
};
|
|
2591
2591
|
}
|
|
2592
|
-
const
|
|
2593
|
-
return
|
|
2592
|
+
const F = T.findIndex((ne) => ne.id === U), R = T.findIndex((ne) => ne.kind === "end"), A = F === -1 ? R === -1 ? T.length : R : F + 1;
|
|
2593
|
+
return T.splice(A, 0, I), { ...C, [m]: { ...C[m], [_]: T } };
|
|
2594
2594
|
});
|
|
2595
2595
|
} else
|
|
2596
|
-
|
|
2597
|
-
const
|
|
2598
|
-
return [...m.filter((
|
|
2596
|
+
S ? (oe((m) => {
|
|
2597
|
+
const _ = m.findIndex((T) => T.id === U);
|
|
2598
|
+
return [...m.filter((T) => T.kind !== "end").slice(0, _ + 1), I];
|
|
2599
2599
|
}), J((m) => ({
|
|
2600
2600
|
...m,
|
|
2601
|
-
[
|
|
2602
|
-
Object.keys(
|
|
2601
|
+
[w]: Object.fromEntries(
|
|
2602
|
+
Object.keys(x).map((_) => [_, [{ id: `end-${w}-${_}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2603
2603
|
)
|
|
2604
2604
|
}))) : oe((m) => {
|
|
2605
|
-
const
|
|
2606
|
-
return
|
|
2605
|
+
const _ = m.findIndex((C) => C.id === U);
|
|
2606
|
+
return _ === -1 ? m : [...m.slice(0, _ + 1), I, ...m.slice(_ + 1)];
|
|
2607
2607
|
});
|
|
2608
|
-
|
|
2609
|
-
}, [
|
|
2610
|
-
const
|
|
2611
|
-
const
|
|
2608
|
+
ke(null), st(null), it(w), V("nodeConfig");
|
|
2609
|
+
}, [U, ie]), vt = Y((y, w) => {
|
|
2610
|
+
const S = (m) => {
|
|
2611
|
+
const _ = m.label || m.key;
|
|
2612
2612
|
switch (m.kind) {
|
|
2613
2613
|
case "if":
|
|
2614
|
-
return `IF · ${
|
|
2614
|
+
return `IF · ${_}`;
|
|
2615
2615
|
case "elseif":
|
|
2616
|
-
return `ELSE IF · ${
|
|
2616
|
+
return `ELSE IF · ${_}`;
|
|
2617
2617
|
case "else":
|
|
2618
|
-
return
|
|
2618
|
+
return _.toUpperCase() === "ELSE" ? _ : `ELSE · ${_}`;
|
|
2619
2619
|
default:
|
|
2620
|
-
return
|
|
2620
|
+
return _;
|
|
2621
2621
|
}
|
|
2622
|
-
},
|
|
2623
|
-
const
|
|
2624
|
-
if ((
|
|
2625
|
-
const
|
|
2626
|
-
if (
|
|
2627
|
-
const
|
|
2628
|
-
return
|
|
2629
|
-
A
|
|
2630
|
-
}), { ...m, [y]:
|
|
2631
|
-
}, I = (m,
|
|
2632
|
-
if (m.descriptorType !== "conditionBranch") return { ...m, formData:
|
|
2633
|
-
const C =
|
|
2634
|
-
return C.forEach((
|
|
2635
|
-
|
|
2636
|
-
}), { ...m, formData:
|
|
2622
|
+
}, x = (m) => {
|
|
2623
|
+
const _ = se(y);
|
|
2624
|
+
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return m;
|
|
2625
|
+
const T = (w.branchConfigs ?? []).map((A) => A.key).filter(Boolean);
|
|
2626
|
+
if (T.length === 0) return m;
|
|
2627
|
+
const F = m[y] ?? {}, R = {};
|
|
2628
|
+
return T.forEach((A) => {
|
|
2629
|
+
R[A] = F[A] ?? [{ id: `end-${y}-${A}`, kind: "end", reactFlowType: "endNode" }];
|
|
2630
|
+
}), { ...m, [y]: R };
|
|
2631
|
+
}, I = (m, _) => {
|
|
2632
|
+
if (m.descriptorType !== "conditionBranch") return { ...m, formData: _ };
|
|
2633
|
+
const C = _.branchConfigs ?? [], T = {};
|
|
2634
|
+
return C.forEach((F) => {
|
|
2635
|
+
F.key && (T[F.key] = S(F));
|
|
2636
|
+
}), { ...m, formData: _, branchLabels: T };
|
|
2637
2637
|
};
|
|
2638
|
-
if (
|
|
2638
|
+
if (P.some((m) => m.id === y)) {
|
|
2639
2639
|
J((m) => {
|
|
2640
|
-
const
|
|
2640
|
+
const _ = x(m);
|
|
2641
2641
|
return oe(
|
|
2642
2642
|
(C) => C.map(
|
|
2643
|
-
(
|
|
2643
|
+
(T) => T.id === y ? I(T, w) : T
|
|
2644
2644
|
)
|
|
2645
|
-
),
|
|
2645
|
+
), _;
|
|
2646
2646
|
});
|
|
2647
2647
|
return;
|
|
2648
2648
|
}
|
|
2649
2649
|
J((m) => {
|
|
2650
|
-
const C = { ...
|
|
2651
|
-
for (const
|
|
2652
|
-
const
|
|
2653
|
-
for (const
|
|
2654
|
-
if (C[
|
|
2655
|
-
return C[
|
|
2650
|
+
const C = { ...x(m) };
|
|
2651
|
+
for (const T of Object.keys(C)) {
|
|
2652
|
+
const F = (R) => R.map((A) => A.id === y ? I(A, w) : A);
|
|
2653
|
+
for (const R of Object.keys(C[T]))
|
|
2654
|
+
if (C[T][R].some((A) => A.id === y))
|
|
2655
|
+
return C[T] = { ...C[T], [R]: F(C[T][R]) }, C;
|
|
2656
2656
|
}
|
|
2657
2657
|
return C;
|
|
2658
2658
|
});
|
|
2659
|
-
}, [
|
|
2660
|
-
() => ls(
|
|
2661
|
-
[
|
|
2662
|
-
),
|
|
2663
|
-
const y =
|
|
2664
|
-
return Et.map((
|
|
2665
|
-
let
|
|
2659
|
+
}, [P, G, se]), Z = K(() => se(Pe ?? ""), [se, Pe]), wt = K(() => Z != null && Z.descriptorType ? e.forType(Z.descriptorType) ?? null : null, [Z, e]), { nodes: Et, edges: Ln } = K(
|
|
2660
|
+
() => ls(P, G, s ? null : ht, at, l, b, rt),
|
|
2661
|
+
[P, G, s, ht, at, l, b, rt]
|
|
2662
|
+
), xt = K(() => {
|
|
2663
|
+
const y = k ? new Map(k.steps.map((w) => [w.nodeId, w])) : null;
|
|
2664
|
+
return Et.map((w) => {
|
|
2665
|
+
let S = {};
|
|
2666
2666
|
if (y) {
|
|
2667
|
-
const
|
|
2668
|
-
|
|
2667
|
+
const x = y.get(w.id);
|
|
2668
|
+
x && (S = { _executionStatus: x.status, _executionError: x.error });
|
|
2669
2669
|
}
|
|
2670
|
-
return
|
|
2670
|
+
return w.type === "subWorkflowNode" && N && (S.onPreview = (x) => {
|
|
2671
2671
|
var m;
|
|
2672
|
-
const I = se(
|
|
2673
|
-
lt({ workflowId:
|
|
2674
|
-
}), Object.keys(
|
|
2672
|
+
const I = se(w.id);
|
|
2673
|
+
lt({ workflowId: x, workflowLabel: ((m = I == null ? void 0 : I.formData) == null ? void 0 : m.workflowLabel) ?? void 0 });
|
|
2674
|
+
}), Object.keys(S).length > 0 ? { ...w, data: { ...w.data, ...S } } : w;
|
|
2675
2675
|
});
|
|
2676
|
-
}, [Et,
|
|
2677
|
-
}, onClickAddTrigger:
|
|
2678
|
-
i && await i({ slots:
|
|
2679
|
-
}, [i,
|
|
2680
|
-
return /* @__PURE__ */ u(
|
|
2676
|
+
}, [Et, k, N, se]), Pn = K(() => ({ onEditNode: Re, onDeleteNode: ut, onAddStep: () => {
|
|
2677
|
+
}, onClickAddTrigger: Fe, messages: ge, nodeRegistry: e, nodeBody: ot }), [Re, ut, Fe, ge, e, ot]), Rn = Y(async () => {
|
|
2678
|
+
i && await i({ slots: P, branches: G });
|
|
2679
|
+
}, [i, P, G]);
|
|
2680
|
+
return /* @__PURE__ */ u(wr, { resolvers: we, children: /* @__PURE__ */ u(qn.Provider, { value: Pn, children: /* @__PURE__ */ v(
|
|
2681
2681
|
"div",
|
|
2682
2682
|
{
|
|
2683
2683
|
className: "flowforge-canvas",
|
|
@@ -2699,40 +2699,40 @@ const Yt = ({
|
|
|
2699
2699
|
"--ff-font-family": l.fontFamily
|
|
2700
2700
|
},
|
|
2701
2701
|
children: [
|
|
2702
|
-
!O && (i || W ||
|
|
2702
|
+
!O && (i || W || j) && /* @__PURE__ */ u(
|
|
2703
2703
|
Ji,
|
|
2704
2704
|
{
|
|
2705
|
-
workflowName:
|
|
2705
|
+
workflowName: j,
|
|
2706
2706
|
onWorkflowNameChange: z,
|
|
2707
|
-
status:
|
|
2707
|
+
status: L,
|
|
2708
2708
|
statusColor: D,
|
|
2709
|
-
onSave: i ?
|
|
2709
|
+
onSave: i ? Rn : void 0,
|
|
2710
2710
|
onCancel: W,
|
|
2711
|
-
saveLabel:
|
|
2711
|
+
saveLabel: $
|
|
2712
2712
|
}
|
|
2713
2713
|
),
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ v("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
2715
|
+
/* @__PURE__ */ v(
|
|
2716
2716
|
Dn,
|
|
2717
2717
|
{
|
|
2718
|
-
nodes:
|
|
2719
|
-
edges:
|
|
2720
|
-
nodeTypes:
|
|
2721
|
-
edgeTypes:
|
|
2718
|
+
nodes: xt,
|
|
2719
|
+
edges: Ln,
|
|
2720
|
+
nodeTypes: Mn,
|
|
2721
|
+
edgeTypes: jn,
|
|
2722
2722
|
fitView: Ee,
|
|
2723
2723
|
fitViewOptions: { padding: te },
|
|
2724
2724
|
nodesDraggable: !1,
|
|
2725
2725
|
nodesConnectable: !1,
|
|
2726
2726
|
panOnScroll: ze,
|
|
2727
|
-
zoomOnScroll:
|
|
2728
|
-
minZoom:
|
|
2727
|
+
zoomOnScroll: Le,
|
|
2728
|
+
minZoom: Sn,
|
|
2729
2729
|
maxZoom: Nn,
|
|
2730
|
-
snapToGrid:
|
|
2730
|
+
snapToGrid: Tn,
|
|
2731
2731
|
snapGrid: Cn,
|
|
2732
2732
|
proOptions: { hideAttribution: !0 },
|
|
2733
|
-
onNodeClick: (y,
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2733
|
+
onNodeClick: (y, w) => {
|
|
2734
|
+
const S = se(w.id);
|
|
2735
|
+
S && (p != null && p(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ? Fe() : (S.kind === "userTask" || S.kind === "filter" || S.kind === "approval") && Re(w.id)));
|
|
2736
2736
|
},
|
|
2737
2737
|
children: [
|
|
2738
2738
|
l.background !== "none" && /* @__PURE__ */ u(
|
|
@@ -2743,26 +2743,26 @@ const Yt = ({
|
|
|
2743
2743
|
gap: 20
|
|
2744
2744
|
}
|
|
2745
2745
|
),
|
|
2746
|
-
he && /* @__PURE__ */ u(
|
|
2747
|
-
|
|
2748
|
-
/* @__PURE__ */ u(
|
|
2746
|
+
he && /* @__PURE__ */ u($n, { showInteractive: !1 }),
|
|
2747
|
+
xe && /* @__PURE__ */ u(Gn, { zoomable: !0, pannable: !0 }),
|
|
2748
|
+
/* @__PURE__ */ u(Xi, { onHeightsReady: On, nodeCount: xt.length })
|
|
2749
2749
|
]
|
|
2750
2750
|
}
|
|
2751
2751
|
),
|
|
2752
|
-
c ?
|
|
2753
|
-
h ?
|
|
2754
|
-
|
|
2755
|
-
}) : /* @__PURE__ */ u(Qi, { open:
|
|
2756
|
-
|
|
2752
|
+
c ? ae === "triggerSelect" && c(t.list(), gt, () => V(null)) : /* @__PURE__ */ u(Zi, { open: ae === "triggerSelect", templates: t.list(), messages: ge, onSelect: gt, onClose: () => V(null), loadTriggerSources: f }),
|
|
2753
|
+
h ? ae === "nodePicker" && h(yt(), mt, () => {
|
|
2754
|
+
V(null), ke(null);
|
|
2755
|
+
}) : /* @__PURE__ */ u(Qi, { open: ae === "nodePicker", availableDescriptors: yt(), messages: ge, onSelect: mt, onClose: () => {
|
|
2756
|
+
V(null), ke(null);
|
|
2757
2757
|
} }),
|
|
2758
|
-
g ?
|
|
2759
|
-
N &&
|
|
2758
|
+
g ? ae === "nodeConfig" && g(wt ?? void 0, Z, vt, () => V(null)) : /* @__PURE__ */ u(es, { open: ae === "nodeConfig", nodeId: Pe, descriptor: wt, initialValues: Z == null ? void 0 : Z.formData, messages: ge, onSave: vt, onClose: () => V(null) }),
|
|
2759
|
+
N && _e && /* @__PURE__ */ u(
|
|
2760
2760
|
ts,
|
|
2761
2761
|
{
|
|
2762
|
-
isOpen: !!
|
|
2762
|
+
isOpen: !!_e,
|
|
2763
2763
|
onClose: () => lt(null),
|
|
2764
|
-
workflowId:
|
|
2765
|
-
workflowLabel:
|
|
2764
|
+
workflowId: _e.workflowId,
|
|
2765
|
+
workflowLabel: _e.workflowLabel,
|
|
2766
2766
|
onFetchWorkflow: N
|
|
2767
2767
|
}
|
|
2768
2768
|
)
|
|
@@ -2770,15 +2770,15 @@ const Yt = ({
|
|
|
2770
2770
|
]
|
|
2771
2771
|
}
|
|
2772
2772
|
) }) });
|
|
2773
|
-
},
|
|
2773
|
+
}, ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2774
2774
|
__proto__: null,
|
|
2775
2775
|
WorkflowCanvas: Yt,
|
|
2776
2776
|
default: Yt
|
|
2777
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2778
|
-
function
|
|
2777
|
+
}, Symbol.toStringTag, { value: "Module" })), He = "All";
|
|
2778
|
+
function as({ template: e, onSelect: t }) {
|
|
2779
2779
|
var o, i;
|
|
2780
|
-
const n = e.triggerCategory ?
|
|
2781
|
-
return /* @__PURE__ */
|
|
2780
|
+
const n = e.triggerCategory ? xr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
2781
|
+
return /* @__PURE__ */ v(
|
|
2782
2782
|
"div",
|
|
2783
2783
|
{
|
|
2784
2784
|
role: "button",
|
|
@@ -2806,23 +2806,23 @@ function ds({ template: e, onSelect: t }) {
|
|
|
2806
2806
|
s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
|
|
2807
2807
|
},
|
|
2808
2808
|
children: [
|
|
2809
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
|
|
2810
2810
|
e.icon && /* @__PURE__ */ u("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
|
|
2811
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2812
2812
|
/* @__PURE__ */ u("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
|
|
2813
2813
|
e.description && /* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
|
|
2814
2814
|
] })
|
|
2815
2815
|
] }),
|
|
2816
|
-
/* @__PURE__ */
|
|
2816
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
|
|
2817
2817
|
n && /* @__PURE__ */ u("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: n.bg, color: n.color }, children: n.label }),
|
|
2818
2818
|
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
|
|
2819
|
-
r > 0 && /* @__PURE__ */
|
|
2819
|
+
r > 0 && /* @__PURE__ */ v("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
|
|
2820
2820
|
r,
|
|
2821
2821
|
" step",
|
|
2822
2822
|
r !== 1 ? "s" : ""
|
|
2823
2823
|
] })
|
|
2824
2824
|
] }),
|
|
2825
|
-
e.author && /* @__PURE__ */
|
|
2825
|
+
e.author && /* @__PURE__ */ v("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
|
|
2826
2826
|
"by ",
|
|
2827
2827
|
e.author
|
|
2828
2828
|
] })
|
|
@@ -2835,91 +2835,91 @@ const Ns = ({
|
|
|
2835
2835
|
onSelectTemplate: t,
|
|
2836
2836
|
onStartFromScratch: n
|
|
2837
2837
|
}) => {
|
|
2838
|
-
const [r, o] =
|
|
2839
|
-
const
|
|
2838
|
+
const [r, o] = M(""), [i, s] = M(He), l = K(() => {
|
|
2839
|
+
const d = /* @__PURE__ */ new Set();
|
|
2840
2840
|
return e.forEach((c) => {
|
|
2841
|
-
c.category &&
|
|
2842
|
-
}), [
|
|
2843
|
-
}, [e]),
|
|
2844
|
-
let
|
|
2845
|
-
if (i !==
|
|
2841
|
+
c.category && d.add(c.category);
|
|
2842
|
+
}), [He, ...Array.from(d)];
|
|
2843
|
+
}, [e]), a = K(() => {
|
|
2844
|
+
let d = e;
|
|
2845
|
+
if (i !== He && (d = d.filter((c) => c.category === i)), r.trim()) {
|
|
2846
2846
|
const c = r.toLowerCase();
|
|
2847
|
-
|
|
2847
|
+
d = d.filter(
|
|
2848
2848
|
(f) => {
|
|
2849
2849
|
var h, g;
|
|
2850
2850
|
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((p) => p.toLowerCase().includes(c)));
|
|
2851
2851
|
}
|
|
2852
2852
|
);
|
|
2853
2853
|
}
|
|
2854
|
-
return [...
|
|
2854
|
+
return [...d].sort((c, f) => (f.popularity ?? 0) - (c.popularity ?? 0));
|
|
2855
2855
|
}, [e, i, r]);
|
|
2856
|
-
return /* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ v("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2857
|
+
/* @__PURE__ */ v("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
2858
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
|
|
2859
|
+
/* @__PURE__ */ v("div", { children: [
|
|
2860
2860
|
/* @__PURE__ */ u("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
|
|
2861
2861
|
/* @__PURE__ */ u("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
|
|
2862
2862
|
] }),
|
|
2863
|
-
n && /* @__PURE__ */
|
|
2863
|
+
n && /* @__PURE__ */ v(
|
|
2864
2864
|
"button",
|
|
2865
2865
|
{
|
|
2866
2866
|
onClick: n,
|
|
2867
2867
|
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" },
|
|
2868
2868
|
children: [
|
|
2869
|
-
/* @__PURE__ */ u(
|
|
2869
|
+
/* @__PURE__ */ u(dr, { size: 16 }),
|
|
2870
2870
|
"Start from Scratch"
|
|
2871
2871
|
]
|
|
2872
2872
|
}
|
|
2873
2873
|
)
|
|
2874
2874
|
] }),
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */ u(
|
|
2875
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2876
|
+
/* @__PURE__ */ u(ar, { size: 18, color: "#9e9e9e" }),
|
|
2877
2877
|
/* @__PURE__ */ u(
|
|
2878
2878
|
"input",
|
|
2879
2879
|
{
|
|
2880
2880
|
value: r,
|
|
2881
|
-
onChange: (
|
|
2881
|
+
onChange: (d) => o(d.target.value),
|
|
2882
2882
|
placeholder: "Search templates...",
|
|
2883
2883
|
style: { border: "none", background: "transparent", outline: "none", fontSize: 14, color: "#212121", flex: 1 }
|
|
2884
2884
|
}
|
|
2885
2885
|
)
|
|
2886
2886
|
] }),
|
|
2887
|
-
l.length > 1 && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((
|
|
2887
|
+
l.length > 1 && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((d) => /* @__PURE__ */ u(
|
|
2888
2888
|
"button",
|
|
2889
2889
|
{
|
|
2890
|
-
onClick: () => s(
|
|
2890
|
+
onClick: () => s(d),
|
|
2891
2891
|
style: {
|
|
2892
2892
|
padding: "4px 12px",
|
|
2893
2893
|
borderRadius: 20,
|
|
2894
2894
|
border: "1.5px solid",
|
|
2895
|
-
borderColor: i ===
|
|
2896
|
-
background: i ===
|
|
2897
|
-
color: i ===
|
|
2895
|
+
borderColor: i === d ? "#1976d2" : "#e0e0e0",
|
|
2896
|
+
background: i === d ? "#e3f2fd" : "#fff",
|
|
2897
|
+
color: i === d ? "#1565c0" : "#616161",
|
|
2898
2898
|
fontSize: 12,
|
|
2899
|
-
fontWeight: i ===
|
|
2899
|
+
fontWeight: i === d ? 600 : 400,
|
|
2900
2900
|
cursor: "pointer"
|
|
2901
2901
|
},
|
|
2902
|
-
children:
|
|
2902
|
+
children: d
|
|
2903
2903
|
},
|
|
2904
|
-
|
|
2904
|
+
d
|
|
2905
2905
|
)) })
|
|
2906
2906
|
] }),
|
|
2907
|
-
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children:
|
|
2907
|
+
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: a.length === 0 ? /* @__PURE__ */ v("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
2908
2908
|
/* @__PURE__ */ u(cr, { size: 36, style: { marginBottom: 8 } }),
|
|
2909
2909
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2910
|
-
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children:
|
|
2910
|
+
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: a.map((d) => /* @__PURE__ */ u(as, { template: d, onSelect: () => t(d) }, d.triggerKey)) }) })
|
|
2911
2911
|
] });
|
|
2912
|
-
},
|
|
2913
|
-
running: { label: "Running", color: ee.running, icon:
|
|
2914
|
-
success: { label: "Success", color: ee.success, icon:
|
|
2915
|
-
failed: { label: "Failed", color: ee.failed, icon:
|
|
2916
|
-
cancelled: { label: "Cancelled", color: ee.cancelled, icon:
|
|
2912
|
+
}, Se = {
|
|
2913
|
+
running: { label: "Running", color: ee.running, icon: B.createElement(qt, { size: 14 }) },
|
|
2914
|
+
success: { label: "Success", color: ee.success, icon: B.createElement(Xt, { size: 14 }) },
|
|
2915
|
+
failed: { label: "Failed", color: ee.failed, icon: B.createElement(Ut, { size: 14 }) },
|
|
2916
|
+
cancelled: { label: "Cancelled", color: ee.cancelled, icon: B.createElement(Vt, { size: 14 }) }
|
|
2917
2917
|
}, cs = {
|
|
2918
|
-
pending: { color: ee.pending, icon:
|
|
2919
|
-
running: { color: ee.running, icon:
|
|
2920
|
-
success: { color: ee.success, icon:
|
|
2921
|
-
failed: { color: ee.failed, icon:
|
|
2922
|
-
skipped: { color: ee.skipped, icon:
|
|
2918
|
+
pending: { color: ee.pending, icon: B.createElement(fr, { size: 14 }) },
|
|
2919
|
+
running: { color: ee.running, icon: B.createElement(qt, { size: 14 }) },
|
|
2920
|
+
success: { color: ee.success, icon: B.createElement(Xt, { size: 14 }) },
|
|
2921
|
+
failed: { color: ee.failed, icon: B.createElement(Ut, { size: 14 }) },
|
|
2922
|
+
skipped: { color: ee.skipped, icon: B.createElement(Vt, { size: 14 }) }
|
|
2923
2923
|
};
|
|
2924
2924
|
function Je(e) {
|
|
2925
2925
|
try {
|
|
@@ -2928,7 +2928,7 @@ function Je(e) {
|
|
|
2928
2928
|
return e;
|
|
2929
2929
|
}
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2931
|
+
function _n(e, t) {
|
|
2932
2932
|
try {
|
|
2933
2933
|
const n = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
2934
2934
|
return n < 1e3 ? `${n}ms` : n < 6e4 ? `${(n / 1e3).toFixed(1)}s` : `${Math.floor(n / 6e4)}m ${Math.floor(n % 6e4 / 1e3)}s`;
|
|
@@ -2937,9 +2937,9 @@ function Tn(e, t) {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
}
|
|
2939
2939
|
function fs({ step: e }) {
|
|
2940
|
-
const [t, n] =
|
|
2941
|
-
return /* @__PURE__ */
|
|
2942
|
-
/* @__PURE__ */
|
|
2940
|
+
const [t, n] = M(!1), r = cs[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
2941
|
+
return /* @__PURE__ */ v("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
2942
|
+
/* @__PURE__ */ v(
|
|
2943
2943
|
"div",
|
|
2944
2944
|
{
|
|
2945
2945
|
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
|
|
@@ -2952,21 +2952,21 @@ function fs({ step: e }) {
|
|
|
2952
2952
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
2953
2953
|
},
|
|
2954
2954
|
children: [
|
|
2955
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
2955
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: B.cloneElement(r.icon, { color: r.color }) }),
|
|
2956
2956
|
/* @__PURE__ */ u("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
2957
2957
|
e.branchTaken && /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
2958
|
-
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ?
|
|
2959
|
-
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ?
|
|
2958
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? _n(e.startedAt, e.completedAt) : "—" }),
|
|
2959
|
+
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? B.createElement(hr, { size: 16 }) : B.createElement(gr, { size: 16 }) })
|
|
2960
2960
|
]
|
|
2961
2961
|
}
|
|
2962
2962
|
),
|
|
2963
|
-
t && o && /* @__PURE__ */
|
|
2963
|
+
t && o && /* @__PURE__ */ v("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
|
|
2964
2964
|
e.error && /* @__PURE__ */ u("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
|
|
2965
|
-
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */
|
|
2965
|
+
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ v("details", { style: { marginBottom: 4 }, children: [
|
|
2966
2966
|
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
|
|
2967
2967
|
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
|
|
2968
2968
|
] }),
|
|
2969
|
-
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */
|
|
2969
|
+
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ v("details", { children: [
|
|
2970
2970
|
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
|
|
2971
2971
|
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
|
|
2972
2972
|
] })
|
|
@@ -2974,8 +2974,8 @@ function fs({ step: e }) {
|
|
|
2974
2974
|
] });
|
|
2975
2975
|
}
|
|
2976
2976
|
function us({ record: e, selected: t, onSelect: n }) {
|
|
2977
|
-
const r =
|
|
2978
|
-
return /* @__PURE__ */
|
|
2977
|
+
const r = Se[e.status];
|
|
2978
|
+
return /* @__PURE__ */ v(
|
|
2979
2979
|
"div",
|
|
2980
2980
|
{
|
|
2981
2981
|
role: "button",
|
|
@@ -2995,10 +2995,10 @@ function us({ record: e, selected: t, onSelect: n }) {
|
|
|
2995
2995
|
outline: "none"
|
|
2996
2996
|
},
|
|
2997
2997
|
children: [
|
|
2998
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
2999
|
-
/* @__PURE__ */
|
|
2998
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: B.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
2999
|
+
/* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3000
3000
|
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: Je(e.triggeredAt) }),
|
|
3001
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ v("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
3002
3002
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
3003
3003
|
" · ",
|
|
3004
3004
|
e.steps.length,
|
|
@@ -3007,42 +3007,42 @@ function us({ record: e, selected: t, onSelect: n }) {
|
|
|
3007
3007
|
] })
|
|
3008
3008
|
] }),
|
|
3009
3009
|
/* @__PURE__ */ u("span", { style: { fontSize: 11, fontWeight: 600, color: r.color, flexShrink: 0 }, children: r.label }),
|
|
3010
|
-
/* @__PURE__ */ u(
|
|
3010
|
+
/* @__PURE__ */ u(Ht, { size: 14, color: "#bdbdbd" })
|
|
3011
3011
|
]
|
|
3012
3012
|
}
|
|
3013
3013
|
);
|
|
3014
3014
|
}
|
|
3015
|
-
const
|
|
3015
|
+
const Ts = ({ records: e, onViewOnCanvas: t }) => {
|
|
3016
3016
|
var s;
|
|
3017
|
-
const [n, r] =
|
|
3018
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
3017
|
+
const [n, r] = M(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === n) ?? null, i = [...e].sort((l, a) => new Date(a.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
3018
|
+
return e.length === 0 ? /* @__PURE__ */ v("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3019
3019
|
/* @__PURE__ */ u(Nt, { size: 36 }),
|
|
3020
3020
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
3021
3021
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
3022
|
-
] }) : /* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3022
|
+
] }) : /* @__PURE__ */ v("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
3023
|
+
/* @__PURE__ */ v("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
|
|
3024
|
+
/* @__PURE__ */ v("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
|
|
3025
3025
|
"Run History (",
|
|
3026
3026
|
e.length,
|
|
3027
3027
|
")"
|
|
3028
3028
|
] }),
|
|
3029
3029
|
i.map((l) => /* @__PURE__ */ u(us, { record: l, selected: l.id === n, onSelect: () => r(l.id) }, l.id))
|
|
3030
3030
|
] }),
|
|
3031
|
-
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
|
|
3036
|
-
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children:
|
|
3031
|
+
/* @__PURE__ */ u("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ v("div", { children: [
|
|
3032
|
+
/* @__PURE__ */ v("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3033
|
+
/* @__PURE__ */ v("div", { children: [
|
|
3034
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3035
|
+
B.cloneElement(Se[o.status].icon, { color: Se[o.status].color, size: 18 }),
|
|
3036
|
+
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: Se[o.status].label })
|
|
3037
3037
|
] }),
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ v("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3039
|
+
/* @__PURE__ */ v("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3040
3040
|
/* @__PURE__ */ u(Nt, { size: 13 }),
|
|
3041
3041
|
" ",
|
|
3042
3042
|
Je(o.triggeredAt),
|
|
3043
|
-
o.completedAt && ` → ${Je(o.completedAt)} (${
|
|
3043
|
+
o.completedAt && ` → ${Je(o.completedAt)} (${_n(o.triggeredAt, o.completedAt)})`
|
|
3044
3044
|
] }),
|
|
3045
|
-
o.triggeredBy && /* @__PURE__ */
|
|
3045
|
+
o.triggeredBy && /* @__PURE__ */ v("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3046
3046
|
/* @__PURE__ */ u(ur, { size: 13 }),
|
|
3047
3047
|
" ",
|
|
3048
3048
|
o.triggeredBy
|
|
@@ -3059,80 +3059,26 @@ const Ss = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3059
3059
|
)
|
|
3060
3060
|
] }),
|
|
3061
3061
|
o.error && /* @__PURE__ */ u("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ v("div", { children: [
|
|
3063
|
+
/* @__PURE__ */ v("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
3064
3064
|
"STEPS (",
|
|
3065
3065
|
o.steps.length,
|
|
3066
3066
|
")"
|
|
3067
3067
|
] }),
|
|
3068
|
-
o.steps.map((l,
|
|
3068
|
+
o.steps.map((l, a) => /* @__PURE__ */ u(fs, { step: l }, `${l.nodeId}-${a}`))
|
|
3069
3069
|
] }),
|
|
3070
|
-
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ u("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */
|
|
3070
|
+
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ u("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ v("details", { children: [
|
|
3071
3071
|
/* @__PURE__ */ u("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
3072
3072
|
/* @__PURE__ */ u("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
|
|
3073
3073
|
] }) })
|
|
3074
3074
|
] }) : /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
3075
3075
|
] });
|
|
3076
|
-
}, Cs = {
|
|
3077
|
-
slots: [
|
|
3078
|
-
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
3079
|
-
{ id: "trigger-END_USER_CREATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "New User Registration", nodeData: { label: "New User Registration" } },
|
|
3080
|
-
{ id: "notification-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Welcome Email", nodeData: { title: "Welcome Email" } },
|
|
3081
|
-
{ id: "approval-1", kind: "approval", reactFlowType: "approvalNode", descriptorType: "approval", deletable: !0, label: "Manager Approval", branchLabels: { pass: "Approved", fail: "Rejected" } },
|
|
3082
|
-
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
3083
|
-
],
|
|
3084
|
-
branches: {
|
|
3085
|
-
"approval-1": {
|
|
3086
|
-
pass: [{ id: "notification-pass-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Approval Confirmed", nodeData: { title: "Approval Confirmed" } }],
|
|
3087
|
-
fail: [{ id: "notification-fail-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Rejection Notice", nodeData: { title: "Rejection Notice" } }]
|
|
3088
|
-
}
|
|
3089
|
-
}
|
|
3090
|
-
}, Is = {
|
|
3091
|
-
slots: [
|
|
3092
|
-
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
3093
|
-
{ id: "trigger-ACCESS_REQUEST", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "Access Request Submitted", nodeData: { label: "Access Request Submitted" } },
|
|
3094
|
-
{ id: "approval-1", kind: "approval", reactFlowType: "approvalNode", descriptorType: "approval", deletable: !0, label: "Access Approval", branchLabels: { pass: "Approved", fail: "Denied" } },
|
|
3095
|
-
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
3096
|
-
],
|
|
3097
|
-
branches: {
|
|
3098
|
-
"approval-1": {
|
|
3099
|
-
pass: [
|
|
3100
|
-
{ id: "restApi-1", kind: "userTask", reactFlowType: "restApiNode", descriptorType: "restApi", deletable: !0, label: "Provision Access", nodeData: { title: "Provision Access" } },
|
|
3101
|
-
{ id: "notification-pass-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Access Granted Email", nodeData: { title: "Access Granted Email" } }
|
|
3102
|
-
],
|
|
3103
|
-
fail: [
|
|
3104
|
-
{ id: "notification-fail-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Access Denied Email", nodeData: { title: "Access Denied Email" } }
|
|
3105
|
-
]
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
}, Os = {
|
|
3109
|
-
slots: [
|
|
3110
|
-
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
3111
|
-
{ id: "trigger-USER_DEACTIVATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "User Deactivation", nodeData: { label: "User Deactivation" } },
|
|
3112
|
-
{ id: "delay-1", kind: "userTask", reactFlowType: "delayNode", descriptorType: "delay", deletable: !0, label: "Grace Period", nodeData: { title: "Grace Period", duration: 7, unit: "days" }, formData: { duration: 7, unit: "days" } },
|
|
3113
|
-
{ id: "notification-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Notify IT Team", nodeData: { title: "Notify IT Team" } },
|
|
3114
|
-
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
3115
|
-
],
|
|
3116
|
-
branches: {}
|
|
3117
|
-
}, js = {
|
|
3118
|
-
slots: [
|
|
3119
|
-
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
3120
|
-
{ id: "trigger-WEBHOOK_TRIGGER", kind: "triggerFixed", reactFlowType: "webhookTriggerNode", deletable: !0, label: "Incoming Webhook", nodeData: { label: "Incoming Webhook" } },
|
|
3121
|
-
{ id: "restApi-1", kind: "userTask", reactFlowType: "restApiNode", descriptorType: "restApi", deletable: !0, label: "Call External API", nodeData: { title: "Call External API" } },
|
|
3122
|
-
{ id: "notification-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Notify on Completion", nodeData: { title: "Notify on Completion" } },
|
|
3123
|
-
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
3124
|
-
],
|
|
3125
|
-
branches: {}
|
|
3126
3076
|
};
|
|
3127
3077
|
export {
|
|
3128
3078
|
Yt as F,
|
|
3129
3079
|
ts as S,
|
|
3130
|
-
|
|
3080
|
+
Ts as W,
|
|
3131
3081
|
Ji as a,
|
|
3132
|
-
Ns as b
|
|
3133
|
-
Is as c,
|
|
3134
|
-
Os as o,
|
|
3135
|
-
Cs as u,
|
|
3136
|
-
js as w
|
|
3082
|
+
Ns as b
|
|
3137
3083
|
};
|
|
3138
|
-
//# sourceMappingURL=
|
|
3084
|
+
//# sourceMappingURL=WorkflowExecutionHistory-B0OiFCyi.js.map
|