@notmrabhi/flowforge 0.1.14 → 0.1.15
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/canvas.cjs +1 -1
- package/dist/canvas.d.ts +15 -1
- package/dist/canvas.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +1 -1
- package/dist/templateSkeletons-CLTHjrVA.js +1 -0
- package/dist/{templateSkeletons-CCXJ0W5L.js → templateSkeletons-CrVa5zSa.js} +1004 -883
- package/package.json +1 -1
- package/dist/templateSkeletons-DT30F9Rm.js +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as y, jsx as f, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import G, { useRef as mt, useEffect as re, useState as M, useCallback as U, useMemo as $ } from "react";
|
|
3
|
+
import Nr, { useStore as Cr, useReactFlow as Sr, Background as Ir, Controls as Or, MiniMap as Mr } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as
|
|
6
|
-
import { Dialog as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
import { e as jr, G as zr, E as Fr, P as Dr, L as Lr, d as Rr, f as Ar } from "./GatewayBranchEdge-DH-aHDPm.js";
|
|
6
|
+
import { Dialog as Pr, Box as J, Drawer as Br, IconButton as wt, Button as _e, CircularProgress as Wr } from "@mui/material";
|
|
7
|
+
import Gr from "react-select";
|
|
8
|
+
import { MdClose as $r, MdCalendarToday as Yr, MdBolt as Kr, MdArrowBack as Pt, MdChevronRight as Bt, MdAddCircleOutline as Ur, MdApps as Vr, MdErrorOutline as Hr, MdAccountTree as qr, MdAdd as Xr, MdSearch as Jr, MdCategory as Zr, MdCancel as Wt, MdError as Gt, MdCheckCircle as $t, MdPlayArrow as Yt, MdHourglassEmpty as Qr, MdSchedule as vt, MdPerson as en, MdExpandLess as tn, MdExpandMore as rn } from "react-icons/md";
|
|
9
|
+
import { GrTrigger as nn } from "react-icons/gr";
|
|
10
|
+
import { BiCollapse as on, BiExpand as sn } from "react-icons/bi";
|
|
11
|
+
import { j as ln, b as an } from "./index-CxVqPygT.js";
|
|
12
|
+
import { m as dn } from "./messages-CO299wPN.js";
|
|
13
|
+
import { T as cn, E as Z } from "./canvasTokens-CAD6G24b.js";
|
|
14
|
+
var Kt = Object.defineProperty, un = (e, t, r) => t in e ? Kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, fn = (e, t) => {
|
|
15
|
+
for (var r in t) Kt(e, r, { get: t[r], enumerable: !0 });
|
|
16
|
+
}, hn = (e, t, r) => un(e, t + "", r), Ut = {};
|
|
17
|
+
fn(Ut, { Graph: () => Y, alg: () => Xe, json: () => Ht, version: () => bn });
|
|
18
|
+
var gn = Object.defineProperty, Vt = (e, t) => {
|
|
19
|
+
for (var r in t) gn(e, r, { get: t[r], enumerable: !0 });
|
|
20
|
+
}, Y = class {
|
|
20
21
|
constructor(e) {
|
|
21
22
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
22
23
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -149,15 +150,15 @@ var cn = Object.defineProperty, Kt = (e, t) => {
|
|
|
149
150
|
setEdge(e, t, r, n) {
|
|
150
151
|
let o, i, s, l, d = !1;
|
|
151
152
|
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 = n, arguments.length > 2 && (l = r, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
152
|
-
let a =
|
|
153
|
+
let a = pe(this._isDirected, o, i, s);
|
|
153
154
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
154
155
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
155
156
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
156
|
-
let c =
|
|
157
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c,
|
|
157
|
+
let c = pn(this._isDirected, o, i, s);
|
|
158
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, Et(this._preds[i], o), Et(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
158
159
|
}
|
|
159
160
|
edge(e, t, r) {
|
|
160
|
-
let n = arguments.length === 1 ?
|
|
161
|
+
let n = arguments.length === 1 ? Le(this._isDirected, e) : pe(this._isDirected, e, t, r);
|
|
161
162
|
return this._edgeLabels[n];
|
|
162
163
|
}
|
|
163
164
|
edgeAsObj(e, t, r) {
|
|
@@ -165,13 +166,13 @@ var cn = Object.defineProperty, Kt = (e, t) => {
|
|
|
165
166
|
return typeof n != "object" ? { label: n } : n;
|
|
166
167
|
}
|
|
167
168
|
hasEdge(e, t, r) {
|
|
168
|
-
return (arguments.length === 1 ?
|
|
169
|
+
return (arguments.length === 1 ? Le(this._isDirected, e) : pe(this._isDirected, e, t, r)) in this._edgeLabels;
|
|
169
170
|
}
|
|
170
171
|
removeEdge(e, t, r) {
|
|
171
|
-
let n = arguments.length === 1 ?
|
|
172
|
+
let n = arguments.length === 1 ? Le(this._isDirected, e) : pe(this._isDirected, e, t, r), o = this._edgeObjs[n];
|
|
172
173
|
if (o) {
|
|
173
174
|
let i = o.v, s = o.w;
|
|
174
|
-
delete this._edgeLabels[n], delete this._edgeObjs[n],
|
|
175
|
+
delete this._edgeLabels[n], delete this._edgeObjs[n], kt(this._preds[s], i), kt(this._sucs[i], s), delete this._in[s][n], delete this._out[i][n], this._edgeCount--;
|
|
175
176
|
}
|
|
176
177
|
return this;
|
|
177
178
|
}
|
|
@@ -193,13 +194,13 @@ var cn = Object.defineProperty, Kt = (e, t) => {
|
|
|
193
194
|
return r ? n.filter((o) => o.v === t && o.w === r || o.v === r && o.w === t) : n;
|
|
194
195
|
}
|
|
195
196
|
};
|
|
196
|
-
function
|
|
197
|
+
function Et(e, t) {
|
|
197
198
|
e[t] ? e[t]++ : e[t] = 1;
|
|
198
199
|
}
|
|
199
|
-
function
|
|
200
|
+
function kt(e, t) {
|
|
200
201
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function pe(e, t, r, n) {
|
|
203
204
|
let o = "" + t, i = "" + r;
|
|
204
205
|
if (!e && o > i) {
|
|
205
206
|
let s = o;
|
|
@@ -207,7 +208,7 @@ function ge(e, t, r, n) {
|
|
|
207
208
|
}
|
|
208
209
|
return o + "" + i + "" + (n === void 0 ? "\0" : n);
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
+
function pn(e, t, r, n) {
|
|
211
212
|
let o = "" + t, i = "" + r;
|
|
212
213
|
if (!e && o > i) {
|
|
213
214
|
let l = o;
|
|
@@ -216,52 +217,52 @@ function un(e, t, r, n) {
|
|
|
216
217
|
let s = { v: o, w: i };
|
|
217
218
|
return n && (s.name = n), s;
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
-
return
|
|
220
|
+
function Le(e, t) {
|
|
221
|
+
return pe(e, t.v, t.w, t.name);
|
|
221
222
|
}
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
function
|
|
225
|
-
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes:
|
|
223
|
+
var bn = "4.0.1", Ht = {};
|
|
224
|
+
Vt(Ht, { read: () => vn, write: () => yn });
|
|
225
|
+
function yn(e) {
|
|
226
|
+
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: mn(e), edges: wn(e) }, r = e.graph();
|
|
226
227
|
return r !== void 0 && (t.value = structuredClone(r)), t;
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
+
function mn(e) {
|
|
229
230
|
return e.nodes().map((t) => {
|
|
230
231
|
let r = e.node(t), n = e.parent(t), o = { v: t };
|
|
231
232
|
return r !== void 0 && (o.value = r), n !== void 0 && (o.parent = n), o;
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
+
function wn(e) {
|
|
235
236
|
return e.edges().map((t) => {
|
|
236
237
|
let r = e.edge(t), n = { v: t.v, w: t.w };
|
|
237
238
|
return t.name !== void 0 && (n.name = t.name), r !== void 0 && (n.value = r), n;
|
|
238
239
|
});
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
let t = new
|
|
241
|
+
function vn(e) {
|
|
242
|
+
let t = new Y(e.options);
|
|
242
243
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((r) => {
|
|
243
244
|
t.setNode(r.v, r.value), r.parent && t.setParent(r.v, r.parent);
|
|
244
245
|
}), e.edges.forEach((r) => {
|
|
245
246
|
t.setEdge({ v: r.v, w: r.w, name: r.name }, r.value);
|
|
246
247
|
}), t;
|
|
247
248
|
}
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
var
|
|
251
|
-
function
|
|
252
|
-
return
|
|
249
|
+
var Xe = {};
|
|
250
|
+
Vt(Xe, { CycleException: () => Ce, bellmanFord: () => qt, components: () => xn, dijkstra: () => Ne, dijkstraAll: () => Nn, findCycles: () => Cn, floydWarshall: () => In, isAcyclic: () => Mn, postorder: () => zn, preorder: () => Fn, prim: () => Dn, shortestPaths: () => Ln, tarjan: () => Jt, topsort: () => Zt });
|
|
251
|
+
var En = () => 1;
|
|
252
|
+
function qt(e, t, r, n) {
|
|
253
|
+
return kn(e, String(t), r || En, n || function(o) {
|
|
253
254
|
return e.outEdges(o);
|
|
254
255
|
});
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function kn(e, t, r, n) {
|
|
257
258
|
let o = {}, i, s = 0, l = e.nodes(), d = function(u) {
|
|
258
259
|
let h = r(u);
|
|
259
260
|
o[u.v].distance + h < o[u.w].distance && (o[u.w] = { distance: o[u.v].distance + h, predecessor: u.v }, i = !0);
|
|
260
261
|
}, a = function() {
|
|
261
262
|
l.forEach(function(u) {
|
|
262
263
|
n(u).forEach(function(h) {
|
|
263
|
-
let g = h.v === u ? h.v : h.w,
|
|
264
|
-
d({ v: g, w:
|
|
264
|
+
let g = h.v === u ? h.v : h.w, p = g === h.v ? h.w : h.v;
|
|
265
|
+
d({ v: g, w: p });
|
|
265
266
|
});
|
|
266
267
|
});
|
|
267
268
|
};
|
|
@@ -274,7 +275,7 @@ function mn(e, t, r, n) {
|
|
|
274
275
|
if (s === c - 1 && (i = !1, a(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
275
276
|
return o;
|
|
276
277
|
}
|
|
277
|
-
function
|
|
278
|
+
function xn(e) {
|
|
278
279
|
let t = {}, r = [], n;
|
|
279
280
|
function o(i) {
|
|
280
281
|
i in t || (t[i] = !0, n.push(i), e.successors(i).forEach(o), e.predecessors(i).forEach(o));
|
|
@@ -283,7 +284,7 @@ function wn(e) {
|
|
|
283
284
|
n = [], o(i), n.length && r.push(n);
|
|
284
285
|
}), r;
|
|
285
286
|
}
|
|
286
|
-
var
|
|
287
|
+
var Xt = class {
|
|
287
288
|
constructor() {
|
|
288
289
|
this._arr = [], this._keyIndices = {};
|
|
289
290
|
}
|
|
@@ -336,15 +337,15 @@ var Ht = class {
|
|
|
336
337
|
let r = this._arr, n = this._keyIndices, o = r[e], i = r[t];
|
|
337
338
|
r[e] = i, r[t] = o, n[i.key] = e, n[o.key] = t;
|
|
338
339
|
}
|
|
339
|
-
},
|
|
340
|
-
function
|
|
340
|
+
}, Tn = () => 1;
|
|
341
|
+
function Ne(e, t, r, n) {
|
|
341
342
|
let o = function(i) {
|
|
342
343
|
return e.outEdges(i);
|
|
343
344
|
};
|
|
344
|
-
return
|
|
345
|
+
return _n(e, String(t), r || Tn, n || o);
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
-
let o = {}, i = new
|
|
347
|
+
function _n(e, t, r, n) {
|
|
348
|
+
let o = {}, i = new Xt(), s, l, d = function(a) {
|
|
348
349
|
let c = a.v !== s ? a.v : a.w, u = o[c], h = r(a), g = l.distance + h;
|
|
349
350
|
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
350
351
|
g < u.distance && (u.distance = g, u.predecessor = s, i.decrease(c, g));
|
|
@@ -355,12 +356,12 @@ function En(e, t, r, n) {
|
|
|
355
356
|
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) n(s).forEach(d);
|
|
356
357
|
return o;
|
|
357
358
|
}
|
|
358
|
-
function
|
|
359
|
+
function Nn(e, t, r) {
|
|
359
360
|
return e.nodes().reduce(function(n, o) {
|
|
360
|
-
return n[o] =
|
|
361
|
+
return n[o] = Ne(e, o, t, r), n;
|
|
361
362
|
}, {});
|
|
362
363
|
}
|
|
363
|
-
function
|
|
364
|
+
function Jt(e) {
|
|
364
365
|
let t = 0, r = [], n = {}, o = [];
|
|
365
366
|
function i(s) {
|
|
366
367
|
let l = n[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
@@ -378,18 +379,18 @@ function qt(e) {
|
|
|
378
379
|
s in n || i(s);
|
|
379
380
|
}), o;
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
-
return
|
|
382
|
+
function Cn(e) {
|
|
383
|
+
return Jt(e).filter(function(t) {
|
|
383
384
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
|
-
var
|
|
387
|
-
function
|
|
388
|
-
return
|
|
387
|
+
var Sn = () => 1;
|
|
388
|
+
function In(e, t, r) {
|
|
389
|
+
return On(e, t || Sn, r || function(n) {
|
|
389
390
|
return e.outEdges(n);
|
|
390
391
|
});
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
+
function On(e, t, r) {
|
|
393
394
|
let n = {}, o = e.nodes();
|
|
394
395
|
return o.forEach(function(i) {
|
|
395
396
|
n[i] = {}, n[i][i] = { distance: 0, predecessor: "" }, o.forEach(function(s) {
|
|
@@ -409,30 +410,30 @@ function Nn(e, t, r) {
|
|
|
409
410
|
});
|
|
410
411
|
}), n;
|
|
411
412
|
}
|
|
412
|
-
var
|
|
413
|
+
var Ce = class extends Error {
|
|
413
414
|
constructor(...e) {
|
|
414
415
|
super(...e);
|
|
415
416
|
}
|
|
416
417
|
};
|
|
417
|
-
function
|
|
418
|
+
function Zt(e) {
|
|
418
419
|
let t = {}, r = {}, n = [];
|
|
419
420
|
function o(i) {
|
|
420
|
-
if (i in r) throw new
|
|
421
|
+
if (i in r) throw new Ce();
|
|
421
422
|
i in t || (r[i] = !0, t[i] = !0, e.predecessors(i).forEach(o), delete r[i], n.push(i));
|
|
422
423
|
}
|
|
423
|
-
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new
|
|
424
|
+
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Ce();
|
|
424
425
|
return n;
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
+
function Mn(e) {
|
|
427
428
|
try {
|
|
428
|
-
|
|
429
|
+
Zt(e);
|
|
429
430
|
} catch (t) {
|
|
430
|
-
if (t instanceof
|
|
431
|
+
if (t instanceof Ce) return !1;
|
|
431
432
|
throw t;
|
|
432
433
|
}
|
|
433
434
|
return !0;
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
+
function jn(e, t, r, n, o) {
|
|
436
437
|
Array.isArray(t) || (t = [t]);
|
|
437
438
|
let i = (l) => {
|
|
438
439
|
var d;
|
|
@@ -440,27 +441,27 @@ function Sn(e, t, r, n, o) {
|
|
|
440
441
|
}, s = {};
|
|
441
442
|
return t.forEach(function(l) {
|
|
442
443
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
443
|
-
o =
|
|
444
|
+
o = Qt(e, l, r === "post", s, i, n, o);
|
|
444
445
|
}), o;
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
+
function Qt(e, t, r, n, o, i, s) {
|
|
447
448
|
return t in n || (n[t] = !0, r || (s = i(s, t)), o(t).forEach(function(l) {
|
|
448
|
-
s =
|
|
449
|
+
s = Qt(e, l, r, n, o, i, s);
|
|
449
450
|
}), r && (s = i(s, t))), s;
|
|
450
451
|
}
|
|
451
|
-
function
|
|
452
|
-
return
|
|
452
|
+
function er(e, t, r) {
|
|
453
|
+
return jn(e, t, r, function(n, o) {
|
|
453
454
|
return n.push(o), n;
|
|
454
455
|
}, []);
|
|
455
456
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
457
|
+
function zn(e, t) {
|
|
458
|
+
return er(e, t, "post");
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
-
return
|
|
460
|
+
function Fn(e, t) {
|
|
461
|
+
return er(e, t, "pre");
|
|
461
462
|
}
|
|
462
|
-
function
|
|
463
|
-
let r = new
|
|
463
|
+
function Dn(e, t) {
|
|
464
|
+
let r = new Y(), n = {}, o = new Xt(), i;
|
|
464
465
|
function s(d) {
|
|
465
466
|
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
466
467
|
if (c !== void 0) {
|
|
@@ -483,14 +484,14 @@ function Mn(e, t) {
|
|
|
483
484
|
}
|
|
484
485
|
return r;
|
|
485
486
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
487
|
+
function Ln(e, t, r, n) {
|
|
488
|
+
return Rn(e, t, r, n ?? ((o) => {
|
|
488
489
|
let i = e.outEdges(o);
|
|
489
490
|
return i ?? [];
|
|
490
491
|
}));
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
-
if (r === void 0) return
|
|
493
|
+
function Rn(e, t, r, n) {
|
|
494
|
+
if (r === void 0) return Ne(e, t, r, n);
|
|
494
495
|
let o = !1, i = e.nodes();
|
|
495
496
|
for (let s = 0; s < i.length; s++) {
|
|
496
497
|
let l = n(i[s]);
|
|
@@ -498,55 +499,55 @@ function Fn(e, t, r, n) {
|
|
|
498
499
|
let a = l[d], c = a.v === i[s] ? a.v : a.w, u = c === a.v ? a.w : a.v;
|
|
499
500
|
r({ v: c, w: u }) < 0 && (o = !0);
|
|
500
501
|
}
|
|
501
|
-
if (o) return
|
|
502
|
+
if (o) return qt(e, t, r, n);
|
|
502
503
|
}
|
|
503
|
-
return
|
|
504
|
+
return Ne(e, t, r, n);
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function he(e, t, r, n) {
|
|
506
507
|
let o = n;
|
|
507
|
-
for (; e.hasNode(o); ) o =
|
|
508
|
+
for (; e.hasNode(o); ) o = Je(n);
|
|
508
509
|
return r.dummy = t, e.setNode(o, r), o;
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
-
let t = new
|
|
511
|
+
function An(e) {
|
|
512
|
+
let t = new Y().setGraph(e.graph());
|
|
512
513
|
return e.nodes().forEach((r) => t.setNode(r, e.node(r))), e.edges().forEach((r) => {
|
|
513
514
|
let n = t.edge(r.v, r.w) || { weight: 0, minlen: 1 }, o = e.edge(r);
|
|
514
515
|
t.setEdge(r.v, r.w, { weight: n.weight + o.weight, minlen: Math.max(n.minlen, o.minlen) });
|
|
515
516
|
}), t;
|
|
516
517
|
}
|
|
517
|
-
function
|
|
518
|
-
let t = new
|
|
518
|
+
function tr(e) {
|
|
519
|
+
let t = new Y({ multigraph: e.isMultigraph() }).setGraph(e.graph());
|
|
519
520
|
return e.nodes().forEach((r) => {
|
|
520
521
|
e.children(r).length || t.setNode(r, e.node(r));
|
|
521
522
|
}), e.edges().forEach((r) => {
|
|
522
523
|
t.setEdge(r, e.edge(r));
|
|
523
524
|
}), t;
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function xt(e, t) {
|
|
526
527
|
let r = e.x, n = e.y, o = t.x - r, i = t.y - n, s = e.width / 2, l = e.height / 2;
|
|
527
528
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
528
529
|
let d, a;
|
|
529
530
|
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: r + d, y: n + a };
|
|
530
531
|
}
|
|
531
|
-
function
|
|
532
|
-
let t =
|
|
532
|
+
function we(e) {
|
|
533
|
+
let t = ye(nr(e) + 1).map(() => []);
|
|
533
534
|
return e.nodes().forEach((r) => {
|
|
534
535
|
let n = e.node(r), o = n.rank;
|
|
535
536
|
o !== void 0 && (t[o] || (t[o] = []), t[o][n.order] = r);
|
|
536
537
|
}), t;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function Pn(e) {
|
|
539
540
|
let t = e.nodes().map((n) => {
|
|
540
541
|
let o = e.node(n).rank;
|
|
541
542
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
542
|
-
}), r =
|
|
543
|
+
}), r = V(Math.min, t);
|
|
543
544
|
e.nodes().forEach((n) => {
|
|
544
545
|
let o = e.node(n);
|
|
545
546
|
Object.hasOwn(o, "rank") && (o.rank -= r);
|
|
546
547
|
});
|
|
547
548
|
}
|
|
548
|
-
function
|
|
549
|
-
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), r =
|
|
549
|
+
function Bn(e) {
|
|
550
|
+
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), r = V(Math.min, t), n = [];
|
|
550
551
|
e.nodes().forEach((s) => {
|
|
551
552
|
let l = e.node(s).rank - r;
|
|
552
553
|
n[l] || (n[l] = []), n[l].push(s);
|
|
@@ -556,11 +557,11 @@ function Dn(e) {
|
|
|
556
557
|
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((d) => e.node(d).rank += o);
|
|
557
558
|
});
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
+
function Tt(e, t, r, n) {
|
|
560
561
|
let o = { width: 0, height: 0 };
|
|
561
|
-
return arguments.length >= 4 && (o.rank = r, o.order = n),
|
|
562
|
+
return arguments.length >= 4 && (o.rank = r, o.order = n), he(e, "border", o, t);
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function Wn(e, t = rr) {
|
|
564
565
|
let r = [];
|
|
565
566
|
for (let n = 0; n < e.length; n += t) {
|
|
566
567
|
let o = e.slice(n, n + t);
|
|
@@ -568,27 +569,27 @@ function Ln(e, t = er) {
|
|
|
568
569
|
}
|
|
569
570
|
return r;
|
|
570
571
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
573
|
-
if (t.length >
|
|
574
|
-
let r =
|
|
572
|
+
var rr = 65535;
|
|
573
|
+
function V(e, t) {
|
|
574
|
+
if (t.length > rr) {
|
|
575
|
+
let r = Wn(t);
|
|
575
576
|
return e(...r.map((n) => e(...n)));
|
|
576
577
|
} else return e(...t);
|
|
577
578
|
}
|
|
578
|
-
function
|
|
579
|
+
function nr(e) {
|
|
579
580
|
let t = e.nodes().map((r) => {
|
|
580
581
|
let n = e.node(r).rank;
|
|
581
582
|
return n === void 0 ? Number.MIN_VALUE : n;
|
|
582
583
|
});
|
|
583
|
-
return
|
|
584
|
+
return V(Math.max, t);
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function Gn(e, t) {
|
|
586
587
|
let r = { lhs: [], rhs: [] };
|
|
587
588
|
return e.forEach((n) => {
|
|
588
589
|
t(n) ? r.lhs.push(n) : r.rhs.push(n);
|
|
589
590
|
}), r;
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function or(e, t) {
|
|
592
593
|
let r = Date.now();
|
|
593
594
|
try {
|
|
594
595
|
return t();
|
|
@@ -596,15 +597,15 @@ function rr(e, t) {
|
|
|
596
597
|
console.log(e + " time: " + (Date.now() - r) + "ms");
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
|
-
function
|
|
600
|
+
function ir(e, t) {
|
|
600
601
|
return t();
|
|
601
602
|
}
|
|
602
|
-
var
|
|
603
|
-
function
|
|
604
|
-
let t =
|
|
603
|
+
var $n = 0;
|
|
604
|
+
function Je(e) {
|
|
605
|
+
let t = ++$n;
|
|
605
606
|
return e + ("" + t);
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
+
function ye(e, t, r = 1) {
|
|
608
609
|
t == null && (t = e, e = 0);
|
|
609
610
|
let n = (i) => i < t;
|
|
610
611
|
r < 0 && (n = (i) => t < i);
|
|
@@ -612,77 +613,77 @@ function pe(e, t, r = 1) {
|
|
|
612
613
|
for (let i = e; n(i); i += r) o.push(i);
|
|
613
614
|
return o;
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
+
function Se(e, t) {
|
|
616
617
|
let r = {};
|
|
617
618
|
for (let n of t) e[n] !== void 0 && (r[n] = e[n]);
|
|
618
619
|
return r;
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
+
function Ie(e, t) {
|
|
621
622
|
let r;
|
|
622
623
|
return typeof t == "string" ? r = (n) => n[t] : r = t, Object.entries(e).reduce((n, [o, i]) => (n[o] = r(i, o), n), {});
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function Yn(e, t) {
|
|
625
626
|
return e.reduce((r, n, o) => (r[n] = t[o], r), {});
|
|
626
627
|
}
|
|
627
|
-
var
|
|
628
|
+
var Oe = "\0", Kn = "3.0.0", Un = class {
|
|
628
629
|
constructor() {
|
|
629
|
-
|
|
630
|
+
hn(this, "_sentinel");
|
|
630
631
|
let e = {};
|
|
631
632
|
e._next = e._prev = e, this._sentinel = e;
|
|
632
633
|
}
|
|
633
634
|
dequeue() {
|
|
634
635
|
let e = this._sentinel, t = e._prev;
|
|
635
|
-
if (t !== e) return
|
|
636
|
+
if (t !== e) return _t(t), t;
|
|
636
637
|
}
|
|
637
638
|
enqueue(e) {
|
|
638
639
|
let t = this._sentinel;
|
|
639
|
-
e._prev && e._next &&
|
|
640
|
+
e._prev && e._next && _t(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
640
641
|
}
|
|
641
642
|
toString() {
|
|
642
643
|
let e = [], t = this._sentinel, r = t._prev;
|
|
643
|
-
for (; r !== t; ) e.push(JSON.stringify(r,
|
|
644
|
+
for (; r !== t; ) e.push(JSON.stringify(r, Vn)), r = r._prev;
|
|
644
645
|
return "[" + e.join(", ") + "]";
|
|
645
646
|
}
|
|
646
647
|
};
|
|
647
|
-
function
|
|
648
|
+
function _t(e) {
|
|
648
649
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
+
function Vn(e, t) {
|
|
651
652
|
if (e !== "_next" && e !== "_prev") return t;
|
|
652
653
|
}
|
|
653
|
-
var
|
|
654
|
-
function
|
|
654
|
+
var Hn = Un, qn = () => 1;
|
|
655
|
+
function Xn(e, t) {
|
|
655
656
|
if (e.nodeCount() <= 1) return [];
|
|
656
|
-
let r =
|
|
657
|
-
return
|
|
657
|
+
let r = Zn(e, t || qn);
|
|
658
|
+
return Jn(r.graph, r.buckets, r.zeroIdx).flatMap((n) => e.outEdges(n.v, n.w) || []);
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
+
function Jn(e, t, r) {
|
|
660
661
|
var n;
|
|
661
662
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
662
663
|
for (; e.nodeCount(); ) {
|
|
663
|
-
for (; l = s.dequeue(); )
|
|
664
|
-
for (; l = i.dequeue(); )
|
|
664
|
+
for (; l = s.dequeue(); ) Re(e, t, r, l);
|
|
665
|
+
for (; l = i.dequeue(); ) Re(e, t, r, l);
|
|
665
666
|
if (e.nodeCount()) {
|
|
666
667
|
for (let d = t.length - 2; d > 0; --d) if (l = (n = t[d]) == null ? void 0 : n.dequeue(), l) {
|
|
667
|
-
o = o.concat(
|
|
668
|
+
o = o.concat(Re(e, t, r, l, !0) || []);
|
|
668
669
|
break;
|
|
669
670
|
}
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
673
|
return o;
|
|
673
674
|
}
|
|
674
|
-
function
|
|
675
|
+
function Re(e, t, r, n, o) {
|
|
675
676
|
let i = [], s = o ? i : void 0;
|
|
676
677
|
return (e.inEdges(n.v) || []).forEach((l) => {
|
|
677
678
|
let d = e.edge(l), a = e.node(l.v);
|
|
678
|
-
o && i.push({ v: l.v, w: l.w }), a.out -= d,
|
|
679
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, Ke(t, r, a);
|
|
679
680
|
}), (e.outEdges(n.v) || []).forEach((l) => {
|
|
680
681
|
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
681
|
-
c.in -= d,
|
|
682
|
+
c.in -= d, Ke(t, r, c);
|
|
682
683
|
}), e.removeNode(n.v), s;
|
|
683
684
|
}
|
|
684
|
-
function
|
|
685
|
-
let r = new
|
|
685
|
+
function Zn(e, t) {
|
|
686
|
+
let r = new Y(), n = 0, o = 0;
|
|
686
687
|
e.nodes().forEach((l) => {
|
|
687
688
|
r.setNode(l, { v: l, in: 0, out: 0 });
|
|
688
689
|
}), e.edges().forEach((l) => {
|
|
@@ -691,30 +692,30 @@ function Hn(e, t) {
|
|
|
691
692
|
let u = r.node(l.v), h = r.node(l.w);
|
|
692
693
|
o = Math.max(o, u.out += a), n = Math.max(n, h.in += a);
|
|
693
694
|
});
|
|
694
|
-
let i =
|
|
695
|
+
let i = Qn(o + n + 3).map(() => new Hn()), s = n + 1;
|
|
695
696
|
return r.nodes().forEach((l) => {
|
|
696
|
-
|
|
697
|
+
Ke(i, s, r.node(l));
|
|
697
698
|
}), { graph: r, buckets: i, zeroIdx: s };
|
|
698
699
|
}
|
|
699
|
-
function
|
|
700
|
+
function Ke(e, t, r) {
|
|
700
701
|
var n, o, i;
|
|
701
702
|
r.out ? r.in ? (i = e[r.out - r.in + t]) == null || i.enqueue(r) : (o = e[e.length - 1]) == null || o.enqueue(r) : (n = e[0]) == null || n.enqueue(r);
|
|
702
703
|
}
|
|
703
|
-
function
|
|
704
|
+
function Qn(e) {
|
|
704
705
|
let t = [];
|
|
705
706
|
for (let r = 0; r < e; r++) t.push(r);
|
|
706
707
|
return t;
|
|
707
708
|
}
|
|
708
|
-
function
|
|
709
|
-
(e.graph().acyclicer === "greedy" ?
|
|
709
|
+
function eo(e) {
|
|
710
|
+
(e.graph().acyclicer === "greedy" ? Xn(e, t(e)) : to(e)).forEach((r) => {
|
|
710
711
|
let n = e.edge(r);
|
|
711
|
-
e.removeEdge(r), n.forwardName = r.name, n.reversed = !0, e.setEdge(r.w, r.v, n,
|
|
712
|
+
e.removeEdge(r), n.forwardName = r.name, n.reversed = !0, e.setEdge(r.w, r.v, n, Je("rev"));
|
|
712
713
|
});
|
|
713
714
|
function t(r) {
|
|
714
715
|
return (n) => r.edge(n).weight;
|
|
715
716
|
}
|
|
716
717
|
}
|
|
717
|
-
function
|
|
718
|
+
function to(e) {
|
|
718
719
|
let t = [], r = {}, n = {};
|
|
719
720
|
function o(i) {
|
|
720
721
|
Object.hasOwn(n, i) || (n[i] = !0, r[i] = !0, e.outEdges(i).forEach((s) => {
|
|
@@ -723,7 +724,7 @@ function Jn(e) {
|
|
|
723
724
|
}
|
|
724
725
|
return e.nodes().forEach(o), t;
|
|
725
726
|
}
|
|
726
|
-
function
|
|
727
|
+
function ro(e) {
|
|
727
728
|
e.edges().forEach((t) => {
|
|
728
729
|
let r = e.edge(t);
|
|
729
730
|
if (r.reversed) {
|
|
@@ -733,89 +734,89 @@ function Zn(e) {
|
|
|
733
734
|
}
|
|
734
735
|
});
|
|
735
736
|
}
|
|
736
|
-
function
|
|
737
|
-
e.graph().dummyChains = [], e.edges().forEach((t) =>
|
|
737
|
+
function no(e) {
|
|
738
|
+
e.graph().dummyChains = [], e.edges().forEach((t) => oo(e, t));
|
|
738
739
|
}
|
|
739
|
-
function
|
|
740
|
+
function oo(e, t) {
|
|
740
741
|
let r = t.v, n = e.node(r).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), d = l.labelRank;
|
|
741
742
|
if (i === n + 1) return;
|
|
742
743
|
e.removeEdge(t);
|
|
743
744
|
let a, c, u;
|
|
744
|
-
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n }, a =
|
|
745
|
+
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n }, a = he(e, "edge", c, "_d"), n === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(r, a, { weight: l.weight }, s), u === 0 && e.graph().dummyChains.push(a), r = a;
|
|
745
746
|
e.setEdge(r, o, { weight: l.weight }, s);
|
|
746
747
|
}
|
|
747
|
-
function
|
|
748
|
+
function io(e) {
|
|
748
749
|
e.graph().dummyChains.forEach((t) => {
|
|
749
750
|
let r = e.node(t), n = r.edgeLabel, o;
|
|
750
751
|
for (e.setEdge(r.edgeObj, n); r.dummy; ) o = e.successors(t)[0], e.removeNode(t), n.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (n.x = r.x, n.y = r.y, n.width = r.width, n.height = r.height), t = o, r = e.node(t);
|
|
751
752
|
});
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
+
function Ze(e) {
|
|
754
755
|
let t = {};
|
|
755
756
|
function r(n) {
|
|
756
757
|
let o = e.node(n);
|
|
757
758
|
if (Object.hasOwn(t, n)) return o.rank;
|
|
758
759
|
t[n] = !0;
|
|
759
|
-
let i = e.outEdges(n), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : r(d.w) - e.edge(d).minlen) : [], l =
|
|
760
|
+
let i = e.outEdges(n), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : r(d.w) - e.edge(d).minlen) : [], l = V(Math.min, s);
|
|
760
761
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
761
762
|
}
|
|
762
763
|
e.sources().forEach(r);
|
|
763
764
|
}
|
|
764
|
-
function
|
|
765
|
+
function fe(e, t) {
|
|
765
766
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
766
767
|
}
|
|
767
|
-
var
|
|
768
|
-
function
|
|
769
|
-
let t = new
|
|
768
|
+
var sr = so;
|
|
769
|
+
function so(e) {
|
|
770
|
+
let t = new Y({ directed: !1 }), r = e.nodes();
|
|
770
771
|
if (r.length === 0) throw new Error("Graph must have at least one node");
|
|
771
772
|
let n = r[0], o = e.nodeCount();
|
|
772
773
|
t.setNode(n, {});
|
|
773
774
|
let i, s;
|
|
774
|
-
for (;
|
|
775
|
+
for (; lo(t, e) < o && (i = ao(t, e), !!i); ) s = t.hasNode(i.v) ? fe(e, i) : -fe(e, i), co(t, e, s);
|
|
775
776
|
return t;
|
|
776
777
|
}
|
|
777
|
-
function
|
|
778
|
+
function lo(e, t) {
|
|
778
779
|
function r(n) {
|
|
779
780
|
let o = t.nodeEdges(n);
|
|
780
781
|
o && o.forEach((i) => {
|
|
781
782
|
let s = i.v, l = n === s ? i.w : s;
|
|
782
|
-
!e.hasNode(l) && !
|
|
783
|
+
!e.hasNode(l) && !fe(t, i) && (e.setNode(l, {}), e.setEdge(n, l, {}), r(l));
|
|
783
784
|
});
|
|
784
785
|
}
|
|
785
786
|
return e.nodes().forEach(r), e.nodeCount();
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
+
function ao(e, t) {
|
|
788
789
|
return t.edges().reduce((r, n) => {
|
|
789
790
|
let o = Number.POSITIVE_INFINITY;
|
|
790
|
-
return e.hasNode(n.v) !== e.hasNode(n.w) && (o =
|
|
791
|
+
return e.hasNode(n.v) !== e.hasNode(n.w) && (o = fe(t, n)), o < r[0] ? [o, n] : r;
|
|
791
792
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
+
function co(e, t, r) {
|
|
794
795
|
e.nodes().forEach((n) => t.node(n).rank += r);
|
|
795
796
|
}
|
|
796
|
-
var { preorder:
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
function
|
|
804
|
-
e =
|
|
805
|
-
let t =
|
|
806
|
-
|
|
797
|
+
var { preorder: uo, postorder: fo } = Xe, ho = le;
|
|
798
|
+
le.initLowLimValues = et;
|
|
799
|
+
le.initCutValues = Qe;
|
|
800
|
+
le.calcCutValue = lr;
|
|
801
|
+
le.leaveEdge = dr;
|
|
802
|
+
le.enterEdge = cr;
|
|
803
|
+
le.exchangeEdges = ur;
|
|
804
|
+
function le(e) {
|
|
805
|
+
e = An(e), Ze(e);
|
|
806
|
+
let t = sr(e);
|
|
807
|
+
et(t), Qe(t, e);
|
|
807
808
|
let r, n;
|
|
808
|
-
for (; r =
|
|
809
|
+
for (; r = dr(t); ) n = cr(t, e, r), ur(t, e, r, n);
|
|
809
810
|
}
|
|
810
|
-
function
|
|
811
|
-
let r =
|
|
812
|
-
r = r.slice(0, r.length - 1), r.forEach((n) =>
|
|
811
|
+
function Qe(e, t) {
|
|
812
|
+
let r = fo(e, e.nodes());
|
|
813
|
+
r = r.slice(0, r.length - 1), r.forEach((n) => go(e, t, n));
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function go(e, t, r) {
|
|
815
816
|
let n = e.node(r).parent, o = e.edge(r, n);
|
|
816
|
-
o.cutvalue =
|
|
817
|
+
o.cutvalue = lr(e, t, r);
|
|
817
818
|
}
|
|
818
|
-
function
|
|
819
|
+
function lr(e, t, r) {
|
|
819
820
|
let n = e.node(r).parent, o = !0, i = t.edge(r, n), s = 0;
|
|
820
821
|
i || (o = !1, i = t.edge(n, r)), s = i.weight;
|
|
821
822
|
let l = t.nodeEdges(r);
|
|
@@ -823,84 +824,84 @@ function ir(e, t, r) {
|
|
|
823
824
|
let a = d.v === r, c = a ? d.w : d.v;
|
|
824
825
|
if (c !== n) {
|
|
825
826
|
let u = a === o, h = t.edge(d).weight;
|
|
826
|
-
if (s += u ? h : -h,
|
|
827
|
+
if (s += u ? h : -h, bo(e, r, c)) {
|
|
827
828
|
let g = e.edge(r, c).cutvalue;
|
|
828
829
|
s += u ? -g : g;
|
|
829
830
|
}
|
|
830
831
|
}
|
|
831
832
|
}), s;
|
|
832
833
|
}
|
|
833
|
-
function
|
|
834
|
-
arguments.length < 2 && (t = e.nodes()[0]),
|
|
834
|
+
function et(e, t) {
|
|
835
|
+
arguments.length < 2 && (t = e.nodes()[0]), ar(e, {}, 1, t);
|
|
835
836
|
}
|
|
836
|
-
function
|
|
837
|
+
function ar(e, t, r, n, o) {
|
|
837
838
|
let i = r, s = e.node(n);
|
|
838
839
|
t[n] = !0;
|
|
839
840
|
let l = e.neighbors(n);
|
|
840
841
|
return l && l.forEach((d) => {
|
|
841
|
-
Object.hasOwn(t, d) || (r =
|
|
842
|
+
Object.hasOwn(t, d) || (r = ar(e, t, r, d, n));
|
|
842
843
|
}), s.low = i, s.lim = r++, o ? s.parent = o : delete s.parent, r;
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function dr(e) {
|
|
845
846
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
846
847
|
}
|
|
847
|
-
function
|
|
848
|
+
function cr(e, t, r) {
|
|
848
849
|
let n = r.v, o = r.w;
|
|
849
850
|
t.hasEdge(n, o) || (n = r.w, o = r.v);
|
|
850
851
|
let i = e.node(n), s = e.node(o), l = i, d = !1;
|
|
851
|
-
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d ===
|
|
852
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === Nt(e, e.node(a.v), l) && d !== Nt(e, e.node(a.w), l)).reduce((a, c) => fe(t, c) < fe(t, a) ? c : a);
|
|
852
853
|
}
|
|
853
|
-
function
|
|
854
|
+
function ur(e, t, r, n) {
|
|
854
855
|
let o = r.v, i = r.w;
|
|
855
|
-
e.removeEdge(o, i), e.setEdge(n.v, n.w, {}),
|
|
856
|
+
e.removeEdge(o, i), e.setEdge(n.v, n.w, {}), et(e), Qe(e, t), po(e, t);
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function po(e, t) {
|
|
858
859
|
let r = e.nodes().find((o) => !e.node(o).parent);
|
|
859
860
|
if (!r) return;
|
|
860
|
-
let n =
|
|
861
|
+
let n = uo(e, [r]);
|
|
861
862
|
n = n.slice(1), n.forEach((o) => {
|
|
862
863
|
let i = e.node(o).parent, s = t.edge(o, i), l = !1;
|
|
863
864
|
s || (s = t.edge(i, o), l = !0), t.node(o).rank = t.node(i).rank + (l ? s.minlen : -s.minlen);
|
|
864
865
|
});
|
|
865
866
|
}
|
|
866
|
-
function
|
|
867
|
+
function bo(e, t, r) {
|
|
867
868
|
return e.hasEdge(t, r);
|
|
868
869
|
}
|
|
869
|
-
function
|
|
870
|
+
function Nt(e, t, r) {
|
|
870
871
|
return r.low <= t.lim && t.lim <= r.lim;
|
|
871
872
|
}
|
|
872
|
-
var
|
|
873
|
-
function
|
|
873
|
+
var yo = mo;
|
|
874
|
+
function mo(e) {
|
|
874
875
|
let t = e.graph().ranker;
|
|
875
876
|
if (typeof t == "function") return t(e);
|
|
876
877
|
switch (t) {
|
|
877
878
|
case "network-simplex":
|
|
878
|
-
|
|
879
|
+
Ct(e);
|
|
879
880
|
break;
|
|
880
881
|
case "tight-tree":
|
|
881
|
-
|
|
882
|
+
vo(e);
|
|
882
883
|
break;
|
|
883
884
|
case "longest-path":
|
|
884
|
-
|
|
885
|
+
wo(e);
|
|
885
886
|
break;
|
|
886
887
|
case "none":
|
|
887
888
|
break;
|
|
888
889
|
default:
|
|
889
|
-
|
|
890
|
+
Ct(e);
|
|
890
891
|
}
|
|
891
892
|
}
|
|
892
|
-
var
|
|
893
|
-
function
|
|
894
|
-
|
|
893
|
+
var wo = Ze;
|
|
894
|
+
function vo(e) {
|
|
895
|
+
Ze(e), sr(e);
|
|
895
896
|
}
|
|
896
|
-
function
|
|
897
|
-
|
|
897
|
+
function Ct(e) {
|
|
898
|
+
ho(e);
|
|
898
899
|
}
|
|
899
|
-
var
|
|
900
|
-
function
|
|
901
|
-
let t =
|
|
900
|
+
var Eo = ko;
|
|
901
|
+
function ko(e) {
|
|
902
|
+
let t = To(e);
|
|
902
903
|
e.graph().dummyChains.forEach((r) => {
|
|
903
|
-
let n = e.node(r), o = n.edgeObj, i =
|
|
904
|
+
let n = e.node(r), o = n.edgeObj, i = xo(e, t, o.v, o.w), s = i.path, l = i.lca, d = 0, a = s[d], c = !0;
|
|
904
905
|
for (; r !== o.w; ) {
|
|
905
906
|
if (n = e.node(r), c) {
|
|
906
907
|
for (; (a = s[d]) !== l && e.node(a).maxRank < n.rank; ) d++;
|
|
@@ -914,7 +915,7 @@ function mo(e) {
|
|
|
914
915
|
}
|
|
915
916
|
});
|
|
916
917
|
}
|
|
917
|
-
function
|
|
918
|
+
function xo(e, t, r, n) {
|
|
918
919
|
let o = [], i = [], s = Math.min(t[r].low, t[n].low), l = Math.max(t[r].lim, t[n].lim), d;
|
|
919
920
|
d = r;
|
|
920
921
|
do
|
|
@@ -924,107 +925,107 @@ function wo(e, t, r, n) {
|
|
|
924
925
|
for (; (c = e.parent(c)) !== a; ) i.push(c);
|
|
925
926
|
return { path: o.concat(i.reverse()), lca: a };
|
|
926
927
|
}
|
|
927
|
-
function
|
|
928
|
+
function To(e) {
|
|
928
929
|
let t = {}, r = 0;
|
|
929
930
|
function n(o) {
|
|
930
931
|
let i = r;
|
|
931
932
|
e.children(o).forEach(n), t[o] = { low: i, lim: r++ };
|
|
932
933
|
}
|
|
933
|
-
return e.children(
|
|
934
|
+
return e.children(Oe).forEach(n), t;
|
|
934
935
|
}
|
|
935
|
-
function
|
|
936
|
-
let t =
|
|
936
|
+
function _o(e) {
|
|
937
|
+
let t = he(e, "root", {}, "_root"), r = No(e), n = Object.values(r), o = V(Math.max, n) - 1, i = 2 * o + 1;
|
|
937
938
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
938
|
-
let s =
|
|
939
|
-
e.children(
|
|
939
|
+
let s = Co(e) + 1;
|
|
940
|
+
e.children(Oe).forEach((l) => fr(e, t, i, s, o, r, l)), e.graph().nodeRankFactor = i;
|
|
940
941
|
}
|
|
941
|
-
function
|
|
942
|
+
function fr(e, t, r, n, o, i, s) {
|
|
942
943
|
var l;
|
|
943
944
|
let d = e.children(s);
|
|
944
945
|
if (!d.length) {
|
|
945
946
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: r });
|
|
946
947
|
return;
|
|
947
948
|
}
|
|
948
|
-
let a =
|
|
949
|
+
let a = Tt(e, "_bt"), c = Tt(e, "_bb"), u = e.node(s);
|
|
949
950
|
e.setParent(a, s), u.borderTop = a, e.setParent(c, s), u.borderBottom = c, d.forEach((h) => {
|
|
950
951
|
var g;
|
|
951
|
-
|
|
952
|
-
let
|
|
953
|
-
e.setEdge(a,
|
|
952
|
+
fr(e, t, r, n, o, i, h);
|
|
953
|
+
let p = e.node(h), m = p.borderTop ? p.borderTop : h, b = p.borderBottom ? p.borderBottom : h, v = p.borderTop ? n : 2 * n, T = m !== b ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
954
|
+
e.setEdge(a, m, { weight: v, minlen: T, nestingEdge: !0 }), e.setEdge(b, c, { weight: v, minlen: T, nestingEdge: !0 });
|
|
954
955
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
955
956
|
}
|
|
956
|
-
function
|
|
957
|
+
function No(e) {
|
|
957
958
|
let t = {};
|
|
958
959
|
function r(n, o) {
|
|
959
960
|
let i = e.children(n);
|
|
960
961
|
i && i.length && i.forEach((s) => r(s, o + 1)), t[n] = o;
|
|
961
962
|
}
|
|
962
|
-
return e.children(
|
|
963
|
+
return e.children(Oe).forEach((n) => r(n, 1)), t;
|
|
963
964
|
}
|
|
964
|
-
function
|
|
965
|
+
function Co(e) {
|
|
965
966
|
return e.edges().reduce((t, r) => t + e.edge(r).weight, 0);
|
|
966
967
|
}
|
|
967
|
-
function
|
|
968
|
+
function So(e) {
|
|
968
969
|
let t = e.graph();
|
|
969
970
|
e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((r) => {
|
|
970
971
|
e.edge(r).nestingEdge && e.removeEdge(r);
|
|
971
972
|
});
|
|
972
973
|
}
|
|
973
|
-
var
|
|
974
|
-
function
|
|
974
|
+
var Io = Oo;
|
|
975
|
+
function Oo(e) {
|
|
975
976
|
function t(r) {
|
|
976
977
|
let n = e.children(r), o = e.node(r);
|
|
977
978
|
if (n.length && n.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
978
979
|
o.borderLeft = [], o.borderRight = [];
|
|
979
|
-
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i)
|
|
980
|
+
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) St(e, "borderLeft", "_bl", r, o, i), St(e, "borderRight", "_br", r, o, i);
|
|
980
981
|
}
|
|
981
982
|
}
|
|
982
|
-
e.children(
|
|
983
|
+
e.children(Oe).forEach(t);
|
|
983
984
|
}
|
|
984
|
-
function
|
|
985
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
985
|
+
function St(e, t, r, n, o, i) {
|
|
986
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = he(e, "border", s, r);
|
|
986
987
|
o[t][i] = d, e.setParent(d, n), l && e.setEdge(l, d, { weight: 1 });
|
|
987
988
|
}
|
|
988
|
-
function
|
|
989
|
+
function Mo(e) {
|
|
989
990
|
var t;
|
|
990
991
|
let r = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
991
|
-
(r === "lr" || r === "rl") &&
|
|
992
|
+
(r === "lr" || r === "rl") && hr(e);
|
|
992
993
|
}
|
|
993
|
-
function
|
|
994
|
+
function jo(e) {
|
|
994
995
|
var t;
|
|
995
996
|
let r = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
996
|
-
(r === "bt" || r === "rl") &&
|
|
997
|
+
(r === "bt" || r === "rl") && zo(e), (r === "lr" || r === "rl") && (Fo(e), hr(e));
|
|
997
998
|
}
|
|
998
|
-
function
|
|
999
|
-
e.nodes().forEach((t) =>
|
|
999
|
+
function hr(e) {
|
|
1000
|
+
e.nodes().forEach((t) => It(e.node(t))), e.edges().forEach((t) => It(e.edge(t)));
|
|
1000
1001
|
}
|
|
1001
|
-
function
|
|
1002
|
+
function It(e) {
|
|
1002
1003
|
let t = e.width;
|
|
1003
1004
|
e.width = e.height, e.height = t;
|
|
1004
1005
|
}
|
|
1005
|
-
function
|
|
1006
|
-
e.nodes().forEach((t) =>
|
|
1006
|
+
function zo(e) {
|
|
1007
|
+
e.nodes().forEach((t) => Ae(e.node(t))), e.edges().forEach((t) => {
|
|
1007
1008
|
var r;
|
|
1008
1009
|
let n = e.edge(t);
|
|
1009
|
-
(r = n.points) == null || r.forEach(
|
|
1010
|
+
(r = n.points) == null || r.forEach(Ae), Object.hasOwn(n, "y") && Ae(n);
|
|
1010
1011
|
});
|
|
1011
1012
|
}
|
|
1012
|
-
function
|
|
1013
|
+
function Ae(e) {
|
|
1013
1014
|
e.y = -e.y;
|
|
1014
1015
|
}
|
|
1015
|
-
function
|
|
1016
|
-
e.nodes().forEach((t) =>
|
|
1016
|
+
function Fo(e) {
|
|
1017
|
+
e.nodes().forEach((t) => Pe(e.node(t))), e.edges().forEach((t) => {
|
|
1017
1018
|
var r;
|
|
1018
1019
|
let n = e.edge(t);
|
|
1019
|
-
(r = n.points) == null || r.forEach(
|
|
1020
|
+
(r = n.points) == null || r.forEach(Pe), Object.hasOwn(n, "x") && Pe(n);
|
|
1020
1021
|
});
|
|
1021
1022
|
}
|
|
1022
|
-
function
|
|
1023
|
+
function Pe(e) {
|
|
1023
1024
|
let t = e.x;
|
|
1024
1025
|
e.x = e.y, e.y = t;
|
|
1025
1026
|
}
|
|
1026
|
-
function
|
|
1027
|
-
let t = {}, r = e.nodes().filter((l) => !e.children(l).length), n = r.map((l) => e.node(l).rank), o =
|
|
1027
|
+
function Do(e) {
|
|
1028
|
+
let t = {}, r = e.nodes().filter((l) => !e.children(l).length), n = r.map((l) => e.node(l).rank), o = V(Math.max, n), i = ye(o + 1).map(() => []);
|
|
1028
1029
|
function s(l) {
|
|
1029
1030
|
if (t[l]) return;
|
|
1030
1031
|
t[l] = !0;
|
|
@@ -1035,13 +1036,13 @@ function Mo(e) {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
return r.sort((l, d) => e.node(l).rank - e.node(d).rank).forEach(s), i;
|
|
1037
1038
|
}
|
|
1038
|
-
function
|
|
1039
|
+
function Lo(e, t) {
|
|
1039
1040
|
let r = 0;
|
|
1040
|
-
for (let n = 1; n < t.length; ++n) r +=
|
|
1041
|
+
for (let n = 1; n < t.length; ++n) r += Ro(e, t[n - 1], t[n]);
|
|
1041
1042
|
return r;
|
|
1042
1043
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let n =
|
|
1044
|
+
function Ro(e, t, r) {
|
|
1045
|
+
let n = Yn(r, r.map((a, c) => c)), o = t.flatMap((a) => {
|
|
1045
1046
|
let c = e.outEdges(a);
|
|
1046
1047
|
return c ? c.map((u) => ({ pos: n[u.w], weight: e.edge(u).weight })).sort((u, h) => u.pos - h.pos) : [];
|
|
1047
1048
|
}), i = 1;
|
|
@@ -1057,7 +1058,7 @@ function Fo(e, t, r) {
|
|
|
1057
1058
|
d += a.weight * u;
|
|
1058
1059
|
}), d;
|
|
1059
1060
|
}
|
|
1060
|
-
function
|
|
1061
|
+
function Ao(e, t = []) {
|
|
1061
1062
|
return t.map((r) => {
|
|
1062
1063
|
let n = e.inEdges(r);
|
|
1063
1064
|
if (!n || !n.length) return { v: r };
|
|
@@ -1070,7 +1071,7 @@ function zo(e, t = []) {
|
|
|
1070
1071
|
}
|
|
1071
1072
|
});
|
|
1072
1073
|
}
|
|
1073
|
-
function
|
|
1074
|
+
function Po(e, t) {
|
|
1074
1075
|
let r = {};
|
|
1075
1076
|
e.forEach((o, i) => {
|
|
1076
1077
|
let s = { indegree: 0, in: [], out: [], vs: [o.v], i };
|
|
@@ -1080,13 +1081,13 @@ function Ro(e, t) {
|
|
|
1080
1081
|
i !== void 0 && s !== void 0 && (s.indegree++, i.out.push(s));
|
|
1081
1082
|
});
|
|
1082
1083
|
let n = Object.values(r).filter((o) => !o.indegree);
|
|
1083
|
-
return
|
|
1084
|
+
return Bo(n);
|
|
1084
1085
|
}
|
|
1085
|
-
function
|
|
1086
|
+
function Bo(e) {
|
|
1086
1087
|
let t = [];
|
|
1087
1088
|
function r(o) {
|
|
1088
1089
|
return (i) => {
|
|
1089
|
-
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) &&
|
|
1090
|
+
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) && Wo(o, i);
|
|
1090
1091
|
};
|
|
1091
1092
|
}
|
|
1092
1093
|
function n(o) {
|
|
@@ -1098,62 +1099,62 @@ function Do(e) {
|
|
|
1098
1099
|
let o = e.pop();
|
|
1099
1100
|
t.push(o), o.in.reverse().forEach(r(o)), o.out.forEach(n(o));
|
|
1100
1101
|
}
|
|
1101
|
-
return t.filter((o) => !o.merged).map((o) =>
|
|
1102
|
+
return t.filter((o) => !o.merged).map((o) => Se(o, ["vs", "i", "barycenter", "weight"]));
|
|
1102
1103
|
}
|
|
1103
|
-
function
|
|
1104
|
+
function Wo(e, t) {
|
|
1104
1105
|
let r = 0, n = 0;
|
|
1105
1106
|
e.weight && (r += e.barycenter * e.weight, n += e.weight), t.weight && (r += t.barycenter * t.weight, n += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = r / n, e.weight = n, e.i = Math.min(t.i, e.i), t.merged = !0;
|
|
1106
1107
|
}
|
|
1107
|
-
function
|
|
1108
|
-
let r =
|
|
1109
|
-
n.sort(
|
|
1110
|
-
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d =
|
|
1108
|
+
function Go(e, t) {
|
|
1109
|
+
let r = Gn(e, (c) => Object.hasOwn(c, "barycenter")), n = r.lhs, o = r.rhs.sort((c, u) => u.i - c.i), i = [], s = 0, l = 0, d = 0;
|
|
1110
|
+
n.sort($o(!!t)), d = Ot(i, o, d), n.forEach((c) => {
|
|
1111
|
+
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = Ot(i, o, d);
|
|
1111
1112
|
});
|
|
1112
1113
|
let a = { vs: i.flat(1) };
|
|
1113
1114
|
return l && (a.barycenter = s / l, a.weight = l), a;
|
|
1114
1115
|
}
|
|
1115
|
-
function
|
|
1116
|
+
function Ot(e, t, r) {
|
|
1116
1117
|
let n;
|
|
1117
1118
|
for (; t.length && (n = t[t.length - 1]).i <= r; ) t.pop(), e.push(n.vs), r++;
|
|
1118
1119
|
return r;
|
|
1119
1120
|
}
|
|
1120
|
-
function
|
|
1121
|
+
function $o(e) {
|
|
1121
1122
|
return (t, r) => t.barycenter < r.barycenter ? -1 : t.barycenter > r.barycenter ? 1 : e ? r.i - t.i : t.i - r.i;
|
|
1122
1123
|
}
|
|
1123
|
-
function
|
|
1124
|
+
function gr(e, t, r, n) {
|
|
1124
1125
|
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, d = {};
|
|
1125
1126
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1126
|
-
let a =
|
|
1127
|
+
let a = Ao(e, o);
|
|
1127
1128
|
a.forEach((h) => {
|
|
1128
1129
|
if (e.children(h.v).length) {
|
|
1129
|
-
let g =
|
|
1130
|
-
d[h.v] = g, Object.hasOwn(g, "barycenter") &&
|
|
1130
|
+
let g = gr(e, h.v, r, n);
|
|
1131
|
+
d[h.v] = g, Object.hasOwn(g, "barycenter") && Ko(h, g);
|
|
1131
1132
|
}
|
|
1132
1133
|
});
|
|
1133
|
-
let c =
|
|
1134
|
-
|
|
1135
|
-
let u =
|
|
1134
|
+
let c = Po(a, r);
|
|
1135
|
+
Yo(c, d);
|
|
1136
|
+
let u = Go(c, n);
|
|
1136
1137
|
if (s && l) {
|
|
1137
1138
|
u.vs = [s, u.vs, l].flat(1);
|
|
1138
1139
|
let h = e.predecessors(s);
|
|
1139
1140
|
if (h && h.length) {
|
|
1140
|
-
let g = e.node(h[0]),
|
|
1141
|
-
Object.hasOwn(u, "barycenter") || (u.barycenter = 0, u.weight = 0), u.barycenter = (u.barycenter * u.weight + g.order +
|
|
1141
|
+
let g = e.node(h[0]), p = e.predecessors(l), m = e.node(p[0]);
|
|
1142
|
+
Object.hasOwn(u, "barycenter") || (u.barycenter = 0, u.weight = 0), u.barycenter = (u.barycenter * u.weight + g.order + m.order) / (u.weight + 2), u.weight += 2;
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
1145
|
return u;
|
|
1145
1146
|
}
|
|
1146
|
-
function
|
|
1147
|
+
function Yo(e, t) {
|
|
1147
1148
|
e.forEach((r) => {
|
|
1148
1149
|
r.vs = r.vs.flatMap((n) => t[n] ? t[n].vs : n);
|
|
1149
1150
|
});
|
|
1150
1151
|
}
|
|
1151
|
-
function
|
|
1152
|
+
function Ko(e, t) {
|
|
1152
1153
|
e.barycenter !== void 0 ? (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight) : (e.barycenter = t.barycenter, e.weight = t.weight);
|
|
1153
1154
|
}
|
|
1154
|
-
function
|
|
1155
|
+
function Uo(e, t, r, n) {
|
|
1155
1156
|
n || (n = e.nodes());
|
|
1156
|
-
let o =
|
|
1157
|
+
let o = Vo(e), i = new Y({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1157
1158
|
return n.forEach((s) => {
|
|
1158
1159
|
let l = e.node(s), d = e.parent(s);
|
|
1159
1160
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
@@ -1166,12 +1167,12 @@ function Go(e, t, r, n) {
|
|
|
1166
1167
|
}
|
|
1167
1168
|
}), i;
|
|
1168
1169
|
}
|
|
1169
|
-
function
|
|
1170
|
+
function Vo(e) {
|
|
1170
1171
|
let t;
|
|
1171
|
-
for (; e.hasNode(t =
|
|
1172
|
+
for (; e.hasNode(t = Je("_root")); ) ;
|
|
1172
1173
|
return t;
|
|
1173
1174
|
}
|
|
1174
|
-
function
|
|
1175
|
+
function Ho(e, t, r) {
|
|
1175
1176
|
let n = {}, o;
|
|
1176
1177
|
r.forEach((i) => {
|
|
1177
1178
|
let s = e.parent(i), l, d;
|
|
@@ -1184,22 +1185,22 @@ function Yo(e, t, r) {
|
|
|
1184
1185
|
}
|
|
1185
1186
|
});
|
|
1186
1187
|
}
|
|
1187
|
-
function
|
|
1188
|
+
function pr(e, t = {}) {
|
|
1188
1189
|
if (typeof t.customOrder == "function") {
|
|
1189
|
-
t.customOrder(e,
|
|
1190
|
+
t.customOrder(e, pr);
|
|
1190
1191
|
return;
|
|
1191
1192
|
}
|
|
1192
|
-
let r =
|
|
1193
|
-
if (
|
|
1193
|
+
let r = nr(e), n = Mt(e, ye(1, r + 1), "inEdges"), o = Mt(e, ye(r - 1, -1, -1), "outEdges"), i = Do(e);
|
|
1194
|
+
if (jt(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1194
1195
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1195
1196
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1196
|
-
|
|
1197
|
-
let u =
|
|
1197
|
+
qo(a % 2 ? n : o, a % 4 >= 2, d), i = we(e);
|
|
1198
|
+
let u = Lo(e, i);
|
|
1198
1199
|
u < s ? (c = 0, l = Object.assign({}, i), s = u) : u === s && (l = structuredClone(i));
|
|
1199
1200
|
}
|
|
1200
|
-
|
|
1201
|
+
jt(e, l);
|
|
1201
1202
|
}
|
|
1202
|
-
function
|
|
1203
|
+
function Mt(e, t, r) {
|
|
1203
1204
|
let n = /* @__PURE__ */ new Map(), o = (i, s) => {
|
|
1204
1205
|
n.has(i) || n.set(i, []), n.get(i).push(s);
|
|
1205
1206
|
};
|
|
@@ -1208,48 +1209,48 @@ function It(e, t, r) {
|
|
|
1208
1209
|
if (typeof s.rank == "number" && o(s.rank, i), typeof s.minRank == "number" && typeof s.maxRank == "number") for (let l = s.minRank; l <= s.maxRank; l++) l !== s.rank && o(l, i);
|
|
1209
1210
|
}
|
|
1210
1211
|
return t.map(function(i) {
|
|
1211
|
-
return
|
|
1212
|
+
return Uo(e, i, r, n.get(i) || []);
|
|
1212
1213
|
});
|
|
1213
1214
|
}
|
|
1214
|
-
function
|
|
1215
|
-
let n = new
|
|
1215
|
+
function qo(e, t, r) {
|
|
1216
|
+
let n = new Y();
|
|
1216
1217
|
e.forEach(function(o) {
|
|
1217
1218
|
r.forEach((l) => n.setEdge(l.left, l.right));
|
|
1218
|
-
let i = o.graph().root, s =
|
|
1219
|
-
s.vs.forEach((l, d) => o.node(l).order = d),
|
|
1219
|
+
let i = o.graph().root, s = gr(o, i, n, t);
|
|
1220
|
+
s.vs.forEach((l, d) => o.node(l).order = d), Ho(o, n, s.vs);
|
|
1220
1221
|
});
|
|
1221
1222
|
}
|
|
1222
|
-
function
|
|
1223
|
+
function jt(e, t) {
|
|
1223
1224
|
Object.values(t).forEach((r) => r.forEach((n, o) => e.node(n).order = o));
|
|
1224
1225
|
}
|
|
1225
|
-
function
|
|
1226
|
+
function Xo(e, t) {
|
|
1226
1227
|
let r = {};
|
|
1227
1228
|
function n(o, i) {
|
|
1228
1229
|
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1229
1230
|
return i.forEach((c, u) => {
|
|
1230
|
-
let h =
|
|
1231
|
-
(h || c === a) && (i.slice(l, u + 1).forEach((
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1234
|
-
let v = e.node(
|
|
1235
|
-
(
|
|
1231
|
+
let h = Zo(e, c), g = h ? e.node(h).order : d;
|
|
1232
|
+
(h || c === a) && (i.slice(l, u + 1).forEach((p) => {
|
|
1233
|
+
let m = e.predecessors(p);
|
|
1234
|
+
m && m.forEach((b) => {
|
|
1235
|
+
let v = e.node(b), T = v.order;
|
|
1236
|
+
(T < s || g < T) && !(v.dummy && e.node(p).dummy) && br(r, b, p);
|
|
1236
1237
|
});
|
|
1237
1238
|
}), l = u + 1, s = g);
|
|
1238
1239
|
}), i;
|
|
1239
1240
|
}
|
|
1240
1241
|
return t.length && t.reduce(n), r;
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function Jo(e, t) {
|
|
1243
1244
|
let r = {};
|
|
1244
1245
|
function n(i, s, l, d, a) {
|
|
1245
|
-
|
|
1246
|
+
ye(s, l).forEach((c) => {
|
|
1246
1247
|
let u = i[c];
|
|
1247
1248
|
if (u !== void 0 && e.node(u).dummy) {
|
|
1248
1249
|
let h = e.predecessors(u);
|
|
1249
1250
|
h && h.forEach((g) => {
|
|
1250
1251
|
if (g === void 0) return;
|
|
1251
|
-
let
|
|
1252
|
-
|
|
1252
|
+
let p = e.node(g);
|
|
1253
|
+
p.dummy && (p.order < d || p.order > a) && br(r, g, u);
|
|
1253
1254
|
});
|
|
1254
1255
|
}
|
|
1255
1256
|
});
|
|
@@ -1270,13 +1271,13 @@ function Vo(e, t) {
|
|
|
1270
1271
|
}
|
|
1271
1272
|
return t.length && t.reduce(o), r;
|
|
1272
1273
|
}
|
|
1273
|
-
function
|
|
1274
|
+
function Zo(e, t) {
|
|
1274
1275
|
if (e.node(t).dummy) {
|
|
1275
1276
|
let r = e.predecessors(t);
|
|
1276
1277
|
if (r) return r.find((n) => e.node(n).dummy);
|
|
1277
1278
|
}
|
|
1278
1279
|
}
|
|
1279
|
-
function
|
|
1280
|
+
function br(e, t, r) {
|
|
1280
1281
|
if (t > r) {
|
|
1281
1282
|
let o = t;
|
|
1282
1283
|
t = r, r = o;
|
|
@@ -1284,7 +1285,7 @@ function gr(e, t, r) {
|
|
|
1284
1285
|
let n = e[t];
|
|
1285
1286
|
n || (e[t] = n = {}), n[r] = !0;
|
|
1286
1287
|
}
|
|
1287
|
-
function
|
|
1288
|
+
function Qo(e, t, r) {
|
|
1288
1289
|
if (t > r) {
|
|
1289
1290
|
let o = t;
|
|
1290
1291
|
t = r, r = o;
|
|
@@ -1292,7 +1293,7 @@ function qo(e, t, r) {
|
|
|
1292
1293
|
let n = e[t];
|
|
1293
1294
|
return n !== void 0 && Object.hasOwn(n, r);
|
|
1294
1295
|
}
|
|
1295
|
-
function
|
|
1296
|
+
function ei(e, t, r, n) {
|
|
1296
1297
|
let o = {}, i = {}, s = {};
|
|
1297
1298
|
return t.forEach((l) => {
|
|
1298
1299
|
l.forEach((d, a) => {
|
|
@@ -1303,52 +1304,52 @@ function Xo(e, t, r, n) {
|
|
|
1303
1304
|
l.forEach((a) => {
|
|
1304
1305
|
let c = n(a);
|
|
1305
1306
|
if (c && c.length) {
|
|
1306
|
-
let u = c.sort((g,
|
|
1307
|
-
let
|
|
1308
|
-
return (
|
|
1307
|
+
let u = c.sort((g, p) => {
|
|
1308
|
+
let m = s[g], b = s[p];
|
|
1309
|
+
return (m !== void 0 ? m : 0) - (b !== void 0 ? b : 0);
|
|
1309
1310
|
}), h = (u.length - 1) / 2;
|
|
1310
|
-
for (let g = Math.floor(h),
|
|
1311
|
-
let
|
|
1312
|
-
if (
|
|
1313
|
-
let
|
|
1314
|
-
if (
|
|
1315
|
-
let v = o[
|
|
1316
|
-
v !== void 0 && (i[
|
|
1311
|
+
for (let g = Math.floor(h), p = Math.ceil(h); g <= p; ++g) {
|
|
1312
|
+
let m = u[g];
|
|
1313
|
+
if (m === void 0) continue;
|
|
1314
|
+
let b = s[m];
|
|
1315
|
+
if (b !== void 0 && i[a] === a && d < b && !Qo(r, a, m)) {
|
|
1316
|
+
let v = o[m];
|
|
1317
|
+
v !== void 0 && (i[m] = a, i[a] = o[a] = v, d = b);
|
|
1317
1318
|
}
|
|
1318
1319
|
}
|
|
1319
1320
|
}
|
|
1320
1321
|
});
|
|
1321
1322
|
}), { root: o, align: i };
|
|
1322
1323
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let i = {}, s =
|
|
1325
|
-
function d(g,
|
|
1326
|
-
let
|
|
1324
|
+
function ti(e, t, r, n, o = !1) {
|
|
1325
|
+
let i = {}, s = ri(e, t, r, o), l = o ? "borderLeft" : "borderRight";
|
|
1326
|
+
function d(g, p) {
|
|
1327
|
+
let m = s.nodes().slice(), b = {}, v = m.pop();
|
|
1327
1328
|
for (; v; ) {
|
|
1328
|
-
if (
|
|
1329
|
+
if (b[v]) g(v);
|
|
1329
1330
|
else {
|
|
1330
|
-
|
|
1331
|
-
for (let
|
|
1331
|
+
b[v] = !0, m.push(v);
|
|
1332
|
+
for (let T of p(v)) m.push(T);
|
|
1332
1333
|
}
|
|
1333
|
-
v =
|
|
1334
|
+
v = m.pop();
|
|
1334
1335
|
}
|
|
1335
1336
|
}
|
|
1336
1337
|
function a(g) {
|
|
1337
|
-
let
|
|
1338
|
-
|
|
1338
|
+
let p = s.inEdges(g);
|
|
1339
|
+
p ? i[g] = p.reduce((m, b) => {
|
|
1339
1340
|
var v;
|
|
1340
|
-
let
|
|
1341
|
-
return Math.max(
|
|
1341
|
+
let T = (v = i[b.v]) != null ? v : 0, S = s.edge(b);
|
|
1342
|
+
return Math.max(m, T + (S !== void 0 ? S : 0));
|
|
1342
1343
|
}, 0) : i[g] = 0;
|
|
1343
1344
|
}
|
|
1344
1345
|
function c(g) {
|
|
1345
|
-
let
|
|
1346
|
-
|
|
1347
|
-
let
|
|
1348
|
-
return Math.min(v, (
|
|
1346
|
+
let p = s.outEdges(g), m = Number.POSITIVE_INFINITY;
|
|
1347
|
+
p && (m = p.reduce((v, T) => {
|
|
1348
|
+
let S = i[T.w], z = s.edge(T);
|
|
1349
|
+
return Math.min(v, (S !== void 0 ? S : 0) - (z !== void 0 ? z : 0));
|
|
1349
1350
|
}, Number.POSITIVE_INFINITY));
|
|
1350
|
-
let
|
|
1351
|
-
|
|
1351
|
+
let b = e.node(g);
|
|
1352
|
+
m !== Number.POSITIVE_INFINITY && b.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, m));
|
|
1352
1353
|
}
|
|
1353
1354
|
function u(g) {
|
|
1354
1355
|
return s.predecessors(g) || [];
|
|
@@ -1357,13 +1358,13 @@ function Jo(e, t, r, n, o = !1) {
|
|
|
1357
1358
|
return s.successors(g) || [];
|
|
1358
1359
|
}
|
|
1359
1360
|
return d(a, u), d(c, h), Object.keys(n).forEach((g) => {
|
|
1360
|
-
var
|
|
1361
|
-
let
|
|
1362
|
-
|
|
1361
|
+
var p;
|
|
1362
|
+
let m = r[g];
|
|
1363
|
+
m !== void 0 && (i[g] = (p = i[m]) != null ? p : 0);
|
|
1363
1364
|
}), i;
|
|
1364
1365
|
}
|
|
1365
|
-
function
|
|
1366
|
-
let o = new
|
|
1366
|
+
function ri(e, t, r, n) {
|
|
1367
|
+
let o = new Y(), i = e.graph(), s = li(i.nodesep, i.edgesep, n);
|
|
1367
1368
|
return t.forEach((l) => {
|
|
1368
1369
|
let d;
|
|
1369
1370
|
l.forEach((a) => {
|
|
@@ -1381,31 +1382,31 @@ function Zo(e, t, r, n) {
|
|
|
1381
1382
|
});
|
|
1382
1383
|
}), o;
|
|
1383
1384
|
}
|
|
1384
|
-
function
|
|
1385
|
+
function ni(e, t) {
|
|
1385
1386
|
return Object.values(t).reduce((r, n) => {
|
|
1386
1387
|
let o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
1387
1388
|
Object.entries(n).forEach(([l, d]) => {
|
|
1388
|
-
let a =
|
|
1389
|
+
let a = ai(e, l) / 2;
|
|
1389
1390
|
o = Math.max(d + a, o), i = Math.min(d - a, i);
|
|
1390
1391
|
});
|
|
1391
1392
|
let s = o - i;
|
|
1392
1393
|
return s < r[0] && (r = [s, n]), r;
|
|
1393
1394
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1394
1395
|
}
|
|
1395
|
-
function
|
|
1396
|
-
let r = Object.values(t), n =
|
|
1396
|
+
function oi(e, t) {
|
|
1397
|
+
let r = Object.values(t), n = V(Math.min, r), o = V(Math.max, r);
|
|
1397
1398
|
["u", "d"].forEach((i) => {
|
|
1398
1399
|
["l", "r"].forEach((s) => {
|
|
1399
1400
|
let l = i + s, d = e[l];
|
|
1400
1401
|
if (!d || d === t) return;
|
|
1401
|
-
let a = Object.values(d), c = n -
|
|
1402
|
-
s !== "l" && (c = o -
|
|
1402
|
+
let a = Object.values(d), c = n - V(Math.min, a);
|
|
1403
|
+
s !== "l" && (c = o - V(Math.max, a)), c && (e[l] = Ie(d, (u) => u + c));
|
|
1403
1404
|
});
|
|
1404
1405
|
});
|
|
1405
1406
|
}
|
|
1406
|
-
function
|
|
1407
|
+
function ii(e, t = void 0) {
|
|
1407
1408
|
let r = e.ul;
|
|
1408
|
-
return r ?
|
|
1409
|
+
return r ? Ie(r, (n, o) => {
|
|
1409
1410
|
var i, s;
|
|
1410
1411
|
if (t) {
|
|
1411
1412
|
let d = t.toLowerCase(), a = e[d];
|
|
@@ -1418,19 +1419,19 @@ function ti(e, t = void 0) {
|
|
|
1418
1419
|
return (((i = l[1]) != null ? i : 0) + ((s = l[2]) != null ? s : 0)) / 2;
|
|
1419
1420
|
}) : {};
|
|
1420
1421
|
}
|
|
1421
|
-
function
|
|
1422
|
-
let t =
|
|
1422
|
+
function si(e) {
|
|
1423
|
+
let t = we(e), r = Object.assign(Xo(e, t), Jo(e, t)), n = {}, o;
|
|
1423
1424
|
["u", "d"].forEach((s) => {
|
|
1424
1425
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1425
1426
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1426
|
-
let d =
|
|
1427
|
-
l === "r" && (a =
|
|
1427
|
+
let d = ei(e, o, r, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = ti(e, o, d.root, d.align, l === "r");
|
|
1428
|
+
l === "r" && (a = Ie(a, (c) => -c)), n[s + l] = a;
|
|
1428
1429
|
});
|
|
1429
1430
|
});
|
|
1430
|
-
let i =
|
|
1431
|
-
return
|
|
1431
|
+
let i = ni(e, n);
|
|
1432
|
+
return oi(n, i), ii(n, e.graph().align);
|
|
1432
1433
|
}
|
|
1433
|
-
function
|
|
1434
|
+
function li(e, t, r) {
|
|
1434
1435
|
return (n, o, i) => {
|
|
1435
1436
|
let s = n.node(o), l = n.node(i), d = 0, a;
|
|
1436
1437
|
if (d += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
|
|
@@ -1452,14 +1453,14 @@ function ni(e, t, r) {
|
|
|
1452
1453
|
return a && (d += r ? a : -a), d;
|
|
1453
1454
|
};
|
|
1454
1455
|
}
|
|
1455
|
-
function
|
|
1456
|
+
function ai(e, t) {
|
|
1456
1457
|
return e.node(t).width;
|
|
1457
1458
|
}
|
|
1458
|
-
function
|
|
1459
|
-
e =
|
|
1459
|
+
function di(e) {
|
|
1460
|
+
e = tr(e), ci(e), Object.entries(si(e)).forEach(([t, r]) => e.node(t).x = r);
|
|
1460
1461
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let t =
|
|
1462
|
+
function ci(e) {
|
|
1463
|
+
let t = we(e), r = e.graph(), n = r.ranksep, o = r.rankalign, i = 0;
|
|
1463
1464
|
t.forEach((s) => {
|
|
1464
1465
|
let l = s.reduce((d, a) => {
|
|
1465
1466
|
var c;
|
|
@@ -1472,17 +1473,17 @@ function si(e) {
|
|
|
1472
1473
|
}), i += l + n;
|
|
1473
1474
|
});
|
|
1474
1475
|
}
|
|
1475
|
-
function
|
|
1476
|
-
let r = t.debugTiming ?
|
|
1476
|
+
function ui(e, t = {}) {
|
|
1477
|
+
let r = t.debugTiming ? or : ir;
|
|
1477
1478
|
return r("layout", () => {
|
|
1478
|
-
let n = r(" buildLayoutGraph", () =>
|
|
1479
|
-
return r(" runLayout", () =>
|
|
1479
|
+
let n = r(" buildLayoutGraph", () => Ei(e));
|
|
1480
|
+
return r(" runLayout", () => fi(n, r, t)), r(" updateInputGraph", () => hi(e, n)), n;
|
|
1480
1481
|
});
|
|
1481
1482
|
}
|
|
1482
|
-
function
|
|
1483
|
-
t(" makeSpaceForEdgeLabels", () =>
|
|
1483
|
+
function fi(e, t, r) {
|
|
1484
|
+
t(" makeSpaceForEdgeLabels", () => ki(e)), t(" removeSelfEdges", () => Mi(e)), t(" acyclic", () => eo(e)), t(" nestingGraph.run", () => _o(e)), t(" rank", () => yo(tr(e))), t(" injectEdgeLabelProxies", () => xi(e)), t(" removeEmptyRanks", () => Bn(e)), t(" nestingGraph.cleanup", () => So(e)), t(" normalizeRanks", () => Pn(e)), t(" assignRankMinMax", () => Ti(e)), t(" removeEdgeLabelProxies", () => _i(e)), t(" normalize.run", () => no(e)), t(" parentDummyChains", () => Eo(e)), t(" addBorderSegments", () => Io(e)), t(" order", () => pr(e, r)), t(" insertSelfEdges", () => ji(e)), t(" adjustCoordinateSystem", () => Mo(e)), t(" position", () => di(e)), t(" positionSelfEdges", () => zi(e)), t(" removeBorderNodes", () => Oi(e)), t(" normalize.undo", () => io(e)), t(" fixupEdgeLabelCoords", () => Si(e)), t(" undoCoordinateSystem", () => jo(e)), t(" translateGraph", () => Ni(e)), t(" assignNodeIntersects", () => Ci(e)), t(" reversePoints", () => Ii(e)), t(" acyclic.undo", () => ro(e));
|
|
1484
1485
|
}
|
|
1485
|
-
function
|
|
1486
|
+
function hi(e, t) {
|
|
1486
1487
|
e.nodes().forEach((r) => {
|
|
1487
1488
|
let n = e.node(r), o = t.node(r);
|
|
1488
1489
|
n && (n.x = o.x, n.y = o.y, n.order = o.order, n.rank = o.rank, t.children(r).length && (n.width = o.width, n.height = o.height));
|
|
@@ -1491,45 +1492,45 @@ function di(e, t) {
|
|
|
1491
1492
|
n.points = o.points, Object.hasOwn(o, "x") && (n.x = o.x, n.y = o.y);
|
|
1492
1493
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1493
1494
|
}
|
|
1494
|
-
var
|
|
1495
|
-
function
|
|
1496
|
-
let t = new
|
|
1497
|
-
return t.setGraph(Object.assign({},
|
|
1498
|
-
let o =
|
|
1499
|
-
Object.keys(
|
|
1500
|
-
i[l] === void 0 && (i[l] =
|
|
1495
|
+
var gi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], pi = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, bi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], yi = ["width", "height", "rank"], zt = { width: 0, height: 0 }, mi = ["minlen", "weight", "width", "height", "labeloffset"], wi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, vi = ["labelpos"];
|
|
1496
|
+
function Ei(e) {
|
|
1497
|
+
let t = new Y({ multigraph: !0, compound: !0 }), r = We(e.graph());
|
|
1498
|
+
return t.setGraph(Object.assign({}, pi, Be(r, gi), Se(r, bi))), e.nodes().forEach((n) => {
|
|
1499
|
+
let o = We(e.node(n)), i = Be(o, yi);
|
|
1500
|
+
Object.keys(zt).forEach((l) => {
|
|
1501
|
+
i[l] === void 0 && (i[l] = zt[l]);
|
|
1501
1502
|
}), t.setNode(n, i);
|
|
1502
1503
|
let s = e.parent(n);
|
|
1503
1504
|
s !== void 0 && t.setParent(n, s);
|
|
1504
1505
|
}), e.edges().forEach((n) => {
|
|
1505
|
-
let o =
|
|
1506
|
-
t.setEdge(n, Object.assign({},
|
|
1506
|
+
let o = We(e.edge(n));
|
|
1507
|
+
t.setEdge(n, Object.assign({}, wi, Be(o, mi), Se(o, vi)));
|
|
1507
1508
|
}), t;
|
|
1508
1509
|
}
|
|
1509
|
-
function
|
|
1510
|
+
function ki(e) {
|
|
1510
1511
|
let t = e.graph();
|
|
1511
1512
|
t.ranksep /= 2, e.edges().forEach((r) => {
|
|
1512
1513
|
let n = e.edge(r);
|
|
1513
1514
|
n.minlen *= 2, n.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? n.width += n.labeloffset : n.height += n.labeloffset);
|
|
1514
1515
|
});
|
|
1515
1516
|
}
|
|
1516
|
-
function
|
|
1517
|
+
function xi(e) {
|
|
1517
1518
|
e.edges().forEach((t) => {
|
|
1518
1519
|
let r = e.edge(t);
|
|
1519
1520
|
if (r.width && r.height) {
|
|
1520
1521
|
let n = e.node(t.v), o = { rank: (e.node(t.w).rank - n.rank) / 2 + n.rank, e: t };
|
|
1521
|
-
|
|
1522
|
+
he(e, "edge-proxy", o, "_ep");
|
|
1522
1523
|
}
|
|
1523
1524
|
});
|
|
1524
1525
|
}
|
|
1525
|
-
function
|
|
1526
|
+
function Ti(e) {
|
|
1526
1527
|
let t = 0;
|
|
1527
1528
|
e.nodes().forEach((r) => {
|
|
1528
1529
|
let n = e.node(r);
|
|
1529
1530
|
n.borderTop && (n.minRank = e.node(n.borderTop).rank, n.maxRank = e.node(n.borderBottom).rank, t = Math.max(t, n.maxRank));
|
|
1530
1531
|
}), e.graph().maxRank = t;
|
|
1531
1532
|
}
|
|
1532
|
-
function
|
|
1533
|
+
function _i(e) {
|
|
1533
1534
|
e.nodes().forEach((t) => {
|
|
1534
1535
|
let r = e.node(t);
|
|
1535
1536
|
if (r.dummy === "edge-proxy") {
|
|
@@ -1538,7 +1539,7 @@ function Ei(e) {
|
|
|
1538
1539
|
}
|
|
1539
1540
|
});
|
|
1540
1541
|
}
|
|
1541
|
-
function
|
|
1542
|
+
function Ni(e) {
|
|
1542
1543
|
let t = Number.POSITIVE_INFINITY, r = 0, n = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1543
1544
|
function d(a) {
|
|
1544
1545
|
let c = a.x, u = a.y, h = a.width, g = a.height;
|
|
@@ -1557,13 +1558,13 @@ function ki(e) {
|
|
|
1557
1558
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= n);
|
|
1558
1559
|
}), i.width = r - t + s, i.height = o - n + l;
|
|
1559
1560
|
}
|
|
1560
|
-
function
|
|
1561
|
+
function Ci(e) {
|
|
1561
1562
|
e.edges().forEach((t) => {
|
|
1562
1563
|
let r = e.edge(t), n = e.node(t.v), o = e.node(t.w), i, s;
|
|
1563
|
-
r.points ? (i = r.points[0], s = r.points[r.points.length - 1]) : (r.points = [], i = o, s = n), r.points.unshift(
|
|
1564
|
+
r.points ? (i = r.points[0], s = r.points[r.points.length - 1]) : (r.points = [], i = o, s = n), r.points.unshift(xt(n, i)), r.points.push(xt(o, s));
|
|
1564
1565
|
});
|
|
1565
1566
|
}
|
|
1566
|
-
function
|
|
1567
|
+
function Si(e) {
|
|
1567
1568
|
e.edges().forEach((t) => {
|
|
1568
1569
|
let r = e.edge(t);
|
|
1569
1570
|
if (Object.hasOwn(r, "x")) switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
|
|
@@ -1576,13 +1577,13 @@ function _i(e) {
|
|
|
1576
1577
|
}
|
|
1577
1578
|
});
|
|
1578
1579
|
}
|
|
1579
|
-
function
|
|
1580
|
+
function Ii(e) {
|
|
1580
1581
|
e.edges().forEach((t) => {
|
|
1581
1582
|
let r = e.edge(t);
|
|
1582
1583
|
r.reversed && r.points.reverse();
|
|
1583
1584
|
});
|
|
1584
1585
|
}
|
|
1585
|
-
function
|
|
1586
|
+
function Oi(e) {
|
|
1586
1587
|
e.nodes().forEach((t) => {
|
|
1587
1588
|
if (e.children(t).length) {
|
|
1588
1589
|
let r = e.node(t), n = e.node(r.borderTop), o = e.node(r.borderBottom), i = e.node(r.borderLeft[r.borderLeft.length - 1]), s = e.node(r.borderRight[r.borderRight.length - 1]);
|
|
@@ -1592,7 +1593,7 @@ function Ni(e) {
|
|
|
1592
1593
|
e.node(t).dummy === "border" && e.removeNode(t);
|
|
1593
1594
|
});
|
|
1594
1595
|
}
|
|
1595
|
-
function
|
|
1596
|
+
function Mi(e) {
|
|
1596
1597
|
e.edges().forEach((t) => {
|
|
1597
1598
|
if (t.v === t.w) {
|
|
1598
1599
|
let r = e.node(t.v);
|
|
@@ -1600,18 +1601,18 @@ function Ci(e) {
|
|
|
1600
1601
|
}
|
|
1601
1602
|
});
|
|
1602
1603
|
}
|
|
1603
|
-
function
|
|
1604
|
-
|
|
1604
|
+
function ji(e) {
|
|
1605
|
+
we(e).forEach((t) => {
|
|
1605
1606
|
let r = 0;
|
|
1606
1607
|
t.forEach((n, o) => {
|
|
1607
1608
|
let i = e.node(n);
|
|
1608
1609
|
i.order = o + r, (i.selfEdges || []).forEach((s) => {
|
|
1609
|
-
|
|
1610
|
+
he(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++r, e: s.e, label: s.label }, "_se");
|
|
1610
1611
|
}), delete i.selfEdges;
|
|
1611
1612
|
});
|
|
1612
1613
|
});
|
|
1613
1614
|
}
|
|
1614
|
-
function
|
|
1615
|
+
function zi(e) {
|
|
1615
1616
|
e.nodes().forEach((t) => {
|
|
1616
1617
|
let r = e.node(t);
|
|
1617
1618
|
if (r.dummy === "selfedge") {
|
|
@@ -1620,17 +1621,17 @@ function Ii(e) {
|
|
|
1620
1621
|
}
|
|
1621
1622
|
});
|
|
1622
1623
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return
|
|
1624
|
+
function Be(e, t) {
|
|
1625
|
+
return Ie(Se(e, t), Number);
|
|
1625
1626
|
}
|
|
1626
|
-
function
|
|
1627
|
+
function We(e) {
|
|
1627
1628
|
let t = {};
|
|
1628
1629
|
return e && Object.entries(e).forEach(([r, n]) => {
|
|
1629
1630
|
typeof r == "string" && (r = r.toLowerCase()), t[r] = n;
|
|
1630
1631
|
}), t;
|
|
1631
1632
|
}
|
|
1632
|
-
function
|
|
1633
|
-
let t =
|
|
1633
|
+
function Fi(e) {
|
|
1634
|
+
let t = we(e), r = new Y({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1634
1635
|
return e.nodes().forEach((n) => {
|
|
1635
1636
|
r.setNode(n, { label: n }), r.setParent(n, "layer" + e.node(n).rank);
|
|
1636
1637
|
}), e.edges().forEach((n) => r.setEdge(n.v, n.w, {}, n.name)), t.forEach((n, o) => {
|
|
@@ -1638,16 +1639,16 @@ function Oi(e) {
|
|
|
1638
1639
|
r.setNode(i, { rank: "same" }), n.reduce((s, l) => (r.setEdge(s, l, { style: "invis" }), l));
|
|
1639
1640
|
}), r;
|
|
1640
1641
|
}
|
|
1641
|
-
var
|
|
1642
|
+
var Di = { graphlib: Ut, version: Kn, layout: ui, debug: Fi, util: { time: or, notime: ir } }, Ft = Di;
|
|
1642
1643
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1643
|
-
const
|
|
1644
|
+
const Li = (e) => {
|
|
1644
1645
|
const t = [];
|
|
1645
1646
|
return e.nodeInternals.forEach((r, n) => t.push(`${n}:${r.height ?? 0}`)), t.join(",");
|
|
1646
|
-
},
|
|
1647
|
-
const r =
|
|
1648
|
-
|
|
1649
|
-
const { fitView: o } =
|
|
1650
|
-
return
|
|
1647
|
+
}, Ri = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1648
|
+
const r = Cr(Li), n = mt("");
|
|
1649
|
+
mt(0);
|
|
1650
|
+
const { fitView: o } = Sr();
|
|
1651
|
+
return re(() => {
|
|
1651
1652
|
if (!r || r === n.current) return;
|
|
1652
1653
|
const i = {};
|
|
1653
1654
|
for (const s of r.split(",")) {
|
|
@@ -1656,19 +1657,19 @@ const ji = (e) => {
|
|
|
1656
1657
|
}
|
|
1657
1658
|
Object.keys(i).length !== 0 && (n.current = r, e(i));
|
|
1658
1659
|
}, [r]), null;
|
|
1659
|
-
},
|
|
1660
|
-
const [l, d] =
|
|
1661
|
-
n && /* @__PURE__ */ f(
|
|
1660
|
+
}, Me = ({ isOpen: e, onClose: t, title: r, icon: n, children: o, footer: i, width: s = 600 }) => {
|
|
1661
|
+
const [l, d] = M(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ y(J, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1662
|
+
n && /* @__PURE__ */ f(J, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: n }),
|
|
1662
1663
|
/* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: r }),
|
|
1663
|
-
/* @__PURE__ */ f(
|
|
1664
|
-
/* @__PURE__ */ f(
|
|
1665
|
-
] }), u = () => i ? /* @__PURE__ */ f(
|
|
1666
|
-
return l ? /* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ f(wt, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(on, {}) : /* @__PURE__ */ f(sn, {}) }),
|
|
1665
|
+
/* @__PURE__ */ f(wt, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f($r, {}) })
|
|
1666
|
+
] }), u = () => i ? /* @__PURE__ */ f(J, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1667
|
+
return l ? /* @__PURE__ */ y(Pr, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1667
1668
|
/* @__PURE__ */ f(c, {}),
|
|
1668
|
-
/* @__PURE__ */ f(
|
|
1669
|
+
/* @__PURE__ */ f(J, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1669
1670
|
/* @__PURE__ */ f(u, {})
|
|
1670
|
-
] }) : /* @__PURE__ */
|
|
1671
|
-
|
|
1671
|
+
] }) : /* @__PURE__ */ y(
|
|
1672
|
+
Br,
|
|
1672
1673
|
{
|
|
1673
1674
|
anchor: "right",
|
|
1674
1675
|
open: e,
|
|
@@ -1693,53 +1694,157 @@ const ji = (e) => {
|
|
|
1693
1694
|
},
|
|
1694
1695
|
children: [
|
|
1695
1696
|
/* @__PURE__ */ f(c, {}),
|
|
1696
|
-
/* @__PURE__ */ f(
|
|
1697
|
+
/* @__PURE__ */ f(J, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1697
1698
|
/* @__PURE__ */ f(u, {})
|
|
1698
1699
|
]
|
|
1699
1700
|
}
|
|
1700
1701
|
);
|
|
1701
|
-
},
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1702
|
+
}, Ai = ({
|
|
1703
|
+
open: e,
|
|
1704
|
+
templates: t,
|
|
1705
|
+
messages: r,
|
|
1706
|
+
onSelect: n,
|
|
1707
|
+
onClose: o,
|
|
1708
|
+
loadTriggerSources: i
|
|
1709
|
+
}) => {
|
|
1710
|
+
const [s, l] = M("trigger"), [d, a] = M(null), [c, u] = M([]), [h, g] = M([]), [p, m] = M(!1), [b, v] = M(null);
|
|
1711
|
+
re(() => {
|
|
1712
|
+
e || (l("trigger"), a(null), u([]), g([]), m(!1), v(null));
|
|
1713
|
+
}, [e]);
|
|
1714
|
+
const T = U(async (F) => {
|
|
1715
|
+
if (!i) {
|
|
1716
|
+
n(F);
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
a(F), m(!0), v(null);
|
|
1720
|
+
try {
|
|
1721
|
+
const D = await i(F.triggerKey);
|
|
1722
|
+
if (!D || D.length === 0) {
|
|
1723
|
+
n(F);
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
u(D), l("sources");
|
|
1727
|
+
} catch (D) {
|
|
1728
|
+
v(D instanceof Error ? D.message : "Failed to load sources.");
|
|
1729
|
+
} finally {
|
|
1730
|
+
m(!1);
|
|
1731
|
+
}
|
|
1732
|
+
}, [i, n]), S = () => {
|
|
1733
|
+
l("trigger"), a(null), u([]), g([]), v(null);
|
|
1734
|
+
}, z = () => {
|
|
1735
|
+
d && n(d, h);
|
|
1736
|
+
}, j = s === "sources" && d, B = j ? /* @__PURE__ */ y(be, { children: [
|
|
1737
|
+
/* @__PURE__ */ f(_e, { type: "button", variant: "outlined", size: "small", onClick: S, children: r.cancel ?? "Back" }),
|
|
1738
|
+
/* @__PURE__ */ f(
|
|
1739
|
+
_e,
|
|
1706
1740
|
{
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1741
|
+
type: "button",
|
|
1742
|
+
variant: "contained",
|
|
1743
|
+
size: "small",
|
|
1744
|
+
onClick: z,
|
|
1745
|
+
disabled: h.length === 0,
|
|
1746
|
+
children: r.save ?? "Continue"
|
|
1747
|
+
}
|
|
1748
|
+
)
|
|
1749
|
+
] }) : null;
|
|
1750
|
+
return /* @__PURE__ */ f(
|
|
1751
|
+
Me,
|
|
1752
|
+
{
|
|
1753
|
+
isOpen: e,
|
|
1754
|
+
onClose: o,
|
|
1755
|
+
title: j ? d.label : r.addTriggerTitle,
|
|
1756
|
+
icon: /* @__PURE__ */ f(nn, {}),
|
|
1757
|
+
width: 500,
|
|
1758
|
+
footer: B,
|
|
1759
|
+
children: /* @__PURE__ */ y(J, { sx: { p: 2 }, children: [
|
|
1760
|
+
!j && /* @__PURE__ */ y(be, { children: [
|
|
1761
|
+
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: r.chooseTrigger }),
|
|
1762
|
+
/* @__PURE__ */ y("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1763
|
+
t.map((F) => /* @__PURE__ */ y(
|
|
1764
|
+
"div",
|
|
1765
|
+
{
|
|
1766
|
+
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1767
|
+
style: { cursor: p ? "wait" : "pointer", transition: "background 0.15s", opacity: p ? 0.6 : 1 },
|
|
1768
|
+
onClick: () => !p && T(F),
|
|
1769
|
+
role: "button",
|
|
1770
|
+
tabIndex: 0,
|
|
1771
|
+
onKeyDown: (D) => {
|
|
1772
|
+
D.key === "Enter" && !p && T(F);
|
|
1773
|
+
},
|
|
1774
|
+
onMouseEnter: (D) => {
|
|
1775
|
+
p || (D.currentTarget.style.background = "#f5f5f5");
|
|
1776
|
+
},
|
|
1777
|
+
onMouseLeave: (D) => {
|
|
1778
|
+
D.currentTarget.style.background = "";
|
|
1779
|
+
},
|
|
1780
|
+
children: [
|
|
1781
|
+
/* @__PURE__ */ f("div", { style: { color: F.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: F.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Yr, { size: 18 }) : /* @__PURE__ */ f(Kr, { size: 18 }) }),
|
|
1782
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1783
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: F.label }),
|
|
1784
|
+
F.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: F.description })
|
|
1785
|
+
] })
|
|
1786
|
+
]
|
|
1787
|
+
},
|
|
1788
|
+
F.triggerKey
|
|
1789
|
+
)),
|
|
1790
|
+
t.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: r.noTriggers })
|
|
1791
|
+
] }),
|
|
1792
|
+
p && /* @__PURE__ */ y(J, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1793
|
+
/* @__PURE__ */ f(Wr, { size: 14 }),
|
|
1794
|
+
/* @__PURE__ */ f("span", { children: "Loading sources for the selected trigger…" })
|
|
1795
|
+
] }),
|
|
1796
|
+
b && /* @__PURE__ */ f("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: b })
|
|
1797
|
+
] }),
|
|
1798
|
+
j && /* @__PURE__ */ y(be, { children: [
|
|
1799
|
+
/* @__PURE__ */ y(
|
|
1800
|
+
"div",
|
|
1801
|
+
{
|
|
1802
|
+
role: "button",
|
|
1803
|
+
tabIndex: 0,
|
|
1804
|
+
onClick: S,
|
|
1805
|
+
onKeyDown: (F) => {
|
|
1806
|
+
F.key === "Enter" && S();
|
|
1807
|
+
},
|
|
1808
|
+
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1809
|
+
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1810
|
+
children: [
|
|
1811
|
+
/* @__PURE__ */ f(Pt, { size: 16 }),
|
|
1812
|
+
/* @__PURE__ */ f("span", { children: r.addTriggerTitle })
|
|
1813
|
+
]
|
|
1814
|
+
}
|
|
1815
|
+
),
|
|
1816
|
+
/* @__PURE__ */ y("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
|
|
1817
|
+
"Pick one or more sources for ",
|
|
1818
|
+
/* @__PURE__ */ f("strong", { children: d.label }),
|
|
1819
|
+
":"
|
|
1820
|
+
] }),
|
|
1821
|
+
/* @__PURE__ */ f(
|
|
1822
|
+
Gr,
|
|
1823
|
+
{
|
|
1824
|
+
isMulti: !0,
|
|
1825
|
+
options: c,
|
|
1826
|
+
value: h,
|
|
1827
|
+
onChange: (F) => g(F ?? []),
|
|
1828
|
+
placeholder: "Select sources…",
|
|
1829
|
+
menuPosition: "fixed",
|
|
1830
|
+
menuPortalTarget: typeof document < "u" ? document.body : void 0,
|
|
1831
|
+
styles: ln(!1, !0)
|
|
1832
|
+
}
|
|
1833
|
+
)
|
|
1834
|
+
] })
|
|
1835
|
+
] })
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1838
|
+
}, Ge = {
|
|
1734
1839
|
cursor: "pointer",
|
|
1735
1840
|
transition: "background 0.15s"
|
|
1736
|
-
},
|
|
1737
|
-
const { apps: i, ungrouped: s } =
|
|
1841
|
+
}, $e = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", Pi = ({ open: e, availableDescriptors: t, messages: r, onSelect: n, onClose: o }) => {
|
|
1842
|
+
const { apps: i, ungrouped: s } = $(() => {
|
|
1738
1843
|
const u = /* @__PURE__ */ new Map(), h = [];
|
|
1739
1844
|
for (const g of t)
|
|
1740
1845
|
if (g.app) {
|
|
1741
|
-
const
|
|
1742
|
-
|
|
1846
|
+
const p = u.get(g.app.key);
|
|
1847
|
+
p ? p.descriptors.push(g) : u.set(g.app.key, {
|
|
1743
1848
|
key: g.app.key,
|
|
1744
1849
|
label: g.app.label,
|
|
1745
1850
|
icon: g.app.icon,
|
|
@@ -1749,23 +1854,23 @@ const ji = (e) => {
|
|
|
1749
1854
|
} else
|
|
1750
1855
|
h.push(g);
|
|
1751
1856
|
return { apps: [...u.values()], ungrouped: h };
|
|
1752
|
-
}, [t]), [l, d] =
|
|
1753
|
-
|
|
1857
|
+
}, [t]), [l, d] = M(null), a = l ? i.find((u) => u.key === l) ?? null : null;
|
|
1858
|
+
re(() => {
|
|
1754
1859
|
e || d(null);
|
|
1755
|
-
}, [e]),
|
|
1860
|
+
}, [e]), re(() => {
|
|
1756
1861
|
d(null);
|
|
1757
1862
|
}, [t]);
|
|
1758
1863
|
const c = !a;
|
|
1759
1864
|
return /* @__PURE__ */ f(
|
|
1760
|
-
|
|
1865
|
+
Me,
|
|
1761
1866
|
{
|
|
1762
1867
|
isOpen: e,
|
|
1763
1868
|
onClose: o,
|
|
1764
1869
|
title: c ? r.addStepTitle : a.label,
|
|
1765
|
-
icon: c ? /* @__PURE__ */ f(
|
|
1870
|
+
icon: c ? /* @__PURE__ */ f(Ur, {}) : a.icon ?? /* @__PURE__ */ f(Vr, {}),
|
|
1766
1871
|
width: 500,
|
|
1767
|
-
children: /* @__PURE__ */
|
|
1768
|
-
!c && /* @__PURE__ */
|
|
1872
|
+
children: /* @__PURE__ */ y(J, { sx: { p: 2 }, children: [
|
|
1873
|
+
!c && /* @__PURE__ */ y(
|
|
1769
1874
|
"div",
|
|
1770
1875
|
{
|
|
1771
1876
|
role: "button",
|
|
@@ -1777,18 +1882,18 @@ const ji = (e) => {
|
|
|
1777
1882
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1778
1883
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1779
1884
|
children: [
|
|
1780
|
-
/* @__PURE__ */ f(
|
|
1885
|
+
/* @__PURE__ */ f(Pt, { size: 16 }),
|
|
1781
1886
|
/* @__PURE__ */ f("span", { children: r.addStepTitle })
|
|
1782
1887
|
]
|
|
1783
1888
|
}
|
|
1784
1889
|
),
|
|
1785
1890
|
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${a.label}` }),
|
|
1786
|
-
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */
|
|
1787
|
-
i.map((u) => /* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ y(be, { children: [
|
|
1892
|
+
i.map((u) => /* @__PURE__ */ y(
|
|
1788
1893
|
"div",
|
|
1789
1894
|
{
|
|
1790
|
-
className:
|
|
1791
|
-
style:
|
|
1895
|
+
className: $e,
|
|
1896
|
+
style: Ge,
|
|
1792
1897
|
onClick: () => d(u.key),
|
|
1793
1898
|
role: "button",
|
|
1794
1899
|
tabIndex: 0,
|
|
@@ -1803,20 +1908,20 @@ const ji = (e) => {
|
|
|
1803
1908
|
},
|
|
1804
1909
|
children: [
|
|
1805
1910
|
u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1807
1912
|
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label }),
|
|
1808
1913
|
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: u.description ?? `${u.descriptors.length} action${u.descriptors.length === 1 ? "" : "s"}` })
|
|
1809
1914
|
] }),
|
|
1810
|
-
/* @__PURE__ */ f(
|
|
1915
|
+
/* @__PURE__ */ f(Bt, { size: 18, color: "#9e9e9e" })
|
|
1811
1916
|
]
|
|
1812
1917
|
},
|
|
1813
1918
|
`app-${u.key}`
|
|
1814
1919
|
)),
|
|
1815
|
-
s.map((u) => /* @__PURE__ */
|
|
1920
|
+
s.map((u) => /* @__PURE__ */ y(
|
|
1816
1921
|
"div",
|
|
1817
1922
|
{
|
|
1818
|
-
className:
|
|
1819
|
-
style:
|
|
1923
|
+
className: $e,
|
|
1924
|
+
style: Ge,
|
|
1820
1925
|
onClick: () => n(u),
|
|
1821
1926
|
role: "button",
|
|
1822
1927
|
tabIndex: 0,
|
|
@@ -1839,11 +1944,11 @@ const ji = (e) => {
|
|
|
1839
1944
|
i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: r.noActions })
|
|
1840
1945
|
] }) : (
|
|
1841
1946
|
/* Stage 2 — actions for the selected app */
|
|
1842
|
-
a.descriptors.map((u) => /* @__PURE__ */
|
|
1947
|
+
a.descriptors.map((u) => /* @__PURE__ */ y(
|
|
1843
1948
|
"div",
|
|
1844
1949
|
{
|
|
1845
|
-
className:
|
|
1846
|
-
style:
|
|
1950
|
+
className: $e,
|
|
1951
|
+
style: Ge,
|
|
1847
1952
|
onClick: () => n(u),
|
|
1848
1953
|
role: "button",
|
|
1849
1954
|
tabIndex: 0,
|
|
@@ -1867,31 +1972,31 @@ const ji = (e) => {
|
|
|
1867
1972
|
] })
|
|
1868
1973
|
}
|
|
1869
1974
|
);
|
|
1870
|
-
},
|
|
1871
|
-
const [l, d] =
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
}, [n, t]),
|
|
1875
|
-
let
|
|
1975
|
+
}, Dt = "_conditionConfig", Bi = ({ open: e, nodeId: t, descriptor: r, initialValues: n, messages: o, onSave: i, onClose: s }) => {
|
|
1976
|
+
const [l, d] = M([]), [a, c] = M(!1), [u, h] = M(null), [g, p] = M({});
|
|
1977
|
+
re(() => {
|
|
1978
|
+
p((n == null ? void 0 : n[Dt]) ?? {});
|
|
1979
|
+
}, [n, t]), re(() => {
|
|
1980
|
+
let T = !1;
|
|
1876
1981
|
if (h(null), !r || !t) {
|
|
1877
1982
|
d([]), c(!1);
|
|
1878
1983
|
return;
|
|
1879
1984
|
}
|
|
1880
|
-
const
|
|
1881
|
-
return typeof
|
|
1882
|
-
|
|
1883
|
-
}).catch((
|
|
1884
|
-
|
|
1885
|
-
})) : (d(
|
|
1886
|
-
|
|
1985
|
+
const S = r.formSchema;
|
|
1986
|
+
return typeof S == "function" ? (c(!0), S(t).then((z) => {
|
|
1987
|
+
T || (d(z), c(!1));
|
|
1988
|
+
}).catch((z) => {
|
|
1989
|
+
T || (d([]), h(z instanceof Error ? z.message : "Unable to load configuration."), c(!1));
|
|
1990
|
+
})) : (d(S), c(!1)), () => {
|
|
1991
|
+
T = !0;
|
|
1887
1992
|
};
|
|
1888
1993
|
}, [r, t]);
|
|
1889
|
-
const
|
|
1890
|
-
/* @__PURE__ */ f(
|
|
1891
|
-
/* @__PURE__ */ f(
|
|
1994
|
+
const m = t ? `node-config-form-${t}` : "node-config-form", b = !a && !u && l.length > 0, v = b ? /* @__PURE__ */ y(be, { children: [
|
|
1995
|
+
/* @__PURE__ */ f(_e, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
|
|
1996
|
+
/* @__PURE__ */ f(_e, { type: "submit", form: m, variant: "contained", size: "small", children: o.save })
|
|
1892
1997
|
] }) : null;
|
|
1893
1998
|
return /* @__PURE__ */ f(
|
|
1894
|
-
|
|
1999
|
+
Me,
|
|
1895
2000
|
{
|
|
1896
2001
|
isOpen: e,
|
|
1897
2002
|
onClose: s,
|
|
@@ -1899,70 +2004,70 @@ const ji = (e) => {
|
|
|
1899
2004
|
icon: r == null ? void 0 : r.icon,
|
|
1900
2005
|
width: 500,
|
|
1901
2006
|
footer: v,
|
|
1902
|
-
children: /* @__PURE__ */
|
|
2007
|
+
children: /* @__PURE__ */ y(J, { sx: { p: 2 }, children: [
|
|
1903
2008
|
a && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
1904
2009
|
!a && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
|
|
1905
2010
|
!a && !u && l.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
1906
|
-
|
|
1907
|
-
|
|
2011
|
+
b && /* @__PURE__ */ f(
|
|
2012
|
+
an,
|
|
1908
2013
|
{
|
|
1909
2014
|
schema: { layout: "flat", fields: l },
|
|
1910
2015
|
initialValues: n ?? {},
|
|
1911
|
-
formId:
|
|
2016
|
+
formId: m,
|
|
1912
2017
|
conditionConfig: g,
|
|
1913
|
-
onConditionConfigChange:
|
|
1914
|
-
onSubmit: (
|
|
2018
|
+
onConditionConfigChange: p,
|
|
2019
|
+
onSubmit: (T) => {
|
|
1915
2020
|
if (!t) return;
|
|
1916
|
-
const
|
|
1917
|
-
i(t, { ...
|
|
2021
|
+
const S = Object.keys(g).length > 0;
|
|
2022
|
+
i(t, { ...T, [Dt]: S ? g : void 0 }), s();
|
|
1918
2023
|
}
|
|
1919
2024
|
}
|
|
1920
2025
|
)
|
|
1921
2026
|
] })
|
|
1922
2027
|
}
|
|
1923
2028
|
);
|
|
1924
|
-
},
|
|
2029
|
+
}, Wi = ({
|
|
1925
2030
|
isOpen: e,
|
|
1926
2031
|
onClose: t,
|
|
1927
2032
|
workflowId: r,
|
|
1928
2033
|
workflowLabel: n,
|
|
1929
2034
|
onFetchWorkflow: o
|
|
1930
2035
|
}) => {
|
|
1931
|
-
const [i, s] =
|
|
1932
|
-
return
|
|
2036
|
+
const [i, s] = M({ status: "idle" });
|
|
2037
|
+
return re(() => {
|
|
1933
2038
|
if (!e || !r) {
|
|
1934
2039
|
s({ status: "idle" });
|
|
1935
2040
|
return;
|
|
1936
2041
|
}
|
|
1937
2042
|
s({ status: "loading" }), o(r).then((l) => s({ status: "loaded", state: l })).catch((l) => s({ status: "error", message: (l == null ? void 0 : l.message) ?? "Failed to load workflow" }));
|
|
1938
2043
|
}, [e, r, o]), /* @__PURE__ */ f(
|
|
1939
|
-
|
|
2044
|
+
Me,
|
|
1940
2045
|
{
|
|
1941
2046
|
isOpen: e,
|
|
1942
2047
|
onClose: t,
|
|
1943
2048
|
title: n ? `Preview: ${n}` : "Sub-Workflow Preview",
|
|
1944
|
-
icon: /* @__PURE__ */ f(
|
|
2049
|
+
icon: /* @__PURE__ */ f(qr, { size: 18, color: "#00695c" }),
|
|
1945
2050
|
width: 700,
|
|
1946
|
-
children: /* @__PURE__ */
|
|
2051
|
+
children: /* @__PURE__ */ y("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
1947
2052
|
i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
1948
|
-
i.status === "loading" && /* @__PURE__ */
|
|
2053
|
+
i.status === "loading" && /* @__PURE__ */ y("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
|
|
1949
2054
|
/* @__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" } }),
|
|
1950
2055
|
/* @__PURE__ */ f("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
|
|
1951
2056
|
/* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
1952
2057
|
] }),
|
|
1953
|
-
i.status === "error" && /* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */ f(
|
|
2058
|
+
i.status === "error" && /* @__PURE__ */ y("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
2059
|
+
/* @__PURE__ */ f(Hr, { size: 32, style: { marginBottom: 8 } }),
|
|
1955
2060
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
1956
2061
|
] }),
|
|
1957
|
-
i.status === "loaded" && /* @__PURE__ */ f("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ f(
|
|
2062
|
+
i.status === "loaded" && /* @__PURE__ */ f("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ f(Gi, { state: i.state }) })
|
|
1958
2063
|
] })
|
|
1959
2064
|
}
|
|
1960
2065
|
);
|
|
1961
|
-
},
|
|
1962
|
-
const [t, r] =
|
|
1963
|
-
return
|
|
2066
|
+
}, Gi = ({ state: e }) => {
|
|
2067
|
+
const [t, r] = M(null), [n, o] = M(null);
|
|
2068
|
+
return re(() => {
|
|
1964
2069
|
Promise.all([
|
|
1965
|
-
Promise.resolve().then(() =>
|
|
2070
|
+
Promise.resolve().then(() => Hi).then((i) => i.default),
|
|
1966
2071
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
1967
2072
|
import("./templateRegistry.js").then((i) => i.templateRegistry)
|
|
1968
2073
|
]).then(([i, s, l]) => {
|
|
@@ -1977,7 +2082,7 @@ const ji = (e) => {
|
|
|
1977
2082
|
readOnly: !0
|
|
1978
2083
|
}
|
|
1979
2084
|
) });
|
|
1980
|
-
},
|
|
2085
|
+
}, me = 350, Ue = 70, Ve = 60, He = {
|
|
1981
2086
|
startNode: 40,
|
|
1982
2087
|
endNode: 40,
|
|
1983
2088
|
addTriggerNode: 56,
|
|
@@ -1987,67 +2092,67 @@ const ji = (e) => {
|
|
|
1987
2092
|
approvalNode: 90,
|
|
1988
2093
|
delayNode: 80,
|
|
1989
2094
|
notificationNode: 80
|
|
1990
|
-
},
|
|
2095
|
+
}, $i = {
|
|
1991
2096
|
plusEdge: Rr,
|
|
1992
|
-
labelPlusEdge:
|
|
1993
|
-
plainEdge:
|
|
1994
|
-
edgeWithPlusLabel:
|
|
1995
|
-
gatewayBranchEdge:
|
|
2097
|
+
labelPlusEdge: Lr,
|
|
2098
|
+
plainEdge: Dr,
|
|
2099
|
+
edgeWithPlusLabel: Fr,
|
|
2100
|
+
gatewayBranchEdge: zr
|
|
1996
2101
|
};
|
|
1997
|
-
function
|
|
2102
|
+
function Lt() {
|
|
1998
2103
|
return [
|
|
1999
2104
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2000
2105
|
{ id: "addTrigger", kind: "addTrigger", reactFlowType: "addTriggerNode" },
|
|
2001
2106
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2002
2107
|
];
|
|
2003
2108
|
}
|
|
2004
|
-
function
|
|
2005
|
-
const o = new
|
|
2109
|
+
function Yi(e, t, r, n = "TB") {
|
|
2110
|
+
const o = new Ft.graphlib.Graph();
|
|
2006
2111
|
return o.setGraph({ rankdir: n, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2007
|
-
const s = r[i.id] ?? { width:
|
|
2112
|
+
const s = r[i.id] ?? { width: me, height: He[i.type ?? ""] ?? 80 };
|
|
2008
2113
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2009
|
-
}), t.forEach((i) => o.setEdge(i.source, i.target)),
|
|
2114
|
+
}), t.forEach((i) => o.setEdge(i.source, i.target)), Ft.layout(o), e.map((i) => {
|
|
2010
2115
|
var a, c;
|
|
2011
|
-
const s = o.node(i.id), l = ((a = r[i.id]) == null ? void 0 : a.width) ??
|
|
2116
|
+
const s = o.node(i.id), l = ((a = r[i.id]) == null ? void 0 : a.width) ?? me, d = ((c = r[i.id]) == null ? void 0 : c.height) ?? He[i.type ?? ""] ?? 80;
|
|
2012
2117
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2013
2118
|
});
|
|
2014
2119
|
}
|
|
2015
|
-
const
|
|
2016
|
-
function
|
|
2017
|
-
const s =
|
|
2018
|
-
for (const
|
|
2019
|
-
for (const
|
|
2020
|
-
for (const v of Object.values(
|
|
2021
|
-
for (const
|
|
2022
|
-
const h = (
|
|
2023
|
-
const
|
|
2024
|
-
return a[
|
|
2025
|
-
}, g = (
|
|
2026
|
-
let
|
|
2027
|
-
for (const
|
|
2028
|
-
|
|
2029
|
-
return
|
|
2030
|
-
},
|
|
2031
|
-
const
|
|
2032
|
-
let
|
|
2033
|
-
return
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2036
|
-
y:
|
|
2037
|
-
label:
|
|
2038
|
-
isPass:
|
|
2039
|
-
}),
|
|
2040
|
-
}), c[
|
|
2041
|
-
branches:
|
|
2042
|
-
height:
|
|
2120
|
+
const se = (e) => e === "filter" || e === "approval";
|
|
2121
|
+
function Ki(e, t, r, n) {
|
|
2122
|
+
const s = Ue, l = 30, d = 30, a = {}, c = {}, u = /* @__PURE__ */ new Map();
|
|
2123
|
+
for (const b of e) u.set(b.id, b);
|
|
2124
|
+
for (const b of Object.values(t))
|
|
2125
|
+
for (const v of Object.values(b))
|
|
2126
|
+
for (const T of v) u.set(T.id, T);
|
|
2127
|
+
const h = (b, v, T) => {
|
|
2128
|
+
const S = n[b] ?? { width: me, height: 80 };
|
|
2129
|
+
return a[b] = { x: v - S.width / 2, y: T }, T + S.height;
|
|
2130
|
+
}, g = (b, v, T) => {
|
|
2131
|
+
let S = T;
|
|
2132
|
+
for (const z of b)
|
|
2133
|
+
S = h(z.id, v, S) + s, se(z.kind) && t[z.id] && (S = p(z.id, v, S));
|
|
2134
|
+
return S;
|
|
2135
|
+
}, p = (b, v, T) => {
|
|
2136
|
+
const S = v + 180, z = t[b], j = Object.keys(z), B = u.get(b), F = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, D = a[b], L = n[b] ?? { height: 80 }, ve = D.y + L.height, Ee = [];
|
|
2137
|
+
let Q = T;
|
|
2138
|
+
return j.forEach((ae, ge) => {
|
|
2139
|
+
const ne = z[ae], R = Q;
|
|
2140
|
+
Ee.push({
|
|
2141
|
+
y: R - ve,
|
|
2142
|
+
label: F[ae] ?? ae,
|
|
2143
|
+
isPass: ge === 0
|
|
2144
|
+
}), Q = g(ne, S, Q + d), ge < j.length - 1 && (Q += l);
|
|
2145
|
+
}), c[b] = {
|
|
2146
|
+
branches: Ee,
|
|
2147
|
+
height: Q - ve,
|
|
2043
2148
|
indent: 180
|
|
2044
|
-
},
|
|
2149
|
+
}, Q;
|
|
2045
2150
|
};
|
|
2046
|
-
let
|
|
2047
|
-
for (const
|
|
2048
|
-
|
|
2151
|
+
let m = Ve;
|
|
2152
|
+
for (const b of e)
|
|
2153
|
+
m = h(b.id, 400, m) + s, se(b.kind) && t[b.id] && (m = p(b.id, 400, m));
|
|
2049
2154
|
return {
|
|
2050
|
-
nodes: r.map((
|
|
2155
|
+
nodes: r.map((b) => a[b.id] ? { ...b, position: a[b.id] } : b),
|
|
2051
2156
|
railSpecs: c
|
|
2052
2157
|
};
|
|
2053
2158
|
}
|
|
@@ -2061,7 +2166,7 @@ function Rt(e) {
|
|
|
2061
2166
|
selectable: !1
|
|
2062
2167
|
};
|
|
2063
2168
|
}
|
|
2064
|
-
function
|
|
2169
|
+
function Ui(e, t, r, n, o) {
|
|
2065
2170
|
return {
|
|
2066
2171
|
id: `e-${e.id}-${t.id}`,
|
|
2067
2172
|
source: e.id,
|
|
@@ -2075,79 +2180,79 @@ function Gi(e, t, r, n, o) {
|
|
|
2075
2180
|
}
|
|
2076
2181
|
};
|
|
2077
2182
|
}
|
|
2078
|
-
function
|
|
2079
|
-
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (
|
|
2080
|
-
const
|
|
2081
|
-
if (!
|
|
2082
|
-
const
|
|
2083
|
-
if (
|
|
2084
|
-
|
|
2085
|
-
id: `e-${
|
|
2086
|
-
source:
|
|
2087
|
-
target:
|
|
2183
|
+
function Vi(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
2184
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (p, m) => {
|
|
2185
|
+
const b = t[p];
|
|
2186
|
+
if (!b) return;
|
|
2187
|
+
const T = m ?? { pass: "Pass", fail: "Fail" }, S = Object.keys(b), z = (j, B, F, D) => {
|
|
2188
|
+
if (j.length !== 0) {
|
|
2189
|
+
j.forEach((L) => d.push(Rt(L))), a.push({
|
|
2190
|
+
id: `e-${p}-${B}-start`,
|
|
2191
|
+
source: p,
|
|
2192
|
+
target: j[0].id,
|
|
2088
2193
|
type: "gatewayBranchEdge",
|
|
2089
2194
|
style: { stroke: l },
|
|
2090
|
-
data: { branch: B, filterId:
|
|
2195
|
+
data: { branch: B, filterId: p, label: F, isFirst: D === 0, onAddStepClick: r, verticalRouting: s === "vertical" }
|
|
2091
2196
|
});
|
|
2092
|
-
for (let
|
|
2093
|
-
|
|
2094
|
-
for (const
|
|
2095
|
-
|
|
2197
|
+
for (let L = 1; L < j.length; L++)
|
|
2198
|
+
se(j[L - 1].kind) || a.push(Ui(j[L - 1], j[L], l, r, { filterId: p, branch: B }));
|
|
2199
|
+
for (const L of j)
|
|
2200
|
+
se(L.kind) && t[L.id] && c(L.id, L.branchLabels);
|
|
2096
2201
|
}
|
|
2097
2202
|
};
|
|
2098
|
-
|
|
2099
|
-
|
|
2203
|
+
S.forEach((j, B) => {
|
|
2204
|
+
z(b[j], j, T[j] ?? j, B);
|
|
2100
2205
|
});
|
|
2101
2206
|
};
|
|
2102
|
-
for (let
|
|
2103
|
-
const
|
|
2104
|
-
if (d.push(Rt(
|
|
2105
|
-
const
|
|
2106
|
-
if (
|
|
2207
|
+
for (let p = 0; p < e.length; p++) {
|
|
2208
|
+
const m = e[p];
|
|
2209
|
+
if (d.push(Rt(m)), p > 0) {
|
|
2210
|
+
const b = e[p - 1], v = b.kind === "start" || b.kind === "addTrigger";
|
|
2211
|
+
if (b.kind === "filter" || b.kind === "approval") continue;
|
|
2107
2212
|
a.push({
|
|
2108
|
-
id: `e-${
|
|
2109
|
-
source:
|
|
2110
|
-
target:
|
|
2213
|
+
id: `e-${b.id}-${m.id}`,
|
|
2214
|
+
source: b.id,
|
|
2215
|
+
target: m.id,
|
|
2111
2216
|
type: v ? "plainEdge" : "plusEdge",
|
|
2112
2217
|
style: { stroke: l },
|
|
2113
2218
|
data: v ? {} : {
|
|
2114
2219
|
onAddStepClick: r,
|
|
2115
|
-
referenceNodeType:
|
|
2220
|
+
referenceNodeType: b.reactFlowType
|
|
2116
2221
|
}
|
|
2117
2222
|
});
|
|
2118
2223
|
}
|
|
2119
|
-
(
|
|
2224
|
+
(m.kind === "filter" || m.kind === "approval") && t[m.id] && c(m.id, m.branchLabels);
|
|
2120
2225
|
}
|
|
2121
2226
|
const u = {};
|
|
2122
|
-
if (d.forEach((
|
|
2123
|
-
u[
|
|
2124
|
-
width:
|
|
2125
|
-
height: n[
|
|
2227
|
+
if (d.forEach((p) => {
|
|
2228
|
+
u[p.id] = {
|
|
2229
|
+
width: me,
|
|
2230
|
+
height: n[p.id] ?? He[p.type ?? ""] ?? 80
|
|
2126
2231
|
};
|
|
2127
2232
|
}), !(Object.keys(t).length > 0)) {
|
|
2128
2233
|
if (i === "LR") {
|
|
2129
|
-
let
|
|
2130
|
-
return { nodes: d.map((
|
|
2131
|
-
const
|
|
2132
|
-
return
|
|
2234
|
+
let T = Ve;
|
|
2235
|
+
return { nodes: d.map((z) => {
|
|
2236
|
+
const j = u[z.id].width, B = u[z.id].height, F = { ...z, position: { x: T, y: 300 - B / 2 } };
|
|
2237
|
+
return T += j + Ue, F;
|
|
2133
2238
|
}), edges: a };
|
|
2134
2239
|
}
|
|
2135
|
-
const
|
|
2136
|
-
let
|
|
2240
|
+
const p = 400;
|
|
2241
|
+
let m = Ve;
|
|
2137
2242
|
return { nodes: d.map((v) => {
|
|
2138
|
-
const
|
|
2139
|
-
return
|
|
2243
|
+
const T = u[v.id].height, S = { ...v, position: { x: p - me / 2, y: m } };
|
|
2244
|
+
return m += T + Ue, S;
|
|
2140
2245
|
}), edges: a };
|
|
2141
2246
|
}
|
|
2142
2247
|
if (s === "vertical") {
|
|
2143
|
-
const { nodes:
|
|
2144
|
-
return { nodes:
|
|
2145
|
-
(v) =>
|
|
2248
|
+
const { nodes: p, railSpecs: m } = Ki(e, t, d, u);
|
|
2249
|
+
return { nodes: p.map(
|
|
2250
|
+
(v) => m[v.id] ? { ...v, data: { ...v.data, _branchRail: m[v.id] } } : v
|
|
2146
2251
|
), edges: a };
|
|
2147
2252
|
}
|
|
2148
|
-
return { nodes:
|
|
2253
|
+
return { nodes: Yi(d, a, u, i), edges: a };
|
|
2149
2254
|
}
|
|
2150
|
-
const
|
|
2255
|
+
const At = ({
|
|
2151
2256
|
nodeRegistry: e,
|
|
2152
2257
|
templateRegistry: t,
|
|
2153
2258
|
initialValue: r,
|
|
@@ -2159,209 +2264,225 @@ const Dt = ({
|
|
|
2159
2264
|
messages: d,
|
|
2160
2265
|
canvasOptions: a = {},
|
|
2161
2266
|
renderTriggerSelector: c,
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2267
|
+
loadTriggerSources: u,
|
|
2268
|
+
renderNodePicker: h,
|
|
2269
|
+
renderNodeConfig: g,
|
|
2270
|
+
onNodeClick: p,
|
|
2271
|
+
maxNodes: m,
|
|
2272
|
+
layoutDirection: b = "TB",
|
|
2273
|
+
executionRecord: v,
|
|
2274
|
+
onFetchWorkflow: T
|
|
2169
2275
|
}) => {
|
|
2170
2276
|
const {
|
|
2171
|
-
fitView:
|
|
2172
|
-
fitViewPadding:
|
|
2173
|
-
showControls:
|
|
2174
|
-
showMiniMap:
|
|
2175
|
-
panOnScroll:
|
|
2176
|
-
zoomOnScroll:
|
|
2177
|
-
minZoom:
|
|
2178
|
-
maxZoom:
|
|
2179
|
-
snapToGrid:
|
|
2180
|
-
snapGrid:
|
|
2181
|
-
branchLayout:
|
|
2182
|
-
nodeBody:
|
|
2183
|
-
} = a,
|
|
2184
|
-
const
|
|
2277
|
+
fitView: S = !0,
|
|
2278
|
+
fitViewPadding: z = 0.3,
|
|
2279
|
+
showControls: j = !0,
|
|
2280
|
+
showMiniMap: B = !1,
|
|
2281
|
+
panOnScroll: F = !0,
|
|
2282
|
+
zoomOnScroll: D = !1,
|
|
2283
|
+
minZoom: L = 0.25,
|
|
2284
|
+
maxZoom: ve = 2,
|
|
2285
|
+
snapToGrid: Ee = !1,
|
|
2286
|
+
snapGrid: Q = [15, 15],
|
|
2287
|
+
branchLayout: ae = "horizontal",
|
|
2288
|
+
nodeBody: ge = "full"
|
|
2289
|
+
} = a, ne = $(() => dn(d), [d]), [R, oe] = M(() => (r == null ? void 0 : r.slots) ?? Lt()), [H, q] = M(() => (r == null ? void 0 : r.branches) ?? {}), [de, K] = M(null), [je, tt] = M(null), [ce, ke] = M(null), [ze, rt] = M(null), [xe, nt] = M(null), [ee, ot] = M(() => {
|
|
2290
|
+
const w = r == null ? void 0 : r.slots.find((x) => x.kind === "triggerFixed"), E = w != null && w.id.startsWith("trigger-") ? w.id.slice(8) : void 0;
|
|
2185
2291
|
return E ? t.lookup(E) ?? null : null;
|
|
2186
|
-
}), [
|
|
2187
|
-
|
|
2188
|
-
}, []),
|
|
2189
|
-
const
|
|
2190
|
-
return
|
|
2191
|
-
}, [R, H]),
|
|
2192
|
-
const E = R.find((
|
|
2292
|
+
}), [it, mr] = M({}), wr = U((w) => {
|
|
2293
|
+
mr(w);
|
|
2294
|
+
}, []), vr = $(() => ({ ...jr, ...n }), [n]), Er = $(() => ({ ...$i, ...o }), [o]), kr = $(() => {
|
|
2295
|
+
const w = R.filter((x) => x.kind === "userTask").length, E = Object.values(H).flatMap((x) => Object.values(x).flat()).filter((x) => x.kind === "userTask").length;
|
|
2296
|
+
return w + E;
|
|
2297
|
+
}, [R, H]), st = m ?? (ee == null ? void 0 : ee.maxTasks), lt = st !== void 0 && kr >= st, ie = U((w) => {
|
|
2298
|
+
const E = R.find((x) => x.id === w);
|
|
2193
2299
|
if (E) return E;
|
|
2194
|
-
for (const
|
|
2195
|
-
const C = Object.values(
|
|
2300
|
+
for (const x of Object.values(H)) {
|
|
2301
|
+
const C = Object.values(x).flat().find((k) => k.id === w);
|
|
2196
2302
|
if (C) return C;
|
|
2197
2303
|
}
|
|
2198
2304
|
return null;
|
|
2199
|
-
}, [R, H]),
|
|
2200
|
-
s || (
|
|
2201
|
-
}, [s]),
|
|
2305
|
+
}, [R, H]), Fe = U((w) => {
|
|
2306
|
+
s || (tt(w), K("nodeConfig"));
|
|
2307
|
+
}, [s]), at = U((w) => {
|
|
2202
2308
|
if (!s) {
|
|
2203
|
-
if (R.some((E) => E.id ===
|
|
2204
|
-
const E = R.find((
|
|
2309
|
+
if (R.some((E) => E.id === w)) {
|
|
2310
|
+
const E = R.find((x) => x.id === w);
|
|
2205
2311
|
if ((E == null ? void 0 : E.kind) === "triggerFixed") {
|
|
2206
|
-
|
|
2312
|
+
oe(Lt()), q({}), ot(null);
|
|
2207
2313
|
return;
|
|
2208
2314
|
}
|
|
2209
|
-
|
|
2210
|
-
const C =
|
|
2211
|
-
return
|
|
2212
|
-
}), q((
|
|
2213
|
-
const C = { ...
|
|
2214
|
-
C[_] && (Object.values(C[_]).flat().filter((
|
|
2315
|
+
oe((x) => {
|
|
2316
|
+
const C = x.filter((k) => k.id !== w);
|
|
2317
|
+
return se((E == null ? void 0 : E.kind) ?? "") && !C.some((k) => k.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2318
|
+
}), q((x) => {
|
|
2319
|
+
const C = { ...x }, k = (_) => {
|
|
2320
|
+
C[_] && (Object.values(C[_]).flat().filter((N) => se(N.kind)).forEach((N) => k(N.id)), delete C[_]);
|
|
2215
2321
|
};
|
|
2216
|
-
return
|
|
2322
|
+
return k(w), C;
|
|
2217
2323
|
});
|
|
2218
2324
|
return;
|
|
2219
2325
|
}
|
|
2220
2326
|
q((E) => {
|
|
2221
|
-
const
|
|
2222
|
-
const
|
|
2223
|
-
for (const
|
|
2224
|
-
|
|
2225
|
-
return
|
|
2327
|
+
const x = (k, _) => {
|
|
2328
|
+
const N = [];
|
|
2329
|
+
for (const I of k)
|
|
2330
|
+
se(I.kind) && _[I.id] && (N.push(I.id), Object.values(_[I.id]).forEach((O) => N.push(...x(O, _))));
|
|
2331
|
+
return N;
|
|
2226
2332
|
}, C = { ...E };
|
|
2227
|
-
for (const
|
|
2228
|
-
for (const _ of Object.keys(C[
|
|
2229
|
-
const
|
|
2230
|
-
if (
|
|
2231
|
-
const
|
|
2232
|
-
let
|
|
2233
|
-
return
|
|
2333
|
+
for (const k of Object.keys(C))
|
|
2334
|
+
for (const _ of Object.keys(C[k])) {
|
|
2335
|
+
const N = C[k][_], I = N.findIndex((W) => W.id === w);
|
|
2336
|
+
if (I === -1 || N[I].kind === "end") continue;
|
|
2337
|
+
const O = N[I];
|
|
2338
|
+
let A = N.filter((W) => W.id !== w);
|
|
2339
|
+
return O.kind === "filter" && ((O.id in C ? x([O], C) : []).forEach((P) => delete C[P]), delete C[O.id], A.some((P) => P.kind === "end") || (A = [...A, { id: `end-${k}-${_}`, kind: "end", reactFlowType: "endNode" }])), C[k] = { ...C[k], [_]: A }, C;
|
|
2234
2340
|
}
|
|
2235
2341
|
return C;
|
|
2236
2342
|
});
|
|
2237
2343
|
}
|
|
2238
|
-
}, [s, R]),
|
|
2239
|
-
s ||
|
|
2240
|
-
}, [s]),
|
|
2241
|
-
s ||
|
|
2242
|
-
}, [s,
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2344
|
+
}, [s, R]), De = U(() => {
|
|
2345
|
+
s || K("triggerSelect");
|
|
2346
|
+
}, [s]), dt = U((w, E) => {
|
|
2347
|
+
s || lt || (ke(w), rt(E.filterId && E.branch ? { filterId: E.filterId, branch: E.branch } : null), K("nodePicker"));
|
|
2348
|
+
}, [s, lt]), ct = U((w, E) => {
|
|
2349
|
+
if (ot(w), K(null), w.skeletonState) {
|
|
2350
|
+
const C = (w.skeletonState.slots ?? []).map((k) => k.kind === "triggerFixed" && Array.isArray(E) && E.length > 0 ? {
|
|
2351
|
+
...k,
|
|
2352
|
+
nodeData: {
|
|
2353
|
+
...k.nodeData ?? {},
|
|
2354
|
+
sources: E
|
|
2355
|
+
}
|
|
2356
|
+
} : k);
|
|
2357
|
+
q(w.skeletonState.branches ?? {}), oe(C);
|
|
2245
2358
|
return;
|
|
2246
2359
|
}
|
|
2247
|
-
q({})
|
|
2360
|
+
q({});
|
|
2361
|
+
const x = Array.isArray(E) && E.length > 0;
|
|
2362
|
+
oe([
|
|
2248
2363
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2249
2364
|
{
|
|
2250
|
-
id: `trigger-${
|
|
2365
|
+
id: `trigger-${w.triggerKey}`,
|
|
2251
2366
|
kind: "triggerFixed",
|
|
2252
2367
|
reactFlowType: "triggerNode",
|
|
2253
|
-
nodeData: {
|
|
2368
|
+
nodeData: {
|
|
2369
|
+
label: w.label,
|
|
2370
|
+
source: w.source,
|
|
2371
|
+
eventType: w.triggerKey,
|
|
2372
|
+
type: w.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2373
|
+
...x && { sources: E }
|
|
2374
|
+
},
|
|
2254
2375
|
deletable: !1
|
|
2255
2376
|
},
|
|
2256
2377
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2257
2378
|
]);
|
|
2258
|
-
}, []),
|
|
2259
|
-
const
|
|
2260
|
-
return (
|
|
2261
|
-
}, [e,
|
|
2262
|
-
if (!
|
|
2263
|
-
const E = `${
|
|
2379
|
+
}, []), ut = U(() => {
|
|
2380
|
+
const w = e.list();
|
|
2381
|
+
return (ee != null && ee.availableTasks ? w.filter((x) => ee.availableTasks.includes(x.type)) : w).filter((x) => x.maxPerWorkflow === void 0 ? !0 : R.filter((k) => k.descriptorType === x.type).length + Object.values(H).flatMap((k) => Object.values(k).flat()).filter((k) => k.descriptorType === x.type).length < x.maxPerWorkflow);
|
|
2382
|
+
}, [e, ee, R, H]), ft = U((w) => {
|
|
2383
|
+
if (!ce) return;
|
|
2384
|
+
const E = `${w.type}-${Date.now()}`, x = w.reactFlowType === "filterNode" || w.reactFlowType === "approvalNode" || w.reactFlowType === "conditionBranchNode", C = w.branchLabels ?? { pass: "Pass", fail: "Fail" }, k = {
|
|
2264
2385
|
id: E,
|
|
2265
|
-
kind:
|
|
2266
|
-
reactFlowType:
|
|
2267
|
-
descriptorType:
|
|
2386
|
+
kind: x ? w.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2387
|
+
reactFlowType: w.reactFlowType,
|
|
2388
|
+
descriptorType: w.type,
|
|
2268
2389
|
formData: {},
|
|
2269
|
-
nodeData: { title:
|
|
2390
|
+
nodeData: { title: w.label },
|
|
2270
2391
|
deletable: !0,
|
|
2271
2392
|
branchLabels: C
|
|
2272
2393
|
};
|
|
2273
|
-
if (
|
|
2274
|
-
const { filterId: _, branch:
|
|
2275
|
-
q((
|
|
2276
|
-
const
|
|
2277
|
-
if (
|
|
2278
|
-
const
|
|
2279
|
-
return
|
|
2280
|
-
...
|
|
2281
|
-
[_]: { ...
|
|
2394
|
+
if (ze) {
|
|
2395
|
+
const { filterId: _, branch: N } = ze;
|
|
2396
|
+
q((I) => {
|
|
2397
|
+
const O = [...I[_][N]];
|
|
2398
|
+
if (x) {
|
|
2399
|
+
const te = O.filter((ue) => ue.kind !== "end"), yt = te.findIndex((ue) => ue.id === ce), _r = yt === -1 ? te.length : yt + 1;
|
|
2400
|
+
return te.splice(_r, 0, k), {
|
|
2401
|
+
...I,
|
|
2402
|
+
[_]: { ...I[_], [N]: te },
|
|
2282
2403
|
[E]: Object.fromEntries(
|
|
2283
|
-
Object.keys(C).map((
|
|
2404
|
+
Object.keys(C).map((ue) => [ue, [{ id: `end-${E}-${ue}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2284
2405
|
)
|
|
2285
2406
|
};
|
|
2286
2407
|
}
|
|
2287
|
-
const
|
|
2288
|
-
return
|
|
2408
|
+
const A = O.findIndex((te) => te.id === ce), W = O.findIndex((te) => te.kind === "end"), P = A === -1 ? W === -1 ? O.length : W : A + 1;
|
|
2409
|
+
return O.splice(P, 0, k), { ...I, [_]: { ...I[_], [N]: O } };
|
|
2289
2410
|
});
|
|
2290
2411
|
} else
|
|
2291
|
-
|
|
2292
|
-
const
|
|
2293
|
-
return [..._.filter((
|
|
2412
|
+
x ? (oe((_) => {
|
|
2413
|
+
const N = _.findIndex((O) => O.id === ce);
|
|
2414
|
+
return [..._.filter((O) => O.kind !== "end").slice(0, N + 1), k];
|
|
2294
2415
|
}), q((_) => ({
|
|
2295
2416
|
..._,
|
|
2296
2417
|
[E]: Object.fromEntries(
|
|
2297
|
-
Object.keys(C).map((
|
|
2418
|
+
Object.keys(C).map((N) => [N, [{ id: `end-${E}-${N}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2298
2419
|
)
|
|
2299
|
-
}))) :
|
|
2300
|
-
const
|
|
2301
|
-
return
|
|
2420
|
+
}))) : oe((_) => {
|
|
2421
|
+
const N = _.findIndex((I) => I.id === ce);
|
|
2422
|
+
return N === -1 ? _ : [..._.slice(0, N + 1), k, ..._.slice(N + 1)];
|
|
2302
2423
|
});
|
|
2303
|
-
|
|
2304
|
-
}, [
|
|
2305
|
-
const
|
|
2306
|
-
const _ =
|
|
2307
|
-
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return
|
|
2308
|
-
const
|
|
2309
|
-
if (
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
|
|
2424
|
+
ke(null), rt(null), tt(E), K("nodeConfig");
|
|
2425
|
+
}, [ce, ze]), ht = U((w, E) => {
|
|
2426
|
+
const x = (k) => {
|
|
2427
|
+
const _ = ie(w);
|
|
2428
|
+
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return k;
|
|
2429
|
+
const N = E.branchConfigs ?? [], I = N.map((P) => P.key).filter(Boolean);
|
|
2430
|
+
if (I.length === 0) return k;
|
|
2431
|
+
const O = k[w] ?? {}, A = {};
|
|
2432
|
+
I.forEach((P) => {
|
|
2433
|
+
A[P] = O[P] ?? [{ id: `end-${w}-${P}`, kind: "end", reactFlowType: "endNode" }];
|
|
2313
2434
|
});
|
|
2314
|
-
const
|
|
2315
|
-
return
|
|
2316
|
-
|
|
2317
|
-
}), { ...
|
|
2318
|
-
}, C = (
|
|
2319
|
-
if (
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2322
|
-
|
|
2323
|
-
}), { ...
|
|
2435
|
+
const W = {};
|
|
2436
|
+
return N.forEach((P) => {
|
|
2437
|
+
P.key && (W[P.key] = P.label || P.key);
|
|
2438
|
+
}), { ...k, [w]: A };
|
|
2439
|
+
}, C = (k, _) => {
|
|
2440
|
+
if (k.descriptorType !== "conditionBranch") return { ...k, formData: _ };
|
|
2441
|
+
const N = _.branchConfigs ?? [], I = {};
|
|
2442
|
+
return N.forEach((O) => {
|
|
2443
|
+
O.key && (I[O.key] = O.label || O.key);
|
|
2444
|
+
}), { ...k, formData: _, branchLabels: I };
|
|
2324
2445
|
};
|
|
2325
|
-
if (R.some((
|
|
2326
|
-
q((
|
|
2327
|
-
const _ = k
|
|
2328
|
-
return
|
|
2329
|
-
const
|
|
2330
|
-
return i == null || i({ slots:
|
|
2446
|
+
if (R.some((k) => k.id === w)) {
|
|
2447
|
+
q((k) => {
|
|
2448
|
+
const _ = x(k);
|
|
2449
|
+
return oe((N) => {
|
|
2450
|
+
const I = N.map((O) => O.id === w ? C(O, E) : O);
|
|
2451
|
+
return i == null || i({ slots: I, branches: _ }), I;
|
|
2331
2452
|
}), _;
|
|
2332
2453
|
});
|
|
2333
2454
|
return;
|
|
2334
2455
|
}
|
|
2335
|
-
q((
|
|
2336
|
-
const
|
|
2337
|
-
for (const
|
|
2338
|
-
const
|
|
2339
|
-
for (const
|
|
2340
|
-
if (
|
|
2341
|
-
return
|
|
2456
|
+
q((k) => {
|
|
2457
|
+
const N = { ...x(k) };
|
|
2458
|
+
for (const I of Object.keys(N)) {
|
|
2459
|
+
const O = (A) => A.map((W) => W.id === w ? C(W, E) : W);
|
|
2460
|
+
for (const A of Object.keys(N[I]))
|
|
2461
|
+
if (N[I][A].some((W) => W.id === w))
|
|
2462
|
+
return N[I] = { ...N[I], [A]: O(N[I][A]) }, i == null || i({ slots: R, branches: N }), N;
|
|
2342
2463
|
}
|
|
2343
|
-
return
|
|
2464
|
+
return N;
|
|
2344
2465
|
});
|
|
2345
|
-
}, [R, H,
|
|
2346
|
-
() =>
|
|
2347
|
-
[R, H, s,
|
|
2348
|
-
),
|
|
2349
|
-
const
|
|
2350
|
-
return
|
|
2351
|
-
let
|
|
2352
|
-
if (
|
|
2353
|
-
const C =
|
|
2354
|
-
C && (
|
|
2466
|
+
}, [R, H, ie, i]), X = $(() => ie(je ?? ""), [ie, je]), gt = $(() => X != null && X.descriptorType ? e.forType(X.descriptorType) ?? null : null, [X, e]), { nodes: pt, edges: xr } = $(
|
|
2467
|
+
() => Vi(R, H, s ? null : dt, it, l, b, ae),
|
|
2468
|
+
[R, H, s, dt, it, l, b, ae]
|
|
2469
|
+
), bt = $(() => {
|
|
2470
|
+
const w = v ? new Map(v.steps.map((E) => [E.nodeId, E])) : null;
|
|
2471
|
+
return pt.map((E) => {
|
|
2472
|
+
let x = {};
|
|
2473
|
+
if (w) {
|
|
2474
|
+
const C = w.get(E.id);
|
|
2475
|
+
C && (x = { _executionStatus: C.status, _executionError: C.error });
|
|
2355
2476
|
}
|
|
2356
|
-
return E.type === "subWorkflowNode" &&
|
|
2477
|
+
return E.type === "subWorkflowNode" && T && (x.onPreview = (C) => {
|
|
2357
2478
|
var _;
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2360
|
-
}), Object.keys(
|
|
2479
|
+
const k = ie(E.id);
|
|
2480
|
+
nt({ workflowId: C, workflowLabel: ((_ = k == null ? void 0 : k.formData) == null ? void 0 : _.workflowLabel) ?? void 0 });
|
|
2481
|
+
}), Object.keys(x).length > 0 ? { ...E, data: { ...E.data, ...x } } : E;
|
|
2361
2482
|
});
|
|
2362
|
-
}, [
|
|
2363
|
-
}, onClickAddTrigger:
|
|
2364
|
-
return /* @__PURE__ */ f(
|
|
2483
|
+
}, [pt, v, T, ie]), Tr = $(() => ({ onEditNode: Fe, onDeleteNode: at, onAddStep: () => {
|
|
2484
|
+
}, onClickAddTrigger: De, messages: ne, nodeRegistry: e, nodeBody: ge }), [Fe, at, De, ne, e, ge]);
|
|
2485
|
+
return /* @__PURE__ */ f(Ar.Provider, { value: Tr, children: /* @__PURE__ */ y(
|
|
2365
2486
|
"div",
|
|
2366
2487
|
{
|
|
2367
2488
|
className: "flowforge-canvas",
|
|
@@ -2381,72 +2502,72 @@ const Dt = ({
|
|
|
2381
2502
|
"--ff-font-family": l.fontFamily
|
|
2382
2503
|
},
|
|
2383
2504
|
children: [
|
|
2384
|
-
/* @__PURE__ */
|
|
2385
|
-
|
|
2505
|
+
/* @__PURE__ */ y(
|
|
2506
|
+
Nr,
|
|
2386
2507
|
{
|
|
2387
|
-
nodes:
|
|
2388
|
-
edges:
|
|
2389
|
-
nodeTypes:
|
|
2390
|
-
edgeTypes:
|
|
2391
|
-
fitView:
|
|
2392
|
-
fitViewOptions: { padding:
|
|
2508
|
+
nodes: bt,
|
|
2509
|
+
edges: xr,
|
|
2510
|
+
nodeTypes: vr,
|
|
2511
|
+
edgeTypes: Er,
|
|
2512
|
+
fitView: S,
|
|
2513
|
+
fitViewOptions: { padding: z },
|
|
2393
2514
|
nodesDraggable: !1,
|
|
2394
2515
|
nodesConnectable: !1,
|
|
2395
|
-
panOnScroll:
|
|
2396
|
-
zoomOnScroll:
|
|
2397
|
-
minZoom:
|
|
2398
|
-
maxZoom:
|
|
2399
|
-
snapToGrid:
|
|
2400
|
-
snapGrid:
|
|
2516
|
+
panOnScroll: F,
|
|
2517
|
+
zoomOnScroll: D,
|
|
2518
|
+
minZoom: L,
|
|
2519
|
+
maxZoom: ve,
|
|
2520
|
+
snapToGrid: Ee,
|
|
2521
|
+
snapGrid: Q,
|
|
2401
2522
|
proOptions: { hideAttribution: !0 },
|
|
2402
|
-
onNodeClick: (
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2523
|
+
onNodeClick: (w, E) => {
|
|
2524
|
+
const x = ie(E.id);
|
|
2525
|
+
x && (p != null && p(x) || (x.kind === "addTrigger" || x.kind === "triggerFixed" ? De() : (x.kind === "userTask" || x.kind === "filter" || x.kind === "approval") && Fe(E.id)));
|
|
2405
2526
|
},
|
|
2406
2527
|
children: [
|
|
2407
2528
|
l.background !== "none" && /* @__PURE__ */ f(
|
|
2408
|
-
|
|
2529
|
+
Ir,
|
|
2409
2530
|
{
|
|
2410
2531
|
variant: l.background,
|
|
2411
2532
|
color: l.backgroundColor ?? "#e0e0e0",
|
|
2412
2533
|
gap: 20
|
|
2413
2534
|
}
|
|
2414
2535
|
),
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
/* @__PURE__ */ f(
|
|
2536
|
+
j && /* @__PURE__ */ f(Or, { showInteractive: !1 }),
|
|
2537
|
+
B && /* @__PURE__ */ f(Mr, { zoomable: !0, pannable: !0 }),
|
|
2538
|
+
/* @__PURE__ */ f(Ri, { onHeightsReady: wr, nodeCount: bt.length })
|
|
2418
2539
|
]
|
|
2419
2540
|
}
|
|
2420
2541
|
),
|
|
2421
|
-
c ?
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
}) : /* @__PURE__ */ f(
|
|
2425
|
-
|
|
2542
|
+
c ? de === "triggerSelect" && c(t.list(), ct, () => K(null)) : /* @__PURE__ */ f(Ai, { open: de === "triggerSelect", templates: t.list(), messages: ne, onSelect: ct, onClose: () => K(null), loadTriggerSources: u }),
|
|
2543
|
+
h ? de === "nodePicker" && h(ut(), ft, () => {
|
|
2544
|
+
K(null), ke(null);
|
|
2545
|
+
}) : /* @__PURE__ */ f(Pi, { open: de === "nodePicker", availableDescriptors: ut(), messages: ne, onSelect: ft, onClose: () => {
|
|
2546
|
+
K(null), ke(null);
|
|
2426
2547
|
} }),
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2548
|
+
g ? de === "nodeConfig" && g(gt ?? void 0, X, ht, () => K(null)) : /* @__PURE__ */ f(Bi, { open: de === "nodeConfig", nodeId: je, descriptor: gt, initialValues: X == null ? void 0 : X.formData, messages: ne, onSave: ht, onClose: () => K(null) }),
|
|
2549
|
+
T && xe && /* @__PURE__ */ f(
|
|
2550
|
+
Wi,
|
|
2430
2551
|
{
|
|
2431
|
-
isOpen: !!
|
|
2432
|
-
onClose: () =>
|
|
2433
|
-
workflowId:
|
|
2434
|
-
workflowLabel:
|
|
2435
|
-
onFetchWorkflow:
|
|
2552
|
+
isOpen: !!xe,
|
|
2553
|
+
onClose: () => nt(null),
|
|
2554
|
+
workflowId: xe.workflowId,
|
|
2555
|
+
workflowLabel: xe.workflowLabel,
|
|
2556
|
+
onFetchWorkflow: T
|
|
2436
2557
|
}
|
|
2437
2558
|
)
|
|
2438
2559
|
]
|
|
2439
2560
|
}
|
|
2440
2561
|
) });
|
|
2441
|
-
},
|
|
2562
|
+
}, Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2442
2563
|
__proto__: null,
|
|
2443
|
-
WorkflowCanvas:
|
|
2444
|
-
default:
|
|
2445
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2446
|
-
function
|
|
2564
|
+
WorkflowCanvas: At,
|
|
2565
|
+
default: At
|
|
2566
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = "All";
|
|
2567
|
+
function qi({ template: e, onSelect: t }) {
|
|
2447
2568
|
var o, i;
|
|
2448
|
-
const r = e.triggerCategory ?
|
|
2449
|
-
return /* @__PURE__ */
|
|
2569
|
+
const r = e.triggerCategory ? cn[e.triggerCategory] : null, n = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
2570
|
+
return /* @__PURE__ */ y(
|
|
2450
2571
|
"div",
|
|
2451
2572
|
{
|
|
2452
2573
|
role: "button",
|
|
@@ -2474,23 +2595,23 @@ function Ki({ template: e, onSelect: t }) {
|
|
|
2474
2595
|
s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
|
|
2475
2596
|
},
|
|
2476
2597
|
children: [
|
|
2477
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
|
|
2478
2599
|
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 }),
|
|
2479
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2480
2601
|
/* @__PURE__ */ f("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
|
|
2481
2602
|
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 })
|
|
2482
2603
|
] })
|
|
2483
2604
|
] }),
|
|
2484
|
-
/* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
|
|
2485
2606
|
r && /* @__PURE__ */ f("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: r.bg, color: r.color }, children: r.label }),
|
|
2486
2607
|
(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)),
|
|
2487
|
-
n > 0 && /* @__PURE__ */
|
|
2608
|
+
n > 0 && /* @__PURE__ */ y("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
|
|
2488
2609
|
n,
|
|
2489
2610
|
" step",
|
|
2490
2611
|
n !== 1 ? "s" : ""
|
|
2491
2612
|
] })
|
|
2492
2613
|
] }),
|
|
2493
|
-
e.author && /* @__PURE__ */
|
|
2614
|
+
e.author && /* @__PURE__ */ y("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
|
|
2494
2615
|
"by ",
|
|
2495
2616
|
e.author
|
|
2496
2617
|
] })
|
|
@@ -2498,50 +2619,50 @@ function Ki({ template: e, onSelect: t }) {
|
|
|
2498
2619
|
}
|
|
2499
2620
|
);
|
|
2500
2621
|
}
|
|
2501
|
-
const
|
|
2622
|
+
const fs = ({
|
|
2502
2623
|
templates: e,
|
|
2503
2624
|
onSelectTemplate: t,
|
|
2504
2625
|
onStartFromScratch: r
|
|
2505
2626
|
}) => {
|
|
2506
|
-
const [n, o] =
|
|
2627
|
+
const [n, o] = M(""), [i, s] = M(Ye), l = $(() => {
|
|
2507
2628
|
const a = /* @__PURE__ */ new Set();
|
|
2508
2629
|
return e.forEach((c) => {
|
|
2509
2630
|
c.category && a.add(c.category);
|
|
2510
|
-
}), [
|
|
2511
|
-
}, [e]), d =
|
|
2631
|
+
}), [Ye, ...Array.from(a)];
|
|
2632
|
+
}, [e]), d = $(() => {
|
|
2512
2633
|
let a = e;
|
|
2513
|
-
if (i !==
|
|
2634
|
+
if (i !== Ye && (a = a.filter((c) => c.category === i)), n.trim()) {
|
|
2514
2635
|
const c = n.toLowerCase();
|
|
2515
2636
|
a = a.filter(
|
|
2516
2637
|
(u) => {
|
|
2517
2638
|
var h, g;
|
|
2518
|
-
return u.label.toLowerCase().includes(c) || ((h = u.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = u.tags) == null ? void 0 : g.some((
|
|
2639
|
+
return u.label.toLowerCase().includes(c) || ((h = u.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = u.tags) == null ? void 0 : g.some((p) => p.toLowerCase().includes(c)));
|
|
2519
2640
|
}
|
|
2520
2641
|
);
|
|
2521
2642
|
}
|
|
2522
2643
|
return [...a].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
|
|
2523
2644
|
}, [e, i, n]);
|
|
2524
|
-
return /* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2646
|
+
/* @__PURE__ */ y("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
2647
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
|
|
2648
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2528
2649
|
/* @__PURE__ */ f("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
|
|
2529
2650
|
/* @__PURE__ */ f("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
|
|
2530
2651
|
] }),
|
|
2531
|
-
r && /* @__PURE__ */
|
|
2652
|
+
r && /* @__PURE__ */ y(
|
|
2532
2653
|
"button",
|
|
2533
2654
|
{
|
|
2534
2655
|
onClick: r,
|
|
2535
2656
|
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" },
|
|
2536
2657
|
children: [
|
|
2537
|
-
/* @__PURE__ */ f(
|
|
2658
|
+
/* @__PURE__ */ f(Xr, { size: 16 }),
|
|
2538
2659
|
"Start from Scratch"
|
|
2539
2660
|
]
|
|
2540
2661
|
}
|
|
2541
2662
|
)
|
|
2542
2663
|
] }),
|
|
2543
|
-
/* @__PURE__ */
|
|
2544
|
-
/* @__PURE__ */ f(
|
|
2664
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2665
|
+
/* @__PURE__ */ f(Jr, { size: 18, color: "#9e9e9e" }),
|
|
2545
2666
|
/* @__PURE__ */ f(
|
|
2546
2667
|
"input",
|
|
2547
2668
|
{
|
|
@@ -2572,31 +2693,31 @@ const ls = ({
|
|
|
2572
2693
|
a
|
|
2573
2694
|
)) })
|
|
2574
2695
|
] }),
|
|
2575
|
-
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */
|
|
2576
|
-
/* @__PURE__ */ f(
|
|
2696
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ y("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
2697
|
+
/* @__PURE__ */ f(Zr, { size: 36, style: { marginBottom: 8 } }),
|
|
2577
2698
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2578
|
-
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ f(
|
|
2699
|
+
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ f(qi, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
2579
2700
|
] });
|
|
2580
|
-
},
|
|
2581
|
-
running: { label: "Running", color:
|
|
2582
|
-
success: { label: "Success", color:
|
|
2583
|
-
failed: { label: "Failed", color:
|
|
2584
|
-
cancelled: { label: "Cancelled", color:
|
|
2585
|
-
},
|
|
2586
|
-
pending: { color:
|
|
2587
|
-
running: { color:
|
|
2588
|
-
success: { color:
|
|
2589
|
-
failed: { color:
|
|
2590
|
-
skipped: { color:
|
|
2701
|
+
}, Te = {
|
|
2702
|
+
running: { label: "Running", color: Z.running, icon: G.createElement(Yt, { size: 14 }) },
|
|
2703
|
+
success: { label: "Success", color: Z.success, icon: G.createElement($t, { size: 14 }) },
|
|
2704
|
+
failed: { label: "Failed", color: Z.failed, icon: G.createElement(Gt, { size: 14 }) },
|
|
2705
|
+
cancelled: { label: "Cancelled", color: Z.cancelled, icon: G.createElement(Wt, { size: 14 }) }
|
|
2706
|
+
}, Xi = {
|
|
2707
|
+
pending: { color: Z.pending, icon: G.createElement(Qr, { size: 14 }) },
|
|
2708
|
+
running: { color: Z.running, icon: G.createElement(Yt, { size: 14 }) },
|
|
2709
|
+
success: { color: Z.success, icon: G.createElement($t, { size: 14 }) },
|
|
2710
|
+
failed: { color: Z.failed, icon: G.createElement(Gt, { size: 14 }) },
|
|
2711
|
+
skipped: { color: Z.skipped, icon: G.createElement(Wt, { size: 14 }) }
|
|
2591
2712
|
};
|
|
2592
|
-
function
|
|
2713
|
+
function qe(e) {
|
|
2593
2714
|
try {
|
|
2594
2715
|
return new Date(e).toLocaleString();
|
|
2595
2716
|
} catch {
|
|
2596
2717
|
return e;
|
|
2597
2718
|
}
|
|
2598
2719
|
}
|
|
2599
|
-
function
|
|
2720
|
+
function yr(e, t) {
|
|
2600
2721
|
try {
|
|
2601
2722
|
const r = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
2602
2723
|
return r < 1e3 ? `${r}ms` : r < 6e4 ? `${(r / 1e3).toFixed(1)}s` : `${Math.floor(r / 6e4)}m ${Math.floor(r % 6e4 / 1e3)}s`;
|
|
@@ -2604,10 +2725,10 @@ function pr(e, t) {
|
|
|
2604
2725
|
return "—";
|
|
2605
2726
|
}
|
|
2606
2727
|
}
|
|
2607
|
-
function
|
|
2608
|
-
const [t, r] =
|
|
2609
|
-
return /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2728
|
+
function Ji({ step: e }) {
|
|
2729
|
+
const [t, r] = M(!1), n = Xi[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
2730
|
+
return /* @__PURE__ */ y("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
2731
|
+
/* @__PURE__ */ y(
|
|
2611
2732
|
"div",
|
|
2612
2733
|
{
|
|
2613
2734
|
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
|
|
@@ -2620,30 +2741,30 @@ function Vi({ step: e }) {
|
|
|
2620
2741
|
o && (i.key === "Enter" || i.key === " ") && r((s) => !s);
|
|
2621
2742
|
},
|
|
2622
2743
|
children: [
|
|
2623
|
-
/* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children:
|
|
2744
|
+
/* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children: G.cloneElement(n.icon, { color: n.color }) }),
|
|
2624
2745
|
/* @__PURE__ */ f("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
2625
2746
|
e.branchTaken && /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
2626
|
-
/* @__PURE__ */ f("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ?
|
|
2627
|
-
o && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ?
|
|
2747
|
+
/* @__PURE__ */ f("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? yr(e.startedAt, e.completedAt) : "—" }),
|
|
2748
|
+
o && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? G.createElement(tn, { size: 16 }) : G.createElement(rn, { size: 16 }) })
|
|
2628
2749
|
]
|
|
2629
2750
|
}
|
|
2630
2751
|
),
|
|
2631
|
-
t && o && /* @__PURE__ */
|
|
2752
|
+
t && o && /* @__PURE__ */ y("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
|
|
2632
2753
|
e.error && /* @__PURE__ */ f("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
|
|
2633
|
-
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */
|
|
2754
|
+
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ y("details", { style: { marginBottom: 4 }, children: [
|
|
2634
2755
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
|
|
2635
2756
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
|
|
2636
2757
|
] }),
|
|
2637
|
-
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */
|
|
2758
|
+
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ y("details", { children: [
|
|
2638
2759
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
|
|
2639
2760
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
|
|
2640
2761
|
] })
|
|
2641
2762
|
] })
|
|
2642
2763
|
] });
|
|
2643
2764
|
}
|
|
2644
|
-
function
|
|
2645
|
-
const n =
|
|
2646
|
-
return /* @__PURE__ */
|
|
2765
|
+
function Zi({ record: e, selected: t, onSelect: r }) {
|
|
2766
|
+
const n = Te[e.status];
|
|
2767
|
+
return /* @__PURE__ */ y(
|
|
2647
2768
|
"div",
|
|
2648
2769
|
{
|
|
2649
2770
|
role: "button",
|
|
@@ -2663,10 +2784,10 @@ function Hi({ record: e, selected: t, onSelect: r }) {
|
|
|
2663
2784
|
outline: "none"
|
|
2664
2785
|
},
|
|
2665
2786
|
children: [
|
|
2666
|
-
/* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children:
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
2669
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children: G.cloneElement(n.icon, { color: n.color, size: 16 }) }),
|
|
2788
|
+
/* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2789
|
+
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: qe(e.triggeredAt) }),
|
|
2790
|
+
/* @__PURE__ */ y("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
2670
2791
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
2671
2792
|
" · ",
|
|
2672
2793
|
e.steps.length,
|
|
@@ -2675,43 +2796,43 @@ function Hi({ record: e, selected: t, onSelect: r }) {
|
|
|
2675
2796
|
] })
|
|
2676
2797
|
] }),
|
|
2677
2798
|
/* @__PURE__ */ f("span", { style: { fontSize: 11, fontWeight: 600, color: n.color, flexShrink: 0 }, children: n.label }),
|
|
2678
|
-
/* @__PURE__ */ f(
|
|
2799
|
+
/* @__PURE__ */ f(Bt, { size: 14, color: "#bdbdbd" })
|
|
2679
2800
|
]
|
|
2680
2801
|
}
|
|
2681
2802
|
);
|
|
2682
2803
|
}
|
|
2683
|
-
const
|
|
2804
|
+
const hs = ({ records: e, onViewOnCanvas: t }) => {
|
|
2684
2805
|
var s;
|
|
2685
|
-
const [r, n] =
|
|
2686
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */ f(
|
|
2806
|
+
const [r, n] = M(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
2807
|
+
return e.length === 0 ? /* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
2808
|
+
/* @__PURE__ */ f(vt, { size: 36 }),
|
|
2688
2809
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
2689
2810
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
2690
|
-
] }) : /* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2811
|
+
] }) : /* @__PURE__ */ y("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
2812
|
+
/* @__PURE__ */ y("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
|
|
2813
|
+
/* @__PURE__ */ y("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
|
|
2693
2814
|
"Run History (",
|
|
2694
2815
|
e.length,
|
|
2695
2816
|
")"
|
|
2696
2817
|
] }),
|
|
2697
|
-
i.map((l) => /* @__PURE__ */ f(
|
|
2818
|
+
i.map((l) => /* @__PURE__ */ f(Zi, { record: l, selected: l.id === r, onSelect: () => n(l.id) }, l.id))
|
|
2698
2819
|
] }),
|
|
2699
|
-
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2703
|
-
|
|
2704
|
-
/* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children:
|
|
2820
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ y("div", { children: [
|
|
2821
|
+
/* @__PURE__ */ y("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
2822
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2823
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
2824
|
+
G.cloneElement(Te[o.status].icon, { color: Te[o.status].color, size: 18 }),
|
|
2825
|
+
/* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: Te[o.status].label })
|
|
2705
2826
|
] }),
|
|
2706
|
-
/* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */ f(
|
|
2827
|
+
/* @__PURE__ */ y("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2828
|
+
/* @__PURE__ */ y("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2829
|
+
/* @__PURE__ */ f(vt, { size: 13 }),
|
|
2709
2830
|
" ",
|
|
2710
|
-
|
|
2711
|
-
o.completedAt && ` → ${
|
|
2831
|
+
qe(o.triggeredAt),
|
|
2832
|
+
o.completedAt && ` → ${qe(o.completedAt)} (${yr(o.triggeredAt, o.completedAt)})`
|
|
2712
2833
|
] }),
|
|
2713
|
-
o.triggeredBy && /* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */ f(
|
|
2834
|
+
o.triggeredBy && /* @__PURE__ */ y("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2835
|
+
/* @__PURE__ */ f(en, { size: 13 }),
|
|
2715
2836
|
" ",
|
|
2716
2837
|
o.triggeredBy
|
|
2717
2838
|
] })
|
|
@@ -2727,21 +2848,21 @@ const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2727
2848
|
)
|
|
2728
2849
|
] }),
|
|
2729
2850
|
o.error && /* @__PURE__ */ f("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2851
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2852
|
+
/* @__PURE__ */ y("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
2732
2853
|
"STEPS (",
|
|
2733
2854
|
o.steps.length,
|
|
2734
2855
|
")"
|
|
2735
2856
|
] }),
|
|
2736
|
-
o.steps.map((l, d) => /* @__PURE__ */ f(
|
|
2857
|
+
o.steps.map((l, d) => /* @__PURE__ */ f(Ji, { step: l }, `${l.nodeId}-${d}`))
|
|
2737
2858
|
] }),
|
|
2738
|
-
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */
|
|
2859
|
+
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ y("details", { children: [
|
|
2739
2860
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
2740
2861
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
|
|
2741
2862
|
] }) })
|
|
2742
2863
|
] }) : /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
2743
2864
|
] });
|
|
2744
|
-
},
|
|
2865
|
+
}, gs = {
|
|
2745
2866
|
slots: [
|
|
2746
2867
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2747
2868
|
{ id: "trigger-END_USER_CREATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "New User Registration", nodeData: { label: "New User Registration" } },
|
|
@@ -2755,7 +2876,7 @@ const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2755
2876
|
fail: [{ id: "notification-fail-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Rejection Notice", nodeData: { title: "Rejection Notice" } }]
|
|
2756
2877
|
}
|
|
2757
2878
|
}
|
|
2758
|
-
},
|
|
2879
|
+
}, ps = {
|
|
2759
2880
|
slots: [
|
|
2760
2881
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2761
2882
|
{ id: "trigger-ACCESS_REQUEST", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "Access Request Submitted", nodeData: { label: "Access Request Submitted" } },
|
|
@@ -2773,7 +2894,7 @@ const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2773
2894
|
]
|
|
2774
2895
|
}
|
|
2775
2896
|
}
|
|
2776
|
-
},
|
|
2897
|
+
}, bs = {
|
|
2777
2898
|
slots: [
|
|
2778
2899
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2779
2900
|
{ id: "trigger-USER_DEACTIVATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "User Deactivation", nodeData: { label: "User Deactivation" } },
|
|
@@ -2782,7 +2903,7 @@ const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2782
2903
|
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
2783
2904
|
],
|
|
2784
2905
|
branches: {}
|
|
2785
|
-
},
|
|
2906
|
+
}, ys = {
|
|
2786
2907
|
slots: [
|
|
2787
2908
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2788
2909
|
{ id: "trigger-WEBHOOK_TRIGGER", kind: "triggerFixed", reactFlowType: "webhookTriggerNode", deletable: !0, label: "Incoming Webhook", nodeData: { label: "Incoming Webhook" } },
|
|
@@ -2793,12 +2914,12 @@ const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2793
2914
|
branches: {}
|
|
2794
2915
|
};
|
|
2795
2916
|
export {
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2917
|
+
At as F,
|
|
2918
|
+
Wi as S,
|
|
2919
|
+
hs as W,
|
|
2920
|
+
fs as a,
|
|
2921
|
+
ps as b,
|
|
2922
|
+
bs as o,
|
|
2923
|
+
gs as u,
|
|
2924
|
+
ys as w
|
|
2804
2925
|
};
|