@notmrabhi/flowforge 0.1.108 → 0.1.110
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-C023FhhW.js → GatewayBranchEdge-BsRuojkK.js} +503 -486
- package/dist/GatewayBranchEdge-BsRuojkK.js.map +1 -0
- package/dist/GatewayBranchEdge-D4TJNKL1.js +2 -0
- package/dist/GatewayBranchEdge-D4TJNKL1.js.map +1 -0
- package/dist/{WorkflowExecutionHistory-BrkL37Wb.js → WorkflowExecutionHistory-DLW_0rl3.js} +2 -2
- package/dist/WorkflowExecutionHistory-DLW_0rl3.js.map +1 -0
- package/dist/{WorkflowExecutionHistory-BBeVPYVc.js → WorkflowExecutionHistory-DmfGMs7_.js} +681 -675
- package/dist/WorkflowExecutionHistory-DmfGMs7_.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +2 -2
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.d.ts +2 -0
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-C023FhhW.js.map +0 -1
- package/dist/GatewayBranchEdge-CdoZtIhn.js +0 -2
- package/dist/GatewayBranchEdge-CdoZtIhn.js.map +0 -1
- package/dist/WorkflowExecutionHistory-BBeVPYVc.js.map +0 -1
- package/dist/WorkflowExecutionHistory-BrkL37Wb.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as w, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as f, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import $, { useRef as Tt, useEffect as se, useState as L, useCallback as U, useMemo as V } from "react";
|
|
3
3
|
import Wn, { useStore as $n, useReactFlow as Gn, Background as Yn, Controls as Kn, MiniMap as Hn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-
|
|
6
|
-
import { Dialog as er, Box as
|
|
5
|
+
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-BsRuojkK.js";
|
|
6
|
+
import { Dialog as er, Box as re, Drawer as tr, IconButton as Ot, Button as Le, CircularProgress as nr } from "@mui/material";
|
|
7
7
|
import rr from "react-select";
|
|
8
|
-
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Jt, MdChevronRight as Zt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as
|
|
8
|
+
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Jt, MdChevronRight as Zt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as ur, MdSearch as fr, MdCategory as hr, MdCancel as Qt, MdError as en, MdCheckCircle as tn, MdPlayArrow as nn, MdHourglassEmpty as gr, MdSchedule as It, MdPerson as pr, MdExpandLess as yr, MdExpandMore as br } from "react-icons/md";
|
|
9
9
|
import { GrTrigger as mr } from "react-icons/gr";
|
|
10
10
|
import { BiCollapse as vr, BiExpand as wr } from "react-icons/bi";
|
|
11
11
|
import { k as Er, c as xr, O as kr } from "./index-C6t1hp3u.js";
|
|
12
12
|
import { m as _r } from "./messages-CRZgWFU-.js";
|
|
13
13
|
import { createTheme as Sr, ThemeProvider as Nr } from "@mui/material/styles";
|
|
14
|
-
import { T as Cr, E as
|
|
15
|
-
var rn = Object.defineProperty, Tr = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n,
|
|
14
|
+
import { T as Cr, E as oe } from "./canvasTokens-CAD6G24b.js";
|
|
15
|
+
var rn = Object.defineProperty, Tr = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Or = (e, t) => {
|
|
16
16
|
for (var n in t) rn(e, n, { get: t[n], enumerable: !0 });
|
|
17
|
-
},
|
|
18
|
-
|
|
17
|
+
}, Ir = (e, t, n) => Tr(e, t + "", n), on = {};
|
|
18
|
+
Or(on, { Graph: () => q, alg: () => it, json: () => ln, version: () => zr });
|
|
19
19
|
var Mr = Object.defineProperty, sn = (e, t) => {
|
|
20
20
|
for (var n in t) Mr(e, n, { get: t[n], enumerable: !0 });
|
|
21
21
|
}, q = class {
|
|
@@ -151,7 +151,7 @@ var Mr = Object.defineProperty, sn = (e, t) => {
|
|
|
151
151
|
setEdge(e, t, n, r) {
|
|
152
152
|
let o, i, s, l, d = !1;
|
|
153
153
|
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t, d = !0)) : (o = e, i = t, s = r, arguments.length > 2 && (l = n, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
154
|
-
let a =
|
|
154
|
+
let a = _e(this._isDirected, o, i, s);
|
|
155
155
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
156
156
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
157
157
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
@@ -159,7 +159,7 @@ var Mr = Object.defineProperty, sn = (e, t) => {
|
|
|
159
159
|
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, Mt(this._preds[i], o), Mt(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
160
160
|
}
|
|
161
161
|
edge(e, t, n) {
|
|
162
|
-
let r = arguments.length === 1 ?
|
|
162
|
+
let r = arguments.length === 1 ? Ke(this._isDirected, e) : _e(this._isDirected, e, t, n);
|
|
163
163
|
return this._edgeLabels[r];
|
|
164
164
|
}
|
|
165
165
|
edgeAsObj(e, t, n) {
|
|
@@ -167,10 +167,10 @@ var Mr = Object.defineProperty, sn = (e, t) => {
|
|
|
167
167
|
return typeof r != "object" ? { label: r } : r;
|
|
168
168
|
}
|
|
169
169
|
hasEdge(e, t, n) {
|
|
170
|
-
return (arguments.length === 1 ?
|
|
170
|
+
return (arguments.length === 1 ? Ke(this._isDirected, e) : _e(this._isDirected, e, t, n)) in this._edgeLabels;
|
|
171
171
|
}
|
|
172
172
|
removeEdge(e, t, n) {
|
|
173
|
-
let r = arguments.length === 1 ?
|
|
173
|
+
let r = arguments.length === 1 ? Ke(this._isDirected, e) : _e(this._isDirected, e, t, n), o = this._edgeObjs[r];
|
|
174
174
|
if (o) {
|
|
175
175
|
let i = o.v, s = o.w;
|
|
176
176
|
delete this._edgeLabels[r], delete this._edgeObjs[r], jt(this._preds[s], i), jt(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
|
|
@@ -201,7 +201,7 @@ function Mt(e, t) {
|
|
|
201
201
|
function jt(e, t) {
|
|
202
202
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function _e(e, t, n, r) {
|
|
205
205
|
let o = "" + t, i = "" + n;
|
|
206
206
|
if (!e && o > i) {
|
|
207
207
|
let s = o;
|
|
@@ -218,8 +218,8 @@ function jr(e, t, n, r) {
|
|
|
218
218
|
let s = { v: o, w: i };
|
|
219
219
|
return r && (s.name = r), s;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
221
|
+
function Ke(e, t) {
|
|
222
|
+
return _e(e, t.v, t.w, t.name);
|
|
223
223
|
}
|
|
224
224
|
var zr = "4.0.1", ln = {};
|
|
225
225
|
sn(ln, { read: () => Rr, write: () => Lr });
|
|
@@ -247,8 +247,8 @@ function Rr(e) {
|
|
|
247
247
|
t.setEdge({ v: n.v, w: n.w, name: n.name }, n.value);
|
|
248
248
|
}), t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
251
|
-
sn(
|
|
250
|
+
var it = {};
|
|
251
|
+
sn(it, { CycleException: () => Fe, bellmanFord: () => an, components: () => Dr, dijkstra: () => Pe, dijkstraAll: () => Gr, findCycles: () => Yr, floydWarshall: () => Hr, isAcyclic: () => Vr, postorder: () => Xr, preorder: () => Jr, prim: () => Zr, shortestPaths: () => Qr, tarjan: () => cn, topsort: () => un });
|
|
252
252
|
var Ar = () => 1;
|
|
253
253
|
function an(e, t, n, r) {
|
|
254
254
|
return Br(e, String(t), n || Ar, r || function(o) {
|
|
@@ -256,23 +256,23 @@ function an(e, t, n, r) {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
function Br(e, t, n, r) {
|
|
259
|
-
let o = {}, i, s = 0, l = e.nodes(), d = function(
|
|
260
|
-
let h = n(
|
|
261
|
-
o[
|
|
259
|
+
let o = {}, i, s = 0, l = e.nodes(), d = function(u) {
|
|
260
|
+
let h = n(u);
|
|
261
|
+
o[u.v].distance + h < o[u.w].distance && (o[u.w] = { distance: o[u.v].distance + h, predecessor: u.v }, i = !0);
|
|
262
262
|
}, a = function() {
|
|
263
|
-
l.forEach(function(
|
|
264
|
-
r(
|
|
265
|
-
let g = h.v ===
|
|
263
|
+
l.forEach(function(u) {
|
|
264
|
+
r(u).forEach(function(h) {
|
|
265
|
+
let g = h.v === u ? h.v : h.w, E = g === h.v ? h.w : h.v;
|
|
266
266
|
d({ v: g, w: E });
|
|
267
267
|
});
|
|
268
268
|
});
|
|
269
269
|
};
|
|
270
|
-
l.forEach(function(
|
|
271
|
-
let h =
|
|
272
|
-
o[
|
|
270
|
+
l.forEach(function(u) {
|
|
271
|
+
let h = u === t ? 0 : Number.POSITIVE_INFINITY;
|
|
272
|
+
o[u] = { distance: h, predecessor: "" };
|
|
273
273
|
});
|
|
274
274
|
let c = l.length;
|
|
275
|
-
for (let
|
|
275
|
+
for (let u = 1; u < c && (i = !1, s++, a(), !!i); u++) ;
|
|
276
276
|
if (s === c - 1 && (i = !1, a(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
277
277
|
return o;
|
|
278
278
|
}
|
|
@@ -339,7 +339,7 @@ var dn = class {
|
|
|
339
339
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
340
340
|
}
|
|
341
341
|
}, Wr = () => 1;
|
|
342
|
-
function
|
|
342
|
+
function Pe(e, t, n, r) {
|
|
343
343
|
let o = function(i) {
|
|
344
344
|
return e.outEdges(i);
|
|
345
345
|
};
|
|
@@ -347,9 +347,9 @@ function Le(e, t, n, r) {
|
|
|
347
347
|
}
|
|
348
348
|
function $r(e, t, n, r) {
|
|
349
349
|
let o = {}, i = new dn(), s, l, d = function(a) {
|
|
350
|
-
let c = a.v !== s ? a.v : a.w,
|
|
350
|
+
let c = a.v !== s ? a.v : a.w, u = o[c], h = n(a), g = l.distance + h;
|
|
351
351
|
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
352
|
-
g <
|
|
352
|
+
g < u.distance && (u.distance = g, u.predecessor = s, i.decrease(c, g));
|
|
353
353
|
};
|
|
354
354
|
for (e.nodes().forEach(function(a) {
|
|
355
355
|
let c = a === t ? 0 : Number.POSITIVE_INFINITY;
|
|
@@ -359,7 +359,7 @@ function $r(e, t, n, r) {
|
|
|
359
359
|
}
|
|
360
360
|
function Gr(e, t, n) {
|
|
361
361
|
return e.nodes().reduce(function(r, o) {
|
|
362
|
-
return r[o] =
|
|
362
|
+
return r[o] = Pe(e, o, t, n), r;
|
|
363
363
|
}, {});
|
|
364
364
|
}
|
|
365
365
|
function cn(e) {
|
|
@@ -405,31 +405,31 @@ function Ur(e, t, n) {
|
|
|
405
405
|
o.forEach(function(l) {
|
|
406
406
|
let d = r[l];
|
|
407
407
|
o.forEach(function(a) {
|
|
408
|
-
let c = d[i],
|
|
409
|
-
g < h.distance && (h.distance = g, h.predecessor =
|
|
408
|
+
let c = d[i], u = s[a], h = d[a], g = c.distance + u.distance;
|
|
409
|
+
g < h.distance && (h.distance = g, h.predecessor = u.predecessor);
|
|
410
410
|
});
|
|
411
411
|
});
|
|
412
412
|
}), r;
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Fe = class extends Error {
|
|
415
415
|
constructor(...e) {
|
|
416
416
|
super(...e);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
-
function
|
|
419
|
+
function un(e) {
|
|
420
420
|
let t = {}, n = {}, r = [];
|
|
421
421
|
function o(i) {
|
|
422
|
-
if (i in n) throw new
|
|
422
|
+
if (i in n) throw new Fe();
|
|
423
423
|
i in t || (n[i] = !0, t[i] = !0, e.predecessors(i).forEach(o), delete n[i], r.push(i));
|
|
424
424
|
}
|
|
425
|
-
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new
|
|
425
|
+
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Fe();
|
|
426
426
|
return r;
|
|
427
427
|
}
|
|
428
428
|
function Vr(e) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
430
|
+
un(e);
|
|
431
431
|
} catch (t) {
|
|
432
|
-
if (t instanceof
|
|
432
|
+
if (t instanceof Fe) return !1;
|
|
433
433
|
throw t;
|
|
434
434
|
}
|
|
435
435
|
return !0;
|
|
@@ -442,12 +442,12 @@ function qr(e, t, n, r, o) {
|
|
|
442
442
|
}, s = {};
|
|
443
443
|
return t.forEach(function(l) {
|
|
444
444
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
445
|
-
o =
|
|
445
|
+
o = fn(e, l, n === "post", s, i, r, o);
|
|
446
446
|
}), o;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function fn(e, t, n, r, o, i, s) {
|
|
449
449
|
return t in r || (r[t] = !0, n || (s = i(s, t)), o(t).forEach(function(l) {
|
|
450
|
-
s =
|
|
450
|
+
s = fn(e, l, n, r, o, i, s);
|
|
451
451
|
}), n && (s = i(s, t))), s;
|
|
452
452
|
}
|
|
453
453
|
function hn(e, t, n) {
|
|
@@ -466,8 +466,8 @@ function Zr(e, t) {
|
|
|
466
466
|
function s(d) {
|
|
467
467
|
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
468
468
|
if (c !== void 0) {
|
|
469
|
-
let
|
|
470
|
-
|
|
469
|
+
let u = t(d);
|
|
470
|
+
u < c && (r[a] = i, o.decrease(a, u));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
if (e.nodeCount() === 0) return n;
|
|
@@ -492,21 +492,21 @@ function Qr(e, t, n, r) {
|
|
|
492
492
|
}));
|
|
493
493
|
}
|
|
494
494
|
function eo(e, t, n, r) {
|
|
495
|
-
if (n === void 0) return
|
|
495
|
+
if (n === void 0) return Pe(e, t, n, r);
|
|
496
496
|
let o = !1, i = e.nodes();
|
|
497
497
|
for (let s = 0; s < i.length; s++) {
|
|
498
498
|
let l = r(i[s]);
|
|
499
499
|
for (let d = 0; d < l.length; d++) {
|
|
500
|
-
let a = l[d], c = a.v === i[s] ? a.v : a.w,
|
|
501
|
-
n({ v: c, w:
|
|
500
|
+
let a = l[d], c = a.v === i[s] ? a.v : a.w, u = c === a.v ? a.w : a.v;
|
|
501
|
+
n({ v: c, w: u }) < 0 && (o = !0);
|
|
502
502
|
}
|
|
503
503
|
if (o) return an(e, t, n, r);
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return Pe(e, t, n, r);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function ve(e, t, n, r) {
|
|
508
508
|
let o = r;
|
|
509
|
-
for (; e.hasNode(o); ) o =
|
|
509
|
+
for (; e.hasNode(o); ) o = st(r);
|
|
510
510
|
return n.dummy = t, e.setNode(o, n), o;
|
|
511
511
|
}
|
|
512
512
|
function to(e) {
|
|
@@ -531,7 +531,7 @@ function zt(e, t) {
|
|
|
531
531
|
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l), d = l * o / i, a = l) : (o < 0 && (s = -s), d = s, a = s * i / o), { x: n + d, y: r + a };
|
|
532
532
|
}
|
|
533
533
|
function Te(e) {
|
|
534
|
-
let t =
|
|
534
|
+
let t = Ne(yn(e) + 1).map(() => []);
|
|
535
535
|
return e.nodes().forEach((n) => {
|
|
536
536
|
let r = e.node(n), o = r.rank;
|
|
537
537
|
o !== void 0 && (t[o] || (t[o] = []), t[o][r.order] = n);
|
|
@@ -541,14 +541,14 @@ function no(e) {
|
|
|
541
541
|
let t = e.nodes().map((r) => {
|
|
542
542
|
let o = e.node(r).rank;
|
|
543
543
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
544
|
-
}), n =
|
|
544
|
+
}), n = ee(Math.min, t);
|
|
545
545
|
e.nodes().forEach((r) => {
|
|
546
546
|
let o = e.node(r);
|
|
547
547
|
Object.hasOwn(o, "rank") && (o.rank -= n);
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function ro(e) {
|
|
551
|
-
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n =
|
|
551
|
+
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n = ee(Math.min, t), r = [];
|
|
552
552
|
e.nodes().forEach((s) => {
|
|
553
553
|
let l = e.node(s).rank - n;
|
|
554
554
|
r[l] || (r[l] = []), r[l].push(s);
|
|
@@ -560,7 +560,7 @@ function ro(e) {
|
|
|
560
560
|
}
|
|
561
561
|
function Lt(e, t, n, r) {
|
|
562
562
|
let o = { width: 0, height: 0 };
|
|
563
|
-
return arguments.length >= 4 && (o.rank = n, o.order = r),
|
|
563
|
+
return arguments.length >= 4 && (o.rank = n, o.order = r), ve(e, "border", o, t);
|
|
564
564
|
}
|
|
565
565
|
function oo(e, t = pn) {
|
|
566
566
|
let n = [];
|
|
@@ -571,7 +571,7 @@ function oo(e, t = pn) {
|
|
|
571
571
|
return n;
|
|
572
572
|
}
|
|
573
573
|
var pn = 65535;
|
|
574
|
-
function
|
|
574
|
+
function ee(e, t) {
|
|
575
575
|
if (t.length > pn) {
|
|
576
576
|
let n = oo(t);
|
|
577
577
|
return e(...n.map((r) => e(...r)));
|
|
@@ -582,7 +582,7 @@ function yn(e) {
|
|
|
582
582
|
let r = e.node(n).rank;
|
|
583
583
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
584
584
|
});
|
|
585
|
-
return
|
|
585
|
+
return ee(Math.max, t);
|
|
586
586
|
}
|
|
587
587
|
function io(e, t) {
|
|
588
588
|
let n = { lhs: [], rhs: [] };
|
|
@@ -602,11 +602,11 @@ function mn(e, t) {
|
|
|
602
602
|
return t();
|
|
603
603
|
}
|
|
604
604
|
var so = 0;
|
|
605
|
-
function
|
|
605
|
+
function st(e) {
|
|
606
606
|
let t = ++so;
|
|
607
607
|
return e + ("" + t);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function Ne(e, t, n = 1) {
|
|
610
610
|
t == null && (t = e, e = 0);
|
|
611
611
|
let r = (i) => i < t;
|
|
612
612
|
n < 0 && (r = (i) => t < i);
|
|
@@ -614,21 +614,21 @@ function Se(e, t, n = 1) {
|
|
|
614
614
|
for (let i = e; r(i); i += n) o.push(i);
|
|
615
615
|
return o;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Re(e, t) {
|
|
618
618
|
let n = {};
|
|
619
619
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
620
620
|
return n;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Ae(e, t) {
|
|
623
623
|
let n;
|
|
624
624
|
return typeof t == "string" ? n = (r) => r[t] : n = t, Object.entries(e).reduce((r, [o, i]) => (r[o] = n(i, o), r), {});
|
|
625
625
|
}
|
|
626
626
|
function lo(e, t) {
|
|
627
627
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
628
628
|
}
|
|
629
|
-
var
|
|
629
|
+
var Be = "\0", ao = "3.0.0", co = class {
|
|
630
630
|
constructor() {
|
|
631
|
-
|
|
631
|
+
Ir(this, "_sentinel");
|
|
632
632
|
let e = {};
|
|
633
633
|
e._next = e._prev = e, this._sentinel = e;
|
|
634
634
|
}
|
|
@@ -642,17 +642,17 @@ var Ae = "\0", ao = "3.0.0", co = class {
|
|
|
642
642
|
}
|
|
643
643
|
toString() {
|
|
644
644
|
let e = [], t = this._sentinel, n = t._prev;
|
|
645
|
-
for (; n !== t; ) e.push(JSON.stringify(n,
|
|
645
|
+
for (; n !== t; ) e.push(JSON.stringify(n, uo)), n = n._prev;
|
|
646
646
|
return "[" + e.join(", ") + "]";
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
649
|
function Pt(e) {
|
|
650
650
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function uo(e, t) {
|
|
653
653
|
if (e !== "_next" && e !== "_prev") return t;
|
|
654
654
|
}
|
|
655
|
-
var
|
|
655
|
+
var fo = co, ho = () => 1;
|
|
656
656
|
function go(e, t) {
|
|
657
657
|
if (e.nodeCount() <= 1) return [];
|
|
658
658
|
let n = yo(e, t || ho);
|
|
@@ -662,25 +662,25 @@ function po(e, t, n) {
|
|
|
662
662
|
var r;
|
|
663
663
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
664
664
|
for (; e.nodeCount(); ) {
|
|
665
|
-
for (; l = s.dequeue(); )
|
|
666
|
-
for (; l = i.dequeue(); )
|
|
665
|
+
for (; l = s.dequeue(); ) He(e, t, n, l);
|
|
666
|
+
for (; l = i.dequeue(); ) He(e, t, n, l);
|
|
667
667
|
if (e.nodeCount()) {
|
|
668
668
|
for (let d = t.length - 2; d > 0; --d) if (l = (r = t[d]) == null ? void 0 : r.dequeue(), l) {
|
|
669
|
-
o = o.concat(
|
|
669
|
+
o = o.concat(He(e, t, n, l, !0) || []);
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
return o;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function He(e, t, n, r, o) {
|
|
677
677
|
let i = [], s = o ? i : void 0;
|
|
678
678
|
return (e.inEdges(r.v) || []).forEach((l) => {
|
|
679
679
|
let d = e.edge(l), a = e.node(l.v);
|
|
680
|
-
o && i.push({ v: l.v, w: l.w }), a.out -= d,
|
|
680
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, et(t, n, a);
|
|
681
681
|
}), (e.outEdges(r.v) || []).forEach((l) => {
|
|
682
682
|
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
683
|
-
c.in -= d,
|
|
683
|
+
c.in -= d, et(t, n, c);
|
|
684
684
|
}), e.removeNode(r.v), s;
|
|
685
685
|
}
|
|
686
686
|
function yo(e, t) {
|
|
@@ -690,15 +690,15 @@ function yo(e, t) {
|
|
|
690
690
|
}), e.edges().forEach((l) => {
|
|
691
691
|
let d = n.edge(l.v, l.w) || 0, a = t(l), c = d + a;
|
|
692
692
|
n.setEdge(l.v, l.w, c);
|
|
693
|
-
let
|
|
694
|
-
o = Math.max(o,
|
|
693
|
+
let u = n.node(l.v), h = n.node(l.w);
|
|
694
|
+
o = Math.max(o, u.out += a), r = Math.max(r, h.in += a);
|
|
695
695
|
});
|
|
696
|
-
let i = bo(o + r + 3).map(() => new
|
|
696
|
+
let i = bo(o + r + 3).map(() => new fo()), s = r + 1;
|
|
697
697
|
return n.nodes().forEach((l) => {
|
|
698
|
-
|
|
698
|
+
et(i, s, n.node(l));
|
|
699
699
|
}), { graph: n, buckets: i, zeroIdx: s };
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function et(e, t, n) {
|
|
702
702
|
var r, o, i;
|
|
703
703
|
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);
|
|
704
704
|
}
|
|
@@ -710,7 +710,7 @@ function bo(e) {
|
|
|
710
710
|
function mo(e) {
|
|
711
711
|
(e.graph().acyclicer === "greedy" ? go(e, t(e)) : vo(e)).forEach((n) => {
|
|
712
712
|
let r = e.edge(n);
|
|
713
|
-
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r,
|
|
713
|
+
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r, st("rev"));
|
|
714
714
|
});
|
|
715
715
|
function t(n) {
|
|
716
716
|
return (r) => n.edge(r).weight;
|
|
@@ -742,8 +742,8 @@ function xo(e, t) {
|
|
|
742
742
|
let n = t.v, r = e.node(n).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), d = l.labelRank;
|
|
743
743
|
if (i === r + 1) return;
|
|
744
744
|
e.removeEdge(t);
|
|
745
|
-
let a, c,
|
|
746
|
-
for (
|
|
745
|
+
let a, c, u;
|
|
746
|
+
for (u = 0, ++r; r < i; ++u, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a = ve(e, "edge", c, "_d"), r === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(n, a, { weight: l.weight }, s), u === 0 && e.graph().dummyChains.push(a), n = a;
|
|
747
747
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
748
748
|
}
|
|
749
749
|
function ko(e) {
|
|
@@ -752,13 +752,13 @@ function ko(e) {
|
|
|
752
752
|
for (e.setEdge(n.edgeObj, r); n.dummy; ) o = e.successors(t)[0], e.removeNode(t), r.points.push({ x: n.x, y: n.y }), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = o, n = e.node(t);
|
|
753
753
|
});
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function lt(e) {
|
|
756
756
|
let t = {};
|
|
757
757
|
function n(r) {
|
|
758
758
|
let o = e.node(r);
|
|
759
759
|
if (Object.hasOwn(t, r)) return o.rank;
|
|
760
760
|
t[r] = !0;
|
|
761
|
-
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l =
|
|
761
|
+
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l = ee(Math.min, s);
|
|
762
762
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
763
763
|
}
|
|
764
764
|
e.sources().forEach(n);
|
|
@@ -795,22 +795,22 @@ function No(e, t) {
|
|
|
795
795
|
function Co(e, t, n) {
|
|
796
796
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
797
797
|
}
|
|
798
|
-
var { preorder: To, postorder:
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
function
|
|
806
|
-
e = to(e),
|
|
798
|
+
var { preorder: To, postorder: Oo } = it, Io = fe;
|
|
799
|
+
fe.initLowLimValues = dt;
|
|
800
|
+
fe.initCutValues = at;
|
|
801
|
+
fe.calcCutValue = wn;
|
|
802
|
+
fe.leaveEdge = xn;
|
|
803
|
+
fe.enterEdge = kn;
|
|
804
|
+
fe.exchangeEdges = _n;
|
|
805
|
+
function fe(e) {
|
|
806
|
+
e = to(e), lt(e);
|
|
807
807
|
let t = vn(e);
|
|
808
|
-
|
|
808
|
+
dt(t), at(t, e);
|
|
809
809
|
let n, r;
|
|
810
810
|
for (; n = xn(t); ) r = kn(t, e, n), _n(t, e, n, r);
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
let n =
|
|
812
|
+
function at(e, t) {
|
|
813
|
+
let n = Oo(e, e.nodes());
|
|
814
814
|
n = n.slice(0, n.length - 1), n.forEach((r) => Mo(e, t, r));
|
|
815
815
|
}
|
|
816
816
|
function Mo(e, t, n) {
|
|
@@ -824,15 +824,15 @@ function wn(e, t, n) {
|
|
|
824
824
|
return l && l.forEach((d) => {
|
|
825
825
|
let a = d.v === n, c = a ? d.w : d.v;
|
|
826
826
|
if (c !== r) {
|
|
827
|
-
let
|
|
828
|
-
if (s +=
|
|
827
|
+
let u = a === o, h = t.edge(d).weight;
|
|
828
|
+
if (s += u ? h : -h, zo(e, n, c)) {
|
|
829
829
|
let g = e.edge(n, c).cutvalue;
|
|
830
|
-
s +=
|
|
830
|
+
s += u ? -g : g;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
}), s;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function dt(e, t) {
|
|
836
836
|
arguments.length < 2 && (t = e.nodes()[0]), En(e, {}, 1, t);
|
|
837
837
|
}
|
|
838
838
|
function En(e, t, n, r, o) {
|
|
@@ -854,7 +854,7 @@ function kn(e, t, n) {
|
|
|
854
854
|
}
|
|
855
855
|
function _n(e, t, n, r) {
|
|
856
856
|
let o = n.v, i = n.w;
|
|
857
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}),
|
|
857
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), dt(e), at(e, t), jo(e, t);
|
|
858
858
|
}
|
|
859
859
|
function jo(e, t) {
|
|
860
860
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
@@ -891,12 +891,12 @@ function Po(e) {
|
|
|
891
891
|
Rt(e);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
var Fo =
|
|
894
|
+
var Fo = lt;
|
|
895
895
|
function Ro(e) {
|
|
896
|
-
|
|
896
|
+
lt(e), vn(e);
|
|
897
897
|
}
|
|
898
898
|
function Rt(e) {
|
|
899
|
-
|
|
899
|
+
Io(e);
|
|
900
900
|
}
|
|
901
901
|
var Ao = Bo;
|
|
902
902
|
function Bo(e) {
|
|
@@ -932,13 +932,13 @@ function Wo(e) {
|
|
|
932
932
|
let i = n;
|
|
933
933
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
934
934
|
}
|
|
935
|
-
return e.children(
|
|
935
|
+
return e.children(Be).forEach(r), t;
|
|
936
936
|
}
|
|
937
937
|
function $o(e) {
|
|
938
|
-
let t =
|
|
938
|
+
let t = ve(e, "root", {}, "_root"), n = Go(e), r = Object.values(n), o = ee(Math.max, r) - 1, i = 2 * o + 1;
|
|
939
939
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
940
940
|
let s = Yo(e) + 1;
|
|
941
|
-
e.children(
|
|
941
|
+
e.children(Be).forEach((l) => Sn(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
942
942
|
}
|
|
943
943
|
function Sn(e, t, n, r, o, i, s) {
|
|
944
944
|
var l;
|
|
@@ -947,12 +947,12 @@ function Sn(e, t, n, r, o, i, s) {
|
|
|
947
947
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: n });
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
let a = Lt(e, "_bt"), c = Lt(e, "_bb"),
|
|
951
|
-
e.setParent(a, s),
|
|
950
|
+
let a = Lt(e, "_bt"), c = Lt(e, "_bb"), u = e.node(s);
|
|
951
|
+
e.setParent(a, s), u.borderTop = a, e.setParent(c, s), u.borderBottom = c, d.forEach((h) => {
|
|
952
952
|
var g;
|
|
953
953
|
Sn(e, t, n, r, o, i, h);
|
|
954
|
-
let E = e.node(h),
|
|
955
|
-
e.setEdge(a,
|
|
954
|
+
let E = e.node(h), b = E.borderTop ? E.borderTop : h, p = E.borderBottom ? E.borderBottom : h, x = E.borderTop ? r : 2 * r, k = b !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
955
|
+
e.setEdge(a, b, { weight: x, minlen: k, nestingEdge: !0 }), e.setEdge(p, c, { weight: x, minlen: k, nestingEdge: !0 });
|
|
956
956
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
957
957
|
}
|
|
958
958
|
function Go(e) {
|
|
@@ -961,7 +961,7 @@ function Go(e) {
|
|
|
961
961
|
let i = e.children(r);
|
|
962
962
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
963
963
|
}
|
|
964
|
-
return e.children(
|
|
964
|
+
return e.children(Be).forEach((r) => n(r, 1)), t;
|
|
965
965
|
}
|
|
966
966
|
function Yo(e) {
|
|
967
967
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
@@ -981,10 +981,10 @@ function Uo(e) {
|
|
|
981
981
|
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) At(e, "borderLeft", "_bl", n, o, i), At(e, "borderRight", "_br", n, o, i);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
e.children(
|
|
984
|
+
e.children(Be).forEach(t);
|
|
985
985
|
}
|
|
986
986
|
function At(e, t, n, r, o, i) {
|
|
987
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
987
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = ve(e, "border", s, n);
|
|
988
988
|
o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
|
|
989
989
|
}
|
|
990
990
|
function Vo(e) {
|
|
@@ -1005,28 +1005,28 @@ function Bt(e) {
|
|
|
1005
1005
|
e.width = e.height, e.height = t;
|
|
1006
1006
|
}
|
|
1007
1007
|
function Xo(e) {
|
|
1008
|
-
e.nodes().forEach((t) =>
|
|
1008
|
+
e.nodes().forEach((t) => Ue(e.node(t))), e.edges().forEach((t) => {
|
|
1009
1009
|
var n;
|
|
1010
1010
|
let r = e.edge(t);
|
|
1011
|
-
(n = r.points) == null || n.forEach(
|
|
1011
|
+
(n = r.points) == null || n.forEach(Ue), Object.hasOwn(r, "y") && Ue(r);
|
|
1012
1012
|
});
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function Ue(e) {
|
|
1015
1015
|
e.y = -e.y;
|
|
1016
1016
|
}
|
|
1017
1017
|
function Jo(e) {
|
|
1018
|
-
e.nodes().forEach((t) =>
|
|
1018
|
+
e.nodes().forEach((t) => Ve(e.node(t))), e.edges().forEach((t) => {
|
|
1019
1019
|
var n;
|
|
1020
1020
|
let r = e.edge(t);
|
|
1021
|
-
(n = r.points) == null || n.forEach(
|
|
1021
|
+
(n = r.points) == null || n.forEach(Ve), Object.hasOwn(r, "x") && Ve(r);
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Ve(e) {
|
|
1025
1025
|
let t = e.x;
|
|
1026
1026
|
e.x = e.y, e.y = t;
|
|
1027
1027
|
}
|
|
1028
1028
|
function Zo(e) {
|
|
1029
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o =
|
|
1029
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = ee(Math.max, r), i = Ne(o + 1).map(() => []);
|
|
1030
1030
|
function s(l) {
|
|
1031
1031
|
if (t[l]) return;
|
|
1032
1032
|
t[l] = !0;
|
|
@@ -1045,7 +1045,7 @@ function Qo(e, t) {
|
|
|
1045
1045
|
function ei(e, t, n) {
|
|
1046
1046
|
let r = lo(n, n.map((a, c) => c)), o = t.flatMap((a) => {
|
|
1047
1047
|
let c = e.outEdges(a);
|
|
1048
|
-
return c ? c.map((
|
|
1048
|
+
return c ? c.map((u) => ({ pos: r[u.w], weight: e.edge(u).weight })).sort((u, h) => u.pos - h.pos) : [];
|
|
1049
1049
|
}), i = 1;
|
|
1050
1050
|
for (; i < n.length; ) i <<= 1;
|
|
1051
1051
|
let s = 2 * i - 1;
|
|
@@ -1054,9 +1054,9 @@ function ei(e, t, n) {
|
|
|
1054
1054
|
return o.forEach((a) => {
|
|
1055
1055
|
let c = a.pos + i;
|
|
1056
1056
|
l[c] += a.weight;
|
|
1057
|
-
let
|
|
1058
|
-
for (; c > 0; ) c % 2 && (
|
|
1059
|
-
d += a.weight *
|
|
1057
|
+
let u = 0;
|
|
1058
|
+
for (; c > 0; ) c % 2 && (u += l[c + 1]), c = c - 1 >> 1, l[c] += a.weight;
|
|
1059
|
+
d += a.weight * u;
|
|
1060
1060
|
}), d;
|
|
1061
1061
|
}
|
|
1062
1062
|
function ti(e, t = []) {
|
|
@@ -1100,14 +1100,14 @@ function ri(e) {
|
|
|
1100
1100
|
let o = e.pop();
|
|
1101
1101
|
t.push(o), o.in.reverse().forEach(n(o)), o.out.forEach(r(o));
|
|
1102
1102
|
}
|
|
1103
|
-
return t.filter((o) => !o.merged).map((o) =>
|
|
1103
|
+
return t.filter((o) => !o.merged).map((o) => Re(o, ["vs", "i", "barycenter", "weight"]));
|
|
1104
1104
|
}
|
|
1105
1105
|
function oi(e, t) {
|
|
1106
1106
|
let n = 0, r = 0;
|
|
1107
1107
|
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;
|
|
1108
1108
|
}
|
|
1109
1109
|
function ii(e, t) {
|
|
1110
|
-
let n = io(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c,
|
|
1110
|
+
let n = io(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c, u) => u.i - c.i), i = [], s = 0, l = 0, d = 0;
|
|
1111
1111
|
r.sort(si(!!t)), d = Dt(i, o, d), r.forEach((c) => {
|
|
1112
1112
|
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = Dt(i, o, d);
|
|
1113
1113
|
});
|
|
@@ -1134,16 +1134,16 @@ function Cn(e, t, n, r) {
|
|
|
1134
1134
|
});
|
|
1135
1135
|
let c = ni(a, n);
|
|
1136
1136
|
li(c, d);
|
|
1137
|
-
let
|
|
1137
|
+
let u = ii(c, r);
|
|
1138
1138
|
if (s && l) {
|
|
1139
|
-
|
|
1139
|
+
u.vs = [s, u.vs, l].flat(1);
|
|
1140
1140
|
let h = e.predecessors(s);
|
|
1141
1141
|
if (h && h.length) {
|
|
1142
|
-
let g = e.node(h[0]), E = e.predecessors(l),
|
|
1143
|
-
Object.hasOwn(
|
|
1142
|
+
let g = e.node(h[0]), E = e.predecessors(l), b = e.node(E[0]);
|
|
1143
|
+
Object.hasOwn(u, "barycenter") || (u.barycenter = 0, u.weight = 0), u.barycenter = (u.barycenter * u.weight + g.order + b.order) / (u.weight + 2), u.weight += 2;
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
|
-
return
|
|
1146
|
+
return u;
|
|
1147
1147
|
}
|
|
1148
1148
|
function li(e, t) {
|
|
1149
1149
|
e.forEach((n) => {
|
|
@@ -1162,18 +1162,18 @@ function di(e, t, n, r) {
|
|
|
1162
1162
|
i.setNode(s), i.setParent(s, d || o);
|
|
1163
1163
|
let a = e[n](s);
|
|
1164
1164
|
a && a.forEach((c) => {
|
|
1165
|
-
let
|
|
1166
|
-
i.setEdge(
|
|
1165
|
+
let u = c.v === s ? c.w : c.v, h = i.edge(u, s), g = h !== void 0 ? h.weight : 0;
|
|
1166
|
+
i.setEdge(u, s, { weight: e.edge(c).weight + g });
|
|
1167
1167
|
}), Object.hasOwn(l, "minRank") && i.setNode(s, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
1168
1168
|
}
|
|
1169
1169
|
}), i;
|
|
1170
1170
|
}
|
|
1171
1171
|
function ci(e) {
|
|
1172
1172
|
let t;
|
|
1173
|
-
for (; e.hasNode(t =
|
|
1173
|
+
for (; e.hasNode(t = st("_root")); ) ;
|
|
1174
1174
|
return t;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function ui(e, t, n) {
|
|
1177
1177
|
let r = {}, o;
|
|
1178
1178
|
n.forEach((i) => {
|
|
1179
1179
|
let s = e.parent(i), l, d;
|
|
@@ -1191,13 +1191,13 @@ function Tn(e, t = {}) {
|
|
|
1191
1191
|
t.customOrder(e, Tn);
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
1194
|
-
let n = yn(e), r = Wt(e,
|
|
1194
|
+
let n = yn(e), r = Wt(e, Ne(1, n + 1), "inEdges"), o = Wt(e, Ne(n - 1, -1, -1), "outEdges"), i = Zo(e);
|
|
1195
1195
|
if ($t(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1196
1196
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1197
1197
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1198
|
-
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1198
|
+
fi(a % 2 ? r : o, a % 4 >= 2, d), i = Te(e);
|
|
1199
|
+
let u = Qo(e, i);
|
|
1200
|
+
u < s ? (c = 0, l = Object.assign({}, i), s = u) : u === s && (l = structuredClone(i));
|
|
1201
1201
|
}
|
|
1202
1202
|
$t(e, l);
|
|
1203
1203
|
}
|
|
@@ -1213,12 +1213,12 @@ function Wt(e, t, n) {
|
|
|
1213
1213
|
return di(e, i, n, r.get(i) || []);
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function fi(e, t, n) {
|
|
1217
1217
|
let r = new q();
|
|
1218
1218
|
e.forEach(function(o) {
|
|
1219
1219
|
n.forEach((l) => r.setEdge(l.left, l.right));
|
|
1220
1220
|
let i = o.graph().root, s = Cn(o, i, r, t);
|
|
1221
|
-
s.vs.forEach((l, d) => o.node(l).order = d),
|
|
1221
|
+
s.vs.forEach((l, d) => o.node(l).order = d), ui(o, r, s.vs);
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
1224
|
function $t(e, t) {
|
|
@@ -1228,15 +1228,15 @@ function hi(e, t) {
|
|
|
1228
1228
|
let n = {};
|
|
1229
1229
|
function r(o, i) {
|
|
1230
1230
|
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1231
|
-
return i.forEach((c,
|
|
1231
|
+
return i.forEach((c, u) => {
|
|
1232
1232
|
let h = pi(e, c), g = h ? e.node(h).order : d;
|
|
1233
|
-
(h || c === a) && (i.slice(l,
|
|
1234
|
-
let
|
|
1235
|
-
|
|
1236
|
-
let
|
|
1237
|
-
(
|
|
1233
|
+
(h || c === a) && (i.slice(l, u + 1).forEach((E) => {
|
|
1234
|
+
let b = e.predecessors(E);
|
|
1235
|
+
b && b.forEach((p) => {
|
|
1236
|
+
let x = e.node(p), k = x.order;
|
|
1237
|
+
(k < s || g < k) && !(x.dummy && e.node(E).dummy) && On(n, p, E);
|
|
1238
1238
|
});
|
|
1239
|
-
}), l =
|
|
1239
|
+
}), l = u + 1, s = g);
|
|
1240
1240
|
}), i;
|
|
1241
1241
|
}
|
|
1242
1242
|
return t.length && t.reduce(r), n;
|
|
@@ -1244,27 +1244,27 @@ function hi(e, t) {
|
|
|
1244
1244
|
function gi(e, t) {
|
|
1245
1245
|
let n = {};
|
|
1246
1246
|
function r(i, s, l, d, a) {
|
|
1247
|
-
|
|
1248
|
-
let
|
|
1249
|
-
if (
|
|
1250
|
-
let h = e.predecessors(
|
|
1247
|
+
Ne(s, l).forEach((c) => {
|
|
1248
|
+
let u = i[c];
|
|
1249
|
+
if (u !== void 0 && e.node(u).dummy) {
|
|
1250
|
+
let h = e.predecessors(u);
|
|
1251
1251
|
h && h.forEach((g) => {
|
|
1252
1252
|
if (g === void 0) return;
|
|
1253
1253
|
let E = e.node(g);
|
|
1254
|
-
E.dummy && (E.order < d || E.order > a) &&
|
|
1254
|
+
E.dummy && (E.order < d || E.order > a) && On(n, g, u);
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
1259
|
function o(i, s) {
|
|
1260
1260
|
let l = -1, d = -1, a = 0;
|
|
1261
|
-
return s.forEach((c,
|
|
1261
|
+
return s.forEach((c, u) => {
|
|
1262
1262
|
if (e.node(c).dummy === "border") {
|
|
1263
1263
|
let h = e.predecessors(c);
|
|
1264
1264
|
if (h && h.length) {
|
|
1265
1265
|
let g = h[0];
|
|
1266
1266
|
if (g === void 0) return;
|
|
1267
|
-
d = e.node(g).order, r(s, a,
|
|
1267
|
+
d = e.node(g).order, r(s, a, u, l, d), a = u, l = d;
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
r(s, a, s.length, d, i.length);
|
|
@@ -1278,7 +1278,7 @@ function pi(e, t) {
|
|
|
1278
1278
|
if (n) return n.find((r) => e.node(r).dummy);
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function On(e, t, n) {
|
|
1282
1282
|
if (t > n) {
|
|
1283
1283
|
let o = t;
|
|
1284
1284
|
t = n, n = o;
|
|
@@ -1305,17 +1305,17 @@ function bi(e, t, n, r) {
|
|
|
1305
1305
|
l.forEach((a) => {
|
|
1306
1306
|
let c = r(a);
|
|
1307
1307
|
if (c && c.length) {
|
|
1308
|
-
let
|
|
1309
|
-
let
|
|
1310
|
-
return (
|
|
1311
|
-
}), h = (
|
|
1308
|
+
let u = c.sort((g, E) => {
|
|
1309
|
+
let b = s[g], p = s[E];
|
|
1310
|
+
return (b !== void 0 ? b : 0) - (p !== void 0 ? p : 0);
|
|
1311
|
+
}), h = (u.length - 1) / 2;
|
|
1312
1312
|
for (let g = Math.floor(h), E = Math.ceil(h); g <= E; ++g) {
|
|
1313
|
-
let
|
|
1314
|
-
if (
|
|
1315
|
-
let p = s[
|
|
1316
|
-
if (p !== void 0 && i[a] === a && d < p && !yi(n, a,
|
|
1317
|
-
let
|
|
1318
|
-
|
|
1313
|
+
let b = u[g];
|
|
1314
|
+
if (b === void 0) continue;
|
|
1315
|
+
let p = s[b];
|
|
1316
|
+
if (p !== void 0 && i[a] === a && d < p && !yi(n, a, b)) {
|
|
1317
|
+
let x = o[b];
|
|
1318
|
+
x !== void 0 && (i[b] = a, i[a] = o[a] = x, d = p);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
@@ -1325,43 +1325,43 @@ function bi(e, t, n, r) {
|
|
|
1325
1325
|
function mi(e, t, n, r, o = !1) {
|
|
1326
1326
|
let i = {}, s = vi(e, t, n, o), l = o ? "borderLeft" : "borderRight";
|
|
1327
1327
|
function d(g, E) {
|
|
1328
|
-
let
|
|
1329
|
-
for (;
|
|
1330
|
-
if (p[
|
|
1328
|
+
let b = s.nodes().slice(), p = {}, x = b.pop();
|
|
1329
|
+
for (; x; ) {
|
|
1330
|
+
if (p[x]) g(x);
|
|
1331
1331
|
else {
|
|
1332
|
-
p[
|
|
1333
|
-
for (let
|
|
1332
|
+
p[x] = !0, b.push(x);
|
|
1333
|
+
for (let k of E(x)) b.push(k);
|
|
1334
1334
|
}
|
|
1335
|
-
|
|
1335
|
+
x = b.pop();
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
function a(g) {
|
|
1339
1339
|
let E = s.inEdges(g);
|
|
1340
|
-
E ? i[g] = E.reduce((
|
|
1341
|
-
var
|
|
1342
|
-
let
|
|
1343
|
-
return Math.max(
|
|
1340
|
+
E ? i[g] = E.reduce((b, p) => {
|
|
1341
|
+
var x;
|
|
1342
|
+
let k = (x = i[p.v]) != null ? x : 0, M = s.edge(p);
|
|
1343
|
+
return Math.max(b, k + (M !== void 0 ? M : 0));
|
|
1344
1344
|
}, 0) : i[g] = 0;
|
|
1345
1345
|
}
|
|
1346
1346
|
function c(g) {
|
|
1347
|
-
let E = s.outEdges(g),
|
|
1348
|
-
E && (
|
|
1349
|
-
let
|
|
1350
|
-
return Math.min(
|
|
1347
|
+
let E = s.outEdges(g), b = Number.POSITIVE_INFINITY;
|
|
1348
|
+
E && (b = E.reduce((x, k) => {
|
|
1349
|
+
let M = i[k.w], z = s.edge(k);
|
|
1350
|
+
return Math.min(x, (M !== void 0 ? M : 0) - (z !== void 0 ? z : 0));
|
|
1351
1351
|
}, Number.POSITIVE_INFINITY));
|
|
1352
1352
|
let p = e.node(g);
|
|
1353
|
-
|
|
1353
|
+
b !== Number.POSITIVE_INFINITY && p.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, b));
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function u(g) {
|
|
1356
1356
|
return s.predecessors(g) || [];
|
|
1357
1357
|
}
|
|
1358
1358
|
function h(g) {
|
|
1359
1359
|
return s.successors(g) || [];
|
|
1360
1360
|
}
|
|
1361
|
-
return d(a,
|
|
1361
|
+
return d(a, u), d(c, h), Object.keys(r).forEach((g) => {
|
|
1362
1362
|
var E;
|
|
1363
|
-
let
|
|
1364
|
-
|
|
1363
|
+
let b = n[g];
|
|
1364
|
+
b !== void 0 && (i[g] = (E = i[b]) != null ? E : 0);
|
|
1365
1365
|
}), i;
|
|
1366
1366
|
}
|
|
1367
1367
|
function vi(e, t, n, r) {
|
|
@@ -1372,10 +1372,10 @@ function vi(e, t, n, r) {
|
|
|
1372
1372
|
let c = n[a];
|
|
1373
1373
|
if (c !== void 0) {
|
|
1374
1374
|
if (o.setNode(c), d !== void 0) {
|
|
1375
|
-
let
|
|
1376
|
-
if (
|
|
1377
|
-
let h = o.edge(
|
|
1378
|
-
o.setEdge(
|
|
1375
|
+
let u = n[d];
|
|
1376
|
+
if (u !== void 0) {
|
|
1377
|
+
let h = o.edge(u, c);
|
|
1378
|
+
o.setEdge(u, c, Math.max(s(e, a, d), h || 0));
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
1381
|
d = a;
|
|
@@ -1395,19 +1395,19 @@ function wi(e, t) {
|
|
|
1395
1395
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1396
1396
|
}
|
|
1397
1397
|
function Ei(e, t) {
|
|
1398
|
-
let n = Object.values(t), r =
|
|
1398
|
+
let n = Object.values(t), r = ee(Math.min, n), o = ee(Math.max, n);
|
|
1399
1399
|
["u", "d"].forEach((i) => {
|
|
1400
1400
|
["l", "r"].forEach((s) => {
|
|
1401
1401
|
let l = i + s, d = e[l];
|
|
1402
1402
|
if (!d || d === t) return;
|
|
1403
|
-
let a = Object.values(d), c = r -
|
|
1404
|
-
s !== "l" && (c = o -
|
|
1403
|
+
let a = Object.values(d), c = r - ee(Math.min, a);
|
|
1404
|
+
s !== "l" && (c = o - ee(Math.max, a)), c && (e[l] = Ae(d, (u) => u + c));
|
|
1405
1405
|
});
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
1408
|
function xi(e, t = void 0) {
|
|
1409
1409
|
let n = e.ul;
|
|
1410
|
-
return n ?
|
|
1410
|
+
return n ? Ae(n, (r, o) => {
|
|
1411
1411
|
var i, s;
|
|
1412
1412
|
if (t) {
|
|
1413
1413
|
let d = t.toLowerCase(), a = e[d];
|
|
@@ -1426,7 +1426,7 @@ function ki(e) {
|
|
|
1426
1426
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1427
1427
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1428
1428
|
let d = bi(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = mi(e, o, d.root, d.align, l === "r");
|
|
1429
|
-
l === "r" && (a =
|
|
1429
|
+
l === "r" && (a = Ae(a, (c) => -c)), r[s + l] = a;
|
|
1430
1430
|
});
|
|
1431
1431
|
});
|
|
1432
1432
|
let i = wi(e, r);
|
|
@@ -1465,8 +1465,8 @@ function Ci(e) {
|
|
|
1465
1465
|
t.forEach((s) => {
|
|
1466
1466
|
let l = s.reduce((d, a) => {
|
|
1467
1467
|
var c;
|
|
1468
|
-
let
|
|
1469
|
-
return d >
|
|
1468
|
+
let u = (c = e.node(a).height) != null ? c : 0;
|
|
1469
|
+
return d > u ? d : u;
|
|
1470
1470
|
}, 0);
|
|
1471
1471
|
s.forEach((d) => {
|
|
1472
1472
|
let a = e.node(d);
|
|
@@ -1478,13 +1478,13 @@ function Ti(e, t = {}) {
|
|
|
1478
1478
|
let n = t.debugTiming ? bn : mn;
|
|
1479
1479
|
return n("layout", () => {
|
|
1480
1480
|
let r = n(" buildLayoutGraph", () => Ai(e));
|
|
1481
|
-
return n(" runLayout", () =>
|
|
1481
|
+
return n(" runLayout", () => Oi(r, n, t)), n(" updateInputGraph", () => Ii(e, r)), r;
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function Oi(e, t, n) {
|
|
1485
1485
|
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(gn(e))), t(" injectEdgeLabelProxies", () => Di(e)), t(" removeEmptyRanks", () => ro(e)), t(" nestingGraph.cleanup", () => Ko(e)), t(" normalizeRanks", () => no(e)), t(" assignRankMinMax", () => Wi(e)), t(" removeEdgeLabelProxies", () => $i(e)), t(" normalize.run", () => Eo(e)), t(" parentDummyChains", () => Ao(e)), t(" addBorderSegments", () => Ho(e)), t(" order", () => Tn(e, n)), t(" insertSelfEdges", () => qi(e)), t(" adjustCoordinateSystem", () => Vo(e)), t(" position", () => Ni(e)), t(" positionSelfEdges", () => Xi(e)), t(" removeBorderNodes", () => Ui(e)), t(" normalize.undo", () => ko(e)), t(" fixupEdgeLabelCoords", () => Ki(e)), t(" undoCoordinateSystem", () => qo(e)), t(" translateGraph", () => Gi(e)), t(" assignNodeIntersects", () => Yi(e)), t(" reversePoints", () => Hi(e)), t(" acyclic.undo", () => wo(e));
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Ii(e, t) {
|
|
1488
1488
|
e.nodes().forEach((n) => {
|
|
1489
1489
|
let r = e.node(n), o = t.node(n);
|
|
1490
1490
|
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));
|
|
@@ -1495,17 +1495,17 @@ function Oi(e, t) {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
var Mi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], ji = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, zi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Li = ["width", "height", "rank"], Gt = { width: 0, height: 0 }, Pi = ["minlen", "weight", "width", "height", "labeloffset"], Fi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, Ri = ["labelpos"];
|
|
1497
1497
|
function Ai(e) {
|
|
1498
|
-
let t = new q({ multigraph: !0, compound: !0 }), n =
|
|
1499
|
-
return t.setGraph(Object.assign({}, ji,
|
|
1500
|
-
let o =
|
|
1498
|
+
let t = new q({ multigraph: !0, compound: !0 }), n = Xe(e.graph());
|
|
1499
|
+
return t.setGraph(Object.assign({}, ji, qe(n, Mi), Re(n, zi))), e.nodes().forEach((r) => {
|
|
1500
|
+
let o = Xe(e.node(r)), i = qe(o, Li);
|
|
1501
1501
|
Object.keys(Gt).forEach((l) => {
|
|
1502
1502
|
i[l] === void 0 && (i[l] = Gt[l]);
|
|
1503
1503
|
}), t.setNode(r, i);
|
|
1504
1504
|
let s = e.parent(r);
|
|
1505
1505
|
s !== void 0 && t.setParent(r, s);
|
|
1506
1506
|
}), e.edges().forEach((r) => {
|
|
1507
|
-
let o =
|
|
1508
|
-
t.setEdge(r, Object.assign({}, Fi,
|
|
1507
|
+
let o = Xe(e.edge(r));
|
|
1508
|
+
t.setEdge(r, Object.assign({}, Fi, qe(o, Pi), Re(o, Ri)));
|
|
1509
1509
|
}), t;
|
|
1510
1510
|
}
|
|
1511
1511
|
function Bi(e) {
|
|
@@ -1520,7 +1520,7 @@ function Di(e) {
|
|
|
1520
1520
|
let n = e.edge(t);
|
|
1521
1521
|
if (n.width && n.height) {
|
|
1522
1522
|
let r = e.node(t.v), o = { rank: (e.node(t.w).rank - r.rank) / 2 + r.rank, e: t };
|
|
1523
|
-
|
|
1523
|
+
ve(e, "edge-proxy", o, "_ep");
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
@@ -1543,8 +1543,8 @@ function $i(e) {
|
|
|
1543
1543
|
function Gi(e) {
|
|
1544
1544
|
let t = Number.POSITIVE_INFINITY, n = 0, r = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1545
1545
|
function d(a) {
|
|
1546
|
-
let c = a.x,
|
|
1547
|
-
t = Math.min(t, c - h / 2), n = Math.max(n, c + h / 2), r = Math.min(r,
|
|
1546
|
+
let c = a.x, u = a.y, h = a.width, g = a.height;
|
|
1547
|
+
t = Math.min(t, c - h / 2), n = Math.max(n, c + h / 2), r = Math.min(r, u - g / 2), o = Math.max(o, u + g / 2);
|
|
1548
1548
|
}
|
|
1549
1549
|
e.nodes().forEach((a) => d(e.node(a))), e.edges().forEach((a) => {
|
|
1550
1550
|
let c = e.edge(a);
|
|
@@ -1554,8 +1554,8 @@ function Gi(e) {
|
|
|
1554
1554
|
c.x -= t, c.y -= r;
|
|
1555
1555
|
}), e.edges().forEach((a) => {
|
|
1556
1556
|
let c = e.edge(a);
|
|
1557
|
-
c.points.forEach((
|
|
1558
|
-
|
|
1557
|
+
c.points.forEach((u) => {
|
|
1558
|
+
u.x -= t, u.y -= r;
|
|
1559
1559
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= r);
|
|
1560
1560
|
}), i.width = n - t + s, i.height = o - r + l;
|
|
1561
1561
|
}
|
|
@@ -1608,7 +1608,7 @@ function qi(e) {
|
|
|
1608
1608
|
t.forEach((r, o) => {
|
|
1609
1609
|
let i = e.node(r);
|
|
1610
1610
|
i.order = o + n, (i.selfEdges || []).forEach((s) => {
|
|
1611
|
-
|
|
1611
|
+
ve(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++n, e: s.e, label: s.label }, "_se");
|
|
1612
1612
|
}), delete i.selfEdges;
|
|
1613
1613
|
});
|
|
1614
1614
|
});
|
|
@@ -1622,10 +1622,10 @@ function Xi(e) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return Re(
|
|
1625
|
+
function qe(e, t) {
|
|
1626
|
+
return Ae(Re(e, t), Number);
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function Xe(e) {
|
|
1629
1629
|
let t = {};
|
|
1630
1630
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
1631
1631
|
typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
|
|
@@ -1674,8 +1674,8 @@ function ns({
|
|
|
1674
1674
|
saveLabel: s = "Save",
|
|
1675
1675
|
saveDisabled: l = !1
|
|
1676
1676
|
}) {
|
|
1677
|
-
const [d, a] =
|
|
1678
|
-
|
|
1677
|
+
const [d, a] = $.useState(!1), [c, u] = $.useState(!1), [h, g] = $.useState(e ?? "");
|
|
1678
|
+
$.useEffect(() => {
|
|
1679
1679
|
g(e ?? "");
|
|
1680
1680
|
}, [e]);
|
|
1681
1681
|
const E = async () => {
|
|
@@ -1687,7 +1687,7 @@ function ns({
|
|
|
1687
1687
|
a(!1);
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
},
|
|
1690
|
+
}, b = ts[r] ?? {
|
|
1691
1691
|
bg: r,
|
|
1692
1692
|
fg: "#fff"
|
|
1693
1693
|
};
|
|
@@ -1705,16 +1705,16 @@ function ns({
|
|
|
1705
1705
|
},
|
|
1706
1706
|
children: [
|
|
1707
1707
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 }, children: [
|
|
1708
|
-
c && t ? /* @__PURE__ */
|
|
1708
|
+
c && t ? /* @__PURE__ */ f(
|
|
1709
1709
|
"input",
|
|
1710
1710
|
{
|
|
1711
1711
|
value: h,
|
|
1712
1712
|
onChange: (p) => g(p.target.value),
|
|
1713
1713
|
onBlur: () => {
|
|
1714
|
-
|
|
1714
|
+
u(!1), h !== e && t(h);
|
|
1715
1715
|
},
|
|
1716
1716
|
onKeyDown: (p) => {
|
|
1717
|
-
p.key === "Enter" && p.target.blur(), p.key === "Escape" && (g(e ?? ""),
|
|
1717
|
+
p.key === "Enter" && p.target.blur(), p.key === "Escape" && (g(e ?? ""), u(!1));
|
|
1718
1718
|
},
|
|
1719
1719
|
autoFocus: !0,
|
|
1720
1720
|
style: {
|
|
@@ -1727,10 +1727,10 @@ function ns({
|
|
|
1727
1727
|
minWidth: 200
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
|
-
) : /* @__PURE__ */
|
|
1730
|
+
) : /* @__PURE__ */ f(
|
|
1731
1731
|
"span",
|
|
1732
1732
|
{
|
|
1733
|
-
onClick: () => t &&
|
|
1733
|
+
onClick: () => t && u(!0),
|
|
1734
1734
|
style: {
|
|
1735
1735
|
fontSize: 15,
|
|
1736
1736
|
fontWeight: 600,
|
|
@@ -1745,7 +1745,7 @@ function ns({
|
|
|
1745
1745
|
children: e || "Untitled workflow"
|
|
1746
1746
|
}
|
|
1747
1747
|
),
|
|
1748
|
-
n && /* @__PURE__ */
|
|
1748
|
+
n && /* @__PURE__ */ f(
|
|
1749
1749
|
"span",
|
|
1750
1750
|
{
|
|
1751
1751
|
style: {
|
|
@@ -1753,8 +1753,8 @@ function ns({
|
|
|
1753
1753
|
fontWeight: 600,
|
|
1754
1754
|
padding: "3px 8px",
|
|
1755
1755
|
borderRadius: 999,
|
|
1756
|
-
background:
|
|
1757
|
-
color:
|
|
1756
|
+
background: b.bg,
|
|
1757
|
+
color: b.fg,
|
|
1758
1758
|
textTransform: "uppercase",
|
|
1759
1759
|
letterSpacing: 0.4,
|
|
1760
1760
|
flexShrink: 0
|
|
@@ -1764,7 +1764,7 @@ function ns({
|
|
|
1764
1764
|
)
|
|
1765
1765
|
] }),
|
|
1766
1766
|
/* @__PURE__ */ w("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1767
|
-
i && /* @__PURE__ */
|
|
1767
|
+
i && /* @__PURE__ */ f(
|
|
1768
1768
|
"button",
|
|
1769
1769
|
{
|
|
1770
1770
|
type: "button",
|
|
@@ -1784,7 +1784,7 @@ function ns({
|
|
|
1784
1784
|
children: "Cancel"
|
|
1785
1785
|
}
|
|
1786
1786
|
),
|
|
1787
|
-
o && /* @__PURE__ */
|
|
1787
|
+
o && /* @__PURE__ */ f(
|
|
1788
1788
|
"button",
|
|
1789
1789
|
{
|
|
1790
1790
|
type: "button",
|
|
@@ -1813,17 +1813,17 @@ function ns({
|
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1817
|
-
const [l, d] = L(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(
|
|
1818
|
-
r && /* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
] }),
|
|
1816
|
+
const Ce = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 720 }) => {
|
|
1817
|
+
const [l, d] = L(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(re, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1818
|
+
r && /* @__PURE__ */ f(re, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1819
|
+
/* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1820
|
+
/* @__PURE__ */ f(Ot, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(vr, {}) : /* @__PURE__ */ f(wr, {}) }),
|
|
1821
|
+
/* @__PURE__ */ f(Ot, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(or, {}) })
|
|
1822
|
+
] }), u = () => i ? /* @__PURE__ */ f(re, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1823
1823
|
return l ? /* @__PURE__ */ w(er, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1824
|
-
/* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */ u
|
|
1824
|
+
/* @__PURE__ */ f(c, {}),
|
|
1825
|
+
/* @__PURE__ */ f(re, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1826
|
+
/* @__PURE__ */ f(u, {})
|
|
1827
1827
|
] }) : /* @__PURE__ */ w(
|
|
1828
1828
|
tr,
|
|
1829
1829
|
{
|
|
@@ -1849,9 +1849,9 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1849
1849
|
}
|
|
1850
1850
|
},
|
|
1851
1851
|
children: [
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */ u
|
|
1852
|
+
/* @__PURE__ */ f(c, {}),
|
|
1853
|
+
/* @__PURE__ */ f(re, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1854
|
+
/* @__PURE__ */ f(u, {})
|
|
1855
1855
|
]
|
|
1856
1856
|
}
|
|
1857
1857
|
);
|
|
@@ -1863,36 +1863,36 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1863
1863
|
onClose: o,
|
|
1864
1864
|
loadTriggerSources: i
|
|
1865
1865
|
}) => {
|
|
1866
|
-
const [s, l] = L("trigger"), [d, a] = L(null), [c,
|
|
1866
|
+
const [s, l] = L("trigger"), [d, a] = L(null), [c, u] = L([]), [h, g] = L([]), [E, b] = L(!1), [p, x] = L(null);
|
|
1867
1867
|
se(() => {
|
|
1868
|
-
e || (l("trigger"), a(null),
|
|
1868
|
+
e || (l("trigger"), a(null), u([]), g([]), b(!1), x(null));
|
|
1869
1869
|
}, [e]);
|
|
1870
|
-
const
|
|
1870
|
+
const k = U(async (P) => {
|
|
1871
1871
|
if (!i) {
|
|
1872
1872
|
r(P);
|
|
1873
1873
|
return;
|
|
1874
1874
|
}
|
|
1875
|
-
a(P),
|
|
1875
|
+
a(P), b(!0), x(null);
|
|
1876
1876
|
try {
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1877
|
+
const I = await i(P.triggerKey);
|
|
1878
|
+
if (!I || I.length === 0) {
|
|
1879
1879
|
r(P);
|
|
1880
1880
|
return;
|
|
1881
1881
|
}
|
|
1882
|
-
|
|
1883
|
-
} catch (
|
|
1884
|
-
|
|
1882
|
+
u(I), l("sources");
|
|
1883
|
+
} catch (I) {
|
|
1884
|
+
x(I instanceof Error ? I.message : "Failed to load sources.");
|
|
1885
1885
|
} finally {
|
|
1886
|
-
|
|
1886
|
+
b(!1);
|
|
1887
1887
|
}
|
|
1888
|
-
}, [i, r]),
|
|
1889
|
-
l("trigger"), a(null),
|
|
1888
|
+
}, [i, r]), M = () => {
|
|
1889
|
+
l("trigger"), a(null), u([]), g([]), x(null);
|
|
1890
1890
|
}, z = () => {
|
|
1891
1891
|
d && r(d, h);
|
|
1892
|
-
}, W = s === "sources" && d,
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
|
|
1892
|
+
}, W = s === "sources" && d, G = W ? /* @__PURE__ */ w(Se, { children: [
|
|
1893
|
+
/* @__PURE__ */ f(Le, { type: "button", variant: "outlined", size: "small", onClick: M, children: n.cancel ?? "Back" }),
|
|
1894
|
+
/* @__PURE__ */ f(
|
|
1895
|
+
Le,
|
|
1896
1896
|
{
|
|
1897
1897
|
type: "button",
|
|
1898
1898
|
variant: "contained",
|
|
@@ -1903,78 +1903,78 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1903
1903
|
}
|
|
1904
1904
|
)
|
|
1905
1905
|
] }) : null;
|
|
1906
|
-
return /* @__PURE__ */
|
|
1907
|
-
|
|
1906
|
+
return /* @__PURE__ */ f(
|
|
1907
|
+
Ce,
|
|
1908
1908
|
{
|
|
1909
1909
|
isOpen: e,
|
|
1910
1910
|
onClose: o,
|
|
1911
1911
|
title: W ? d.label : n.addTriggerTitle,
|
|
1912
|
-
icon: /* @__PURE__ */
|
|
1912
|
+
icon: /* @__PURE__ */ f(mr, {}),
|
|
1913
1913
|
width: 500,
|
|
1914
|
-
footer:
|
|
1915
|
-
children: /* @__PURE__ */ w(
|
|
1916
|
-
!W && /* @__PURE__ */ w(
|
|
1917
|
-
/* @__PURE__ */
|
|
1914
|
+
footer: G,
|
|
1915
|
+
children: /* @__PURE__ */ w(re, { sx: { p: 2 }, children: [
|
|
1916
|
+
!W && /* @__PURE__ */ w(Se, { children: [
|
|
1917
|
+
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1918
1918
|
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1919
1919
|
t.map((P) => /* @__PURE__ */ w(
|
|
1920
1920
|
"div",
|
|
1921
1921
|
{
|
|
1922
1922
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1923
1923
|
style: { cursor: E ? "wait" : "pointer", transition: "background 0.15s", opacity: E ? 0.6 : 1 },
|
|
1924
|
-
onClick: () => !E &&
|
|
1924
|
+
onClick: () => !E && k(P),
|
|
1925
1925
|
role: "button",
|
|
1926
1926
|
tabIndex: 0,
|
|
1927
|
-
onKeyDown: (
|
|
1928
|
-
|
|
1927
|
+
onKeyDown: (I) => {
|
|
1928
|
+
I.key === "Enter" && !E && k(P);
|
|
1929
1929
|
},
|
|
1930
|
-
onMouseEnter: (
|
|
1931
|
-
E || (
|
|
1930
|
+
onMouseEnter: (I) => {
|
|
1931
|
+
E || (I.currentTarget.style.background = "#f5f5f5");
|
|
1932
1932
|
},
|
|
1933
|
-
onMouseLeave: (
|
|
1934
|
-
|
|
1933
|
+
onMouseLeave: (I) => {
|
|
1934
|
+
I.currentTarget.style.background = "";
|
|
1935
1935
|
},
|
|
1936
1936
|
children: [
|
|
1937
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ f("div", { style: { color: P.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: P.triggerCategory === "scheduler" ? /* @__PURE__ */ f(ir, { size: 18 }) : /* @__PURE__ */ f(sr, { size: 18 }) }),
|
|
1938
1938
|
/* @__PURE__ */ w("div", { children: [
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
P.description && /* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: P.label }),
|
|
1940
|
+
P.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: P.description })
|
|
1941
1941
|
] })
|
|
1942
1942
|
]
|
|
1943
1943
|
},
|
|
1944
1944
|
P.triggerKey
|
|
1945
1945
|
)),
|
|
1946
|
-
t.length === 0 && /* @__PURE__ */
|
|
1946
|
+
t.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1947
1947
|
] }),
|
|
1948
|
-
E && /* @__PURE__ */ w(
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
1948
|
+
E && /* @__PURE__ */ w(re, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1949
|
+
/* @__PURE__ */ f(nr, { size: 14 }),
|
|
1950
|
+
/* @__PURE__ */ f("span", { children: "Loading sources for the selected trigger…" })
|
|
1951
1951
|
] }),
|
|
1952
|
-
p && /* @__PURE__ */
|
|
1952
|
+
p && /* @__PURE__ */ f("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: p })
|
|
1953
1953
|
] }),
|
|
1954
|
-
W && /* @__PURE__ */ w(
|
|
1954
|
+
W && /* @__PURE__ */ w(Se, { children: [
|
|
1955
1955
|
/* @__PURE__ */ w(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
1958
1958
|
role: "button",
|
|
1959
1959
|
tabIndex: 0,
|
|
1960
|
-
onClick:
|
|
1960
|
+
onClick: M,
|
|
1961
1961
|
onKeyDown: (P) => {
|
|
1962
|
-
P.key === "Enter" &&
|
|
1962
|
+
P.key === "Enter" && M();
|
|
1963
1963
|
},
|
|
1964
1964
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1965
1965
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1966
1966
|
children: [
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ f(Jt, { size: 16 }),
|
|
1968
|
+
/* @__PURE__ */ f("span", { children: n.addTriggerTitle })
|
|
1969
1969
|
]
|
|
1970
1970
|
}
|
|
1971
1971
|
),
|
|
1972
1972
|
/* @__PURE__ */ w("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
|
|
1973
1973
|
"Pick one or more sources for ",
|
|
1974
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ f("strong", { children: d.label }),
|
|
1975
1975
|
":"
|
|
1976
1976
|
] }),
|
|
1977
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ f(
|
|
1978
1978
|
rr,
|
|
1979
1979
|
{
|
|
1980
1980
|
isMulti: !0,
|
|
@@ -1991,16 +1991,16 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1991
1991
|
] })
|
|
1992
1992
|
}
|
|
1993
1993
|
);
|
|
1994
|
-
},
|
|
1994
|
+
}, Je = {
|
|
1995
1995
|
cursor: "pointer",
|
|
1996
1996
|
transition: "background 0.15s"
|
|
1997
|
-
},
|
|
1998
|
-
const { apps: i, ungrouped: s } =
|
|
1999
|
-
const
|
|
1997
|
+
}, Ze = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", os = ({ open: e, availableDescriptors: t, messages: n, onSelect: r, onClose: o }) => {
|
|
1998
|
+
const { apps: i, ungrouped: s } = V(() => {
|
|
1999
|
+
const u = /* @__PURE__ */ new Map(), h = [];
|
|
2000
2000
|
for (const g of t)
|
|
2001
2001
|
if (g.app) {
|
|
2002
|
-
const E =
|
|
2003
|
-
E ? E.descriptors.push(g) :
|
|
2002
|
+
const E = u.get(g.app.key);
|
|
2003
|
+
E ? E.descriptors.push(g) : u.set(g.app.key, {
|
|
2004
2004
|
key: g.app.key,
|
|
2005
2005
|
label: g.app.label,
|
|
2006
2006
|
icon: g.app.icon,
|
|
@@ -2009,52 +2009,52 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2009
2009
|
});
|
|
2010
2010
|
} else
|
|
2011
2011
|
h.push(g);
|
|
2012
|
-
return { apps: [...
|
|
2013
|
-
}, [t]), [l, d] = L(null), a = l ? i.find((
|
|
2012
|
+
return { apps: [...u.values()], ungrouped: h };
|
|
2013
|
+
}, [t]), [l, d] = L(null), a = l ? i.find((u) => u.key === l) ?? null : null;
|
|
2014
2014
|
se(() => {
|
|
2015
2015
|
e || d(null);
|
|
2016
2016
|
}, [e]), se(() => {
|
|
2017
2017
|
d(null);
|
|
2018
2018
|
}, [t]);
|
|
2019
2019
|
const c = !a;
|
|
2020
|
-
return /* @__PURE__ */
|
|
2021
|
-
|
|
2020
|
+
return /* @__PURE__ */ f(
|
|
2021
|
+
Ce,
|
|
2022
2022
|
{
|
|
2023
2023
|
isOpen: e,
|
|
2024
2024
|
onClose: o,
|
|
2025
2025
|
title: c ? n.addStepTitle : a.label,
|
|
2026
|
-
icon: c ? /* @__PURE__ */
|
|
2026
|
+
icon: c ? /* @__PURE__ */ f(lr, {}) : a.icon ?? /* @__PURE__ */ f(ar, {}),
|
|
2027
2027
|
width: 500,
|
|
2028
|
-
children: /* @__PURE__ */ w(
|
|
2028
|
+
children: /* @__PURE__ */ w(re, { sx: { p: 2 }, children: [
|
|
2029
2029
|
!c && /* @__PURE__ */ w(
|
|
2030
2030
|
"div",
|
|
2031
2031
|
{
|
|
2032
2032
|
role: "button",
|
|
2033
2033
|
tabIndex: 0,
|
|
2034
2034
|
onClick: () => d(null),
|
|
2035
|
-
onKeyDown: (
|
|
2036
|
-
|
|
2035
|
+
onKeyDown: (u) => {
|
|
2036
|
+
u.key === "Enter" && d(null);
|
|
2037
2037
|
},
|
|
2038
2038
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
2039
2039
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
2040
2040
|
children: [
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ f(Jt, { size: 16 }),
|
|
2042
|
+
/* @__PURE__ */ f("span", { children: n.addStepTitle })
|
|
2043
2043
|
]
|
|
2044
2044
|
}
|
|
2045
2045
|
),
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
i.map((
|
|
2046
|
+
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
|
|
2047
|
+
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(Se, { children: [
|
|
2048
|
+
i.map((u) => /* @__PURE__ */ w(
|
|
2049
2049
|
"div",
|
|
2050
2050
|
{
|
|
2051
|
-
className:
|
|
2052
|
-
style:
|
|
2053
|
-
onClick: () => d(
|
|
2051
|
+
className: Ze,
|
|
2052
|
+
style: Je,
|
|
2053
|
+
onClick: () => d(u.key),
|
|
2054
2054
|
role: "button",
|
|
2055
2055
|
tabIndex: 0,
|
|
2056
2056
|
onKeyDown: (h) => {
|
|
2057
|
-
h.key === "Enter" && d(
|
|
2057
|
+
h.key === "Enter" && d(u.key);
|
|
2058
2058
|
},
|
|
2059
2059
|
onMouseEnter: (h) => {
|
|
2060
2060
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -2063,26 +2063,26 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2063
2063
|
h.currentTarget.style.background = "";
|
|
2064
2064
|
},
|
|
2065
2065
|
children: [
|
|
2066
|
-
|
|
2066
|
+
u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
|
|
2067
2067
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label }),
|
|
2069
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: u.description ?? `${u.descriptors.length} action${u.descriptors.length === 1 ? "" : "s"}` })
|
|
2070
2070
|
] }),
|
|
2071
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ f(Zt, { size: 18, color: "#9e9e9e" })
|
|
2072
2072
|
]
|
|
2073
2073
|
},
|
|
2074
|
-
`app-${
|
|
2074
|
+
`app-${u.key}`
|
|
2075
2075
|
)),
|
|
2076
|
-
s.map((
|
|
2076
|
+
s.map((u) => /* @__PURE__ */ w(
|
|
2077
2077
|
"div",
|
|
2078
2078
|
{
|
|
2079
|
-
className:
|
|
2080
|
-
style:
|
|
2081
|
-
onClick: () => r(
|
|
2079
|
+
className: Ze,
|
|
2080
|
+
style: Je,
|
|
2081
|
+
onClick: () => r(u),
|
|
2082
2082
|
role: "button",
|
|
2083
2083
|
tabIndex: 0,
|
|
2084
2084
|
onKeyDown: (h) => {
|
|
2085
|
-
h.key === "Enter" && r(
|
|
2085
|
+
h.key === "Enter" && r(u);
|
|
2086
2086
|
},
|
|
2087
2087
|
onMouseEnter: (h) => {
|
|
2088
2088
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -2091,25 +2091,25 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2091
2091
|
h.currentTarget.style.background = "";
|
|
2092
2092
|
},
|
|
2093
2093
|
children: [
|
|
2094
|
-
|
|
2095
|
-
/* @__PURE__ */
|
|
2094
|
+
u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
|
|
2095
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label })
|
|
2096
2096
|
]
|
|
2097
2097
|
},
|
|
2098
|
-
|
|
2098
|
+
u.type
|
|
2099
2099
|
)),
|
|
2100
|
-
i.length === 0 && s.length === 0 && /* @__PURE__ */
|
|
2100
|
+
i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noActions })
|
|
2101
2101
|
] }) : (
|
|
2102
2102
|
/* Stage 2 — actions for the selected app */
|
|
2103
|
-
a.descriptors.map((
|
|
2103
|
+
a.descriptors.map((u) => /* @__PURE__ */ w(
|
|
2104
2104
|
"div",
|
|
2105
2105
|
{
|
|
2106
|
-
className:
|
|
2107
|
-
style:
|
|
2108
|
-
onClick: () => r(
|
|
2106
|
+
className: Ze,
|
|
2107
|
+
style: Je,
|
|
2108
|
+
onClick: () => r(u),
|
|
2109
2109
|
role: "button",
|
|
2110
2110
|
tabIndex: 0,
|
|
2111
2111
|
onKeyDown: (h) => {
|
|
2112
|
-
h.key === "Enter" && r(
|
|
2112
|
+
h.key === "Enter" && r(u);
|
|
2113
2113
|
},
|
|
2114
2114
|
onMouseEnter: (h) => {
|
|
2115
2115
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -2118,11 +2118,11 @@ const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2118
2118
|
h.currentTarget.style.background = "";
|
|
2119
2119
|
},
|
|
2120
2120
|
children: [
|
|
2121
|
-
|
|
2122
|
-
/* @__PURE__ */
|
|
2121
|
+
u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
|
|
2122
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label })
|
|
2123
2123
|
]
|
|
2124
2124
|
},
|
|
2125
|
-
|
|
2125
|
+
u.type
|
|
2126
2126
|
))
|
|
2127
2127
|
) })
|
|
2128
2128
|
] })
|
|
@@ -2139,31 +2139,31 @@ function Ut(e) {
|
|
|
2139
2139
|
}) : Array.isArray(e.fields) && e.fields.length > 0;
|
|
2140
2140
|
}
|
|
2141
2141
|
const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2142
|
-
const [l, d] = L({ layout: "flat", fields: [] }), [a, c] = L(!1), [
|
|
2142
|
+
const [l, d] = L({ layout: "flat", fields: [] }), [a, c] = L(!1), [u, h] = L(null), [g, E] = L({});
|
|
2143
2143
|
se(() => {
|
|
2144
2144
|
E((r == null ? void 0 : r[Kt]) ?? {});
|
|
2145
2145
|
}, [r, t]), se(() => {
|
|
2146
|
-
let
|
|
2146
|
+
let k = !1;
|
|
2147
2147
|
if (h(null), !n || !t || n.customPanel) {
|
|
2148
2148
|
d({ layout: "flat", fields: [] }), c(!1);
|
|
2149
2149
|
return;
|
|
2150
2150
|
}
|
|
2151
|
-
const
|
|
2152
|
-
return typeof
|
|
2153
|
-
|
|
2151
|
+
const M = n.formSchema;
|
|
2152
|
+
return typeof M == "function" ? (c(!0), M(t).then((z) => {
|
|
2153
|
+
k || (d(Ht(z)), c(!1));
|
|
2154
2154
|
}).catch((z) => {
|
|
2155
|
-
|
|
2156
|
-
})) : (d(Ht(
|
|
2157
|
-
|
|
2155
|
+
k || (d({ layout: "flat", fields: [] }), h(z instanceof Error ? z.message : "Unable to load configuration."), c(!1));
|
|
2156
|
+
})) : (d(Ht(M)), c(!1)), () => {
|
|
2157
|
+
k = !0;
|
|
2158
2158
|
};
|
|
2159
2159
|
}, [n, t]);
|
|
2160
|
-
const
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
|
|
2160
|
+
const b = t ? `node-config-form-${t}` : "node-config-form", p = !a && !u && Ut(l), x = p ? /* @__PURE__ */ w(Se, { children: [
|
|
2161
|
+
/* @__PURE__ */ f(Le, { type: "button", variant: "text", size: "small", sx: { textTransform: "none", color: "#475569" }, onClick: s, children: o.cancel }),
|
|
2162
|
+
/* @__PURE__ */ f(
|
|
2163
|
+
Le,
|
|
2164
2164
|
{
|
|
2165
2165
|
type: "submit",
|
|
2166
|
-
form:
|
|
2166
|
+
form: b,
|
|
2167
2167
|
variant: "contained",
|
|
2168
2168
|
size: "small",
|
|
2169
2169
|
disableElevation: !0,
|
|
@@ -2178,38 +2178,38 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2178
2178
|
}
|
|
2179
2179
|
)
|
|
2180
2180
|
] }) : null;
|
|
2181
|
-
return n != null && n.customPanel && t ? /* @__PURE__ */
|
|
2181
|
+
return n != null && n.customPanel && t ? /* @__PURE__ */ f(Ce, { isOpen: e, onClose: s, title: n.label ?? o.configureStep, icon: n.icon, width: 500, children: n.customPanel({
|
|
2182
2182
|
nodeId: t,
|
|
2183
2183
|
data: r ?? {},
|
|
2184
|
-
onSave: (
|
|
2185
|
-
i(t,
|
|
2184
|
+
onSave: (k) => {
|
|
2185
|
+
i(t, k), s();
|
|
2186
2186
|
},
|
|
2187
2187
|
onClose: s
|
|
2188
|
-
}) }) : /* @__PURE__ */
|
|
2189
|
-
|
|
2188
|
+
}) }) : /* @__PURE__ */ f(
|
|
2189
|
+
Ce,
|
|
2190
2190
|
{
|
|
2191
2191
|
isOpen: e,
|
|
2192
2192
|
onClose: s,
|
|
2193
2193
|
title: (n == null ? void 0 : n.label) ?? o.configureStep,
|
|
2194
2194
|
icon: n == null ? void 0 : n.icon,
|
|
2195
2195
|
width: 500,
|
|
2196
|
-
footer:
|
|
2197
|
-
children: /* @__PURE__ */ w(
|
|
2198
|
-
a && /* @__PURE__ */
|
|
2199
|
-
!a &&
|
|
2200
|
-
!a && !
|
|
2201
|
-
p && /* @__PURE__ */
|
|
2196
|
+
footer: x,
|
|
2197
|
+
children: /* @__PURE__ */ w(re, { sx: { p: 2 }, children: [
|
|
2198
|
+
a && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2199
|
+
!a && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
|
|
2200
|
+
!a && !u && !Ut(l) && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2201
|
+
p && /* @__PURE__ */ f(
|
|
2202
2202
|
xr,
|
|
2203
2203
|
{
|
|
2204
2204
|
schema: l,
|
|
2205
2205
|
initialValues: r ?? {},
|
|
2206
|
-
formId:
|
|
2206
|
+
formId: b,
|
|
2207
2207
|
conditionConfig: g,
|
|
2208
2208
|
onConditionConfigChange: E,
|
|
2209
|
-
onSubmit: (
|
|
2209
|
+
onSubmit: (k) => {
|
|
2210
2210
|
if (!t) return;
|
|
2211
|
-
const
|
|
2212
|
-
i(t, { ...
|
|
2211
|
+
const M = Object.keys(g).length > 0;
|
|
2212
|
+
i(t, { ...k, [Kt]: M ? g : void 0 }), s();
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
2215
|
)
|
|
@@ -2230,26 +2230,26 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2230
2230
|
return;
|
|
2231
2231
|
}
|
|
2232
2232
|
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" }));
|
|
2233
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2234
|
-
|
|
2233
|
+
}, [e, n, o]), /* @__PURE__ */ f(
|
|
2234
|
+
Ce,
|
|
2235
2235
|
{
|
|
2236
2236
|
isOpen: e,
|
|
2237
2237
|
onClose: t,
|
|
2238
2238
|
title: r ? `Preview: ${r}` : "Sub-Workflow Preview",
|
|
2239
|
-
icon: /* @__PURE__ */
|
|
2239
|
+
icon: /* @__PURE__ */ f(cr, { size: 18, color: "#00695c" }),
|
|
2240
2240
|
width: 700,
|
|
2241
2241
|
children: /* @__PURE__ */ w("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
2242
|
-
i.status === "idle" && /* @__PURE__ */
|
|
2242
|
+
i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
2243
2243
|
i.status === "loading" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
|
|
2244
|
-
/* @__PURE__ */
|
|
2245
|
-
/* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ f("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
|
|
2245
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
|
|
2246
|
+
/* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
2247
2247
|
] }),
|
|
2248
2248
|
i.status === "error" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
2249
|
-
/* @__PURE__ */
|
|
2250
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ f(dr, { size: 32, style: { marginBottom: 8 } }),
|
|
2250
|
+
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
2251
2251
|
] }),
|
|
2252
|
-
i.status === "loaded" && /* @__PURE__ */
|
|
2252
|
+
i.status === "loaded" && /* @__PURE__ */ f("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ f(ls, { state: i.state }) })
|
|
2253
2253
|
] })
|
|
2254
2254
|
}
|
|
2255
2255
|
);
|
|
@@ -2263,7 +2263,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2263
2263
|
]).then(([i, s, l]) => {
|
|
2264
2264
|
n(() => i), o({ nodeTypeRegistry: s, templateRegistry: l });
|
|
2265
2265
|
});
|
|
2266
|
-
}, []), !t || !r ? /* @__PURE__ */
|
|
2266
|
+
}, []), !t || !r ? /* @__PURE__ */ f("div", { style: { color: "#9e9e9e", fontSize: 13, textAlign: "center" }, children: "Loading canvas…" }) : /* @__PURE__ */ f("div", { style: { width: "100%", height: 480, border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: /* @__PURE__ */ f(
|
|
2267
2267
|
t,
|
|
2268
2268
|
{
|
|
2269
2269
|
nodeRegistry: r.nodeTypeRegistry,
|
|
@@ -2272,7 +2272,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2272
2272
|
readOnly: !0
|
|
2273
2273
|
}
|
|
2274
2274
|
) });
|
|
2275
|
-
},
|
|
2275
|
+
}, me = 350, tt = 70, nt = 60, rt = {
|
|
2276
2276
|
startNode: 40,
|
|
2277
2277
|
endNode: 40,
|
|
2278
2278
|
addTriggerNode: 56,
|
|
@@ -2299,61 +2299,61 @@ function Vt() {
|
|
|
2299
2299
|
function ds(e, t, n, r = "TB") {
|
|
2300
2300
|
const o = new Yt.graphlib.Graph();
|
|
2301
2301
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2302
|
-
const s = n[i.id] ?? { width:
|
|
2302
|
+
const s = n[i.id] ?? { width: me, height: rt[i.type ?? ""] ?? 80 };
|
|
2303
2303
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2304
2304
|
}), t.forEach((i) => o.setEdge(i.source, i.target)), Yt.layout(o), e.map((i) => {
|
|
2305
2305
|
var a, c;
|
|
2306
|
-
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ??
|
|
2306
|
+
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? me, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? rt[i.type ?? ""] ?? 80;
|
|
2307
2307
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
|
-
const
|
|
2310
|
+
const ue = (e) => e === "filter" || e === "approval";
|
|
2311
2311
|
function cs(e, t, n, r) {
|
|
2312
|
-
const s =
|
|
2313
|
-
for (const p of e)
|
|
2312
|
+
const s = tt, l = 30, d = 30, a = {}, c = {}, u = /* @__PURE__ */ new Map();
|
|
2313
|
+
for (const p of e) u.set(p.id, p);
|
|
2314
2314
|
for (const p of Object.values(t))
|
|
2315
|
-
for (const
|
|
2316
|
-
for (const
|
|
2317
|
-
const h = (p,
|
|
2318
|
-
const
|
|
2319
|
-
return a[p] = { x:
|
|
2320
|
-
}, g = (p,
|
|
2321
|
-
let
|
|
2315
|
+
for (const x of Object.values(p))
|
|
2316
|
+
for (const k of x) u.set(k.id, k);
|
|
2317
|
+
const h = (p, x, k) => {
|
|
2318
|
+
const M = r[p] ?? { width: me, height: 80 };
|
|
2319
|
+
return a[p] = { x: x - M.width / 2, y: k }, k + M.height;
|
|
2320
|
+
}, g = (p, x, k) => {
|
|
2321
|
+
let M = k;
|
|
2322
2322
|
for (const z of p)
|
|
2323
|
-
|
|
2324
|
-
return
|
|
2325
|
-
}, E = (p,
|
|
2326
|
-
const
|
|
2327
|
-
if ((
|
|
2328
|
-
const ie = [];
|
|
2329
|
-
let
|
|
2323
|
+
M = h(z.id, x, M) + s, ue(z.kind) && t[z.id] && (M = E(z.id, x, M));
|
|
2324
|
+
return M;
|
|
2325
|
+
}, E = (p, x, k) => {
|
|
2326
|
+
const M = x + 180, z = t[p], W = Object.keys(z), G = u.get(p), P = (G == null ? void 0 : G.branchLabels) ?? { pass: "Pass", fail: "Fail" }, I = a[p], Y = r[p] ?? { width: me, height: 80 }, J = I.y + Y.height;
|
|
2327
|
+
if ((G == null ? void 0 : G.branchStyle) === "inline-gate") {
|
|
2328
|
+
const ie = [], he = x + Y.width / 2 + 140;
|
|
2329
|
+
let te = I.y + Y.height / 2;
|
|
2330
2330
|
W.slice(1).forEach((ge) => {
|
|
2331
|
-
var
|
|
2332
|
-
ie.push({ y:
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2331
|
+
var we, Ee;
|
|
2332
|
+
ie.push({ y: te - J, label: P[ge] ?? ge, isPass: !1 });
|
|
2333
|
+
const De = te - (((Ee = r[(we = z[ge][0]) == null ? void 0 : we.id]) == null ? void 0 : Ee.height) ?? 50) / 2;
|
|
2334
|
+
te = g(z[ge], he, De) + l;
|
|
2335
2335
|
});
|
|
2336
|
-
const
|
|
2337
|
-
return c[p] = { branches: ie, height: Math.max(
|
|
2336
|
+
const Ie = g(z[W[0]], x, k);
|
|
2337
|
+
return c[p] = { branches: ie, height: Math.max(te, Ie) - J, indent: 180 }, Math.max(Ie, te);
|
|
2338
2338
|
}
|
|
2339
2339
|
const le = [];
|
|
2340
|
-
let A =
|
|
2341
|
-
return W.forEach((ie,
|
|
2342
|
-
const
|
|
2340
|
+
let A = k;
|
|
2341
|
+
return W.forEach((ie, he) => {
|
|
2342
|
+
const Oe = z[ie], te = A;
|
|
2343
2343
|
le.push({
|
|
2344
|
-
y:
|
|
2344
|
+
y: te - J,
|
|
2345
2345
|
label: P[ie] ?? ie,
|
|
2346
|
-
isPass:
|
|
2347
|
-
}), A = g(
|
|
2346
|
+
isPass: he === 0
|
|
2347
|
+
}), A = g(Oe, M, A + d), he < W.length - 1 && (A += l);
|
|
2348
2348
|
}), c[p] = {
|
|
2349
2349
|
branches: le,
|
|
2350
|
-
height: A -
|
|
2350
|
+
height: A - J,
|
|
2351
2351
|
indent: 180
|
|
2352
2352
|
}, A;
|
|
2353
2353
|
};
|
|
2354
|
-
let
|
|
2354
|
+
let b = nt;
|
|
2355
2355
|
for (const p of e)
|
|
2356
|
-
|
|
2356
|
+
b = h(p.id, 400, b) + s, ue(p.kind) && t[p.id] && (b = E(p.id, 400, b));
|
|
2357
2357
|
return {
|
|
2358
2358
|
nodes: n.map((p) => a[p.id] ? { ...p, position: a[p.id] } : p),
|
|
2359
2359
|
railSpecs: c
|
|
@@ -2369,7 +2369,7 @@ function qt(e) {
|
|
|
2369
2369
|
selectable: !1
|
|
2370
2370
|
};
|
|
2371
2371
|
}
|
|
2372
|
-
function
|
|
2372
|
+
function us(e, t, n, r, o) {
|
|
2373
2373
|
return {
|
|
2374
2374
|
id: `e-${e.id}-${t.id}`,
|
|
2375
2375
|
source: e.id,
|
|
@@ -2383,91 +2383,97 @@ function fs(e, t, n, r, o) {
|
|
|
2383
2383
|
}
|
|
2384
2384
|
};
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2387
|
-
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (
|
|
2388
|
-
const
|
|
2389
|
-
if (!
|
|
2390
|
-
const z = p ?? { pass: "Pass", fail: "Fail" }, W = Object.keys(
|
|
2391
|
-
if (
|
|
2392
|
-
|
|
2393
|
-
id: `e-${
|
|
2394
|
-
source:
|
|
2386
|
+
function fs(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
2387
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (b, p, x) => {
|
|
2388
|
+
const k = t[b];
|
|
2389
|
+
if (!k) return;
|
|
2390
|
+
const z = p ?? { pass: "Pass", fail: "Fail" }, W = Object.keys(k), G = x === "inline-gate", P = (I, Y, J, le) => {
|
|
2391
|
+
if (I.length !== 0) {
|
|
2392
|
+
I.forEach((A) => d.push(qt(A))), G && le === 0 ? a.push({
|
|
2393
|
+
id: `e-${b}-${Y}-start`,
|
|
2394
|
+
source: b,
|
|
2395
2395
|
sourceHandle: "pass",
|
|
2396
|
-
target:
|
|
2397
|
-
type: "
|
|
2396
|
+
target: I[0].id,
|
|
2397
|
+
type: "gatewayBranchEdge",
|
|
2398
|
+
style: { stroke: l },
|
|
2399
|
+
data: { branch: Y, filterId: b, label: J, isFirst: !0, onAddStepClick: n, verticalRouting: !0, railless: !0 }
|
|
2400
|
+
}) : G ? a.push({
|
|
2401
|
+
id: `e-${b}-${Y}-start`,
|
|
2402
|
+
source: b,
|
|
2403
|
+
sourceHandle: "fail",
|
|
2404
|
+
target: I[0].id,
|
|
2405
|
+
targetHandle: "left",
|
|
2406
|
+
type: "gatewayBranchEdge",
|
|
2398
2407
|
style: { stroke: l },
|
|
2399
|
-
data: {
|
|
2408
|
+
data: { branch: Y, filterId: b, label: J, isFirst: !1, sideRouting: !0 }
|
|
2400
2409
|
}) : a.push({
|
|
2401
|
-
id: `e-${
|
|
2402
|
-
source:
|
|
2403
|
-
|
|
2404
|
-
// to the side instead of tangling with the Pass edge at the bottom.
|
|
2405
|
-
...$ ? { sourceHandle: "fail" } : {},
|
|
2406
|
-
target: M[0].id,
|
|
2410
|
+
id: `e-${b}-${Y}-start`,
|
|
2411
|
+
source: b,
|
|
2412
|
+
target: I[0].id,
|
|
2407
2413
|
type: "gatewayBranchEdge",
|
|
2408
2414
|
style: { stroke: l },
|
|
2409
|
-
data: { branch:
|
|
2415
|
+
data: { branch: Y, filterId: b, label: J, isFirst: le === 0, onAddStepClick: n, verticalRouting: s === "vertical" }
|
|
2410
2416
|
});
|
|
2411
|
-
for (let A = 1; A <
|
|
2412
|
-
|
|
2413
|
-
for (const A of
|
|
2414
|
-
|
|
2417
|
+
for (let A = 1; A < I.length; A++)
|
|
2418
|
+
ue(I[A - 1].kind) || a.push(us(I[A - 1], I[A], l, n, { filterId: b, branch: Y }));
|
|
2419
|
+
for (const A of I)
|
|
2420
|
+
ue(A.kind) && t[A.id] && c(A.id, A.branchLabels, A.branchStyle);
|
|
2415
2421
|
}
|
|
2416
2422
|
};
|
|
2417
|
-
W.forEach((
|
|
2418
|
-
P(
|
|
2423
|
+
W.forEach((I, Y) => {
|
|
2424
|
+
P(k[I], I, z[I] ?? I, Y);
|
|
2419
2425
|
});
|
|
2420
2426
|
};
|
|
2421
|
-
for (let
|
|
2422
|
-
const p = e[
|
|
2423
|
-
if (d.push(qt(p)),
|
|
2424
|
-
const
|
|
2425
|
-
if (
|
|
2427
|
+
for (let b = 0; b < e.length; b++) {
|
|
2428
|
+
const p = e[b];
|
|
2429
|
+
if (d.push(qt(p)), b > 0) {
|
|
2430
|
+
const x = e[b - 1], k = x.kind === "start" || x.kind === "addTrigger";
|
|
2431
|
+
if (x.kind === "filter" || x.kind === "approval") continue;
|
|
2426
2432
|
a.push({
|
|
2427
|
-
id: `e-${
|
|
2428
|
-
source:
|
|
2433
|
+
id: `e-${x.id}-${p.id}`,
|
|
2434
|
+
source: x.id,
|
|
2429
2435
|
target: p.id,
|
|
2430
|
-
type:
|
|
2436
|
+
type: k ? "plainEdge" : "plusEdge",
|
|
2431
2437
|
style: { stroke: l },
|
|
2432
|
-
data:
|
|
2438
|
+
data: k ? {} : {
|
|
2433
2439
|
onAddStepClick: n,
|
|
2434
|
-
referenceNodeType:
|
|
2440
|
+
referenceNodeType: x.reactFlowType
|
|
2435
2441
|
}
|
|
2436
2442
|
});
|
|
2437
2443
|
}
|
|
2438
2444
|
(p.kind === "filter" || p.kind === "approval") && t[p.id] && c(p.id, p.branchLabels, p.branchStyle);
|
|
2439
2445
|
}
|
|
2440
|
-
const
|
|
2441
|
-
if (d.forEach((
|
|
2442
|
-
|
|
2443
|
-
width:
|
|
2444
|
-
height: r[
|
|
2446
|
+
const u = {};
|
|
2447
|
+
if (d.forEach((b) => {
|
|
2448
|
+
u[b.id] = {
|
|
2449
|
+
width: me,
|
|
2450
|
+
height: r[b.id] ?? rt[b.type ?? ""] ?? 80
|
|
2445
2451
|
};
|
|
2446
2452
|
}), !(Object.keys(t).length > 0)) {
|
|
2447
2453
|
if (i === "LR") {
|
|
2448
|
-
let
|
|
2454
|
+
let M = nt;
|
|
2449
2455
|
return { nodes: d.map((W) => {
|
|
2450
|
-
const
|
|
2451
|
-
return
|
|
2456
|
+
const G = u[W.id].width, P = u[W.id].height, I = { ...W, position: { x: M, y: 300 - P / 2 } };
|
|
2457
|
+
return M += G + tt, I;
|
|
2452
2458
|
}), edges: a };
|
|
2453
2459
|
}
|
|
2454
|
-
const
|
|
2455
|
-
let p =
|
|
2456
|
-
return { nodes: d.map((
|
|
2457
|
-
const
|
|
2458
|
-
return p +=
|
|
2460
|
+
const b = 400;
|
|
2461
|
+
let p = nt;
|
|
2462
|
+
return { nodes: d.map((k) => {
|
|
2463
|
+
const M = u[k.id].height, z = { ...k, position: { x: b - me / 2, y: p } };
|
|
2464
|
+
return p += M + tt, z;
|
|
2459
2465
|
}), edges: a };
|
|
2460
2466
|
}
|
|
2461
|
-
const g = e.some((
|
|
2462
|
-
(
|
|
2467
|
+
const g = e.some((b) => b.branchStyle === "inline-gate") || Object.values(t).some(
|
|
2468
|
+
(b) => Object.values(b).flat().some((p) => p.branchStyle === "inline-gate")
|
|
2463
2469
|
);
|
|
2464
2470
|
if (s === "vertical" || g) {
|
|
2465
|
-
const { nodes:
|
|
2466
|
-
return { nodes:
|
|
2467
|
-
(
|
|
2471
|
+
const { nodes: b, railSpecs: p } = cs(e, t, d, u);
|
|
2472
|
+
return { nodes: b.map(
|
|
2473
|
+
(k) => p[k.id] ? { ...k, data: { ...k.data, _branchRail: p[k.id] } } : k
|
|
2468
2474
|
), edges: a };
|
|
2469
2475
|
}
|
|
2470
|
-
return { nodes: ds(d, a,
|
|
2476
|
+
return { nodes: ds(d, a, u, i), edges: a };
|
|
2471
2477
|
}
|
|
2472
2478
|
const Xt = ({
|
|
2473
2479
|
nodeRegistry: e,
|
|
@@ -2481,109 +2487,109 @@ const Xt = ({
|
|
|
2481
2487
|
messages: d,
|
|
2482
2488
|
canvasOptions: a = {},
|
|
2483
2489
|
renderTriggerSelector: c,
|
|
2484
|
-
loadTriggerSources:
|
|
2490
|
+
loadTriggerSources: u,
|
|
2485
2491
|
renderNodePicker: h,
|
|
2486
2492
|
renderNodeConfig: g,
|
|
2487
2493
|
onNodeClick: E,
|
|
2488
|
-
maxNodes:
|
|
2494
|
+
maxNodes: b,
|
|
2489
2495
|
layoutDirection: p = "TB",
|
|
2490
|
-
executionRecord:
|
|
2491
|
-
onFetchWorkflow:
|
|
2492
|
-
hideHeader:
|
|
2496
|
+
executionRecord: x,
|
|
2497
|
+
onFetchWorkflow: k,
|
|
2498
|
+
hideHeader: M = !1,
|
|
2493
2499
|
workflowName: z,
|
|
2494
2500
|
onWorkflowNameChange: W,
|
|
2495
|
-
onCancel:
|
|
2501
|
+
onCancel: G,
|
|
2496
2502
|
workflowStatus: P,
|
|
2497
|
-
workflowStatusColor:
|
|
2498
|
-
saveLabel:
|
|
2499
|
-
optionsResolvers:
|
|
2503
|
+
workflowStatusColor: I,
|
|
2504
|
+
saveLabel: Y,
|
|
2505
|
+
optionsResolvers: J
|
|
2500
2506
|
}) => {
|
|
2501
2507
|
const {
|
|
2502
2508
|
fitView: le = !0,
|
|
2503
2509
|
fitViewPadding: A = 0.3,
|
|
2504
2510
|
showControls: ie = !0,
|
|
2505
|
-
showMiniMap:
|
|
2506
|
-
panOnScroll:
|
|
2507
|
-
zoomOnScroll:
|
|
2508
|
-
minZoom:
|
|
2509
|
-
maxZoom:
|
|
2510
|
-
snapToGrid:
|
|
2511
|
-
snapGrid:
|
|
2511
|
+
showMiniMap: he = !1,
|
|
2512
|
+
panOnScroll: Oe = !0,
|
|
2513
|
+
zoomOnScroll: te = !1,
|
|
2514
|
+
minZoom: Ie = 0.25,
|
|
2515
|
+
maxZoom: ge = 2,
|
|
2516
|
+
snapToGrid: De = !1,
|
|
2517
|
+
snapGrid: ct = [15, 15],
|
|
2512
2518
|
branchLayout: we = "horizontal",
|
|
2513
|
-
nodeBody:
|
|
2514
|
-
} = a,
|
|
2519
|
+
nodeBody: Ee = "full"
|
|
2520
|
+
} = a, xe = V(() => _r(d), [d]), [R, ae] = L(() => (n == null ? void 0 : n.slots) ?? Vt()), [K, ne] = L(() => (n == null ? void 0 : n.branches) ?? {}), [pe, X] = L(null), [We, ut] = L(null), [Z, Me] = L(null), [de, ft] = L(null), [je, ht] = L(null), [j, gt] = L(() => {
|
|
2515
2521
|
const y = n == null ? void 0 : n.slots.find((S) => S.kind === "triggerFixed"), v = y != null && y.id.startsWith("trigger-") ? y.id.slice(8) : void 0;
|
|
2516
2522
|
return v ? t.lookup(v) ?? null : null;
|
|
2517
|
-
}), [pt, Mn] = L({}), jn =
|
|
2523
|
+
}), [pt, Mn] = L({}), jn = U((y) => {
|
|
2518
2524
|
Mn(y);
|
|
2519
|
-
}, []), zn =
|
|
2520
|
-
const y = R.filter((S) => S.kind === "userTask").length, v = Object.values(
|
|
2525
|
+
}, []), zn = V(() => ({ ...Un, ...r }), [r]), Ln = V(() => ({ ...as, ...o }), [o]), Pn = V(() => {
|
|
2526
|
+
const y = R.filter((S) => S.kind === "userTask").length, v = Object.values(K).flatMap((S) => Object.values(S).flat()).filter((S) => S.kind === "userTask").length;
|
|
2521
2527
|
return y + v;
|
|
2522
|
-
}, [R,
|
|
2528
|
+
}, [R, K]), yt = b ?? (j == null ? void 0 : j.maxTasks), bt = yt !== void 0 && Pn >= yt, ce = U((y) => {
|
|
2523
2529
|
const v = R.find((S) => S.id === y);
|
|
2524
2530
|
if (v) return v;
|
|
2525
|
-
for (const S of Object.values(
|
|
2531
|
+
for (const S of Object.values(K)) {
|
|
2526
2532
|
const C = Object.values(S).flat().find((T) => T.id === y);
|
|
2527
2533
|
if (C) return C;
|
|
2528
2534
|
}
|
|
2529
2535
|
return null;
|
|
2530
|
-
}, [R,
|
|
2531
|
-
s || (
|
|
2532
|
-
}, [s]), mt =
|
|
2536
|
+
}, [R, K]), $e = U((y) => {
|
|
2537
|
+
s || (ut(y), X("nodeConfig"));
|
|
2538
|
+
}, [s]), mt = U((y) => {
|
|
2533
2539
|
if (!s) {
|
|
2534
2540
|
if (R.some((v) => v.id === y)) {
|
|
2535
2541
|
const v = R.find((S) => S.id === y);
|
|
2536
2542
|
if ((v == null ? void 0 : v.kind) === "triggerFixed") {
|
|
2537
|
-
ae(Vt()),
|
|
2543
|
+
ae(Vt()), ne({}), gt(null);
|
|
2538
2544
|
return;
|
|
2539
2545
|
}
|
|
2540
2546
|
ae((S) => {
|
|
2541
2547
|
const C = S.filter((T) => T.id !== y);
|
|
2542
|
-
return
|
|
2543
|
-
}),
|
|
2544
|
-
const C = { ...S }, T = (
|
|
2545
|
-
C[
|
|
2548
|
+
return ue((v == null ? void 0 : v.kind) ?? "") && !C.some((T) => T.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2549
|
+
}), ne((S) => {
|
|
2550
|
+
const C = { ...S }, T = (m) => {
|
|
2551
|
+
C[m] && (Object.values(C[m]).flat().filter((N) => ue(N.kind)).forEach((N) => T(N.id)), delete C[m]);
|
|
2546
2552
|
};
|
|
2547
2553
|
return T(y), C;
|
|
2548
2554
|
});
|
|
2549
2555
|
return;
|
|
2550
2556
|
}
|
|
2551
|
-
|
|
2552
|
-
const S = (T,
|
|
2557
|
+
ne((v) => {
|
|
2558
|
+
const S = (T, m) => {
|
|
2553
2559
|
const N = [];
|
|
2554
2560
|
for (const _ of T)
|
|
2555
|
-
|
|
2561
|
+
ue(_.kind) && m[_.id] && (N.push(_.id), Object.values(m[_.id]).forEach((O) => N.push(...S(O, m))));
|
|
2556
2562
|
return N;
|
|
2557
2563
|
}, C = { ...v };
|
|
2558
2564
|
for (const T of Object.keys(C))
|
|
2559
|
-
for (const
|
|
2560
|
-
const N = C[T][
|
|
2565
|
+
for (const m of Object.keys(C[T])) {
|
|
2566
|
+
const N = C[T][m], _ = N.findIndex((F) => F.id === y);
|
|
2561
2567
|
if (_ === -1 || N[_].kind === "end") continue;
|
|
2562
|
-
const
|
|
2568
|
+
const O = N[_];
|
|
2563
2569
|
let B = N.filter((F) => F.id !== y);
|
|
2564
|
-
return
|
|
2570
|
+
return O.kind === "filter" && ((O.id in C ? S([O], C) : []).forEach((D) => delete C[D]), delete C[O.id], B.some((D) => D.kind === "end") || (B = [...B, { id: `end-${T}-${m}`, kind: "end", reactFlowType: "endNode" }])), C[T] = { ...C[T], [m]: B }, C;
|
|
2565
2571
|
}
|
|
2566
2572
|
return C;
|
|
2567
2573
|
});
|
|
2568
2574
|
}
|
|
2569
|
-
}, [s, R]),
|
|
2575
|
+
}, [s, R]), Ge = U(() => {
|
|
2570
2576
|
s || X("triggerSelect");
|
|
2571
|
-
}, [s]), vt =
|
|
2572
|
-
s || bt || (
|
|
2573
|
-
}, [s, bt]), wt =
|
|
2577
|
+
}, [s]), vt = U((y, v) => {
|
|
2578
|
+
s || bt || (Me(y), ft(v.filterId && v.branch ? { filterId: v.filterId, branch: v.branch } : null), X("nodePicker"));
|
|
2579
|
+
}, [s, bt]), wt = U((y, v) => {
|
|
2574
2580
|
if (gt(y), X(null), y.skeletonState) {
|
|
2575
|
-
const C = Array.isArray(v) && v.length > 0, T = (y.skeletonState.slots ?? []).map((
|
|
2576
|
-
...
|
|
2581
|
+
const C = Array.isArray(v) && v.length > 0, T = (y.skeletonState.slots ?? []).map((m) => m.kind !== "triggerFixed" ? m : {
|
|
2582
|
+
...m,
|
|
2577
2583
|
nodeData: {
|
|
2578
2584
|
label: y.label,
|
|
2579
|
-
...
|
|
2585
|
+
...m.nodeData ?? {},
|
|
2580
2586
|
...C && { sources: v }
|
|
2581
2587
|
}
|
|
2582
2588
|
});
|
|
2583
|
-
|
|
2589
|
+
ne(y.skeletonState.branches ?? {}), ae(T);
|
|
2584
2590
|
return;
|
|
2585
2591
|
}
|
|
2586
|
-
|
|
2592
|
+
ne({});
|
|
2587
2593
|
const S = Array.isArray(v) && v.length > 0;
|
|
2588
2594
|
ae([
|
|
2589
2595
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
@@ -2602,7 +2608,7 @@ const Xt = ({
|
|
|
2602
2608
|
},
|
|
2603
2609
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2604
2610
|
]);
|
|
2605
|
-
}, []), Et =
|
|
2611
|
+
}, []), Et = U(() => {
|
|
2606
2612
|
var S;
|
|
2607
2613
|
const y = {
|
|
2608
2614
|
insertAfterSlot: null,
|
|
@@ -2611,25 +2617,25 @@ const Xt = ({
|
|
|
2611
2617
|
branch: de,
|
|
2612
2618
|
template: j
|
|
2613
2619
|
};
|
|
2614
|
-
if (!
|
|
2620
|
+
if (!Z) return y;
|
|
2615
2621
|
if (de) {
|
|
2616
|
-
const { filterId: C, branch: T } = de,
|
|
2617
|
-
return y.upstreamSlots = [...N, ...B], y.downstreamSlots =
|
|
2622
|
+
const { filterId: C, branch: T } = de, m = R.findIndex((F) => F.id === C), N = m >= 0 ? R.slice(0, m + 1) : [], _ = ((S = K[C]) == null ? void 0 : S[T]) ?? [], O = _.findIndex((F) => F.id === Z), B = O >= 0 ? _.slice(0, O + 1) : [];
|
|
2623
|
+
return y.upstreamSlots = [...N, ...B], y.downstreamSlots = O >= 0 ? _.slice(O + 1) : _, y.insertAfterSlot = B[B.length - 1] ?? null, y;
|
|
2618
2624
|
}
|
|
2619
|
-
const v = R.findIndex((C) => C.id ===
|
|
2625
|
+
const v = R.findIndex((C) => C.id === Z);
|
|
2620
2626
|
return y.upstreamSlots = v >= 0 ? R.slice(0, v + 1) : [], y.downstreamSlots = v >= 0 ? R.slice(v + 1) : [], y.insertAfterSlot = y.upstreamSlots[y.upstreamSlots.length - 1] ?? null, y;
|
|
2621
|
-
}, [R,
|
|
2622
|
-
const y = e.list(), v = j != null && j.availableTasks ? y.filter((
|
|
2627
|
+
}, [R, K, Z, de, j]), Ye = (y, v) => y.descriptorType === v || y.id === v || y.kind === v, xt = U(() => {
|
|
2628
|
+
const y = e.list(), v = j != null && j.availableTasks ? y.filter((m) => j.availableTasks.includes(m.type)) : y, S = Et(), C = [
|
|
2623
2629
|
...R,
|
|
2624
|
-
...Object.values(
|
|
2625
|
-
], T = (
|
|
2626
|
-
return v.filter((
|
|
2627
|
-
(_) =>
|
|
2628
|
-
) ||
|
|
2629
|
-
(_) =>
|
|
2630
|
+
...Object.values(K).flatMap((m) => Object.values(m).flat())
|
|
2631
|
+
], T = (m) => C.some((N) => m.some((_) => Ye(N, _)));
|
|
2632
|
+
return v.filter((m) => m.maxPerWorkflow !== void 0 && R.filter((_) => _.descriptorType === m.type).length + Object.values(K).flatMap((_) => Object.values(_).flat()).filter((_) => _.descriptorType === m.type).length >= m.maxPerWorkflow ? !1 : m.canInsert ? m.canInsert(S) : !(m.insertAfter && m.insertAfter.length > 0 && T(m.insertAfter) && !S.upstreamSlots.some(
|
|
2633
|
+
(_) => m.insertAfter.some((O) => Ye(_, O))
|
|
2634
|
+
) || m.insertBefore && m.insertBefore.length > 0 && T(m.insertBefore) && !S.downstreamSlots.some(
|
|
2635
|
+
(_) => m.insertBefore.some((O) => Ye(_, O))
|
|
2630
2636
|
)));
|
|
2631
|
-
}, [e, j, R,
|
|
2632
|
-
if (!
|
|
2637
|
+
}, [e, j, R, K, Et]), kt = U((y) => {
|
|
2638
|
+
if (!Z) return;
|
|
2633
2639
|
const v = `${y.type}-${Date.now()}`, S = y.reactFlowType === "filterNode" || y.reactFlowType === "approvalNode" || y.reactFlowType === "conditionBranchNode", C = y.branchLabels ?? { pass: "Pass", fail: "Fail" }, T = {
|
|
2634
2640
|
id: v,
|
|
2635
2641
|
kind: S ? y.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
@@ -2642,45 +2648,45 @@ const Xt = ({
|
|
|
2642
2648
|
...y.branchStyle ? { branchStyle: y.branchStyle } : {}
|
|
2643
2649
|
};
|
|
2644
2650
|
if (de) {
|
|
2645
|
-
const { filterId:
|
|
2646
|
-
|
|
2647
|
-
const
|
|
2651
|
+
const { filterId: m, branch: N } = de;
|
|
2652
|
+
ne((_) => {
|
|
2653
|
+
const O = [..._[m][N]];
|
|
2648
2654
|
if (S) {
|
|
2649
|
-
const
|
|
2650
|
-
return
|
|
2655
|
+
const Q = O.filter((ye) => ye.kind !== "end"), ke = Q.findIndex((ye) => ye.id === Z), Dn = ke === -1 ? Q.length : ke + 1;
|
|
2656
|
+
return Q.splice(Dn, 0, T), {
|
|
2651
2657
|
..._,
|
|
2652
|
-
[
|
|
2658
|
+
[m]: { ..._[m], [N]: Q },
|
|
2653
2659
|
[v]: Object.fromEntries(
|
|
2654
2660
|
Object.keys(C).map((ye) => [ye, [{ id: `end-${v}-${ye}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2655
2661
|
)
|
|
2656
2662
|
};
|
|
2657
2663
|
}
|
|
2658
|
-
const B =
|
|
2659
|
-
return
|
|
2664
|
+
const B = O.findIndex((Q) => Q.id === Z), F = O.findIndex((Q) => Q.kind === "end"), D = B === -1 ? F === -1 ? O.length : F : B + 1;
|
|
2665
|
+
return O.splice(D, 0, T), { ..._, [m]: { ..._[m], [N]: O } };
|
|
2660
2666
|
});
|
|
2661
2667
|
} else if (S) {
|
|
2662
|
-
const
|
|
2668
|
+
const m = y.branchStyle === "inline-gate", N = R.filter((F) => F.kind !== "end"), _ = N.findIndex((F) => F.id === Z), O = _ >= 0 ? N.slice(_ + 1) : [];
|
|
2663
2669
|
ae(() => [...N.slice(0, _ + 1), T]);
|
|
2664
2670
|
const B = Object.keys(C);
|
|
2665
|
-
|
|
2671
|
+
ne((F) => ({
|
|
2666
2672
|
...F,
|
|
2667
2673
|
[v]: Object.fromEntries(
|
|
2668
|
-
B.map((D,
|
|
2669
|
-
const
|
|
2670
|
-
return
|
|
2674
|
+
B.map((D, Q) => {
|
|
2675
|
+
const ke = { id: `end-${v}-${D}`, kind: "end", reactFlowType: "endNode" };
|
|
2676
|
+
return m && Q === 0 && O.length > 0 ? [D, [...O, ke]] : [D, [ke]];
|
|
2671
2677
|
})
|
|
2672
2678
|
)
|
|
2673
2679
|
}));
|
|
2674
2680
|
} else
|
|
2675
|
-
ae((
|
|
2676
|
-
const N =
|
|
2677
|
-
return N === -1 ?
|
|
2681
|
+
ae((m) => {
|
|
2682
|
+
const N = m.findIndex((_) => _.id === Z);
|
|
2683
|
+
return N === -1 ? m : [...m.slice(0, N + 1), T, ...m.slice(N + 1)];
|
|
2678
2684
|
});
|
|
2679
|
-
|
|
2680
|
-
}, [
|
|
2681
|
-
const S = (
|
|
2682
|
-
const N =
|
|
2683
|
-
switch (
|
|
2685
|
+
Me(null), ft(null), ut(v), X("nodeConfig");
|
|
2686
|
+
}, [Z, de]), _t = U((y, v) => {
|
|
2687
|
+
const S = (m) => {
|
|
2688
|
+
const N = m.label || m.key;
|
|
2689
|
+
switch (m.kind) {
|
|
2684
2690
|
case "if":
|
|
2685
2691
|
return `IF · ${N}`;
|
|
2686
2692
|
case "elseif":
|
|
@@ -2690,54 +2696,54 @@ const Xt = ({
|
|
|
2690
2696
|
default:
|
|
2691
2697
|
return N;
|
|
2692
2698
|
}
|
|
2693
|
-
}, C = (
|
|
2699
|
+
}, C = (m) => {
|
|
2694
2700
|
const N = ce(y);
|
|
2695
|
-
if ((N == null ? void 0 : N.descriptorType) !== "conditionBranch") return
|
|
2696
|
-
const
|
|
2697
|
-
if (
|
|
2698
|
-
const B =
|
|
2699
|
-
return
|
|
2701
|
+
if ((N == null ? void 0 : N.descriptorType) !== "conditionBranch") return m;
|
|
2702
|
+
const O = (v.branchConfigs ?? []).map((D) => D.key).filter(Boolean);
|
|
2703
|
+
if (O.length === 0) return m;
|
|
2704
|
+
const B = m[y] ?? {}, F = {};
|
|
2705
|
+
return O.forEach((D) => {
|
|
2700
2706
|
F[D] = B[D] ?? [{ id: `end-${y}-${D}`, kind: "end", reactFlowType: "endNode" }];
|
|
2701
|
-
}), { ...
|
|
2702
|
-
}, T = (
|
|
2703
|
-
if (
|
|
2704
|
-
const _ = N.branchConfigs ?? [],
|
|
2707
|
+
}), { ...m, [y]: F };
|
|
2708
|
+
}, T = (m, N) => {
|
|
2709
|
+
if (m.descriptorType !== "conditionBranch") return { ...m, formData: N };
|
|
2710
|
+
const _ = N.branchConfigs ?? [], O = {};
|
|
2705
2711
|
return _.forEach((B) => {
|
|
2706
|
-
B.key && (
|
|
2707
|
-
}), { ...
|
|
2712
|
+
B.key && (O[B.key] = S(B));
|
|
2713
|
+
}), { ...m, formData: N, branchLabels: O };
|
|
2708
2714
|
};
|
|
2709
|
-
if (R.some((
|
|
2710
|
-
|
|
2711
|
-
const N = C(
|
|
2715
|
+
if (R.some((m) => m.id === y)) {
|
|
2716
|
+
ne((m) => {
|
|
2717
|
+
const N = C(m);
|
|
2712
2718
|
return ae(
|
|
2713
2719
|
(_) => _.map(
|
|
2714
|
-
(
|
|
2720
|
+
(O) => O.id === y ? T(O, v) : O
|
|
2715
2721
|
)
|
|
2716
2722
|
), N;
|
|
2717
2723
|
});
|
|
2718
2724
|
return;
|
|
2719
2725
|
}
|
|
2720
|
-
|
|
2721
|
-
const _ = { ...C(
|
|
2722
|
-
for (const
|
|
2726
|
+
ne((m) => {
|
|
2727
|
+
const _ = { ...C(m) };
|
|
2728
|
+
for (const O of Object.keys(_)) {
|
|
2723
2729
|
const B = (F) => F.map((D) => D.id === y ? T(D, v) : D);
|
|
2724
|
-
for (const F of Object.keys(_[
|
|
2725
|
-
if (_[
|
|
2726
|
-
return _[
|
|
2730
|
+
for (const F of Object.keys(_[O]))
|
|
2731
|
+
if (_[O][F].some((D) => D.id === y))
|
|
2732
|
+
return _[O] = { ..._[O], [F]: B(_[O][F]) }, _;
|
|
2727
2733
|
}
|
|
2728
2734
|
return _;
|
|
2729
2735
|
});
|
|
2730
|
-
}, [R,
|
|
2731
|
-
if ((
|
|
2736
|
+
}, [R, K, ce]), H = V(() => ce(We ?? ""), [ce, We]), St = V(() => {
|
|
2737
|
+
if ((H == null ? void 0 : H.kind) === "triggerFixed") {
|
|
2732
2738
|
const y = (j == null ? void 0 : j.triggerCategory) === "scheduler", v = (j == null ? void 0 : j.triggerConfigTitle) ?? (y ? "Scheduler" : j == null ? void 0 : j.label) ?? "Trigger", S = j == null ? void 0 : j.triggerCustomPanel;
|
|
2733
2739
|
if (S)
|
|
2734
2740
|
return {
|
|
2735
|
-
type:
|
|
2741
|
+
type: H.id,
|
|
2736
2742
|
label: v,
|
|
2737
2743
|
icon: j == null ? void 0 : j.icon,
|
|
2738
2744
|
reactFlowType: "triggerNode",
|
|
2739
2745
|
formSchema: [],
|
|
2740
|
-
customPanel: ({ nodeId: T, data:
|
|
2746
|
+
customPanel: ({ nodeId: T, data: m, onSave: N, onClose: _ }) => S({ data: m, onSave: N, onClose: _ }),
|
|
2741
2747
|
matches: () => !1,
|
|
2742
2748
|
bpmnEntry: (T) => T,
|
|
2743
2749
|
bpmnExit: (T) => T,
|
|
@@ -2745,7 +2751,7 @@ const Xt = ({
|
|
|
2745
2751
|
};
|
|
2746
2752
|
const C = j == null ? void 0 : j.triggerConfigSchema;
|
|
2747
2753
|
return Array.isArray(C) && C.length > 0 ? {
|
|
2748
|
-
type:
|
|
2754
|
+
type: H.id,
|
|
2749
2755
|
// Title the config by what it IS (a scheduler), not the workflow name
|
|
2750
2756
|
// (which would read as "Identify Dormant Account").
|
|
2751
2757
|
label: v,
|
|
@@ -2758,28 +2764,28 @@ const Xt = ({
|
|
|
2758
2764
|
emitBpmnElements: () => []
|
|
2759
2765
|
} : null;
|
|
2760
2766
|
}
|
|
2761
|
-
return
|
|
2762
|
-
}, [
|
|
2763
|
-
() =>
|
|
2764
|
-
[R,
|
|
2765
|
-
), Ct =
|
|
2766
|
-
const y =
|
|
2767
|
+
return H != null && H.descriptorType ? e.forType(H.descriptorType) ?? null : null;
|
|
2768
|
+
}, [H, e, j]), { nodes: Nt, edges: Fn } = V(
|
|
2769
|
+
() => fs(R, K, s ? null : vt, pt, l, p, we),
|
|
2770
|
+
[R, K, s, vt, pt, l, p, we]
|
|
2771
|
+
), Ct = V(() => {
|
|
2772
|
+
const y = x ? new Map(x.steps.map((v) => [v.nodeId, v])) : null;
|
|
2767
2773
|
return Nt.map((v) => {
|
|
2768
2774
|
let S = {};
|
|
2769
2775
|
if (y) {
|
|
2770
2776
|
const C = y.get(v.id);
|
|
2771
2777
|
C && (S = { _executionStatus: C.status, _executionError: C.error });
|
|
2772
2778
|
}
|
|
2773
|
-
return v.type === "subWorkflowNode" &&
|
|
2774
|
-
var
|
|
2779
|
+
return v.type === "subWorkflowNode" && k && (S.onPreview = (C) => {
|
|
2780
|
+
var m;
|
|
2775
2781
|
const T = ce(v.id);
|
|
2776
|
-
ht({ workflowId: C, workflowLabel: ((
|
|
2782
|
+
ht({ workflowId: C, workflowLabel: ((m = T == null ? void 0 : T.formData) == null ? void 0 : m.workflowLabel) ?? void 0 });
|
|
2777
2783
|
}), Object.keys(S).length > 0 ? { ...v, data: { ...v.data, ...S } } : v;
|
|
2778
2784
|
});
|
|
2779
|
-
}, [Nt,
|
|
2780
|
-
}, onClickAddTrigger:
|
|
2781
|
-
i && await i({ slots: R, branches:
|
|
2782
|
-
}, [i, R,
|
|
2785
|
+
}, [Nt, x, k, ce]), Rn = V(() => ({ onEditNode: $e, onDeleteNode: mt, onAddStep: () => {
|
|
2786
|
+
}, onClickAddTrigger: Ge, messages: xe, nodeRegistry: e, nodeBody: Ee, activeTemplate: j }), [$e, mt, Ge, xe, e, Ee, j]), An = U(async () => {
|
|
2787
|
+
i && await i({ slots: R, branches: K });
|
|
2788
|
+
}, [i, R, K]), Bn = V(() => Sr({
|
|
2783
2789
|
palette: {
|
|
2784
2790
|
primary: { main: l.primaryColor ?? "#1976d2" },
|
|
2785
2791
|
secondary: { main: l.secondaryColor ?? "#9c27b0" },
|
|
@@ -2791,7 +2797,7 @@ const Xt = ({
|
|
|
2791
2797
|
shape: { borderRadius: l.borderRadius ?? 6 },
|
|
2792
2798
|
typography: l.fontFamily ? { fontFamily: l.fontFamily } : {}
|
|
2793
2799
|
}), [l]);
|
|
2794
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ f(Nr, { theme: Bn, children: /* @__PURE__ */ f(kr, { resolvers: J, children: /* @__PURE__ */ f(Qn.Provider, { value: Rn, children: /* @__PURE__ */ w(
|
|
2795
2801
|
"div",
|
|
2796
2802
|
{
|
|
2797
2803
|
className: "flowforge-canvas",
|
|
@@ -2813,16 +2819,16 @@ const Xt = ({
|
|
|
2813
2819
|
"--ff-font-family": l.fontFamily
|
|
2814
2820
|
},
|
|
2815
2821
|
children: [
|
|
2816
|
-
!
|
|
2822
|
+
!M && (i || G || z) && /* @__PURE__ */ f(
|
|
2817
2823
|
ns,
|
|
2818
2824
|
{
|
|
2819
2825
|
workflowName: z,
|
|
2820
2826
|
onWorkflowNameChange: W,
|
|
2821
2827
|
status: P,
|
|
2822
|
-
statusColor:
|
|
2828
|
+
statusColor: I,
|
|
2823
2829
|
onSave: i ? An : void 0,
|
|
2824
|
-
onCancel:
|
|
2825
|
-
saveLabel:
|
|
2830
|
+
onCancel: G,
|
|
2831
|
+
saveLabel: Y
|
|
2826
2832
|
}
|
|
2827
2833
|
),
|
|
2828
2834
|
/* @__PURE__ */ w("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
@@ -2837,19 +2843,19 @@ const Xt = ({
|
|
|
2837
2843
|
fitViewOptions: { padding: A },
|
|
2838
2844
|
nodesDraggable: !1,
|
|
2839
2845
|
nodesConnectable: !1,
|
|
2840
|
-
panOnScroll:
|
|
2841
|
-
zoomOnScroll:
|
|
2842
|
-
minZoom:
|
|
2843
|
-
maxZoom:
|
|
2844
|
-
snapToGrid:
|
|
2845
|
-
snapGrid:
|
|
2846
|
+
panOnScroll: Oe,
|
|
2847
|
+
zoomOnScroll: te,
|
|
2848
|
+
minZoom: Ie,
|
|
2849
|
+
maxZoom: ge,
|
|
2850
|
+
snapToGrid: De,
|
|
2851
|
+
snapGrid: ct,
|
|
2846
2852
|
proOptions: { hideAttribution: !0 },
|
|
2847
2853
|
onNodeClick: (y, v) => {
|
|
2848
2854
|
const S = ce(v.id);
|
|
2849
|
-
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ?
|
|
2855
|
+
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ? Ge() : (S.kind === "userTask" || S.kind === "filter" || S.kind === "approval") && $e(v.id)));
|
|
2850
2856
|
},
|
|
2851
2857
|
children: [
|
|
2852
|
-
l.background !== "none" && /* @__PURE__ */
|
|
2858
|
+
l.background !== "none" && /* @__PURE__ */ f(
|
|
2853
2859
|
Yn,
|
|
2854
2860
|
{
|
|
2855
2861
|
variant: l.background,
|
|
@@ -2857,27 +2863,27 @@ const Xt = ({
|
|
|
2857
2863
|
gap: 20
|
|
2858
2864
|
}
|
|
2859
2865
|
),
|
|
2860
|
-
ie && /* @__PURE__ */
|
|
2861
|
-
|
|
2862
|
-
/* @__PURE__ */
|
|
2866
|
+
ie && /* @__PURE__ */ f(Kn, { showInteractive: !1 }),
|
|
2867
|
+
he && /* @__PURE__ */ f(Hn, { zoomable: !0, pannable: !0 }),
|
|
2868
|
+
/* @__PURE__ */ f(es, { onHeightsReady: jn, nodeCount: Ct.length })
|
|
2863
2869
|
]
|
|
2864
2870
|
}
|
|
2865
2871
|
),
|
|
2866
|
-
c ? pe === "triggerSelect" && c(t.list(), wt, () => X(null)) : /* @__PURE__ */
|
|
2872
|
+
c ? pe === "triggerSelect" && c(t.list(), wt, () => X(null)) : /* @__PURE__ */ f(rs, { open: pe === "triggerSelect", templates: t.list(), messages: xe, onSelect: wt, onClose: () => X(null), loadTriggerSources: u }),
|
|
2867
2873
|
h ? pe === "nodePicker" && h(xt(), kt, () => {
|
|
2868
|
-
X(null),
|
|
2869
|
-
}) : /* @__PURE__ */
|
|
2870
|
-
X(null),
|
|
2874
|
+
X(null), Me(null);
|
|
2875
|
+
}) : /* @__PURE__ */ f(os, { open: pe === "nodePicker", availableDescriptors: xt(), messages: xe, onSelect: kt, onClose: () => {
|
|
2876
|
+
X(null), Me(null);
|
|
2871
2877
|
} }),
|
|
2872
|
-
g ? pe === "nodeConfig" && g(St ?? void 0,
|
|
2873
|
-
|
|
2878
|
+
g ? pe === "nodeConfig" && g(St ?? void 0, H, _t, () => X(null)) : /* @__PURE__ */ f(is, { open: pe === "nodeConfig", nodeId: We, descriptor: St, initialValues: H == null ? void 0 : H.formData, messages: xe, onSave: _t, onClose: () => X(null) }),
|
|
2879
|
+
k && je && /* @__PURE__ */ f(
|
|
2874
2880
|
ss,
|
|
2875
2881
|
{
|
|
2876
|
-
isOpen: !!
|
|
2882
|
+
isOpen: !!je,
|
|
2877
2883
|
onClose: () => ht(null),
|
|
2878
|
-
workflowId:
|
|
2879
|
-
workflowLabel:
|
|
2880
|
-
onFetchWorkflow:
|
|
2884
|
+
workflowId: je.workflowId,
|
|
2885
|
+
workflowLabel: je.workflowLabel,
|
|
2886
|
+
onFetchWorkflow: k
|
|
2881
2887
|
}
|
|
2882
2888
|
)
|
|
2883
2889
|
] })
|
|
@@ -2888,7 +2894,7 @@ const Xt = ({
|
|
|
2888
2894
|
__proto__: null,
|
|
2889
2895
|
WorkflowCanvas: Xt,
|
|
2890
2896
|
default: Xt
|
|
2891
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2897
|
+
}, Symbol.toStringTag, { value: "Module" })), Qe = "All";
|
|
2892
2898
|
function gs({ template: e, onSelect: t }) {
|
|
2893
2899
|
var o, i;
|
|
2894
2900
|
const n = e.triggerCategory ? Cr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
@@ -2921,15 +2927,15 @@ function gs({ template: e, onSelect: t }) {
|
|
|
2921
2927
|
},
|
|
2922
2928
|
children: [
|
|
2923
2929
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
|
|
2924
|
-
e.icon && /* @__PURE__ */
|
|
2930
|
+
e.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
|
|
2925
2931
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
e.description && /* @__PURE__ */
|
|
2932
|
+
/* @__PURE__ */ f("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
|
|
2933
|
+
e.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
|
|
2928
2934
|
] })
|
|
2929
2935
|
] }),
|
|
2930
2936
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
|
|
2931
|
-
n && /* @__PURE__ */
|
|
2932
|
-
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */
|
|
2937
|
+
n && /* @__PURE__ */ f("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: n.bg, color: n.color }, children: n.label }),
|
|
2938
|
+
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
|
|
2933
2939
|
r > 0 && /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
|
|
2934
2940
|
r,
|
|
2935
2941
|
" step",
|
|
@@ -2949,30 +2955,30 @@ const js = ({
|
|
|
2949
2955
|
onSelectTemplate: t,
|
|
2950
2956
|
onStartFromScratch: n
|
|
2951
2957
|
}) => {
|
|
2952
|
-
const [r, o] = L(""), [i, s] = L(
|
|
2958
|
+
const [r, o] = L(""), [i, s] = L(Qe), l = V(() => {
|
|
2953
2959
|
const a = /* @__PURE__ */ new Set();
|
|
2954
2960
|
return e.forEach((c) => {
|
|
2955
2961
|
c.category && a.add(c.category);
|
|
2956
|
-
}), [
|
|
2957
|
-
}, [e]), d =
|
|
2962
|
+
}), [Qe, ...Array.from(a)];
|
|
2963
|
+
}, [e]), d = V(() => {
|
|
2958
2964
|
let a = e;
|
|
2959
|
-
if (i !==
|
|
2965
|
+
if (i !== Qe && (a = a.filter((c) => c.category === i)), r.trim()) {
|
|
2960
2966
|
const c = r.toLowerCase();
|
|
2961
2967
|
a = a.filter(
|
|
2962
|
-
(
|
|
2968
|
+
(u) => {
|
|
2963
2969
|
var h, g;
|
|
2964
|
-
return
|
|
2970
|
+
return u.label.toLowerCase().includes(c) || ((h = u.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = u.tags) == null ? void 0 : g.some((E) => E.toLowerCase().includes(c)));
|
|
2965
2971
|
}
|
|
2966
2972
|
);
|
|
2967
2973
|
}
|
|
2968
|
-
return [...a].sort((c,
|
|
2974
|
+
return [...a].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
|
|
2969
2975
|
}, [e, i, r]);
|
|
2970
2976
|
return /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2971
2977
|
/* @__PURE__ */ w("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
2972
2978
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
|
|
2973
2979
|
/* @__PURE__ */ w("div", { children: [
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ f("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
|
|
2981
|
+
/* @__PURE__ */ f("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
|
|
2976
2982
|
] }),
|
|
2977
2983
|
n && /* @__PURE__ */ w(
|
|
2978
2984
|
"button",
|
|
@@ -2980,15 +2986,15 @@ const js = ({
|
|
|
2980
2986
|
onClick: n,
|
|
2981
2987
|
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" },
|
|
2982
2988
|
children: [
|
|
2983
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ f(ur, { size: 16 }),
|
|
2984
2990
|
"Start from Scratch"
|
|
2985
2991
|
]
|
|
2986
2992
|
}
|
|
2987
2993
|
)
|
|
2988
2994
|
] }),
|
|
2989
2995
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ f(fr, { size: 18, color: "#9e9e9e" }),
|
|
2997
|
+
/* @__PURE__ */ f(
|
|
2992
2998
|
"input",
|
|
2993
2999
|
{
|
|
2994
3000
|
value: r,
|
|
@@ -2998,7 +3004,7 @@ const js = ({
|
|
|
2998
3004
|
}
|
|
2999
3005
|
)
|
|
3000
3006
|
] }),
|
|
3001
|
-
l.length > 1 && /* @__PURE__ */
|
|
3007
|
+
l.length > 1 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((a) => /* @__PURE__ */ f(
|
|
3002
3008
|
"button",
|
|
3003
3009
|
{
|
|
3004
3010
|
onClick: () => s(a),
|
|
@@ -3018,31 +3024,31 @@ const js = ({
|
|
|
3018
3024
|
a
|
|
3019
3025
|
)) })
|
|
3020
3026
|
] }),
|
|
3021
|
-
/* @__PURE__ */
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
] }) : /* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ w("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
3028
|
+
/* @__PURE__ */ f(hr, { size: 36, style: { marginBottom: 8 } }),
|
|
3029
|
+
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
3030
|
+
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ f(gs, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
3025
3031
|
] });
|
|
3026
|
-
},
|
|
3027
|
-
running: { label: "Running", color:
|
|
3028
|
-
success: { label: "Success", color:
|
|
3029
|
-
failed: { label: "Failed", color:
|
|
3030
|
-
cancelled: { label: "Cancelled", color:
|
|
3032
|
+
}, ze = {
|
|
3033
|
+
running: { label: "Running", color: oe.running, icon: $.createElement(nn, { size: 14 }) },
|
|
3034
|
+
success: { label: "Success", color: oe.success, icon: $.createElement(tn, { size: 14 }) },
|
|
3035
|
+
failed: { label: "Failed", color: oe.failed, icon: $.createElement(en, { size: 14 }) },
|
|
3036
|
+
cancelled: { label: "Cancelled", color: oe.cancelled, icon: $.createElement(Qt, { size: 14 }) }
|
|
3031
3037
|
}, ps = {
|
|
3032
|
-
pending: { color:
|
|
3033
|
-
running: { color:
|
|
3034
|
-
success: { color:
|
|
3035
|
-
failed: { color:
|
|
3036
|
-
skipped: { color:
|
|
3038
|
+
pending: { color: oe.pending, icon: $.createElement(gr, { size: 14 }) },
|
|
3039
|
+
running: { color: oe.running, icon: $.createElement(nn, { size: 14 }) },
|
|
3040
|
+
success: { color: oe.success, icon: $.createElement(tn, { size: 14 }) },
|
|
3041
|
+
failed: { color: oe.failed, icon: $.createElement(en, { size: 14 }) },
|
|
3042
|
+
skipped: { color: oe.skipped, icon: $.createElement(Qt, { size: 14 }) }
|
|
3037
3043
|
};
|
|
3038
|
-
function
|
|
3044
|
+
function ot(e) {
|
|
3039
3045
|
try {
|
|
3040
3046
|
return new Date(e).toLocaleString();
|
|
3041
3047
|
} catch {
|
|
3042
3048
|
return e;
|
|
3043
3049
|
}
|
|
3044
3050
|
}
|
|
3045
|
-
function
|
|
3051
|
+
function In(e, t) {
|
|
3046
3052
|
try {
|
|
3047
3053
|
const n = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
3048
3054
|
return n < 1e3 ? `${n}ms` : n < 6e4 ? `${(n / 1e3).toFixed(1)}s` : `${Math.floor(n / 6e4)}m ${Math.floor(n % 6e4 / 1e3)}s`;
|
|
@@ -3066,29 +3072,29 @@ function ys({ step: e }) {
|
|
|
3066
3072
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
3067
3073
|
},
|
|
3068
3074
|
children: [
|
|
3069
|
-
/* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
-
e.branchTaken && /* @__PURE__ */
|
|
3072
|
-
/* @__PURE__ */
|
|
3073
|
-
o && /* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ f("span", { style: { color: r.color, flexShrink: 0 }, children: $.cloneElement(r.icon, { color: r.color }) }),
|
|
3076
|
+
/* @__PURE__ */ f("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
3077
|
+
e.branchTaken && /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
3078
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? In(e.startedAt, e.completedAt) : "—" }),
|
|
3079
|
+
o && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? $.createElement(yr, { size: 16 }) : $.createElement(br, { size: 16 }) })
|
|
3074
3080
|
]
|
|
3075
3081
|
}
|
|
3076
3082
|
),
|
|
3077
3083
|
t && o && /* @__PURE__ */ w("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
|
|
3078
|
-
e.error && /* @__PURE__ */
|
|
3084
|
+
e.error && /* @__PURE__ */ f("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
|
|
3079
3085
|
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ w("details", { style: { marginBottom: 4 }, children: [
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
|
|
3087
|
+
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
|
|
3082
3088
|
] }),
|
|
3083
3089
|
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ w("details", { children: [
|
|
3084
|
-
/* @__PURE__ */
|
|
3085
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
|
|
3091
|
+
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
|
|
3086
3092
|
] })
|
|
3087
3093
|
] })
|
|
3088
3094
|
] });
|
|
3089
3095
|
}
|
|
3090
3096
|
function bs({ record: e, selected: t, onSelect: n }) {
|
|
3091
|
-
const r =
|
|
3097
|
+
const r = ze[e.status];
|
|
3092
3098
|
return /* @__PURE__ */ w(
|
|
3093
3099
|
"div",
|
|
3094
3100
|
{
|
|
@@ -3109,9 +3115,9 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3109
3115
|
outline: "none"
|
|
3110
3116
|
},
|
|
3111
3117
|
children: [
|
|
3112
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ f("span", { style: { color: r.color, flexShrink: 0 }, children: $.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
3113
3119
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3114
|
-
/* @__PURE__ */
|
|
3120
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: ot(e.triggeredAt) }),
|
|
3115
3121
|
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
3116
3122
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
3117
3123
|
" · ",
|
|
@@ -3120,8 +3126,8 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3120
3126
|
e.steps.length !== 1 ? "s" : ""
|
|
3121
3127
|
] })
|
|
3122
3128
|
] }),
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3129
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 11, fontWeight: 600, color: r.color, flexShrink: 0 }, children: r.label }),
|
|
3130
|
+
/* @__PURE__ */ f(Zt, { size: 14, color: "#bdbdbd" })
|
|
3125
3131
|
]
|
|
3126
3132
|
}
|
|
3127
3133
|
);
|
|
@@ -3130,9 +3136,9 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3130
3136
|
var s;
|
|
3131
3137
|
const [n, r] = L(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === n) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
3132
3138
|
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3139
|
+
/* @__PURE__ */ f(It, { size: 36 }),
|
|
3140
|
+
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
3141
|
+
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
3136
3142
|
] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
3137
3143
|
/* @__PURE__ */ w("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
|
|
3138
3144
|
/* @__PURE__ */ w("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
|
|
@@ -3140,30 +3146,30 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3140
3146
|
e.length,
|
|
3141
3147
|
")"
|
|
3142
3148
|
] }),
|
|
3143
|
-
i.map((l) => /* @__PURE__ */
|
|
3149
|
+
i.map((l) => /* @__PURE__ */ f(bs, { record: l, selected: l.id === n, onSelect: () => r(l.id) }, l.id))
|
|
3144
3150
|
] }),
|
|
3145
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ w("div", { children: [
|
|
3146
3152
|
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3147
3153
|
/* @__PURE__ */ w("div", { children: [
|
|
3148
3154
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3149
|
-
|
|
3150
|
-
/* @__PURE__ */
|
|
3155
|
+
$.cloneElement(ze[o.status].icon, { color: ze[o.status].color, size: 18 }),
|
|
3156
|
+
/* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: ze[o.status].label })
|
|
3151
3157
|
] }),
|
|
3152
3158
|
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3153
3159
|
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3154
|
-
/* @__PURE__ */
|
|
3160
|
+
/* @__PURE__ */ f(It, { size: 13 }),
|
|
3155
3161
|
" ",
|
|
3156
|
-
|
|
3157
|
-
o.completedAt && ` → ${
|
|
3162
|
+
ot(o.triggeredAt),
|
|
3163
|
+
o.completedAt && ` → ${ot(o.completedAt)} (${In(o.triggeredAt, o.completedAt)})`
|
|
3158
3164
|
] }),
|
|
3159
3165
|
o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3160
|
-
/* @__PURE__ */
|
|
3166
|
+
/* @__PURE__ */ f(pr, { size: 13 }),
|
|
3161
3167
|
" ",
|
|
3162
3168
|
o.triggeredBy
|
|
3163
3169
|
] })
|
|
3164
3170
|
] })
|
|
3165
3171
|
] }),
|
|
3166
|
-
t && /* @__PURE__ */
|
|
3172
|
+
t && /* @__PURE__ */ f(
|
|
3167
3173
|
"button",
|
|
3168
3174
|
{
|
|
3169
3175
|
onClick: () => t(o),
|
|
@@ -3172,20 +3178,20 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3172
3178
|
}
|
|
3173
3179
|
)
|
|
3174
3180
|
] }),
|
|
3175
|
-
o.error && /* @__PURE__ */
|
|
3181
|
+
o.error && /* @__PURE__ */ f("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
|
|
3176
3182
|
/* @__PURE__ */ w("div", { children: [
|
|
3177
3183
|
/* @__PURE__ */ w("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
3178
3184
|
"STEPS (",
|
|
3179
3185
|
o.steps.length,
|
|
3180
3186
|
")"
|
|
3181
3187
|
] }),
|
|
3182
|
-
o.steps.map((l, d) => /* @__PURE__ */
|
|
3188
|
+
o.steps.map((l, d) => /* @__PURE__ */ f(ys, { step: l }, `${l.nodeId}-${d}`))
|
|
3183
3189
|
] }),
|
|
3184
|
-
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3186
|
-
/* @__PURE__ */
|
|
3190
|
+
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ w("details", { children: [
|
|
3191
|
+
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
3192
|
+
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
|
|
3187
3193
|
] }) })
|
|
3188
|
-
] }) : /* @__PURE__ */
|
|
3194
|
+
] }) : /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
3189
3195
|
] });
|
|
3190
3196
|
};
|
|
3191
3197
|
export {
|
|
@@ -3195,4 +3201,4 @@ export {
|
|
|
3195
3201
|
ns as a,
|
|
3196
3202
|
js as b
|
|
3197
3203
|
};
|
|
3198
|
-
//# sourceMappingURL=WorkflowExecutionHistory-
|
|
3204
|
+
//# sourceMappingURL=WorkflowExecutionHistory-DmfGMs7_.js.map
|