@g1cloud/bpmn-modeler-next 5.0.0-beta.60 → 5.0.0-beta.62
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/bpmn-modeler.js +848 -843
- package/dist/bpmn-modeler.umd.cjs +12 -12
- package/package.json +1 -1
package/dist/bpmn-modeler.js
CHANGED
|
@@ -414,7 +414,7 @@ class Qb {
|
|
|
414
414
|
const b = !!v && !y(m), E = b ? r.filter((k) => k !== m && w(k) && !y(k)) : [], A = () => {
|
|
415
415
|
let k = c.extensionElements;
|
|
416
416
|
return k || (k = this.moddle.create("bpmn:ExtensionElements", { values: [] }), k.$parent = c, c.extensionElements = k, u.push(() => delete c.extensionElements)), k.get("values");
|
|
417
|
-
},
|
|
417
|
+
}, I = (k, H) => {
|
|
418
418
|
const F = A();
|
|
419
419
|
let G = F.find((ee) => {
|
|
420
420
|
var se;
|
|
@@ -433,15 +433,15 @@ class Qb {
|
|
|
433
433
|
if (m === o && l) {
|
|
434
434
|
if (f && !p.some((H) => H.body === f)) {
|
|
435
435
|
const H = a && a !== o ? a : void 0;
|
|
436
|
-
H &&
|
|
436
|
+
H && I(H, f);
|
|
437
437
|
}
|
|
438
438
|
const k = Object.prototype.hasOwnProperty.call(l.target, l.key);
|
|
439
439
|
l.target[l.key] = i, u.push(() => {
|
|
440
440
|
k ? l.target[l.key] = f : delete l.target[l.key];
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
|
|
444
|
-
} else (p.some((k) => Dn(k) === m) || !f && m !== d) &&
|
|
443
|
+
I(m, i);
|
|
444
|
+
} else (p.some((k) => Dn(k) === m) || !f && m !== d) && I(m, i);
|
|
445
445
|
if (!b) for (const k of Nr(c).filter((H) => H.locale === m)) P(k);
|
|
446
446
|
for (const k of E) {
|
|
447
447
|
const H = A(), F = this.moddle.create(wd, { locale: k, sourceLocale: m, previous: v });
|
|
@@ -1318,7 +1318,7 @@ function lw(e) {
|
|
|
1318
1318
|
if (!this)
|
|
1319
1319
|
return new lw(e);
|
|
1320
1320
|
var t = e && e.proxy, n, i, o, r, a = MR, s, c, l, u, p = Hc, f = !1, d = !1, g = "", h = !1, m = !1, w = null, y = !1, v, b, E, A;
|
|
1321
|
-
function
|
|
1321
|
+
function I(F) {
|
|
1322
1322
|
F instanceof Error || (F = zo(F)), w = F, a(F, p);
|
|
1323
1323
|
}
|
|
1324
1324
|
function P(F) {
|
|
@@ -1388,7 +1388,7 @@ function lw(e) {
|
|
|
1388
1388
|
y = !0;
|
|
1389
1389
|
};
|
|
1390
1390
|
function H(F, G = !1) {
|
|
1391
|
-
var ee = null, se = null, ie, ve = 0,
|
|
1391
|
+
var ee = null, se = null, ie, ve = 0, de = !1, me = !1, _e = 0, U = 0, le, K, Q, he, Ee, Fe, $, C, R, W = "", q = 0, pe;
|
|
1392
1392
|
function Te(_t, Jt) {
|
|
1393
1393
|
var En = _t.indexOf(":");
|
|
1394
1394
|
if (En === -1)
|
|
@@ -1483,9 +1483,9 @@ function lw(e) {
|
|
|
1483
1483
|
if (G)
|
|
1484
1484
|
return F.substring(U);
|
|
1485
1485
|
if (E.length)
|
|
1486
|
-
return
|
|
1486
|
+
return I("unexpected end of file");
|
|
1487
1487
|
if (!d)
|
|
1488
|
-
return
|
|
1488
|
+
return I("missing start tag");
|
|
1489
1489
|
U < F.length && F.substring(U).trim() && P(Hm);
|
|
1490
1490
|
return;
|
|
1491
1491
|
}
|
|
@@ -1496,10 +1496,10 @@ function lw(e) {
|
|
|
1496
1496
|
} else if (F.substring(U, _e).trim() && (P(Hm), y))
|
|
1497
1497
|
return;
|
|
1498
1498
|
}
|
|
1499
|
-
if (
|
|
1499
|
+
if (he = F.charCodeAt(_e + 1), he === 33) {
|
|
1500
1500
|
if (Q = F.charCodeAt(_e + 2), Q === 91 && F.substr(_e + 3, 6) === "CDATA[") {
|
|
1501
1501
|
if (U = F.indexOf("]]>", _e), U === -1)
|
|
1502
|
-
return G ? F.substring(_e) :
|
|
1502
|
+
return G ? F.substring(_e) : I("unclosed cdata");
|
|
1503
1503
|
if (r && (r(F.substring(_e + 9, U), p), y))
|
|
1504
1504
|
return;
|
|
1505
1505
|
U += 3;
|
|
@@ -1507,16 +1507,16 @@ function lw(e) {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
if (Q === 45 && F.charCodeAt(_e + 3) === 45) {
|
|
1509
1509
|
if (U = F.indexOf("-->", _e), U === -1)
|
|
1510
|
-
return G ? F.substring(_e) :
|
|
1510
|
+
return G ? F.substring(_e) : I("unclosed comment");
|
|
1511
1511
|
if (c && (c(F.substring(_e + 4, U), Tr, p), y))
|
|
1512
1512
|
return;
|
|
1513
1513
|
U += 3;
|
|
1514
1514
|
continue;
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
|
-
if (
|
|
1517
|
+
if (he === 63) {
|
|
1518
1518
|
if (U = F.indexOf("?>", _e), U === -1)
|
|
1519
|
-
return G ? F.substring(_e) :
|
|
1519
|
+
return G ? F.substring(_e) : I("unclosed question");
|
|
1520
1520
|
if (l && (l(F.substring(_e, U + 2), p), y))
|
|
1521
1521
|
return;
|
|
1522
1522
|
U += 2;
|
|
@@ -1524,7 +1524,7 @@ function lw(e) {
|
|
|
1524
1524
|
}
|
|
1525
1525
|
for (le = _e + 1; ; le++) {
|
|
1526
1526
|
if (Ee = F.charCodeAt(le), isNaN(Ee))
|
|
1527
|
-
return G ? F.substring(_e) : (U = -1,
|
|
1527
|
+
return G ? F.substring(_e) : (U = -1, I("unclosed tag"));
|
|
1528
1528
|
if (Ee === 34)
|
|
1529
1529
|
Q = F.indexOf('"', le + 1), le = Q !== -1 ? Q : le;
|
|
1530
1530
|
else if (Ee === 39)
|
|
@@ -1534,54 +1534,54 @@ function lw(e) {
|
|
|
1534
1534
|
break;
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
if (
|
|
1537
|
+
if (he === 33) {
|
|
1538
1538
|
if (u && (u(F.substring(_e, U + 1), Tr, p), y))
|
|
1539
1539
|
return;
|
|
1540
1540
|
U += 1;
|
|
1541
1541
|
continue;
|
|
1542
1542
|
}
|
|
1543
|
-
if (pe = {},
|
|
1544
|
-
if (
|
|
1545
|
-
return
|
|
1543
|
+
if (pe = {}, he === 47) {
|
|
1544
|
+
if (de = !1, me = !0, !E.length)
|
|
1545
|
+
return I("missing open tag");
|
|
1546
1546
|
if (le = $ = E.pop(), Q = _e + 2 + le.length, F.substring(_e + 2, Q) !== le)
|
|
1547
|
-
return
|
|
1547
|
+
return I("closing tag mismatch");
|
|
1548
1548
|
for (; Q < U; Q++)
|
|
1549
|
-
if (
|
|
1550
|
-
return
|
|
1549
|
+
if (he = F.charCodeAt(Q), !(he === 32 || he > 8 && he < 14))
|
|
1550
|
+
return I("close tag");
|
|
1551
1551
|
} else {
|
|
1552
|
-
if (F.charCodeAt(U - 1) === 47 ? (le = $ = F.substring(_e + 1, U - 1),
|
|
1553
|
-
return
|
|
1552
|
+
if (F.charCodeAt(U - 1) === 47 ? (le = $ = F.substring(_e + 1, U - 1), de = !0, me = !0) : (le = $ = F.substring(_e + 1, U), de = !0, me = !1), !(he > 96 && he < 123 || he > 64 && he < 91 || he === 95 || he === 58))
|
|
1553
|
+
return I("illegal first char nodeName");
|
|
1554
1554
|
for (Q = 1, K = le.length; Q < K; Q++)
|
|
1555
|
-
if (
|
|
1556
|
-
if (
|
|
1555
|
+
if (he = le.charCodeAt(Q), !(he > 96 && he < 123 || he > 64 && he < 91 || he > 47 && he < 59 || he === 45 || he === 95 || he == 46)) {
|
|
1556
|
+
if (he === 32 || he < 14 && he > 8) {
|
|
1557
1557
|
$ = le.substring(0, Q), pe = null;
|
|
1558
1558
|
break;
|
|
1559
1559
|
}
|
|
1560
|
-
return
|
|
1560
|
+
return I("invalid nodeName");
|
|
1561
1561
|
}
|
|
1562
|
-
|
|
1562
|
+
me || E.push($);
|
|
1563
1563
|
}
|
|
1564
1564
|
if (m) {
|
|
1565
|
-
ie = b,
|
|
1565
|
+
ie = b, de && (me || v.push(ie), pe === null && (h = le.indexOf("xmlns", Q) !== -1) && (q = Q, W = le, Qe(), h = !1)), C = $, se !== b && (ee = b[zm], ee === void 0 && (ee = b[zm] = /* @__PURE__ */ Object.create(null)), se = b);
|
|
1566
1566
|
var jt = ee[$];
|
|
1567
1567
|
if (jt !== void 0)
|
|
1568
1568
|
$ = jt;
|
|
1569
1569
|
else {
|
|
1570
|
-
if (
|
|
1571
|
-
if (Fe = b[$.substring(0,
|
|
1572
|
-
return
|
|
1573
|
-
$ = $.substr(
|
|
1570
|
+
if (he = $.indexOf(":"), he !== -1) {
|
|
1571
|
+
if (Fe = b[$.substring(0, he)], !Fe)
|
|
1572
|
+
return I("missing namespace on <" + C + ">");
|
|
1573
|
+
$ = $.substr(he + 1);
|
|
1574
1574
|
} else
|
|
1575
1575
|
Fe = b.xmlns;
|
|
1576
1576
|
Fe && ($ = Fe + ":" + $), ee[C] = $;
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
if (
|
|
1579
|
+
if (de && (q = Q, W = le, i && (t ? i(R, Tr, me, p) : i($, Qe, Tr, me, p), y)))
|
|
1580
1580
|
return;
|
|
1581
|
-
if (
|
|
1582
|
-
if (o && (o(t ? R : $, Tr,
|
|
1581
|
+
if (me) {
|
|
1582
|
+
if (o && (o(t ? R : $, Tr, de, p), y))
|
|
1583
1583
|
return;
|
|
1584
|
-
m && (
|
|
1584
|
+
m && (de ? b = ie : b = v.pop());
|
|
1585
1585
|
}
|
|
1586
1586
|
U += 1;
|
|
1587
1587
|
}
|
|
@@ -1819,14 +1819,14 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1819
1819
|
t instanceof qn ? (i = t, t = {}) : typeof t == "string" ? (i = this.handler(t), t = {}) : typeof i == "string" && (i = this.handler(i));
|
|
1820
1820
|
var o = this.model, r = this.lax, a = new OR(Y({}, t, { rootHandler: i })), s = new lw({ proxy: !0 }), c = DR();
|
|
1821
1821
|
i.context = a, c.push(i);
|
|
1822
|
-
function l(E, A,
|
|
1822
|
+
function l(E, A, I) {
|
|
1823
1823
|
var P = A(), k = P.line, H = P.column, F = P.data;
|
|
1824
1824
|
F.charAt(0) === "<" && F.indexOf(" ") !== -1 && (F = F.slice(0, F.indexOf(" ")) + ">");
|
|
1825
1825
|
var G = "unparsable content " + (F ? F + " " : "") + `detected
|
|
1826
1826
|
line: ` + k + `
|
|
1827
1827
|
column: ` + H + `
|
|
1828
1828
|
nested error: ` + E.message;
|
|
1829
|
-
if (
|
|
1829
|
+
if (I)
|
|
1830
1830
|
return a.addWarning({
|
|
1831
1831
|
message: G,
|
|
1832
1832
|
error: E
|
|
@@ -1837,8 +1837,8 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1837
1837
|
return l(E, A, !0);
|
|
1838
1838
|
}
|
|
1839
1839
|
function p() {
|
|
1840
|
-
var E = a.elementsById, A = a.references,
|
|
1841
|
-
for (
|
|
1840
|
+
var E = a.elementsById, A = a.references, I, P;
|
|
1841
|
+
for (I = 0; P = A[I]; I++) {
|
|
1842
1842
|
var k = P.element, H = E[P.id], F = wo(k).propertiesByName[P.property];
|
|
1843
1843
|
if (H || a.addWarning({
|
|
1844
1844
|
message: "unresolved reference <" + P.id + ">",
|
|
@@ -1858,16 +1858,16 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1858
1858
|
var d = /^<\?xml /i, g = / encoding="([^"]+)"/i, h = /^utf-8$/i;
|
|
1859
1859
|
function m(E) {
|
|
1860
1860
|
if (d.test(E)) {
|
|
1861
|
-
var A = g.exec(E),
|
|
1862
|
-
!
|
|
1863
|
-
message: "unsupported document encoding <" +
|
|
1861
|
+
var A = g.exec(E), I = A && A[1];
|
|
1862
|
+
!I || h.test(I) || a.addWarning({
|
|
1863
|
+
message: "unsupported document encoding <" + I + ">, falling back to UTF-8"
|
|
1864
1864
|
});
|
|
1865
1865
|
}
|
|
1866
1866
|
}
|
|
1867
1867
|
function w(E, A) {
|
|
1868
|
-
var
|
|
1868
|
+
var I = c.peek();
|
|
1869
1869
|
try {
|
|
1870
|
-
c.push(
|
|
1870
|
+
c.push(I.handleNode(E));
|
|
1871
1871
|
} catch (P) {
|
|
1872
1872
|
l(P, A, r) && c.push(new Cd());
|
|
1873
1873
|
}
|
|
@@ -1875,8 +1875,8 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1875
1875
|
function y(E, A) {
|
|
1876
1876
|
try {
|
|
1877
1877
|
c.peek().handleText(E);
|
|
1878
|
-
} catch (
|
|
1879
|
-
u(
|
|
1878
|
+
} catch (I) {
|
|
1879
|
+
u(I, A);
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
function v(E, A) {
|
|
@@ -1884,10 +1884,10 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1884
1884
|
}
|
|
1885
1885
|
var b = o.getPackages().reduce(function(E, A) {
|
|
1886
1886
|
return E[A.uri] = A.prefix, E;
|
|
1887
|
-
}, Object.entries(Of).reduce(function(E, [A,
|
|
1888
|
-
return E[
|
|
1887
|
+
}, Object.entries(Of).reduce(function(E, [A, I]) {
|
|
1888
|
+
return E[I] = A, E;
|
|
1889
1889
|
}, o.config && o.config.nsMap || {}));
|
|
1890
|
-
return s.ns(b).on("openTag", function(E, A,
|
|
1890
|
+
return s.ns(b).on("openTag", function(E, A, I, P) {
|
|
1891
1891
|
var k = E.attrs || {}, H = Object.keys(k).reduce(function(G, ee) {
|
|
1892
1892
|
var se = A(k[ee]);
|
|
1893
1893
|
return G[ee] = se, G;
|
|
@@ -1898,19 +1898,19 @@ Pd.prototype.fromXML = function(e, t, n) {
|
|
|
1898
1898
|
ns: E.ns
|
|
1899
1899
|
};
|
|
1900
1900
|
w(F, P);
|
|
1901
|
-
}).on("question", m).on("closeTag", f).on("cdata", y).on("text", function(E, A,
|
|
1902
|
-
v(A(E),
|
|
1901
|
+
}).on("question", m).on("closeTag", f).on("cdata", y).on("text", function(E, A, I) {
|
|
1902
|
+
v(A(E), I);
|
|
1903
1903
|
}).on("error", l).on("warn", u), new Promise(function(E, A) {
|
|
1904
|
-
var
|
|
1904
|
+
var I;
|
|
1905
1905
|
try {
|
|
1906
1906
|
s.parse(e), p();
|
|
1907
1907
|
} catch (G) {
|
|
1908
|
-
|
|
1908
|
+
I = G;
|
|
1909
1909
|
}
|
|
1910
1910
|
var P = i.element;
|
|
1911
|
-
!
|
|
1911
|
+
!I && !P && (I = Qo("failed to parse document as <" + i.type.$descriptor.name + ">"));
|
|
1912
1912
|
var k = a.warnings, H = a.references, F = a.elementsById;
|
|
1913
|
-
return
|
|
1913
|
+
return I ? (I.warnings = k, A(I)) : E({
|
|
1914
1914
|
rootElement: P,
|
|
1915
1915
|
elementsById: F,
|
|
1916
1916
|
references: H,
|
|
@@ -6520,7 +6520,7 @@ function pt(e, t = {}) {
|
|
|
6520
6520
|
if (!b) continue;
|
|
6521
6521
|
const A = e.shapes.find((H) => H.id === b);
|
|
6522
6522
|
if (!A || A.container) continue;
|
|
6523
|
-
const
|
|
6523
|
+
const I = Math.max(A.x - E.x, E.x - (A.x + A.width), 0), P = Math.max(A.y - E.y, E.y - (A.y + A.height), 0), k = Math.hypot(I, P);
|
|
6524
6524
|
k > pM && n.push({ kind: "edge-endpoint-detached", edge: y.id, shape: b, distance: Math.round(k) });
|
|
6525
6525
|
}
|
|
6526
6526
|
}
|
|
@@ -6538,8 +6538,8 @@ function pt(e, t = {}) {
|
|
|
6538
6538
|
);
|
|
6539
6539
|
for (let y = 0; y < a.length; y++)
|
|
6540
6540
|
for (let v = y + 1; v < a.length; v++) {
|
|
6541
|
-
const b = a[y], E = a[v], A = Math.min(b.x + b.width, E.x + E.width) - Math.max(b.x, E.x),
|
|
6542
|
-
if (A <= zc ||
|
|
6541
|
+
const b = a[y], E = a[v], A = Math.min(b.x + b.width, E.x + E.width) - Math.max(b.x, E.x), I = Math.min(b.y + b.height, E.y + E.height) - Math.max(b.y, E.y);
|
|
6542
|
+
if (A <= zc || I <= zc) continue;
|
|
6543
6543
|
const P = b.id < E.id ? [b.id, E.id] : [E.id, b.id], k = new Set(E.members);
|
|
6544
6544
|
if (b.members.some((F) => k.has(F))) {
|
|
6545
6545
|
const F = Ym(e, a, {
|
|
@@ -6571,13 +6571,13 @@ function pt(e, t = {}) {
|
|
|
6571
6571
|
for (const y of a) {
|
|
6572
6572
|
const v = new Set(c(y).map((k) => k.id)), b = new Set(y.members), E = new Set([...v].filter((k) => !b.has(k) && s.has(k)));
|
|
6573
6573
|
if (!E.size) continue;
|
|
6574
|
-
let A = !1,
|
|
6574
|
+
let A = !1, I = !1, P = !1;
|
|
6575
6575
|
for (const k of e.edges) {
|
|
6576
6576
|
if (k.type !== "bpmn:SequenceFlow" || !k.source || !k.target) continue;
|
|
6577
6577
|
const H = E.has(k.source), F = E.has(k.target);
|
|
6578
|
-
!H && F && !v.has(k.source) ? A = !0 : H && !F && !v.has(k.target) ?
|
|
6578
|
+
!H && F && !v.has(k.source) ? A = !0 : H && !F && !v.has(k.target) ? I = !0 : H && F && (P = !0);
|
|
6579
6579
|
}
|
|
6580
|
-
A &&
|
|
6580
|
+
A && I && P && n.push({
|
|
6581
6581
|
kind: "group-overlap-unreadable",
|
|
6582
6582
|
reason: "throughpass",
|
|
6583
6583
|
group: y.id,
|
|
@@ -6595,10 +6595,10 @@ function pt(e, t = {}) {
|
|
|
6595
6595
|
bottom: Math.min(...E.map((k) => k.y + k.height))
|
|
6596
6596
|
};
|
|
6597
6597
|
if (A.right - A.x <= zc || A.bottom - A.y <= zc) continue;
|
|
6598
|
-
const
|
|
6599
|
-
if (!
|
|
6598
|
+
const I = Ym(e, [], A);
|
|
6599
|
+
if (!I.length) continue;
|
|
6600
6600
|
const P = E.map((k) => k.id).sort();
|
|
6601
|
-
n.push({ kind: "group-stack-unreadable", groups: P, shapes:
|
|
6601
|
+
n.push({ kind: "group-stack-unreadable", groups: P, shapes: I });
|
|
6602
6602
|
}
|
|
6603
6603
|
for (const y of e.shapes.filter((v) => v.type === "bpmn:Group"))
|
|
6604
6604
|
for (const v of e.shapes) {
|
|
@@ -6609,10 +6609,10 @@ function pt(e, t = {}) {
|
|
|
6609
6609
|
["left", y.x, "v", y.y, y.y + y.height],
|
|
6610
6610
|
["right", y.x + y.width, "v", y.y, y.y + y.height]
|
|
6611
6611
|
];
|
|
6612
|
-
for (const [E, A,
|
|
6613
|
-
const H =
|
|
6612
|
+
for (const [E, A, I, P, k] of b) {
|
|
6613
|
+
const H = I === "h" ? v.x : v.y, F = I === "h" ? v.x + v.width : v.y + v.height;
|
|
6614
6614
|
if (!(H < k && P < F)) continue;
|
|
6615
|
-
const G =
|
|
6615
|
+
const G = I === "h" ? v.y : v.x, ee = I === "h" ? v.y + v.height : v.x + v.width;
|
|
6616
6616
|
if (!(G < A && A < ee)) continue;
|
|
6617
6617
|
const se = Math.min(A - G, ee - A);
|
|
6618
6618
|
se < aM || n.push({ kind: "group-cuts-shape", group: y.id, shape: v.id, side: E, depth: se });
|
|
@@ -6628,19 +6628,19 @@ function pt(e, t = {}) {
|
|
|
6628
6628
|
const b = xn(v);
|
|
6629
6629
|
if (b.length)
|
|
6630
6630
|
for (const E of u) {
|
|
6631
|
-
const A = E.x + E.width,
|
|
6631
|
+
const A = E.x + E.width, I = E.y + E.height, P = v.endpoints.some((H) => {
|
|
6632
6632
|
const F = y.get(H);
|
|
6633
|
-
return !!F && E.x < F.x && F.x < A && E.y < F.y && F.y <
|
|
6633
|
+
return !!F && E.x < F.x && F.x < A && E.y < F.y && F.y < I;
|
|
6634
6634
|
});
|
|
6635
6635
|
let k = null;
|
|
6636
6636
|
for (const H of b) {
|
|
6637
|
-
const [F, G, ee] = H.axis === "v" ? [E.y,
|
|
6637
|
+
const [F, G, ee] = H.axis === "v" ? [E.y, I, [["left", E.x], ["right", A]]] : [E.x, A, [["top", E.y], ["bottom", I]]], se = Math.min(H.hi, G) - Math.max(H.lo, F);
|
|
6638
6638
|
if (se < _w) continue;
|
|
6639
|
-
const ie = H.axis === "v" ? E.x < H.at && H.at < A : E.y < H.at && H.at <
|
|
6639
|
+
const ie = H.axis === "v" ? E.x < H.at && H.at < A : E.y < H.at && H.at < I;
|
|
6640
6640
|
if (!(ie && P))
|
|
6641
|
-
for (const [ve,
|
|
6642
|
-
const
|
|
6643
|
-
|
|
6641
|
+
for (const [ve, de] of ee) {
|
|
6642
|
+
const me = Math.abs(H.at - de);
|
|
6643
|
+
me <= Cs && (!k || me < k.distance) && (k = { side: ve, inside: ie, distance: me, length: se });
|
|
6644
6644
|
}
|
|
6645
6645
|
}
|
|
6646
6646
|
k && n.push({
|
|
@@ -6664,15 +6664,15 @@ function pt(e, t = {}) {
|
|
|
6664
6664
|
["left", y.x, v.x, E],
|
|
6665
6665
|
["right", y.x + y.width, v.x + v.width, E]
|
|
6666
6666
|
];
|
|
6667
|
-
for (const [
|
|
6668
|
-
H && Math.abs(P - k) <= Gm && n.push({ kind: "group-on-container-boundary", group: y.id, container: v.id, side:
|
|
6667
|
+
for (const [I, P, k, H] of A)
|
|
6668
|
+
H && Math.abs(P - k) <= Gm && n.push({ kind: "group-on-container-boundary", group: y.id, container: v.id, side: I });
|
|
6669
6669
|
}
|
|
6670
6670
|
const f = e.shapes.filter((y) => y.type === "bpmn:Group");
|
|
6671
6671
|
for (let y = 0; y < f.length; y++)
|
|
6672
6672
|
for (let v = y + 1; v < f.length; v++) {
|
|
6673
|
-
const b = f[y], E = f[v], A = b.x < E.x + E.width && E.x < b.x + b.width,
|
|
6674
|
-
["x", b.x + b.width, E.x,
|
|
6675
|
-
["x", E.x + E.width, b.x,
|
|
6673
|
+
const b = f[y], E = f[v], A = b.x < E.x + E.width && E.x < b.x + b.width, I = b.y < E.y + E.height && E.y < b.y + b.height, P = [
|
|
6674
|
+
["x", b.x + b.width, E.x, I],
|
|
6675
|
+
["x", E.x + E.width, b.x, I],
|
|
6676
6676
|
["y", b.y + b.height, E.y, A],
|
|
6677
6677
|
["y", E.y + E.height, b.y, A]
|
|
6678
6678
|
];
|
|
@@ -6690,10 +6690,10 @@ function pt(e, t = {}) {
|
|
|
6690
6690
|
for (let v = y + 1; v < e.edges.length; v++) {
|
|
6691
6691
|
const b = e.edges[y], E = e.edges[v], A = ja(b, E);
|
|
6692
6692
|
if (!A) continue;
|
|
6693
|
-
const
|
|
6693
|
+
const I = b.id < E.id ? [b.id, E.id] : [E.id, b.id];
|
|
6694
6694
|
n.push({
|
|
6695
6695
|
kind: A.kind === "opposite" ? "edge-overlap-opposite" : A.kind === "mixed" ? "edge-overlap-mixed" : "edge-overlap-unrelated",
|
|
6696
|
-
edges:
|
|
6696
|
+
edges: I,
|
|
6697
6697
|
axis: A.axis,
|
|
6698
6698
|
length: Math.round(A.length)
|
|
6699
6699
|
});
|
|
@@ -6792,7 +6792,7 @@ function PM(e) {
|
|
|
6792
6792
|
if (!w) continue;
|
|
6793
6793
|
const y = typeof (m == null ? void 0 : m.$type) == "string" ? m.$type : "", v = Ft(h.bounds);
|
|
6794
6794
|
if (v) {
|
|
6795
|
-
const E = h.isExpanded === !1 && y !== "bpmn:Participant", A = Ft((l = Ft(h.label)) == null ? void 0 : l.bounds),
|
|
6795
|
+
const E = h.isExpanded === !1 && y !== "bpmn:Participant", A = Ft((l = Ft(h.label)) == null ? void 0 : l.bounds), I = {
|
|
6796
6796
|
id: w,
|
|
6797
6797
|
type: y,
|
|
6798
6798
|
x: Qt(v.x),
|
|
@@ -6805,7 +6805,7 @@ function PM(e) {
|
|
|
6805
6805
|
...A ? { label: { x: Qt(A.x), y: Qt(A.y), width: Qt(A.width), height: Qt(A.height) } } : {},
|
|
6806
6806
|
...y === "bpmn:Group" ? Pw(Aw(m)) : {}
|
|
6807
6807
|
}, P = h.isHorizontal !== !1, k = typeof (m == null ? void 0 : m.name) == "string" ? m.name : "";
|
|
6808
|
-
r.has(w) && P && k && (
|
|
6808
|
+
r.has(w) && P && k && (I.label = Sw(I, k)), t.push(I);
|
|
6809
6809
|
continue;
|
|
6810
6810
|
}
|
|
6811
6811
|
const b = h.waypoint;
|
|
@@ -6815,8 +6815,8 @@ function PM(e) {
|
|
|
6815
6815
|
id: w,
|
|
6816
6816
|
type: y,
|
|
6817
6817
|
waypoints: b.map((A) => {
|
|
6818
|
-
var
|
|
6819
|
-
return { x: Qt((
|
|
6818
|
+
var I, P;
|
|
6819
|
+
return { x: Qt((I = Ft(A)) == null ? void 0 : I.x), y: Qt((P = Ft(A)) == null ? void 0 : P.y) };
|
|
6820
6820
|
}),
|
|
6821
6821
|
endpoints: CM(m),
|
|
6822
6822
|
...MM(m),
|
|
@@ -7161,22 +7161,22 @@ function FM(e, t, n) {
|
|
|
7161
7161
|
[u, l]
|
|
7162
7162
|
]) {
|
|
7163
7163
|
if (n.has(p)) continue;
|
|
7164
|
-
const d = s.edges.find((
|
|
7164
|
+
const d = s.edges.find((I) => I.id === p), g = s.edges.find((I) => I.id === f);
|
|
7165
7165
|
if (!d || !g) continue;
|
|
7166
7166
|
const h = i.get(p);
|
|
7167
7167
|
if (!h) continue;
|
|
7168
7168
|
const m = Ql(h), w = $M(g), y = [...Nd(d, a) ?? []], v = Bd(d, [...a, ...w], m, r.edges);
|
|
7169
7169
|
v && y.push(v);
|
|
7170
|
-
for (let
|
|
7170
|
+
for (let I = 0; I + 1 < d.waypoints.length; I++)
|
|
7171
7171
|
for (const P of w)
|
|
7172
|
-
for (const k of Lf(d.waypoints[
|
|
7173
|
-
y.push(If(d.waypoints,
|
|
7174
|
-
const b = s.edges.filter((
|
|
7172
|
+
for (const k of Lf(d.waypoints[I], d.waypoints[I + 1], P) ?? [])
|
|
7173
|
+
y.push(If(d.waypoints, I, k));
|
|
7174
|
+
const b = s.edges.filter((I) => I.id !== p), E = (I) => ({
|
|
7175
7175
|
...s,
|
|
7176
|
-
edges: s.edges.map((P) => P.id === p ? { ...P, waypoints:
|
|
7177
|
-
}), A = y.find((
|
|
7178
|
-
const P = { ...d, waypoints:
|
|
7179
|
-
return jp(P, g) || !Nf(
|
|
7176
|
+
edges: s.edges.map((P) => P.id === p ? { ...P, waypoints: I } : P)
|
|
7177
|
+
}), A = y.find((I) => {
|
|
7178
|
+
const P = { ...d, waypoints: I };
|
|
7179
|
+
return jp(P, g) || !Nf(I, m) || b.some((k) => k.id !== f && !jp(d, k) && jp(P, k)) ? !1 : pt(E(I)).every((k) => c.has(ft(k)));
|
|
7180
7180
|
});
|
|
7181
7181
|
if (A) {
|
|
7182
7182
|
o.updateWaypoints(h, A), s = E(A);
|
|
@@ -7238,14 +7238,14 @@ function WM(e, t, n) {
|
|
|
7238
7238
|
if (!g || g.container) continue;
|
|
7239
7239
|
const h = i.get(l), m = i.get(u);
|
|
7240
7240
|
if (!h || !m) continue;
|
|
7241
|
-
const w = (k) => n.has(k.id) ? [k.waypoints] : [k.waypoints, ...VM(k, g, a)], y = (k) => k.length - 2, v = w(p).flatMap((k) => w(f).map((H) => ({ pa: k, pb: H }))).filter(({ pa: k, pb: H }) => k !== p.waypoints || H !== f.waypoints).map((k) => ({ ...k, cost: ey(k.pa) + ey(k.pb) + HM * (y(k.pa) + y(k.pb)) })).sort((k, H) => k.cost - H.cost), b = Ql(h), E = Ql(m), A = to(c).length,
|
|
7241
|
+
const w = (k) => n.has(k.id) ? [k.waypoints] : [k.waypoints, ...VM(k, g, a)], y = (k) => k.length - 2, v = w(p).flatMap((k) => w(f).map((H) => ({ pa: k, pb: H }))).filter(({ pa: k, pb: H }) => k !== p.waypoints || H !== f.waypoints).map((k) => ({ ...k, cost: ey(k.pa) + ey(k.pb) + HM * (y(k.pa) + y(k.pb)) })).sort((k, H) => k.cost - H.cost), b = Ql(h), E = Ql(m), A = to(c).length, I = new Set(er(c).map(([k, H]) => `${k}|${H}`)), P = v.find(({ pa: k, pb: H }) => {
|
|
7242
7242
|
const F = { ...p, waypoints: k }, G = { ...f, waypoints: H };
|
|
7243
7243
|
if (to({ edges: [F, G] }).length || ja(F, G) || !Nf(k, b) || !Nf(H, E)) return !1;
|
|
7244
7244
|
const ee = {
|
|
7245
7245
|
...c,
|
|
7246
7246
|
edges: c.edges.map((se) => se.id === l ? F : se.id === u ? G : se)
|
|
7247
7247
|
};
|
|
7248
|
-
return to(ee).length >= A || er(ee).some(([se, ie]) => !
|
|
7248
|
+
return to(ee).length >= A || er(ee).some(([se, ie]) => !I.has(`${se}|${ie}`)) ? !1 : pt(ee).every((se) => s.has(ft(se)));
|
|
7249
7249
|
});
|
|
7250
7250
|
P && (P.pa !== p.waypoints && o.updateWaypoints(h, P.pa), P.pb !== f.waypoints && o.updateWaypoints(m, P.pb), c = {
|
|
7251
7251
|
...c,
|
|
@@ -7278,7 +7278,7 @@ function YM(e, t, n) {
|
|
|
7278
7278
|
if (!d || d.type === "bpmn:Participant") continue;
|
|
7279
7279
|
const g = d.x + d.width / 2;
|
|
7280
7280
|
if (g >= f.x + 10 && g <= f.x + f.width - 10) continue;
|
|
7281
|
-
const h = g > f.x + f.width, m = f.y > d.y, w = m ? d.y + d.height : d.y, y = m ? f.y : f.y + f.height, v = Math.round((w + y) / 2), b = (H) => f === u ? [...H].reverse() : H, E = (l.waypoints ?? []).map((H) => ({ x: H.x, y: H.y })), A = r(l.id),
|
|
7281
|
+
const h = g > f.x + f.width, m = f.y > d.y, w = m ? d.y + d.height : d.y, y = m ? f.y : f.y + f.height, v = Math.round((w + y) / 2), b = (H) => f === u ? [...H].reverse() : H, E = (l.waypoints ?? []).map((H) => ({ x: H.x, y: H.y })), A = r(l.id), I = a(l.id, E) ?? /* @__PURE__ */ new Set(), P = h ? f.x + f.width : f.x, k = f.x + f.width / 2;
|
|
7282
7282
|
for (let H = Math.min(UM, f.width / 4); h ? P - H > k : P + H < k; H += qM) {
|
|
7283
7283
|
const F = Math.round(h ? P - H : P + H), G = b([
|
|
7284
7284
|
{ x: g, y: w },
|
|
@@ -7286,7 +7286,7 @@ function YM(e, t, n) {
|
|
|
7286
7286
|
{ x: F, y: v },
|
|
7287
7287
|
{ x: F, y }
|
|
7288
7288
|
]), ee = a(l.id, G);
|
|
7289
|
-
if (!ee || [...ee].some((ie) => !
|
|
7289
|
+
if (!ee || [...ee].some((ie) => !I.has(ie))) continue;
|
|
7290
7290
|
o.updateWaypoints(l, G);
|
|
7291
7291
|
const se = r(l.id);
|
|
7292
7292
|
if (se.crossings <= A.crossings && se.shared <= A.shared && se.mine <= A.mine && [...se.keys].every((ie) => A.keys.has(ie)))
|
|
@@ -7314,9 +7314,9 @@ function XM(e, t) {
|
|
|
7314
7314
|
if (!u.length) return null;
|
|
7315
7315
|
const p = u[0], f = u[u.length - 1], d = (c.y + c.height + p.y) / 2, g = (f.y + f.height + l.y) / 2, h = s ? d : g, m = s ? g : d, w = e.waypoints[0], y = e.waypoints[e.waypoints.length - 1], v = Un(t), b = t.edges.filter((G) => G.id !== e.id), E = Pi(e, b), A = Ht(e, v).length;
|
|
7316
7316
|
if (E === 0 && A === 0 || A === 0 && e.waypoints.length === 2) return null;
|
|
7317
|
-
const
|
|
7317
|
+
const I = Math.min(...u.map((G) => G.x)), P = Math.max(...u.map((G) => G.x + G.width)), k = (w.x + y.x) / 2, H = (G) => G.filter((ee, se) => se === 0 || !(Ye(ee.x, G[se - 1].x) && Ye(ee.y, G[se - 1].y)));
|
|
7318
7318
|
let F;
|
|
7319
|
-
for (let G =
|
|
7319
|
+
for (let G = I; G <= P; G += KM) {
|
|
7320
7320
|
const ee = H([w, { x: w.x, y: h }, { x: G, y: h }, { x: G, y: m }, { x: y.x, y: m }, y]), se = { ...e, waypoints: ee };
|
|
7321
7321
|
if (Ht(se, v).length > 0) continue;
|
|
7322
7322
|
const ie = Pi(se, b), ve = Math.abs(G - k);
|
|
@@ -7337,7 +7337,7 @@ function JM(e, t, n) {
|
|
|
7337
7337
|
const w = h.x - d.x, y = h.y - d.y;
|
|
7338
7338
|
if (Ye(w, 0) && Ye(y, 0) || !Ye(m.x - g.x, w) || !Ye(m.y - g.y, y)) continue;
|
|
7339
7339
|
const v = p.waypoints.map((A) => ({ x: A.x + w, y: A.y + y })), b = f.waypoints.map((A) => ({ x: A.x, y: A.y }));
|
|
7340
|
-
b.length === v.length && b.every((A,
|
|
7340
|
+
b.length === v.length && b.every((A, I) => Ye(A.x, v[I].x) && Ye(A.y, v[I].y)) || b.length === 2 && (Ye(b[0].x, b[1].x) || Ye(b[0].y, b[1].y)) && Ht({ ...p, waypoints: b }, c).length === 0 || Ht({ ...p, waypoints: v }, c).length > 0 || o.updateWaypoints(f, v);
|
|
7341
7341
|
}
|
|
7342
7342
|
}
|
|
7343
7343
|
function QM(e, t) {
|
|
@@ -7407,8 +7407,8 @@ function oA(e, t, n, i, o) {
|
|
|
7407
7407
|
}
|
|
7408
7408
|
const v = (ie, ve) => {
|
|
7409
7409
|
if (Math.abs(ve - ie) < 2 * ji) return [];
|
|
7410
|
-
const
|
|
7411
|
-
return Vp(Math.round((ie + ve) / 2),
|
|
7410
|
+
const de = Math.min(ie, ve) + ji, me = Math.max(ie, ve) - ji;
|
|
7411
|
+
return Vp(Math.round((ie + ve) / 2), de, me);
|
|
7412
7412
|
};
|
|
7413
7413
|
if (!a && n)
|
|
7414
7414
|
for (const ie of v(l, c ? n.y + n.height : n.y))
|
|
@@ -7417,22 +7417,22 @@ function oA(e, t, n, i, o) {
|
|
|
7417
7417
|
for (const ie of v(u, c ? i.y : i.y + i.height))
|
|
7418
7418
|
r.push([{ x: y, y: l }, { x: y, y: ie }, { x: f, y: ie }, { x: f, y: u }]);
|
|
7419
7419
|
const b = Math.min(y, w), E = Math.max(y, w), A = [];
|
|
7420
|
-
for (const [ie, ve] of o.filter((
|
|
7421
|
-
const
|
|
7422
|
-
|
|
7420
|
+
for (const [ie, ve] of o.filter((de) => de.x < E && de.x + de.width > b).map((de) => [de.y, de.y + de.height]).sort((de, me) => de[0] - me[0])) {
|
|
7421
|
+
const de = A[A.length - 1];
|
|
7422
|
+
de && ie <= de[1] ? de[1] = Math.max(de[1], ve) : A.push([ie, ve]);
|
|
7423
7423
|
}
|
|
7424
|
-
const
|
|
7424
|
+
const I = [];
|
|
7425
7425
|
for (let ie = 1; ie < A.length; ie++)
|
|
7426
|
-
A[ie][0] - A[ie - 1][1] >= tA &&
|
|
7427
|
-
A.length &&
|
|
7428
|
-
const P = (ie, ve) => ve < ie.y ? ie.y : ve > ie.y + ie.height ? ie.y + ie.height : void 0, k = new Set([a ? e.id : n == null ? void 0 : n.id, s ? t.id : i == null ? void 0 : i.id].filter((ie) => !!ie)), H = e.y + e.height / 2, F = t.y + t.height / 2, G = F > H ? 1 : -1, ee = (ie, ve,
|
|
7429
|
-
(
|
|
7426
|
+
A[ie][0] - A[ie - 1][1] >= tA && I.push(Math.round((A[ie - 1][1] + A[ie][0]) / 2));
|
|
7427
|
+
A.length && I.push(A[0][0] - iy, A[A.length - 1][1] + iy);
|
|
7428
|
+
const P = (ie, ve) => ve < ie.y ? ie.y : ve > ie.y + ie.height ? ie.y + ie.height : void 0, k = new Set([a ? e.id : n == null ? void 0 : n.id, s ? t.id : i == null ? void 0 : i.id].filter((ie) => !!ie)), H = e.y + e.height / 2, F = t.y + t.height / 2, G = F > H ? 1 : -1, ee = (ie, ve, de) => o.some(
|
|
7429
|
+
(me) => !k.has(me.id) && me.x < ie && ie < me.x + me.width && me.y < Math.max(ve, de) - 1 && me.y + me.height > Math.min(ve, de) + 1
|
|
7430
7430
|
), se = [];
|
|
7431
|
-
for (const ie of
|
|
7432
|
-
const ve = P(e, ie),
|
|
7433
|
-
ve === void 0 ||
|
|
7434
|
-
pts: [{ x: y, y: ve }, { x: y, y: ie }, { x: w, y: ie }, { x: w, y:
|
|
7435
|
-
len: Math.abs(ie - ve) + (E - b) + Math.abs(
|
|
7431
|
+
for (const ie of I) {
|
|
7432
|
+
const ve = P(e, ie), de = P(t, ie);
|
|
7433
|
+
ve === void 0 || de === void 0 || (ie - H) * G < 0 && ee(y, ve, ie) || (ie - F) * G > 0 && ee(w, de, ie) || se.push({
|
|
7434
|
+
pts: [{ x: y, y: ve }, { x: y, y: ie }, { x: w, y: ie }, { x: w, y: de }],
|
|
7435
|
+
len: Math.abs(ie - ve) + (E - b) + Math.abs(de - ie)
|
|
7436
7436
|
});
|
|
7437
7437
|
}
|
|
7438
7438
|
return { inPools: r, outside: se.sort((ie, ve) => ie.len - ve.len).map((ie) => ie.pts) };
|
|
@@ -7452,11 +7452,11 @@ function rA(e, t, n) {
|
|
|
7452
7452
|
}, l = (d, g) => d.length === g.length && d.every((h, m) => Ye(h.x, g[m].x) && Ye(h.y, g[m].y)), u = (d) => {
|
|
7453
7453
|
const g = d.source, h = d.target;
|
|
7454
7454
|
if (!g || !h) return "skip";
|
|
7455
|
-
const m = We(i), w = new Map(m.shapes.map((U) => [U.id, U])), y = s(g), v = s(h), b = new Set([y, v].filter((U) => !!U)), E = m.shapes.filter((U) => U.type === "bpmn:Participant"), A = (d.waypoints ?? []).map((U) => ({ x: U.x, y: U.y })),
|
|
7456
|
-
if (
|
|
7455
|
+
const m = We(i), w = new Map(m.shapes.map((U) => [U.id, U])), y = s(g), v = s(h), b = new Set([y, v].filter((U) => !!U)), E = m.shapes.filter((U) => U.type === "bpmn:Participant"), A = (d.waypoints ?? []).map((U) => ({ x: U.x, y: U.y })), I = Gp(A, b, E);
|
|
7456
|
+
if (I < Hp) return "skip";
|
|
7457
7457
|
if (t.has(d.id)) {
|
|
7458
7458
|
const U = r.get(d.id);
|
|
7459
|
-
if (U && l(U, A) ||
|
|
7459
|
+
if (U && l(U, A) || I - (U ? Gp(U, b, a) : 0) < Hp) return "skip";
|
|
7460
7460
|
}
|
|
7461
7461
|
const P = w.get(g.id), k = w.get(h.id), H = m.edges.find((U) => U.id === d.id);
|
|
7462
7462
|
if (!P || !k || !H) return "skip";
|
|
@@ -7469,14 +7469,14 @@ function rA(e, t, n) {
|
|
|
7469
7469
|
y ? w.get(y) : void 0,
|
|
7470
7470
|
v ? w.get(v) : void 0,
|
|
7471
7471
|
E
|
|
7472
|
-
),
|
|
7473
|
-
for (const U of
|
|
7472
|
+
), de = (U) => U.map((le, K) => ({ pts: le, i: K, key: le.length * 2 + (ie(le) ? 1 : 0) })).sort((le, K) => le.key - K.key || le.i - K.i).map((le) => le.pts), me = [...de(ve.inPools), ...de(ve.outside)], _e = c();
|
|
7473
|
+
for (const U of me) {
|
|
7474
7474
|
if (Gp(U, b, E) >= Hp) continue;
|
|
7475
7475
|
const le = { ...H, waypoints: U };
|
|
7476
|
-
if (Ht(le, F).some((
|
|
7476
|
+
if (Ht(le, F).some((he) => !G.has(he.id)) || xn(le).some((he) => iA(he, m.shapes) || ee.some((Ee) => io(Ee.rect, he)))) continue;
|
|
7477
7477
|
o.updateWaypoints(d, U);
|
|
7478
7478
|
const Q = c();
|
|
7479
|
-
if (Q.crossings <= _e.crossings && Q.shared <= _e.shared && [...Q.keys].every((
|
|
7479
|
+
if (Q.crossings <= _e.crossings && Q.shared <= _e.shared && [...Q.keys].every((he) => _e.keys.has(he))) return "fixed";
|
|
7480
7480
|
o.updateWaypoints(d, A);
|
|
7481
7481
|
}
|
|
7482
7482
|
return "stuck";
|
|
@@ -7610,32 +7610,32 @@ function uA(e, t) {
|
|
|
7610
7610
|
if (e.type !== "bpmn:SequenceFlow") return null;
|
|
7611
7611
|
const n = t.shapes.filter((A) => A.container), i = new Map(t.shapes.map((A) => [A.id, A])), o = Un(t), r = t.edges.filter((A) => A.id !== e.id), a = Ai(e, r), s = Pi(e, r), c = (A) => lA(A, t.shapes, e.endpoints) + (oy(A, n) ? 1 : 0), l = c(e.waypoints), u = (A) => {
|
|
7612
7612
|
if (!A) return;
|
|
7613
|
-
const
|
|
7614
|
-
return n.find((k) => k.type === "bpmn:Lane" &&
|
|
7613
|
+
const I = A.x + A.width / 2, P = A.y + A.height / 2;
|
|
7614
|
+
return n.find((k) => k.type === "bpmn:Lane" && I >= k.x && I <= k.x + k.width && P >= k.y && P <= k.y + k.height);
|
|
7615
7615
|
}, p = u(i.get(e.endpoints[0] ?? "")), f = u(i.get(e.endpoints[1] ?? "")), d = !!p && !!f && p.id !== f.id, g = (A) => {
|
|
7616
7616
|
if (!d || !f) return !1;
|
|
7617
|
-
for (let
|
|
7618
|
-
const P = A[
|
|
7617
|
+
for (let I = 1; I < A.length - 2; I++) {
|
|
7618
|
+
const P = A[I], k = A[I + 1];
|
|
7619
7619
|
if (Ye(P.y, k.y) && !Ye(P.x, k.x) && P.y > f.y && P.y < f.y + f.height) return !0;
|
|
7620
7620
|
}
|
|
7621
7621
|
return !1;
|
|
7622
7622
|
}, h = g(e.waypoints), w = ((A) => {
|
|
7623
7623
|
if (!A) return;
|
|
7624
|
-
const
|
|
7625
|
-
return n.filter((k) => k.type === "bpmn:Participant" &&
|
|
7624
|
+
const I = A.x + A.width / 2, P = A.y + A.height / 2;
|
|
7625
|
+
return n.filter((k) => k.type === "bpmn:Participant" && I >= k.x && I <= k.x + k.width && P >= k.y && P <= k.y + k.height).sort((k, H) => k.width * k.height - H.width * H.height)[0];
|
|
7626
7626
|
})(i.get(e.endpoints[0] ?? "")), y = (A) => {
|
|
7627
7627
|
if (!w) return 0;
|
|
7628
|
-
let
|
|
7628
|
+
let I = 0;
|
|
7629
7629
|
for (let P = 1; P < A.length - 1; P++) {
|
|
7630
7630
|
const k = A[P];
|
|
7631
|
-
(k.x < w.x || k.x > w.x + w.width || k.y < w.y || k.y > w.y + w.height) &&
|
|
7631
|
+
(k.x < w.x || k.x > w.x + w.width || k.y < w.y || k.y > w.y + w.height) && I++;
|
|
7632
7632
|
}
|
|
7633
|
-
return
|
|
7633
|
+
return I;
|
|
7634
7634
|
}, v = y(e.waypoints);
|
|
7635
7635
|
if (!oy(e.waypoints, n) && !(d && !h) && v === 0) return null;
|
|
7636
|
-
const b = (A) => A.reduce((
|
|
7636
|
+
const b = (A) => A.reduce((I, P, k) => k ? I + Math.abs(P.x - A[k - 1].x) + Math.abs(P.y - A[k - 1].y) : 0, 0);
|
|
7637
7637
|
let E;
|
|
7638
|
-
for (const { pts: A, cost:
|
|
7638
|
+
for (const { pts: A, cost: I } of Cu(e, i)) {
|
|
7639
7639
|
const P = { ...e, waypoints: A };
|
|
7640
7640
|
if (Ht(P, o).length > 0) continue;
|
|
7641
7641
|
const k = Ai(P, r);
|
|
@@ -7647,7 +7647,7 @@ function uA(e, t) {
|
|
|
7647
7647
|
const G = c(A), ee = g(A);
|
|
7648
7648
|
if (!F && !(ee && !h) && G >= l) continue;
|
|
7649
7649
|
const ie = ee ? 0 : 1, ve = b(A);
|
|
7650
|
-
(!E || H < E.out || H === E.out && (ie < E.lane || ie === E.lane && (k < E.opp || k === E.opp && (G < E.sc || G === E.sc && (
|
|
7650
|
+
(!E || H < E.out || H === E.out && (ie < E.lane || ie === E.lane && (k < E.opp || k === E.opp && (G < E.sc || G === E.sc && (I < E.cost || I === E.cost && ve < E.len))))) && (E = { pts: A, out: H, sc: G, lane: ie, opp: k, cost: I, len: ve });
|
|
7651
7651
|
}
|
|
7652
7652
|
return (E == null ? void 0 : E.pts) ?? null;
|
|
7653
7653
|
}
|
|
@@ -8035,12 +8035,12 @@ function PA(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
8035
8035
|
const p = u.wps, f = i.get(l), d = f == null ? void 0 : f.label;
|
|
8036
8036
|
if (!d || !(f != null && f.waypoints)) continue;
|
|
8037
8037
|
const g = f.waypoints[0].x - p[0].x, h = f.waypoints[0].y - p[0].y;
|
|
8038
|
-
if (!(f.waypoints.length === p.length && f.waypoints.every((
|
|
8038
|
+
if (!(f.waypoints.length === p.length && f.waypoints.every((I, P) => I.x - p[P].x === g && I.y - p[P].y === h))) {
|
|
8039
8039
|
if (((s = f.source) == null ? void 0 : s.id) === u.source && ((c = f.target) == null ? void 0 : c.id) === u.target) continue;
|
|
8040
|
-
const
|
|
8041
|
-
if (!(
|
|
8042
|
-
let P = { ...
|
|
8043
|
-
if ((Zl(P, r).length || py(P,
|
|
8040
|
+
const I = r.edges.find((G) => G.id === l);
|
|
8041
|
+
if (!(I != null && I.label) || !Zl(I.label, r).length && !n.has(l)) continue;
|
|
8042
|
+
let P = { ...I.label, x: u.label.x, y: u.label.y };
|
|
8043
|
+
if ((Zl(P, r).length || py(P, I.waypoints) > uy) && (P = null), !P && py(I.label, I.waypoints) > uy && (P = AA(I, r)), !P) continue;
|
|
8044
8044
|
const k = P;
|
|
8045
8045
|
if (k.x === d.x && k.y === d.y) continue;
|
|
8046
8046
|
const H = { ...r, edges: r.edges.map((G) => G.id === l ? { ...G, label: k } : G) }, F = pt(H);
|
|
@@ -8050,10 +8050,10 @@ function PA(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
8050
8050
|
}
|
|
8051
8051
|
const w = u.label.x + g - d.x, y = u.label.y + h - d.y;
|
|
8052
8052
|
if (w === 0 && y === 0) continue;
|
|
8053
|
-
const v = r.edges.find((
|
|
8053
|
+
const v = r.edges.find((I) => I.id === l);
|
|
8054
8054
|
if (!(v != null && v.label)) continue;
|
|
8055
|
-
const b = { ...v.label, x: v.label.x + w, y: v.label.y + y }, E = { ...r, edges: r.edges.map((
|
|
8056
|
-
A.some((
|
|
8055
|
+
const b = { ...v.label, x: v.label.x + w, y: v.label.y + y }, E = { ...r, edges: r.edges.map((I) => I.id === l ? { ...I, label: b } : I) }, A = pt(E);
|
|
8056
|
+
A.some((I) => !a.has(ft(I))) || (o.moveElements([d], { x: w, y }), r = E, a = new Set(A.map(ft)));
|
|
8057
8057
|
}
|
|
8058
8058
|
}
|
|
8059
8059
|
function TA(e, t, n = /* @__PURE__ */ new Set()) {
|
|
@@ -8556,13 +8556,13 @@ function jA(e, t, n = {}) {
|
|
|
8556
8556
|
break;
|
|
8557
8557
|
}
|
|
8558
8558
|
case "sequenceFlow.add": {
|
|
8559
|
-
const { id: v, source: b, target: E, name: A, condition:
|
|
8560
|
-
P && k && l(b) !== l(E) && o.push({ kind: "flow-cross-pool", opIndex: m, id: v }), A !== void 0 &&
|
|
8559
|
+
const { id: v, source: b, target: E, name: A, condition: I } = h.flow, P = u(m, b, "source", ["flowNode"]), k = u(m, E, "target", ["flowNode"]);
|
|
8560
|
+
P && k && l(b) !== l(E) && o.push({ kind: "flow-cross-pool", opIndex: m, id: v }), A !== void 0 && I !== void 0 && o.push({ kind: "condition-name-conflict", opIndex: m, id: v });
|
|
8561
8561
|
break;
|
|
8562
8562
|
}
|
|
8563
8563
|
case "messageFlow.add": {
|
|
8564
|
-
const { id: v, source: b, target: E } = h.flow, A = u(m, b, "source", ["flowNode", "participant"]),
|
|
8565
|
-
if (A &&
|
|
8564
|
+
const { id: v, source: b, target: E } = h.flow, A = u(m, b, "source", ["flowNode", "participant"]), I = u(m, E, "target", ["flowNode", "participant"]);
|
|
8565
|
+
if (A && I) {
|
|
8566
8566
|
const P = l(b), k = l(E);
|
|
8567
8567
|
P !== void 0 && P === k && o.push({ kind: "message-flow-same-pool", opIndex: m, id: v });
|
|
8568
8568
|
}
|
|
@@ -8589,14 +8589,14 @@ function jA(e, t, n = {}) {
|
|
|
8589
8589
|
case "dataAssociation.add": {
|
|
8590
8590
|
const { source: v, target: b } = h.association, E = u(m, v, "source"), A = u(m, b, "target");
|
|
8591
8591
|
if (E && A) {
|
|
8592
|
-
const
|
|
8593
|
-
|
|
8592
|
+
const I = /* @__PURE__ */ new Set([E, A]);
|
|
8593
|
+
I.has("dataStore") && I.has("flowNode") || o.push({ kind: "data-association-ends", opIndex: m, source: v, target: b });
|
|
8594
8594
|
}
|
|
8595
8595
|
break;
|
|
8596
8596
|
}
|
|
8597
8597
|
case "association.add": {
|
|
8598
|
-
const { id: v, source: b, target: E } = h.association, A = u(m, b, "source"),
|
|
8599
|
-
A &&
|
|
8598
|
+
const { id: v, source: b, target: E } = h.association, A = u(m, b, "source"), I = u(m, E, "target");
|
|
8599
|
+
A && I && A !== "annotation" && I !== "annotation" && o.push({
|
|
8600
8600
|
kind: "association-detached",
|
|
8601
8601
|
opIndex: m,
|
|
8602
8602
|
annotation: v ?? `${b}->${E}`
|
|
@@ -8639,8 +8639,8 @@ function jA(e, t, n = {}) {
|
|
|
8639
8639
|
b.includes(P) || o.push({ kind: "lane-shrink-unsupported", opIndex: m, participant: h.id, lane: P });
|
|
8640
8640
|
for (const P of b)
|
|
8641
8641
|
t.categoryOf(P) !== void 0 && !v.includes(P) && o.push({ kind: "id-duplicate", opIndex: m, id: P });
|
|
8642
|
-
const E = b.filter((P) => v.includes(P)), A = (P) => E.every((k, H) => k === P[H]),
|
|
8643
|
-
E.length === v.length && !A(v) && !A(
|
|
8642
|
+
const E = b.filter((P) => v.includes(P)), A = (P) => E.every((k, H) => k === P[H]), I = (((y = t.laneDeclarationOrderOf) == null ? void 0 : y.call(t, h.id)) ?? v).filter((P) => v.includes(P));
|
|
8643
|
+
E.length === v.length && !A(v) && !A(I) && o.push({ kind: "lane-reorder-unsupported", opIndex: m, participant: h.id });
|
|
8644
8644
|
}
|
|
8645
8645
|
break;
|
|
8646
8646
|
}
|
|
@@ -8655,8 +8655,8 @@ function jA(e, t, n = {}) {
|
|
|
8655
8655
|
case "sequenceFlow.update": {
|
|
8656
8656
|
if (g(m, h.id, "sequenceFlow") === void 0) break;
|
|
8657
8657
|
if (h.name !== void 0 && h.condition !== void 0 && o.push({ kind: "condition-name-conflict", opIndex: m, id: h.id }), h.source !== void 0 || h.target !== void 0) {
|
|
8658
|
-
const v = h.source === void 0 || u(m, h.source, "source", ["flowNode"]) !== void 0, b = h.target === void 0 || u(m, h.target, "target", ["flowNode"]) !== void 0, E = t.endpointsOf(h.id), A = h.source ?? (E == null ? void 0 : E.source),
|
|
8659
|
-
v && b && A !== void 0 &&
|
|
8658
|
+
const v = h.source === void 0 || u(m, h.source, "source", ["flowNode"]) !== void 0, b = h.target === void 0 || u(m, h.target, "target", ["flowNode"]) !== void 0, E = t.endpointsOf(h.id), A = h.source ?? (E == null ? void 0 : E.source), I = h.target ?? (E == null ? void 0 : E.target);
|
|
8659
|
+
v && b && A !== void 0 && I !== void 0 && (/* @__PURE__ */ new Set([l(A), l(I), l(h.id)])).size > 1 && o.push({ kind: "flow-cross-pool", opIndex: m, id: h.id });
|
|
8660
8660
|
}
|
|
8661
8661
|
break;
|
|
8662
8662
|
}
|
|
@@ -8765,13 +8765,13 @@ function Lw(e, t, n) {
|
|
|
8765
8765
|
const tu = (e, t, n) => e.y - t.height / 2 >= n.y && e.y + t.height / 2 <= n.y + n.height;
|
|
8766
8766
|
function nu(e, t, n, i, o) {
|
|
8767
8767
|
const r = n, a = Lw(e, t, i), s = a ?? i, c = (ee, se, ie = s) => {
|
|
8768
|
-
const [ve,
|
|
8769
|
-
let
|
|
8768
|
+
const [ve, de] = eu[ee];
|
|
8769
|
+
let me = {
|
|
8770
8770
|
x: t.x + t.width / 2 + ve * (t.width / 2 + r.width / 2 + se),
|
|
8771
|
-
y: t.y + t.height / 2 +
|
|
8771
|
+
y: t.y + t.height / 2 + de * (t.height / 2 + r.height / 2 + se)
|
|
8772
8772
|
};
|
|
8773
|
-
const _e = ie.x + Pn + r.width / 2, U = ie.x + ie.width - Pn - r.width / 2, le = ie.y + Pn + r.height / 2, K = ie.y + ie.height - Pn - r.height / 2, Q = { x: Math.min(U, Math.max(_e,
|
|
8774
|
-
return (Q.x !==
|
|
8773
|
+
const _e = ie.x + Pn + r.width / 2, U = ie.x + ie.width - Pn - r.width / 2, le = ie.y + Pn + r.height / 2, K = ie.y + ie.height - Pn - r.height / 2, Q = { x: Math.min(U, Math.max(_e, me.x)), y: Math.min(K, Math.max(le, me.y)) };
|
|
8774
|
+
return (Q.x !== me.x || Q.y !== me.y) && (me = Math.abs(Q.x - (t.x + t.width / 2)) < (t.width + r.width) / 2 + Pn && Math.abs(Q.y - (t.y + t.height / 2)) < (t.height + r.height) / 2 + Pn ? { x: t.x + t.width + Pn + r.width / 2, y: Q.y } : Q), me;
|
|
8775
8775
|
}, l = (i.children ?? []).filter(
|
|
8776
8776
|
(ee) => !("waypoints" in ee && ee.waypoints) && ee.type !== "bpmn:Lane" && ee.type !== "label" && typeof ee.x == "number" && ee.id !== o.selfId
|
|
8777
8777
|
), u = We(e), p = (ee) => {
|
|
@@ -8807,26 +8807,26 @@ function nu(e, t, n, i, o) {
|
|
|
8807
8807
|
);
|
|
8808
8808
|
}, b = (ee) => h(ee) || m(ee) || w(ee) || v(ee), E = (ee) => ee.x - r.width / 2 >= i.x && ee.x + r.width / 2 <= i.x + i.width && ee.y - r.height / 2 >= i.y && ee.y + r.height / 2 <= i.y + i.height, A = (ee) => E(ee) && (!a || tu(ee, r, a));
|
|
8809
8809
|
if (o.placement) {
|
|
8810
|
-
const ee = (_e) => _e.startsWith("top") ? _e.replace(/^top/, "bottom") : _e.replace(/^bottom/, "top"), se = (_e) => _e.endsWith("left") ? _e.replace(/left$/, "right") : _e.replace(/right$/, "left"), ie = o.placement.side, ve = [ie, ee(ie), se(ie), ee(se(ie)), "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"],
|
|
8811
|
-
let
|
|
8812
|
-
if (b(
|
|
8810
|
+
const ee = (_e) => _e.startsWith("top") ? _e.replace(/^top/, "bottom") : _e.replace(/^bottom/, "top"), se = (_e) => _e.endsWith("left") ? _e.replace(/left$/, "right") : _e.replace(/right$/, "left"), ie = o.placement.side, ve = [ie, ee(ie), se(ie), ee(se(ie)), "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"], de = o.placement.offset ?? 50;
|
|
8811
|
+
let me = c(ie, de);
|
|
8812
|
+
if (b(me) || a && !tu(me, r, a)) {
|
|
8813
8813
|
const _e = (U, le) => {
|
|
8814
8814
|
const K = /* @__PURE__ */ new Set();
|
|
8815
8815
|
for (const Q of ve) {
|
|
8816
8816
|
if (K.has(Q)) continue;
|
|
8817
8817
|
K.add(Q);
|
|
8818
|
-
const
|
|
8819
|
-
if (le(
|
|
8820
|
-
return
|
|
8818
|
+
const he = c(Q, de, U);
|
|
8819
|
+
if (le(he) && !b(he))
|
|
8820
|
+
return me = he, !0;
|
|
8821
8821
|
}
|
|
8822
8822
|
return !1;
|
|
8823
8823
|
};
|
|
8824
8824
|
!_e(s, A) && a && _e(i, E);
|
|
8825
8825
|
}
|
|
8826
|
-
return
|
|
8826
|
+
return me;
|
|
8827
8827
|
}
|
|
8828
|
-
const
|
|
8829
|
-
let G = { x: Math.min(k, Math.max(P,
|
|
8828
|
+
const I = o.from, P = s.x + Pn + r.width / 2, k = s.x + s.width - Pn - r.width / 2, H = s.y + Pn + r.height / 2, F = s.y + s.height - Pn - r.height / 2;
|
|
8829
|
+
let G = { x: Math.min(k, Math.max(P, I.x)), y: Math.min(F, Math.max(H, I.y)) };
|
|
8830
8830
|
if (b(G)) {
|
|
8831
8831
|
const ee = (t.width + r.width) / 2 + Pn, ie = [
|
|
8832
8832
|
{ x: G.x + ee, y: G.y },
|
|
@@ -8881,12 +8881,12 @@ function qA(e, t) {
|
|
|
8881
8881
|
(_) => !("waypoints" in _ && _.waypoints) && _.type !== "bpmn:Lane" && _.type !== "label" && typeof _.x == "number"
|
|
8882
8882
|
))
|
|
8883
8883
|
h.set(x.id, { x: x.x, y: x.y });
|
|
8884
|
-
const m = Bt(e, "participant.add"), w = Bt(e, "node.add"), y = Bt(e, "sequenceFlow.add"), v = Bt(e, "messageFlow.add"), b = Bt(e, "dataStore.add"), E = Bt(e, "dataAssociation.add"), A = Bt(e, "annotation.add"),
|
|
8884
|
+
const m = Bt(e, "participant.add"), w = Bt(e, "node.add"), y = Bt(e, "sequenceFlow.add"), v = Bt(e, "messageFlow.add"), b = Bt(e, "dataStore.add"), E = Bt(e, "dataAssociation.add"), A = Bt(e, "annotation.add"), I = Bt(e, "group.add"), P = new Map(w.map((x) => [x.node.id, x])), k = Iw(e, (x) => {
|
|
8885
8885
|
var _, S;
|
|
8886
8886
|
return (S = (_ = f(x)) == null ? void 0 : _.source) == null ? void 0 : S.id;
|
|
8887
8887
|
}), H = new Set([...k.values()].map((x) => x.flow.id)), F = y.filter((x) => !H.has(x.flow.id)), G = new Set([...k.values()].map((x) => x.flow.target)), ee = (x) => Bt(e, "sequenceFlow.update").filter((_) => _.target === x).length + (G.has(x) ? 1 : 0), se = (x, _, S) => {
|
|
8888
8888
|
var L;
|
|
8889
|
-
const O = x.businessObject,
|
|
8889
|
+
const O = x.businessObject, N = (((L = O.extensionElements) == null ? void 0 : L.values) ?? []).filter((D) => D.$type !== _), T = S ? [...N, i.create(_, S)] : N;
|
|
8890
8890
|
if (!T.length) {
|
|
8891
8891
|
O.extensionElements && n.updateProperties(x, { extensionElements: void 0 });
|
|
8892
8892
|
return;
|
|
@@ -8911,7 +8911,7 @@ function qA(e, t) {
|
|
|
8911
8911
|
var S;
|
|
8912
8912
|
return _.type === "bpmn:Lane" && ((S = g(_)) == null ? void 0 : S.id) === x;
|
|
8913
8913
|
}
|
|
8914
|
-
).sort((_, S) => _.y - S.y),
|
|
8914
|
+
).sort((_, S) => _.y - S.y), de = [];
|
|
8915
8915
|
for (const x of Bt(e, "participant.update")) {
|
|
8916
8916
|
const _ = d(x.id);
|
|
8917
8917
|
if (x.name !== void 0 && n.updateProperties(_, { name: x.name ?? void 0 }), !x.lanes) continue;
|
|
@@ -8920,23 +8920,23 @@ function qA(e, t) {
|
|
|
8920
8920
|
n.splitLane(_, x.lanes.length), ve(x.id).forEach((T, B) => {
|
|
8921
8921
|
const L = x.lanes[B];
|
|
8922
8922
|
L && n.updateProperties(T, { id: L.id, name: L.name });
|
|
8923
|
-
}),
|
|
8923
|
+
}), de.push({ pool: x.id, lanes: new Set(x.lanes.map((T) => T.id)) });
|
|
8924
8924
|
continue;
|
|
8925
8925
|
}
|
|
8926
|
-
const O = new Set(S.map((T) => T.id)),
|
|
8926
|
+
const O = new Set(S.map((T) => T.id)), N = x.lanes.reduce((T, B, L) => O.has(B.id) ? L : T, -1);
|
|
8927
8927
|
x.lanes.forEach((T, B) => {
|
|
8928
8928
|
if (O.has(T.id)) {
|
|
8929
8929
|
n.updateProperties(d(T.id), { name: T.name });
|
|
8930
8930
|
return;
|
|
8931
8931
|
}
|
|
8932
|
-
const L = B ===
|
|
8932
|
+
const L = B === N + 1 && N >= 0, D = B === 0 ? n.addLane(ve(x.id)[0], "top") : L ? n.addLane(ve(x.id).at(-1), "bottom") : n.addLane(d(x.lanes[B - 1].id), "bottom");
|
|
8933
8933
|
n.updateProperties(D, { id: T.id, name: T.name });
|
|
8934
8934
|
});
|
|
8935
8935
|
}
|
|
8936
|
-
const
|
|
8936
|
+
const me = 150, _e = 130, U = 80, le = 90, K = 180, Q = 30, he = 30, Ee = 10, Fe = 300, $ = 5, C = (x, _, S, O, N) => {
|
|
8937
8937
|
const T = S - _.width / 2, B = O - _.height / 2;
|
|
8938
8938
|
return (x.children ?? []).find(
|
|
8939
|
-
(L) => !("waypoints" in L && L.waypoints) && L.type !== "bpmn:Lane" && L.type !== "label" && !(
|
|
8939
|
+
(L) => !("waypoints" in L && L.waypoints) && L.type !== "bpmn:Lane" && L.type !== "label" && !(N != null && N.has(L.id)) && typeof L.x == "number" && T < L.x + L.width + he && T + _.width + he > L.x && B < L.y + L.height && B + _.height > L.y
|
|
8940
8940
|
);
|
|
8941
8941
|
}, R = /* @__PURE__ */ new Set();
|
|
8942
8942
|
for (const x of m) {
|
|
@@ -8952,39 +8952,39 @@ function qA(e, t) {
|
|
|
8952
8952
|
const q = /* @__PURE__ */ new Map();
|
|
8953
8953
|
for (const [x, _] of W) {
|
|
8954
8954
|
if (!R.has(x)) continue;
|
|
8955
|
-
const S = [..._].sort((T, B) => T - B), O = S.map((T, B) => B === 0 ? 0 : B % 2 === 1 ? Math.ceil(B / 2) : -(B / 2)),
|
|
8956
|
-
q.set(x, new Map(S.map((T, B) => [T, O[B] -
|
|
8955
|
+
const S = [..._].sort((T, B) => T - B), O = S.map((T, B) => B === 0 ? 0 : B % 2 === 1 ? Math.ceil(B / 2) : -(B / 2)), N = Math.min(...O);
|
|
8956
|
+
q.set(x, new Map(S.map((T, B) => [T, O[B] - N])));
|
|
8957
8957
|
}
|
|
8958
8958
|
{
|
|
8959
8959
|
const x = /* @__PURE__ */ new Map();
|
|
8960
8960
|
for (const _ of m) (_.participant.lanes ?? []).forEach((S, O) => x.set(S.id, O));
|
|
8961
8961
|
for (const [_, S] of q) {
|
|
8962
8962
|
if (!x.has(_) || S.size < 2) continue;
|
|
8963
|
-
const O = x.get(_),
|
|
8963
|
+
const O = x.get(_), N = S.get(0) ?? 0, T = /* @__PURE__ */ new Set();
|
|
8964
8964
|
for (const ne of w) {
|
|
8965
8965
|
if (ne.node.lane !== _ || (ne.band ?? 0) !== 0 || !ne.node.type.endsWith("Gateway")) continue;
|
|
8966
8966
|
const ce = { in: /* @__PURE__ */ new Set(), out: /* @__PURE__ */ new Set(), cross: /* @__PURE__ */ new Set() };
|
|
8967
8967
|
for (const ae of F) {
|
|
8968
8968
|
const oe = ae.flow.source === ne.node.id;
|
|
8969
8969
|
if (!oe && ae.flow.target !== ne.node.id) continue;
|
|
8970
|
-
const
|
|
8971
|
-
if (!
|
|
8972
|
-
let
|
|
8973
|
-
if (
|
|
8974
|
-
const Z = x.get(
|
|
8970
|
+
const ye = P.get(oe ? ae.flow.target : ae.flow.source);
|
|
8971
|
+
if (!ye || ye.node.participant !== ne.node.participant || !ye.node.lane) continue;
|
|
8972
|
+
let ge, te = !1;
|
|
8973
|
+
if (ye.node.lane !== _) {
|
|
8974
|
+
const Z = x.get(ye.node.lane);
|
|
8975
8975
|
if (Z === void 0) continue;
|
|
8976
|
-
|
|
8976
|
+
ge = Z > O ? "down" : "up", te = !0;
|
|
8977
8977
|
} else {
|
|
8978
|
-
const Z = S.get(
|
|
8979
|
-
|
|
8978
|
+
const Z = S.get(ye.band ?? 0) ?? N;
|
|
8979
|
+
ge = Z > N ? "down" : Z < N ? "up" : void 0;
|
|
8980
8980
|
}
|
|
8981
|
-
|
|
8981
|
+
ge && (ce[oe ? "out" : "in"].add(ge), te && ce.cross.add(ge));
|
|
8982
8982
|
}
|
|
8983
8983
|
for (const ae of ["up", "down"]) ce.in.has(ae) && ce.out.has(ae) && ce.cross.has(ae) && T.add(ae);
|
|
8984
8984
|
}
|
|
8985
8985
|
if (T.size !== 1) continue;
|
|
8986
8986
|
const [B] = T, L = Math.max(...S.values()), D = B === "down" ? L : 0;
|
|
8987
|
-
if (
|
|
8987
|
+
if (N === D) continue;
|
|
8988
8988
|
const z = [...S.entries()].filter(([ne]) => ne !== 0).sort((ne, ce) => ne[1] - ce[1]), j = [...Array(L + 1).keys()].filter((ne) => ne !== D), X = /* @__PURE__ */ new Map([[0, D]]);
|
|
8989
8989
|
z.forEach(([ne], ce) => X.set(ne, j[ce])), q.set(_, X);
|
|
8990
8990
|
}
|
|
@@ -9002,37 +9002,37 @@ function qA(e, t) {
|
|
|
9002
9002
|
const x = /* @__PURE__ */ new Map();
|
|
9003
9003
|
for (const O of F) x.set(O.flow.target, (x.get(O.flow.target) ?? 0) + 1);
|
|
9004
9004
|
const _ = (O) => {
|
|
9005
|
-
const
|
|
9005
|
+
const N = [], T = /* @__PURE__ */ new Set([O]), B = [O];
|
|
9006
9006
|
for (; B.length; ) {
|
|
9007
9007
|
const L = B.shift();
|
|
9008
|
-
|
|
9008
|
+
N.push(L);
|
|
9009
9009
|
for (const D of F)
|
|
9010
9010
|
D.flow.source !== L || T.has(D.flow.target) || (x.get(D.flow.target) ?? 0) !== 1 || (T.add(D.flow.target), B.push(D.flow.target));
|
|
9011
9011
|
}
|
|
9012
|
-
return
|
|
9013
|
-
}, S = (O,
|
|
9012
|
+
return N;
|
|
9013
|
+
}, S = (O, N) => {
|
|
9014
9014
|
var T;
|
|
9015
|
-
return ((T = q.get(O)) == null ? void 0 : T.get(
|
|
9015
|
+
return ((T = q.get(O)) == null ? void 0 : T.get(N)) ?? N;
|
|
9016
9016
|
};
|
|
9017
9017
|
for (const O of w) {
|
|
9018
9018
|
if (!O.node.type.endsWith("Gateway")) continue;
|
|
9019
|
-
const
|
|
9019
|
+
const N = O.node.lane ?? `pool:${O.node.participant ?? ""}`, T = q.get(N);
|
|
9020
9020
|
if (!T || T.size < 2) continue;
|
|
9021
9021
|
const B = at(O);
|
|
9022
|
-
if (B === void 0 || S(
|
|
9023
|
-
const L = S(
|
|
9022
|
+
if (B === void 0 || S(N, B) !== S(N, 0)) continue;
|
|
9023
|
+
const L = S(N, B), D = F.filter((ae) => ae.flow.source === O.node.id).map((ae) => P.get(ae.flow.target)).filter((ae) => !!ae && (ae.node.lane ?? `pool:${ae.node.participant ?? ""}`) === N), z = D.filter((ae) => {
|
|
9024
9024
|
const oe = at(ae);
|
|
9025
|
-
return oe !== void 0 && S(
|
|
9025
|
+
return oe !== void 0 && S(N, oe) === L && (x.get(ae.node.id) ?? 0) === 1;
|
|
9026
9026
|
}), j = D.some((ae) => {
|
|
9027
9027
|
const oe = at(ae);
|
|
9028
|
-
return oe !== void 0 && S(
|
|
9028
|
+
return oe !== void 0 && S(N, oe) > L;
|
|
9029
9029
|
});
|
|
9030
9030
|
if (z.length !== 1 || !j) continue;
|
|
9031
9031
|
const X = new Set(D.flatMap((ae) => _(ae.node.id)));
|
|
9032
9032
|
if (!F.some((ae) => ae.flow.target === O.node.id && X.has(ae.flow.source))) continue;
|
|
9033
9033
|
const ce = /* @__PURE__ */ new Map();
|
|
9034
9034
|
for (const [ae, oe] of T) ce.set(ae, oe + 1);
|
|
9035
|
-
ce.set(-1, 0), q.set(
|
|
9035
|
+
ce.set(-1, 0), q.set(N, ce);
|
|
9036
9036
|
for (const ae of _(z[0].node.id)) P.has(ae) && (Qe.set(ae, -1), _t.add(ae));
|
|
9037
9037
|
jt.add(O.node.id);
|
|
9038
9038
|
}
|
|
@@ -9040,7 +9040,7 @@ function qA(e, t) {
|
|
|
9040
9040
|
{
|
|
9041
9041
|
const x = (j) => j.node.lane ?? `pool:${j.node.participant ?? ""}`, _ = (j) => at(j) ?? 0, S = new Map(
|
|
9042
9042
|
m.map((j, X) => ({ id: j.participant.id, order: j.order ?? Number.POSITIVE_INFINITY, declared: X })).sort((j, X) => j.order !== X.order ? j.order - X.order : j.declared - X.declared).map((j, X) => [j.id, X])
|
|
9043
|
-
), O = (j) => j === void 0 ? void 0 : S.get(j) ?? -1,
|
|
9043
|
+
), O = (j) => j === void 0 ? void 0 : S.get(j) ?? -1, N = (j) => {
|
|
9044
9044
|
var ce;
|
|
9045
9045
|
const X = P.get(j);
|
|
9046
9046
|
if (X) return X.node.participant;
|
|
@@ -9066,8 +9066,8 @@ function qA(e, t) {
|
|
|
9066
9066
|
for (const ae of v) {
|
|
9067
9067
|
const oe = X.has(ae.flow.source) ? ae.flow.target : X.has(ae.flow.target) ? ae.flow.source : void 0;
|
|
9068
9068
|
if (oe === void 0) continue;
|
|
9069
|
-
const
|
|
9070
|
-
|
|
9069
|
+
const ye = O(N(oe));
|
|
9070
|
+
ye === void 0 || ye === ne || ce.add(ye < ne ? "up" : "down");
|
|
9071
9071
|
}
|
|
9072
9072
|
return ce.size === 1 ? [...ce][0] : void 0;
|
|
9073
9073
|
}, D = /* @__PURE__ */ new Map();
|
|
@@ -9075,23 +9075,23 @@ function qA(e, t) {
|
|
|
9075
9075
|
const j = /* @__PURE__ */ new Map();
|
|
9076
9076
|
for (const oe of F) {
|
|
9077
9077
|
if (!P.has(oe.flow.source) || !P.has(oe.flow.target)) continue;
|
|
9078
|
-
const
|
|
9079
|
-
|
|
9078
|
+
const ye = j.get(oe.flow.source) ?? [];
|
|
9079
|
+
ye.push(oe.flow.target), j.set(oe.flow.source, ye);
|
|
9080
9080
|
}
|
|
9081
9081
|
const X = /* @__PURE__ */ new Map(), ne = [], ce = /* @__PURE__ */ new Set(), ae = (oe) => {
|
|
9082
9082
|
X.set(oe, "open");
|
|
9083
|
-
for (const
|
|
9084
|
-
const
|
|
9085
|
-
|
|
9083
|
+
for (const ye of j.get(oe) ?? []) {
|
|
9084
|
+
const ge = X.get(ye);
|
|
9085
|
+
ge === "open" ? ce.add(`${oe}>${ye}`) : ge || ae(ye);
|
|
9086
9086
|
}
|
|
9087
9087
|
X.set(oe, "done"), ne.push(oe);
|
|
9088
9088
|
};
|
|
9089
9089
|
for (const oe of w) X.has(oe.node.id) || ae(oe.node.id);
|
|
9090
9090
|
for (const oe of ne.reverse()) {
|
|
9091
|
-
const
|
|
9092
|
-
D.set(oe,
|
|
9093
|
-
for (const
|
|
9094
|
-
!ce.has(`${oe}>${
|
|
9091
|
+
const ye = D.get(oe) ?? 0;
|
|
9092
|
+
D.set(oe, ye);
|
|
9093
|
+
for (const ge of j.get(oe) ?? [])
|
|
9094
|
+
!ce.has(`${oe}>${ge}`) && (D.get(ge) ?? -1) < ye + 1 && D.set(ge, ye + 1);
|
|
9095
9095
|
}
|
|
9096
9096
|
}
|
|
9097
9097
|
let z = -1e3;
|
|
@@ -9104,15 +9104,15 @@ function qA(e, t) {
|
|
|
9104
9104
|
return { root: te, subtree: Z, dir: L(Z) };
|
|
9105
9105
|
});
|
|
9106
9106
|
if (oe.some((te) => te.dir === "up") && oe.some((te) => te.dir === "down")) continue;
|
|
9107
|
-
const
|
|
9107
|
+
const ye = F.some((te) => {
|
|
9108
9108
|
const Z = te.flow.source === j.node.id ? P.get(te.flow.target) : void 0;
|
|
9109
9109
|
return !!Z && x(Z) === X && ae(Z) === 0;
|
|
9110
9110
|
});
|
|
9111
|
-
let
|
|
9112
|
-
if (!
|
|
9113
|
-
const te = F.filter((
|
|
9111
|
+
let ge = !1;
|
|
9112
|
+
if (!ye) {
|
|
9113
|
+
const te = F.filter((fe) => fe.flow.source === j.node.id).map((fe) => P.get(fe.flow.target)).filter((fe) => !!fe && x(fe) === X && (!!fe.node.lane || Te(fe) !== void 0) && ae(fe) < 0), Z = te.length ? Math.max(...te.map(ae)) : void 0, re = te.filter((fe) => ae(fe) === Z);
|
|
9114
9114
|
if (!At(j.node.id) && re.length === 1 && (T.get(re[0].node.id) ?? 0) === 1 && !jt.has(j.node.id)) continue;
|
|
9115
|
-
|
|
9115
|
+
ge = !0;
|
|
9116
9116
|
}
|
|
9117
9117
|
for (const te of oe) {
|
|
9118
9118
|
const Z = te.dir;
|
|
@@ -9124,15 +9124,15 @@ function qA(e, t) {
|
|
|
9124
9124
|
const Be = ae(Pe);
|
|
9125
9125
|
return Z === "up" ? Be < 0 : Be > 0;
|
|
9126
9126
|
})) continue;
|
|
9127
|
-
const
|
|
9128
|
-
if (!
|
|
9127
|
+
const fe = [...ne].map(([Re, Pe]) => ({ band: Re, rel: Pe - ce })).filter((Re) => Z === "up" ? Re.rel < 0 : Re.rel > 0).sort((Re, Pe) => Math.abs(Pe.rel) - Math.abs(Re.rel));
|
|
9128
|
+
if (!fe.length && Z === "down") continue;
|
|
9129
9129
|
const Ne = _(te.root), ke = te.subtree.filter((Re) => x(Re) === X && _(Re) === Ne), qe = new Set(te.subtree.map((Re) => Re.node.id)), Ce = ke.map((Re) => D.get(Re.node.id) ?? 0), Me = Math.min(...Ce) - 1, Se = Math.max(...Ce) + 1, Ae = (Re) => !w.some((Pe) => {
|
|
9130
9130
|
if (qe.has(Pe.node.id) || x(Pe) !== X || _(Pe) !== Re) return !1;
|
|
9131
9131
|
if (!Jt.has(Re)) return !0;
|
|
9132
9132
|
const Be = D.get(Pe.node.id) ?? 0;
|
|
9133
9133
|
return Be >= Me && Be <= Se;
|
|
9134
9134
|
});
|
|
9135
|
-
let ue =
|
|
9135
|
+
let ue = ge ? _(j) : (lm = fe.find((Re) => Ae(Re.band))) == null ? void 0 : lm.band;
|
|
9136
9136
|
if (ue === void 0) {
|
|
9137
9137
|
if (ue = z--, Jt.add(ue), Z === "up") {
|
|
9138
9138
|
const Re = /* @__PURE__ */ new Map();
|
|
@@ -9146,67 +9146,67 @@ function qA(e, t) {
|
|
|
9146
9146
|
}
|
|
9147
9147
|
{
|
|
9148
9148
|
const j = (oe) => {
|
|
9149
|
-
const
|
|
9150
|
-
return
|
|
9149
|
+
const ye = F.find((ge) => ge.flow.target === oe.node.id);
|
|
9150
|
+
return ye ? P.get(ye.flow.source) : void 0;
|
|
9151
9151
|
}, X = (oe) => {
|
|
9152
|
-
const
|
|
9153
|
-
if (!
|
|
9154
|
-
const
|
|
9155
|
-
if (!
|
|
9156
|
-
const te =
|
|
9152
|
+
const ye = j(oe);
|
|
9153
|
+
if (!ye || !ye.node.type.endsWith("Gateway") || x(ye) !== x(oe)) return !1;
|
|
9154
|
+
const ge = q.get(x(ye));
|
|
9155
|
+
if (!ge) return !1;
|
|
9156
|
+
const te = ge.get(_(ye)) ?? 0, Z = (ke) => x(ke) === x(ye) ? (ge.get(_(ke)) ?? 0) - te : Number.NaN, re = F.filter((ke) => ke.flow.source === ye.node.id).map((ke) => P.get(ke.flow.target)).filter((ke) => !!ke && (!!ke.node.lane || Te(ke) !== void 0));
|
|
9157
9157
|
if (re.some((ke) => Z(ke) === 0)) return !1;
|
|
9158
|
-
const J = re.filter((ke) => ke.node.lane ===
|
|
9158
|
+
const J = re.filter((ke) => ke.node.lane === ye.node.lane && Z(ke) < 0);
|
|
9159
9159
|
if (!J.length) return !1;
|
|
9160
|
-
const
|
|
9161
|
-
return Ne.length === 1 && Ne[0] === oe && (T.get(oe.node.id) ?? 0) === 1 && !At(
|
|
9160
|
+
const fe = Math.max(...J.map(Z)), Ne = J.filter((ke) => Z(ke) === fe);
|
|
9161
|
+
return Ne.length === 1 && Ne[0] === oe && (T.get(oe.node.id) ?? 0) === 1 && !At(ye.node.id) && !jt.has(ye.node.id);
|
|
9162
9162
|
}, ne = /* @__PURE__ */ new Set();
|
|
9163
9163
|
for (const oe of w) {
|
|
9164
9164
|
if (!oe.node.type.endsWith("Gateway") || At(oe.node.id)) continue;
|
|
9165
|
-
const
|
|
9166
|
-
if (!
|
|
9167
|
-
const
|
|
9165
|
+
const ye = q.get(x(oe));
|
|
9166
|
+
if (!ye) continue;
|
|
9167
|
+
const ge = ye.get(_(oe)) ?? 0;
|
|
9168
9168
|
let te;
|
|
9169
9169
|
for (const Z of F) {
|
|
9170
9170
|
if (Z.flow.source !== oe.node.id) continue;
|
|
9171
9171
|
const re = P.get(Z.flow.target);
|
|
9172
9172
|
if (!re || x(re) !== x(oe) || !re.node.lane && Te(re) === void 0) continue;
|
|
9173
|
-
const J =
|
|
9174
|
-
J <=
|
|
9173
|
+
const J = ye.get(_(re)) ?? 0;
|
|
9174
|
+
J <= ge || (!te || J > te.row ? te = { id: re.node.id, row: J, count: 1 } : J === te.row && te.count++);
|
|
9175
9175
|
}
|
|
9176
9176
|
te && te.count === 1 && (T.get(te.id) ?? 0) === 1 && ne.add(te.id);
|
|
9177
9177
|
}
|
|
9178
|
-
const ce = /* @__PURE__ */ new Set(), ae = [...w].sort((oe,
|
|
9178
|
+
const ce = /* @__PURE__ */ new Set(), ae = [...w].sort((oe, ye) => Number(ne.has(oe.node.id)) - Number(ne.has(ye.node.id)));
|
|
9179
9179
|
for (const oe of ae) {
|
|
9180
|
-
const
|
|
9181
|
-
if (!
|
|
9180
|
+
const ye = x(oe), ge = q.get(ye);
|
|
9181
|
+
if (!ge) continue;
|
|
9182
9182
|
const te = oe.node.id, Z = v.filter((xt) => xt.flow.target === te);
|
|
9183
9183
|
if (Z.length !== 1 || !(T.get(te) ?? 0) || !oe.node.lane && Te(oe) === void 0 || _t.has(te) || En.has(te)) continue;
|
|
9184
9184
|
const re = (pm = P.get(Z[0].flow.source)) == null ? void 0 : pm.node.participant;
|
|
9185
9185
|
if (!re || re === oe.node.participant) continue;
|
|
9186
|
-
const J = O(oe.node.participant),
|
|
9187
|
-
if (J === void 0 ||
|
|
9188
|
-
const Ne =
|
|
9186
|
+
const J = O(oe.node.participant), fe = O(re);
|
|
9187
|
+
if (J === void 0 || fe === void 0 || J === fe) continue;
|
|
9188
|
+
const Ne = fe < J, ke = ge.get(0) ?? 0, qe = (ge.get(_(oe)) ?? ke) - ke;
|
|
9189
9189
|
if (qe === 0 || (Ne ? qe < 0 : qe > 0) || X(oe)) continue;
|
|
9190
9190
|
let Ce;
|
|
9191
|
-
for (const [xt, tn] of
|
|
9191
|
+
for (const [xt, tn] of ge) {
|
|
9192
9192
|
if (Jt.has(xt)) continue;
|
|
9193
9193
|
const Gt = tn - ke;
|
|
9194
9194
|
(Ne ? Gt < 0 && (!Ce || Gt < Ce.row) : Gt > 0 && (!Ce || Gt > Ce.row)) && (Ce = { band: xt, row: Gt });
|
|
9195
9195
|
}
|
|
9196
9196
|
if (!Ce) continue;
|
|
9197
|
-
const Me = _(oe), Se = B(oe).filter((xt) => x(xt) ===
|
|
9197
|
+
const Me = _(oe), Se = B(oe).filter((xt) => x(xt) === ye && _(xt) === Me && !_t.has(xt.node.id)), Ae = j(oe), ue = Ae != null && Ae.node.type.endsWith("Gateway") ? `${Ae.node.id}|${ye}|${Ce.band}` : void 0, Re = Ce, Pe = !!ue && ne.has(te) && F.some((xt) => {
|
|
9198
9198
|
if (xt.flow.source !== Ae.node.id || xt.flow.target === te) return !1;
|
|
9199
9199
|
const tn = P.get(xt.flow.target);
|
|
9200
|
-
return !!tn && x(tn) ===
|
|
9200
|
+
return !!tn && x(tn) === ye && !Se.includes(tn) && _(tn) === Re.band;
|
|
9201
9201
|
});
|
|
9202
9202
|
let Be = Ce.band;
|
|
9203
9203
|
if (ue && (ce.has(ue) || Pe)) {
|
|
9204
9204
|
if (Be = z--, Jt.add(Be), Ne) {
|
|
9205
9205
|
const xt = /* @__PURE__ */ new Map();
|
|
9206
|
-
for (const [tn, Gt] of
|
|
9207
|
-
xt.set(Be, 0), q.set(
|
|
9208
|
-
} else
|
|
9209
|
-
(fm = W.get(
|
|
9206
|
+
for (const [tn, Gt] of ge) xt.set(tn, Gt + 1);
|
|
9207
|
+
xt.set(Be, 0), q.set(ye, xt);
|
|
9208
|
+
} else ge.set(Be, Math.max(...ge.values()) + 1);
|
|
9209
|
+
(fm = W.get(ye)) == null || fm.add(Be);
|
|
9210
9210
|
}
|
|
9211
9211
|
ue && ce.add(ue);
|
|
9212
9212
|
for (const xt of Se)
|
|
@@ -9219,51 +9219,51 @@ function qA(e, t) {
|
|
|
9219
9219
|
var S;
|
|
9220
9220
|
return ((S = q.get(x)) == null ? void 0 : S.get(_)) ?? _;
|
|
9221
9221
|
}, fn = (x, _, S, O) => {
|
|
9222
|
-
const
|
|
9223
|
-
if (!
|
|
9224
|
-
const T = x ?
|
|
9225
|
-
return Math.abs(T + Nt(x ?? `pool:${_ ?? ""}`, S) *
|
|
9222
|
+
const N = x ? f(x) : _ ? f(_) : void 0;
|
|
9223
|
+
if (!N) return !1;
|
|
9224
|
+
const T = x ? N.y + Math.min(N.height / 2, le) : N.y + U;
|
|
9225
|
+
return Math.abs(T + Nt(x ?? `pool:${_ ?? ""}`, S) * me - O) <= me / 2;
|
|
9226
9226
|
}, Io = /* @__PURE__ */ new Map();
|
|
9227
9227
|
for (const [x, _] of W) {
|
|
9228
9228
|
let S = 0;
|
|
9229
9229
|
for (const O of _) S = Math.max(S, Nt(x, O));
|
|
9230
9230
|
Io.set(x, S);
|
|
9231
9231
|
}
|
|
9232
|
-
const Kn = (x) => K +
|
|
9233
|
-
const
|
|
9234
|
-
(
|
|
9232
|
+
const Kn = (x) => K + me * x, Xn = (x, _, S, O) => {
|
|
9233
|
+
const N = p().children.filter(
|
|
9234
|
+
(T) => !("waypoints" in T && T.waypoints) && T.type !== "label" && T.id !== _ && !(O != null && O.has(T.id)) && typeof T.y == "number" && T.y >= x
|
|
9235
9235
|
);
|
|
9236
|
-
|
|
9236
|
+
N.length && n.moveElements(N, { x: 0, y: S });
|
|
9237
9237
|
}, di = (x, _, S) => {
|
|
9238
9238
|
const O = x.type === "bpmn:Participant" ? x : void 0;
|
|
9239
9239
|
if (!O || O.children.some((L) => L.type === "bpmn:Lane")) return;
|
|
9240
|
-
const
|
|
9241
|
-
if (O.height >=
|
|
9242
|
-
const T =
|
|
9243
|
-
n.resizeShape(O, { x: O.x, y: O.y, width: O.width, height:
|
|
9240
|
+
const N = S + _.height / 2 + Q - O.y;
|
|
9241
|
+
if (O.height >= N) return;
|
|
9242
|
+
const T = N - O.height, B = O.y + O.height;
|
|
9243
|
+
n.resizeShape(O, { x: O.x, y: O.y, width: O.width, height: N }), Xn(B, O.id, T);
|
|
9244
9244
|
}, on = (x, _) => {
|
|
9245
9245
|
const S = _ - x.height;
|
|
9246
|
-
if (S <= 0) return;
|
|
9247
|
-
const O = g(x) ?? x,
|
|
9248
|
-
|
|
9246
|
+
if (S <= 0) return /* @__PURE__ */ new Set();
|
|
9247
|
+
const O = g(x) ?? x, N = [], T = (D) => {
|
|
9248
|
+
N.push(D);
|
|
9249
9249
|
for (const z of D.children ?? []) T(z);
|
|
9250
9250
|
};
|
|
9251
9251
|
T(O);
|
|
9252
|
-
const B = x.y + x.height - 10, L = l.calculateAdjustments(
|
|
9253
|
-
l.makeSpace(L.movingShapes, L.resizingShapes, { x: 0, y: S }, "s", B);
|
|
9252
|
+
const B = x.y + x.height - 10, L = l.calculateAdjustments(N, "y", S, B);
|
|
9253
|
+
return l.makeSpace(L.movingShapes, L.resizingShapes, { x: 0, y: S }, "s", B), new Set(L.movingShapes.map((D) => D.id));
|
|
9254
9254
|
}, go = (x, _, S) => {
|
|
9255
9255
|
if (x) {
|
|
9256
9256
|
const B = d(x), L = Kn(_);
|
|
9257
9257
|
if (B.height >= L) return;
|
|
9258
|
-
const D = L - B.height, z = g(B), j = z ? z.y + z.height : B.y + B.height;
|
|
9259
|
-
|
|
9258
|
+
const D = L - B.height, z = g(B), j = z ? z.y + z.height : B.y + B.height, X = on(B, L);
|
|
9259
|
+
Xn(j, z == null ? void 0 : z.id, D, X);
|
|
9260
9260
|
return;
|
|
9261
9261
|
}
|
|
9262
9262
|
if (!S) return;
|
|
9263
|
-
const O =
|
|
9263
|
+
const O = me * (_ + 1);
|
|
9264
9264
|
if (S.height >= O) return;
|
|
9265
|
-
const
|
|
9266
|
-
n.resizeShape(S, { x: S.x, y: S.y, width: S.width, height: O }), Xn(T, S.id,
|
|
9265
|
+
const N = O - S.height, T = S.y + S.height;
|
|
9266
|
+
n.resizeShape(S, { x: S.x, y: S.y, width: S.width, height: O }), Xn(T, S.id, N);
|
|
9267
9267
|
}, ta = /* @__PURE__ */ new Map();
|
|
9268
9268
|
for (const x of F) ta.set(x.flow.target, (ta.get(x.flow.target) ?? 0) + 1);
|
|
9269
9269
|
const ei = (x) => (ta.get(x) ?? 0) <= 1, vt = new Set(
|
|
@@ -9274,65 +9274,70 @@ function qA(e, t) {
|
|
|
9274
9274
|
if (!x) return;
|
|
9275
9275
|
const S = f(x);
|
|
9276
9276
|
if (!S || S.height >= Kn(_)) return;
|
|
9277
|
-
const O = S.y + S.height - 10,
|
|
9278
|
-
if (
|
|
9277
|
+
const O = S.y + S.height - 10, N = g(S);
|
|
9278
|
+
if (N)
|
|
9279
9279
|
return new Set(
|
|
9280
|
-
(
|
|
9280
|
+
(N.children ?? []).filter((T) => T.type !== "bpmn:Lane" && typeof T.y == "number" && T.y > O).map((T) => T.id)
|
|
9281
9281
|
);
|
|
9282
9282
|
}, Pc = (x, _, S) => {
|
|
9283
9283
|
if (!x) return !0;
|
|
9284
9284
|
const O = f(x);
|
|
9285
9285
|
return O ? S - _.height / 2 >= O.y && S + _.height / 2 <= O.y + O.height : !0;
|
|
9286
9286
|
}, U1 = 10, q1 = /(Task|Event|Gateway|CallActivity|SubProcess|Transaction)$/;
|
|
9287
|
-
for (const { pool: x, lanes: _ } of
|
|
9287
|
+
for (const { pool: x, lanes: _ } of de) {
|
|
9288
9288
|
const S = f(x), O = ve(x);
|
|
9289
9289
|
if (!S || O.length < 2) continue;
|
|
9290
|
-
const
|
|
9290
|
+
const N = Kn(0), T = U1, B = new Set(
|
|
9291
9291
|
Bt(e, "node.update").filter((J) => J.lane !== void 0 && _.has(J.lane)).map((J) => J.id)
|
|
9292
9292
|
), L = S.children ?? [], D = L.filter(
|
|
9293
9293
|
(J) => !("waypoints" in J && J.waypoints) && J.type !== "bpmn:Lane" && J.type !== "label" && typeof J.y == "number"
|
|
9294
9294
|
), z = [];
|
|
9295
9295
|
for (const J of D) {
|
|
9296
9296
|
z.push([J.y, J.y + J.height]);
|
|
9297
|
-
const
|
|
9298
|
-
|
|
9297
|
+
const fe = J.label;
|
|
9298
|
+
fe && z.push([fe.y, fe.y + fe.height]);
|
|
9299
9299
|
}
|
|
9300
9300
|
for (const J of L) {
|
|
9301
|
-
const
|
|
9302
|
-
|
|
9301
|
+
const fe = "waypoints" in J && J.waypoints ? J.label : void 0;
|
|
9302
|
+
fe && fe.y + fe.height > S.y && fe.y < S.y + S.height && z.push([fe.y, fe.y + fe.height]);
|
|
9303
9303
|
}
|
|
9304
|
-
|
|
9304
|
+
for (const J of p().children) {
|
|
9305
|
+
if (J.type !== "bpmn:TextAnnotation") continue;
|
|
9306
|
+
const fe = J;
|
|
9307
|
+
fe.x < S.x + S.width && fe.x + fe.width > S.x && fe.y < S.y + S.height && fe.y + fe.height > S.y && z.push([fe.y, fe.y + fe.height]);
|
|
9308
|
+
}
|
|
9309
|
+
z.sort((J, fe) => J[0] - fe[0]);
|
|
9305
9310
|
const j = S.y, X = S.y + S.height, ne = [];
|
|
9306
9311
|
let ce = j;
|
|
9307
|
-
for (const [J,
|
|
9308
|
-
J > ce && ne.push([ce, J]), ce = Math.max(ce,
|
|
9309
|
-
const ae = D.filter((J) => q1.test(J.type) && !B.has(J.id)), oe = (J,
|
|
9312
|
+
for (const [J, fe] of z)
|
|
9313
|
+
J > ce && ne.push([ce, J]), ce = Math.max(ce, fe);
|
|
9314
|
+
const ae = D.filter((J) => q1.test(J.type) && !B.has(J.id)), oe = (J, fe) => ae.some((Ne) => Ne.y + Ne.height / 2 >= J && Ne.y + Ne.height / 2 <= fe), ye = (J) => z.some(([fe, Ne]) => fe < J - 0.5 && J + 0.5 < Ne), ge = [];
|
|
9310
9315
|
let te = j;
|
|
9311
|
-
for (const J of O.slice(1).map((
|
|
9312
|
-
const
|
|
9316
|
+
for (const J of O.slice(1).map((fe) => fe.y)) {
|
|
9317
|
+
const fe = te + 2 * T, Ne = !ye(J) && J >= fe && J <= X - 2 * T ? [J] : [];
|
|
9313
9318
|
for (const [qe, Ce] of ne) {
|
|
9314
|
-
const Me = Math.max(qe + T,
|
|
9319
|
+
const Me = Math.max(qe + T, fe), Se = Math.min(Ce - T, X - 2 * T);
|
|
9315
9320
|
Me <= Se && Ne.push(Math.min(Math.max(J, Me), Se));
|
|
9316
9321
|
}
|
|
9317
|
-
Ne.push(Math.max(ce + T,
|
|
9322
|
+
Ne.push(Math.max(ce + T, fe));
|
|
9318
9323
|
let ke;
|
|
9319
9324
|
for (const qe of Ne) {
|
|
9320
|
-
const Ce = !oe(te, qe) && qe - te <
|
|
9325
|
+
const Ce = !oe(te, qe) && qe - te < N ? D.filter((Ae) => Ae.y >= qe).length : 0, Me = Math.abs(qe - J), Se = ke ? Math.abs(ke.y - J) : 0;
|
|
9321
9326
|
(!ke || Ce < ke.cost || Ce === ke.cost && (Me < Se || Me === Se && qe > ke.y)) && (ke = { y: qe, cost: Ce });
|
|
9322
9327
|
}
|
|
9323
|
-
|
|
9328
|
+
ge.push(ke.y), te = ke.y;
|
|
9324
9329
|
}
|
|
9325
|
-
const Z =
|
|
9330
|
+
const Z = ge[ge.length - 1] + 2 * T - X;
|
|
9326
9331
|
Z > 0 && (n.resizeShape(S, { x: S.x, y: S.y, width: S.width, height: S.height + Z }), Xn(X, S.id, Z));
|
|
9327
|
-
const re = [j, ...
|
|
9328
|
-
O.forEach((J,
|
|
9329
|
-
const Ne = re[
|
|
9332
|
+
const re = [j, ...ge, S.y + S.height];
|
|
9333
|
+
O.forEach((J, fe) => {
|
|
9334
|
+
const Ne = re[fe], ke = re[fe + 1] - Ne;
|
|
9330
9335
|
(J.y !== Ne || J.height !== ke) && n.resizeShape(J, { x: J.x, y: Ne, width: J.width, height: ke });
|
|
9331
9336
|
});
|
|
9332
9337
|
for (const J of O) {
|
|
9333
|
-
if (J.height >=
|
|
9334
|
-
const
|
|
9335
|
-
|
|
9338
|
+
if (J.height >= N || oe(J.y, J.y + J.height)) continue;
|
|
9339
|
+
const fe = N - J.height, Ne = S.y + S.height, ke = on(J, N);
|
|
9340
|
+
Xn(Ne, S.id, fe, ke);
|
|
9336
9341
|
}
|
|
9337
9342
|
}
|
|
9338
9343
|
const Tc = m.map((x, _) => ({ op: x, declared: _ }));
|
|
@@ -9347,13 +9352,13 @@ function qA(e, t) {
|
|
|
9347
9352
|
(x) => x.type === "bpmn:Participant" && x.parent === p()
|
|
9348
9353
|
), Y1 = (() => {
|
|
9349
9354
|
if (!Ep.length) return;
|
|
9350
|
-
const x = Ep.filter((
|
|
9355
|
+
const x = Ep.filter((N) => !$w(N)), _ = x.length ? x : Ep, S = Math.min(..._.map((N) => N.x)), O = Math.max(..._.map((N) => N.x + N.width));
|
|
9351
9356
|
return O > S ? { x: S, width: O - S } : void 0;
|
|
9352
9357
|
})();
|
|
9353
9358
|
for (const { op: x } of Tc) {
|
|
9354
|
-
const _ = x.participant, S = w.filter((oe) => oe.node.participant === _.id).length, O = ((dm = _.lanes) == null ? void 0 : dm.length) ?? 0,
|
|
9359
|
+
const _ = x.participant, S = w.filter((oe) => oe.node.participant === _.id).length, O = ((dm = _.lanes) == null ? void 0 : dm.length) ?? 0, N = Math.max(1200, S * 160 + 300), T = (_.lanes ?? []).map((oe) => Kn(Io.get(oe.id) ?? 0)), B = T.reduce((oe, ye) => oe + ye, 0);
|
|
9355
9360
|
O && B < 300 && (T[O - 1] += 300 - B);
|
|
9356
|
-
const L = Math.max(300,
|
|
9361
|
+
const L = Math.max(300, me * ((Io.get(`pool:${_.id}`) ?? 0) + 1)), D = _.blackBox || S + O === 0 ? 120 : O ? Math.max(300, B) : L, z = _.blackBox ? Y1 : void 0, j = (z == null ? void 0 : z.x) ?? 100, X = (z == null ? void 0 : z.width) ?? N, ne = o.createShape({
|
|
9357
9362
|
type: "bpmn:Participant",
|
|
9358
9363
|
businessObject: i.create("bpmn:Participant", {
|
|
9359
9364
|
id: _.id,
|
|
@@ -9371,19 +9376,19 @@ function qA(e, t) {
|
|
|
9371
9376
|
}), ce = n.createShape(ne, { x: j + X / 2, y: ts + D / 2 }, p()), ae = _.lanes ?? [];
|
|
9372
9377
|
if (ae.length && n.splitLane(ce, ae.length), ae.length) {
|
|
9373
9378
|
const oe = r.filter(
|
|
9374
|
-
(
|
|
9375
|
-
var
|
|
9376
|
-
return
|
|
9379
|
+
(ye) => {
|
|
9380
|
+
var ge;
|
|
9381
|
+
return ye.type === "bpmn:Lane" && ((ge = g(ye)) == null ? void 0 : ge.id) === _.id;
|
|
9377
9382
|
}
|
|
9378
|
-
).sort((
|
|
9379
|
-
if (oe.forEach((
|
|
9380
|
-
const te = ae[
|
|
9381
|
-
te && n.updateProperties(
|
|
9382
|
-
}), T.some((
|
|
9383
|
-
let
|
|
9384
|
-
oe.forEach((
|
|
9383
|
+
).sort((ye, ge) => ye.y - ge.y);
|
|
9384
|
+
if (oe.forEach((ye, ge) => {
|
|
9385
|
+
const te = ae[ge];
|
|
9386
|
+
te && n.updateProperties(ye, { id: te.id, name: te.name });
|
|
9387
|
+
}), T.some((ye) => ye !== ce.height / O)) {
|
|
9388
|
+
let ye = ce.y;
|
|
9389
|
+
oe.forEach((ge, te) => {
|
|
9385
9390
|
const Z = T[te];
|
|
9386
|
-
n.resizeShape(
|
|
9391
|
+
n.resizeShape(ge, { x: ge.x, y: ye, width: ge.width, height: Z }), ye += Z;
|
|
9387
9392
|
});
|
|
9388
9393
|
}
|
|
9389
9394
|
}
|
|
@@ -9426,30 +9431,30 @@ function qA(e, t) {
|
|
|
9426
9431
|
], Rp = (x) => x.endsWith("Gateway");
|
|
9427
9432
|
for (const x of X1) {
|
|
9428
9433
|
const _ = ns.get(x), S = x ? d(x) : void 0, O = S ? S.x + 150 : 250;
|
|
9429
|
-
let
|
|
9434
|
+
let N = S ? S.y + 80 : 120;
|
|
9430
9435
|
const T = (Z, re, J) => {
|
|
9431
9436
|
if (Z) {
|
|
9432
|
-
const
|
|
9433
|
-
return
|
|
9437
|
+
const fe = d(Z);
|
|
9438
|
+
return fe.y + Math.min(fe.height / 2, le) + Nt(Z, re ?? 0) * me;
|
|
9434
9439
|
}
|
|
9435
|
-
return re !== void 0 && S ? S.y + U + Nt(`pool:${x}`, re) *
|
|
9440
|
+
return re !== void 0 && S ? S.y + U + Nt(`pool:${x}`, re) * me : J;
|
|
9436
9441
|
}, B = (Z, re, J) => {
|
|
9437
9442
|
if (Z) {
|
|
9438
|
-
const
|
|
9439
|
-
return
|
|
9443
|
+
const fe = d(Z);
|
|
9444
|
+
return fe.y + Math.min(fe.height / 2, le) + re * me;
|
|
9440
9445
|
}
|
|
9441
|
-
return S ? S.y + U + re *
|
|
9442
|
-
}, L = (Z) => Z.participant ? d(Z.participant) : p(), D = (Z, re, J,
|
|
9443
|
-
const Me = J !== void 0 ||
|
|
9446
|
+
return S ? S.y + U + re * me : J;
|
|
9447
|
+
}, L = (Z) => Z.participant ? d(Z.participant) : p(), D = (Z, re, J, fe, Ne, ke, qe, Ce) => {
|
|
9448
|
+
const Me = J !== void 0 || fe !== void 0, Se = (Pe) => {
|
|
9444
9449
|
const Be = () => go(J, Pe, S);
|
|
9445
9450
|
Ce ? Ce(Be) : Be();
|
|
9446
|
-
}, Ae = Nt(J ?? `pool:${x}`,
|
|
9451
|
+
}, Ae = Nt(J ?? `pool:${x}`, fe ?? 0);
|
|
9447
9452
|
if (
|
|
9448
9453
|
// ── B-89. band 를 **줘도** 그것이 상류 행의 슬롯을 가리키면 승계한다 ──
|
|
9449
9454
|
// 🔴 종전엔 `band === undefined` 만 승계했는데, 사람 문서에서는 *"상류와 같은 행"* 을
|
|
9450
9455
|
// 가리키는 band 가 **아예 없다**(격자 밖 92%). ⇒ band 를 주는 것이 승계를 **끄는**
|
|
9451
9456
|
// 부작용을 냈다(표본 65 = 에이전트가 band 3 을 정확히 계산했는데 그 때문에 30px 어긋났다).
|
|
9452
|
-
(
|
|
9457
|
+
(fe === void 0 || fn(J, x, fe, qe ?? Number.NaN)) && qe !== void 0 && Pc(J, re, qe) && !C(Z, re, Ne, qe)
|
|
9453
9458
|
)
|
|
9454
9459
|
return { x: Ne, y: qe };
|
|
9455
9460
|
if (Me)
|
|
@@ -9458,7 +9463,7 @@ function qA(e, t) {
|
|
|
9458
9463
|
if (!C(Z, re, Ne, Be, kg(J, Ae + Pe)))
|
|
9459
9464
|
return Se(Ae + Pe), { x: Ne, y: Be };
|
|
9460
9465
|
}
|
|
9461
|
-
const ue = T(J,
|
|
9466
|
+
const ue = T(J, fe, ke);
|
|
9462
9467
|
Me ? Se(Ae) : Ce ? Ce(() => di(Z, re, re.y + re.height / 2)) : di(Z, re, ue);
|
|
9463
9468
|
let Re = Ne;
|
|
9464
9469
|
for (let Pe = 0; Pe < 64; Pe++) {
|
|
@@ -9468,16 +9473,16 @@ function qA(e, t) {
|
|
|
9468
9473
|
}
|
|
9469
9474
|
return { x: Re, y: ue };
|
|
9470
9475
|
}, z = (Z, re, J) => {
|
|
9471
|
-
const
|
|
9476
|
+
const fe = r.getAll().filter(
|
|
9472
9477
|
(ke) => {
|
|
9473
9478
|
var qe;
|
|
9474
9479
|
return /Association$/.test(ke.type) && (((qe = ke.waypoints) == null ? void 0 : qe.length) ?? 0) >= 2;
|
|
9475
9480
|
}
|
|
9476
9481
|
);
|
|
9477
|
-
if (!
|
|
9482
|
+
if (!fe.length) return J;
|
|
9478
9483
|
const Ne = (ke) => {
|
|
9479
9484
|
const qe = { id: re.id, type: re.type, x: ke - re.width / 2, y: J.y - re.height / 2, width: re.width, height: re.height };
|
|
9480
|
-
return
|
|
9485
|
+
return fe.some(
|
|
9481
9486
|
(Ce) => Ce.waypoints.some((Me, Se) => !!Ce.waypoints[Se + 1] && la(Me, Ce.waypoints[Se + 1], qe) <= Ee)
|
|
9482
9487
|
);
|
|
9483
9488
|
};
|
|
@@ -9494,14 +9499,14 @@ function qA(e, t) {
|
|
|
9494
9499
|
return re.x + re.width + _e;
|
|
9495
9500
|
}, ce = (Z) => {
|
|
9496
9501
|
if (ee(Z) > 0) return;
|
|
9497
|
-
const re = _.flows.filter((
|
|
9502
|
+
const re = _.flows.filter((fe) => fe.flow.source === Z);
|
|
9498
9503
|
if (re.length !== 1) return;
|
|
9499
9504
|
const J = r.get(re[0].flow.target);
|
|
9500
9505
|
return J && typeof J.y == "number" && typeof J.height == "number" ? J.y + J.height / 2 : void 0;
|
|
9501
9506
|
};
|
|
9502
9507
|
for (const Z of _.nodes) {
|
|
9503
9508
|
if (j.has(Z.node.id)) continue;
|
|
9504
|
-
const re = Sp(Z.node, Z.band, Z.afterColumn), J = Te(Z),
|
|
9509
|
+
const re = Sp(Z.node, Z.band, Z.afterColumn), J = Te(Z), fe = Z.node.lane ? `${Z.node.lane}|${J ?? ""}` : J !== void 0 ? `band:${J}` : "", Ne = L(Z.node), ke = X.get(fe) ?? O, qe = ne(Z.afterColumn), Ce = qe === void 0 ? ke : Math.max(ke, qe);
|
|
9505
9510
|
let Me;
|
|
9506
9511
|
const Se = D(
|
|
9507
9512
|
Ne,
|
|
@@ -9509,7 +9514,7 @@ function qA(e, t) {
|
|
|
9509
9514
|
Z.node.lane,
|
|
9510
9515
|
J,
|
|
9511
9516
|
Ce,
|
|
9512
|
-
|
|
9517
|
+
N,
|
|
9513
9518
|
ce(Z.node.id),
|
|
9514
9519
|
vt.has(Z.node.id) && Z.node.participant !== void 0 ? (Ae) => Me = Ae : void 0
|
|
9515
9520
|
);
|
|
@@ -9517,13 +9522,13 @@ function qA(e, t) {
|
|
|
9517
9522
|
const Ae = Z.node.lane ? d(Z.node.lane) : Ne;
|
|
9518
9523
|
Et.set(Z.node.id, { container: Ae, relCy: Se.y - Ae.y, grow: Me });
|
|
9519
9524
|
}
|
|
9520
|
-
X.set(
|
|
9525
|
+
X.set(fe, Se.x + re.width + _e), !Z.node.lane && J === void 0 && (N += 160);
|
|
9521
9526
|
}
|
|
9522
|
-
const ae = /* @__PURE__ */ new Set(), oe = /* @__PURE__ */ new Map(),
|
|
9527
|
+
const ae = /* @__PURE__ */ new Set(), oe = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map();
|
|
9523
9528
|
if (x && R.has(`pool:${x}`)) {
|
|
9524
9529
|
const Z = /* @__PURE__ */ new Map();
|
|
9525
9530
|
for (const Ce of _.flows) Z.set(Ce.flow.target, (Z.get(Ce.flow.target) ?? 0) + 1);
|
|
9526
|
-
const re = (Ce) => T(Ce.node.lane, at(Ce), Number.NaN), J = /* @__PURE__ */ new Set(),
|
|
9531
|
+
const re = (Ce) => T(Ce.node.lane, at(Ce), Number.NaN), J = /* @__PURE__ */ new Set(), fe = (Ce) => {
|
|
9527
9532
|
var Ae;
|
|
9528
9533
|
const Me = (Ae = P.get(Ce)) == null ? void 0 : Ae.node.participant;
|
|
9529
9534
|
if (Me) return f(Me);
|
|
@@ -9545,7 +9550,7 @@ function qA(e, t) {
|
|
|
9545
9550
|
let Se = !1, Ae = !1;
|
|
9546
9551
|
for (const ue of v) {
|
|
9547
9552
|
if (!Me.has(ue.flow.source)) continue;
|
|
9548
|
-
const Re =
|
|
9553
|
+
const Re = fe(ue.flow.target);
|
|
9549
9554
|
!Re || Re.id === S.id || (Re.y < S.y ? Se = !0 : Ae = !0);
|
|
9550
9555
|
}
|
|
9551
9556
|
return Se && !Ae ? "up" : Ae && !Se ? "down" : void 0;
|
|
@@ -9584,7 +9589,7 @@ function qA(e, t) {
|
|
|
9584
9589
|
let Se = !1, Ae = !1;
|
|
9585
9590
|
for (const ue of v) {
|
|
9586
9591
|
if (!Me.has(ue.flow.target)) continue;
|
|
9587
|
-
const Re =
|
|
9592
|
+
const Re = fe(ue.flow.source);
|
|
9588
9593
|
!Re || Re.id === S.id || (Re.y < S.y ? Se = !0 : Ae = !0);
|
|
9589
9594
|
}
|
|
9590
9595
|
return Se && !Ae ? "up" : Ae && !Se ? "down" : void 0;
|
|
@@ -9633,21 +9638,21 @@ function qA(e, t) {
|
|
|
9633
9638
|
Me && !J.has(Me) && ae.add(Ce);
|
|
9634
9639
|
}
|
|
9635
9640
|
}
|
|
9636
|
-
const
|
|
9641
|
+
const ge = /* @__PURE__ */ new Set();
|
|
9637
9642
|
let te = 0;
|
|
9638
9643
|
for (; te++ < _.nodes.length + 2; ) {
|
|
9639
9644
|
for (let J = 0; J < _.nodes.length + _.flows.length + 2; J++) {
|
|
9640
|
-
let
|
|
9645
|
+
let fe = !1;
|
|
9641
9646
|
for (const Ne of _.flows) {
|
|
9642
9647
|
const ke = Ne.flow;
|
|
9643
|
-
if (
|
|
9648
|
+
if (ge.has(ke.id)) continue;
|
|
9644
9649
|
const qe = f(ke.source);
|
|
9645
9650
|
if (!qe) continue;
|
|
9646
9651
|
const Ce = f(ke.target), Me = P.get(ke.target);
|
|
9647
9652
|
if (!Ce && Me) {
|
|
9648
9653
|
const Se = Sp(Me.node, Me.band), Ae = at(Me);
|
|
9649
9654
|
if (Me.node.lane || Ae !== void 0) {
|
|
9650
|
-
const ue = L(Me.node), Re = qe, Pe = Re.x + (
|
|
9655
|
+
const ue = L(Me.node), Re = qe, Pe = Re.x + (ye.get(ke.source) ?? 0) + Re.width + _e, Be = oe.get(ke.target), xt = D(
|
|
9651
9656
|
ue,
|
|
9652
9657
|
Se,
|
|
9653
9658
|
Be ? Be.lane : Me.node.lane,
|
|
@@ -9658,7 +9663,7 @@ function qA(e, t) {
|
|
|
9658
9663
|
// 합류(유입 ≥ 2)는 물려받을 행이 유일하지 않다(위 `inheritsRowFrom` 주석).
|
|
9659
9664
|
Be || !ei(ke.target) ? void 0 : Re.y + Re.height / 2
|
|
9660
9665
|
), tn = P.has(ke.source) ? xt : z(ue, Se, xt), Gt = n.createShape(Se, tn, ue);
|
|
9661
|
-
ae.has(ke.target) &&
|
|
9666
|
+
ae.has(ke.target) && ye.set(ke.target, Pe - (Gt.x + Gt.width / 2)), n.connect(qe, Gt, { type: "bpmn:SequenceFlow", businessObject: kc(ke) });
|
|
9662
9667
|
} else
|
|
9663
9668
|
s.append(qe, Se, {
|
|
9664
9669
|
connection: { type: "bpmn:SequenceFlow", businessObject: kc(ke) }
|
|
@@ -9667,16 +9672,16 @@ function qA(e, t) {
|
|
|
9667
9672
|
n.connect(qe, Ce, { type: "bpmn:SequenceFlow", businessObject: kc(ke) });
|
|
9668
9673
|
else
|
|
9669
9674
|
continue;
|
|
9670
|
-
|
|
9675
|
+
ge.add(ke.id), fe = !0;
|
|
9671
9676
|
}
|
|
9672
|
-
if (!
|
|
9677
|
+
if (!fe) break;
|
|
9673
9678
|
}
|
|
9674
9679
|
const Z = _.nodes.filter((J) => !f(J.node.id));
|
|
9675
9680
|
if (!Z.length) break;
|
|
9676
9681
|
const re = Z[0];
|
|
9677
9682
|
{
|
|
9678
|
-
const J = Sp(re.node, re.band),
|
|
9679
|
-
n.createShape(J, D(
|
|
9683
|
+
const J = Sp(re.node, re.band), fe = L(re.node), Ne = Te(re);
|
|
9684
|
+
n.createShape(J, D(fe, J, re.node.lane, Ne, O, N), fe), !re.node.lane && Ne === void 0 && (N += 160);
|
|
9680
9685
|
}
|
|
9681
9686
|
}
|
|
9682
9687
|
}
|
|
@@ -9684,14 +9689,14 @@ function qA(e, t) {
|
|
|
9684
9689
|
for (const [x, _] of k) {
|
|
9685
9690
|
const S = f(x), O = f(_.flow.target);
|
|
9686
9691
|
if (!(S != null && S.target) || !O) continue;
|
|
9687
|
-
const
|
|
9688
|
-
Dg.set(x, { waypoints: S.waypoints.map((L) => ({ x: L.x, y: L.y })), label:
|
|
9692
|
+
const N = S.label && { x: S.label.x, y: S.label.y, width: S.label.width, height: S.label.height };
|
|
9693
|
+
Dg.set(x, { waypoints: S.waypoints.map((L) => ({ x: L.x, y: L.y })), label: N });
|
|
9689
9694
|
const T = S.target, B = (L) => ({ x: L.x + L.width / 2, y: L.y + L.height / 2 });
|
|
9690
9695
|
n.reconnect(S, O, T, [B(O), B(T)]), n.layoutConnection(S, { waypoints: [] });
|
|
9691
9696
|
}
|
|
9692
9697
|
const Lg = /* @__PURE__ */ new Set();
|
|
9693
9698
|
{
|
|
9694
|
-
const x = (T) => T.endsWith("Task") || T === "bpmn:CallActivity" || T === "bpmn:SubProcess", _ = (T) => x(T) || T === "bpmn:EndEvent" || T === "bpmn:IntermediateThrowEvent" || T === "bpmn:IntermediateCatchEvent", S = (T) => (T ?? []).filter((B) => B.type === "bpmn:SequenceFlow"), O = Bt(e, "sequenceFlow.update"),
|
|
9699
|
+
const x = (T) => T.endsWith("Task") || T === "bpmn:CallActivity" || T === "bpmn:SubProcess", _ = (T) => x(T) || T === "bpmn:EndEvent" || T === "bpmn:IntermediateThrowEvent" || T === "bpmn:IntermediateCatchEvent", S = (T) => (T ?? []).filter((B) => B.type === "bpmn:SequenceFlow"), O = Bt(e, "sequenceFlow.update"), N = (T, B) => {
|
|
9695
9700
|
if (!T) return;
|
|
9696
9701
|
const L = B.x + B.width / 2, D = B.y + B.height / 2;
|
|
9697
9702
|
let z;
|
|
@@ -9710,24 +9715,24 @@ function qA(e, t) {
|
|
|
9710
9715
|
if (!B) continue;
|
|
9711
9716
|
const L = T.source !== void 0 ? f(T.source) : B.source, D = T.target !== void 0 ? f(T.target) : B.target;
|
|
9712
9717
|
if (!L || !D || L.id === D.id || P.has(L.id) || P.has(D.id) || !x(L.type) || !_(D.type) || L.parent !== D.parent || S(D.incoming).some((te) => te.id !== B.id) || S(D.outgoing).some((te) => te.id !== B.id) || O.some((te) => te !== T && (te.target === D.id || te.source === D.id)) || D.x >= L.x + L.width) continue;
|
|
9713
|
-
const z = L.parent, j = g(L), X = L.x + L.width + _e, ne = L.y + L.height / 2, ce = D.y + D.height / 2, ae =
|
|
9714
|
-
if (
|
|
9715
|
-
if (n.moveElements([D], { x: X - (D.x + D.width / 2), y:
|
|
9718
|
+
const z = L.parent, j = g(L), X = L.x + L.width + _e, ne = L.y + L.height / 2, ce = D.y + D.height / 2, ae = N(j, L) === N(j, D), oe = /* @__PURE__ */ new Set([D.id]), ye = [ae ? ne : ce, ce].find((te) => !C(z, D, X, te, oe));
|
|
9719
|
+
if (ye === void 0) continue;
|
|
9720
|
+
if (n.moveElements([D], { x: X - (D.x + D.width / 2), y: ye - ce }), j) {
|
|
9716
9721
|
const te = D.x + D.width + $f - (j.x + j.width);
|
|
9717
9722
|
te > 0 && iu(n, j, j.width + te);
|
|
9718
9723
|
}
|
|
9719
|
-
const
|
|
9720
|
-
n.reconnect(B, L, D, [
|
|
9724
|
+
const ge = (te) => ({ x: te.x + te.width / 2, y: te.y + te.height / 2 });
|
|
9725
|
+
n.reconnect(B, L, D, [ge(L), ge(D)]), Math.abs(ge(L).y - ge(D).y) > 1 && n.layoutConnection(B, { waypoints: [] }), Lg.add(T.id);
|
|
9721
9726
|
}
|
|
9722
9727
|
}
|
|
9723
9728
|
const No = 40, Z1 = 10, Oc = (x) => {
|
|
9724
9729
|
const _ = (j) => j.kind === "label-over-line" || j.kind === "label-over-shape" || j.kind === "label-on-shared-segment" ? j.edge === x.id : j.kind === "annotation-over-label" || j.kind === "pool-name-over-label" ? j.label === x.id : !1, S = () => new Map(
|
|
9725
9730
|
pt(We(r)).filter((j) => !_(j)).map((j) => [ft(j), j])
|
|
9726
|
-
), O = S(),
|
|
9731
|
+
), O = S(), N = (j) => [...j].filter(([X]) => !O.has(X)).map(([, X]) => X), T = (j) => N(j).length <= [...O.keys()].filter((X) => !j.has(X)).length, B = x.waypoints.map((j) => ({ x: j.x, y: j.y })), L = x.label, D = L && { x: L.x, y: L.y };
|
|
9727
9732
|
n.layoutConnection(x, { waypoints: [] });
|
|
9728
9733
|
const z = S();
|
|
9729
9734
|
if (!T(z)) {
|
|
9730
|
-
if (
|
|
9735
|
+
if (N(z).every((j) => j.kind === "edge-crosses-shape" && j.edge === x.id)) {
|
|
9731
9736
|
const j = We(r), X = j.edges.find((oe) => oe.id === x.id), ne = Un(j), ce = X ? Ht(X, ne) : [], ae = X && ce.length && !ce.every((oe) => oe.type === "bpmn:TextAnnotation") ? Bd(X, ne, Ql(x), j.edges) : null;
|
|
9732
9737
|
if (ae && (n.updateWaypoints(x, ae), T(S())))
|
|
9733
9738
|
return;
|
|
@@ -9739,12 +9744,12 @@ function qA(e, t) {
|
|
|
9739
9744
|
...v.map((x) => x.flow.id),
|
|
9740
9745
|
...Bt(e, "sequenceFlow.update").map((x) => x.id),
|
|
9741
9746
|
...Bt(e, "messageFlow.update").map((x) => x.id)
|
|
9742
|
-
].filter((x) => !!x)), J1 = (x, _, S, O,
|
|
9747
|
+
].filter((x) => !!x)), J1 = (x, _, S, O, N, T) => {
|
|
9743
9748
|
const B = new Set(x.map((te) => te.id)), L = Math.min(...x.map((te) => te.x)) + _ - vi, D = Math.max(...x.map((te) => te.x + te.width)) + _ + Ig + vi, z = Math.min(...x.map((te) => te.y + Math.min(0, ...S))) - vi, j = Math.max(...x.map((te) => te.y + te.height + Math.max(0, ...S))) + vi, X = r.getAll().filter((te) => {
|
|
9744
9749
|
if (te.type !== "bpmn:SequenceFlow" && te.type !== "bpmn:MessageFlow") return !1;
|
|
9745
9750
|
const Z = te;
|
|
9746
|
-
return is.has(Z.id) || !Z.waypoints || Z.waypoints.length < 2 || [Z.source, Z.target].some((J) => !J || B.has(J.id) || J.x >= O) ? !1 : Z.waypoints.some((J,
|
|
9747
|
-
const Ne = Z.waypoints[
|
|
9751
|
+
return is.has(Z.id) || !Z.waypoints || Z.waypoints.length < 2 || [Z.source, Z.target].some((J) => !J || B.has(J.id) || J.x >= O) ? !1 : Z.waypoints.some((J, fe) => {
|
|
9752
|
+
const Ne = Z.waypoints[fe + 1];
|
|
9748
9753
|
return !!Ne && Math.max(J.x, Ne.x) >= L && Math.min(J.x, Ne.x) <= D && Math.max(J.y, Ne.y) >= z && Math.min(J.y, Ne.y) <= j;
|
|
9749
9754
|
});
|
|
9750
9755
|
});
|
|
@@ -9753,10 +9758,10 @@ function qA(e, t) {
|
|
|
9753
9758
|
const Z = /* @__PURE__ */ new Map();
|
|
9754
9759
|
for (const re of x)
|
|
9755
9760
|
for (const J of S) {
|
|
9756
|
-
const
|
|
9761
|
+
const fe = { id: re.id, type: re.type, x: re.x + _ + te, y: re.y + J, width: re.width, height: re.height };
|
|
9757
9762
|
for (const Ne of X) {
|
|
9758
9763
|
let ke = 1 / 0;
|
|
9759
|
-
for (let Ce = 0; Ce + 1 < Ne.waypoints.length; Ce++) ke = Math.min(ke, la(Ne.waypoints[Ce], Ne.waypoints[Ce + 1],
|
|
9764
|
+
for (let Ce = 0; Ce + 1 < Ne.waypoints.length; Ce++) ke = Math.min(ke, la(Ne.waypoints[Ce], Ne.waypoints[Ce + 1], fe));
|
|
9760
9765
|
const qe = `${Ne.id}|${re.id}`;
|
|
9761
9766
|
Z.set(qe, Math.min(Z.get(qe) ?? 1 / 0, ke));
|
|
9762
9767
|
}
|
|
@@ -9773,25 +9778,25 @@ function qA(e, t) {
|
|
|
9773
9778
|
}
|
|
9774
9779
|
}
|
|
9775
9780
|
if (!ae) return 0;
|
|
9776
|
-
const oe = Math.min(...x.map((te) => te.x)) + _ + ae,
|
|
9781
|
+
const oe = Math.min(...x.map((te) => te.x)) + _ + ae, ye = new Set(ce.map((te) => te.slice(0, te.indexOf("|"))));
|
|
9777
9782
|
return X.some(
|
|
9778
|
-
(te) => te.type === "bpmn:SequenceFlow" &&
|
|
9783
|
+
(te) => te.type === "bpmn:SequenceFlow" && ye.has(te.id) && te.waypoints.some((Z, re) => {
|
|
9779
9784
|
const J = te.waypoints[re + 1];
|
|
9780
9785
|
if (!J || Math.min(Z.y, J.y) > T || Math.max(Z.y, J.y) < T || Z.y === J.y) return !1;
|
|
9781
|
-
const
|
|
9782
|
-
return
|
|
9786
|
+
const fe = Z.x + (T - Z.y) * (J.x - Z.x) / (J.y - Z.y);
|
|
9787
|
+
return fe > N && fe < oe;
|
|
9783
9788
|
})
|
|
9784
9789
|
) ? 0 : ae;
|
|
9785
9790
|
}, Bo = (x, _ = () => !0) => {
|
|
9786
9791
|
const S = f(x);
|
|
9787
9792
|
if (!S) return [];
|
|
9788
|
-
const O = [S],
|
|
9793
|
+
const O = [S], N = /* @__PURE__ */ new Set([x]);
|
|
9789
9794
|
for (let T = 0; T < O.length; T++) {
|
|
9790
9795
|
const B = O[T].id;
|
|
9791
9796
|
for (const L of F) {
|
|
9792
9797
|
const D = L.flow.target;
|
|
9793
|
-
if (L.flow.source !== B ||
|
|
9794
|
-
|
|
9798
|
+
if (L.flow.source !== B || N.has(D) || !P.has(D)) continue;
|
|
9799
|
+
N.add(D);
|
|
9795
9800
|
const z = f(D);
|
|
9796
9801
|
z && _(z) && O.push(z);
|
|
9797
9802
|
}
|
|
@@ -9800,13 +9805,13 @@ function qA(e, t) {
|
|
|
9800
9805
|
}, Q1 = (x, _ = () => !0) => {
|
|
9801
9806
|
const S = f(x);
|
|
9802
9807
|
if (!S) return [];
|
|
9803
|
-
const O = [S],
|
|
9808
|
+
const O = [S], N = /* @__PURE__ */ new Set([x]);
|
|
9804
9809
|
for (let T = 0; T < O.length; T++) {
|
|
9805
9810
|
const B = O[T].id;
|
|
9806
9811
|
for (const L of F) {
|
|
9807
9812
|
const D = L.flow.source;
|
|
9808
|
-
if (L.flow.target !== B ||
|
|
9809
|
-
|
|
9813
|
+
if (L.flow.target !== B || N.has(D) || !P.has(D)) continue;
|
|
9814
|
+
N.add(D);
|
|
9810
9815
|
const z = f(D);
|
|
9811
9816
|
z && _(z) && O.push(z);
|
|
9812
9817
|
}
|
|
@@ -9822,7 +9827,7 @@ function qA(e, t) {
|
|
|
9822
9827
|
)
|
|
9823
9828
|
)) return null;
|
|
9824
9829
|
}
|
|
9825
|
-
const
|
|
9830
|
+
const N = x.map((D) => D.pool.width), T = S ? r.filter((D) => Array.isArray(D.waypoints)).map((D) => ({
|
|
9826
9831
|
c: D,
|
|
9827
9832
|
wps: D.waypoints.map((z) => ({ x: z.x, y: z.y }))
|
|
9828
9833
|
})) : [], B = r.filter((D) => D.type === "label").map((D) => ({
|
|
@@ -9843,7 +9848,7 @@ function qA(e, t) {
|
|
|
9843
9848
|
x.flatMap((D) => D.subtree),
|
|
9844
9849
|
{ x: -_, y: 0 }
|
|
9845
9850
|
), x.forEach((D, z) => {
|
|
9846
|
-
L[z] > 0 && na(D.pool,
|
|
9851
|
+
L[z] > 0 && na(D.pool, N[z]);
|
|
9847
9852
|
});
|
|
9848
9853
|
for (const { c: D, wps: z } of T) {
|
|
9849
9854
|
const j = D.waypoints ?? [];
|
|
@@ -9859,7 +9864,7 @@ function qA(e, t) {
|
|
|
9859
9864
|
}
|
|
9860
9865
|
};
|
|
9861
9866
|
}, Mp = (x) => {
|
|
9862
|
-
var
|
|
9867
|
+
var N, T;
|
|
9863
9868
|
const _ = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
|
|
9864
9869
|
for (const B of r.getAll()) {
|
|
9865
9870
|
if (B.type !== "bpmn:Participant") continue;
|
|
@@ -9868,7 +9873,7 @@ function qA(e, t) {
|
|
|
9868
9873
|
}
|
|
9869
9874
|
for (const B of r.getAll()) {
|
|
9870
9875
|
if (B.type !== "bpmn:MessageFlow") continue;
|
|
9871
|
-
const L = B, D = (
|
|
9876
|
+
const L = B, D = (N = L.source) == null ? void 0 : N.id, z = (T = L.target) == null ? void 0 : T.id;
|
|
9872
9877
|
D && z && S.has(D) && S.get(D).push(z), D && z && S.has(z) && S.get(z).push(D);
|
|
9873
9878
|
}
|
|
9874
9879
|
const O = [];
|
|
@@ -9879,9 +9884,9 @@ function qA(e, t) {
|
|
|
9879
9884
|
if (!x.length) return null;
|
|
9880
9885
|
const S = new Set(x.map((j) => j.id)), O = r.getAll().filter(
|
|
9881
9886
|
(j) => j.type === "bpmn:Participant" && !S.has(j.id)
|
|
9882
|
-
),
|
|
9887
|
+
), N = Math.min(
|
|
9883
9888
|
...O.filter((j) => (j.children ?? []).length > 0).map((j) => j.x)
|
|
9884
|
-
), T = new Set(x.filter((j) => Math.abs(j.x -
|
|
9889
|
+
), T = new Set(x.filter((j) => Math.abs(j.x - N) <= 2).map((j) => j.id));
|
|
9885
9890
|
if (x.some((j) => {
|
|
9886
9891
|
const X = T.has(j.id) ? j.x : j.x + _, ne = T.has(j.id) ? j.width + _ : j.width;
|
|
9887
9892
|
return O.some(
|
|
@@ -9908,34 +9913,34 @@ function qA(e, t) {
|
|
|
9908
9913
|
}
|
|
9909
9914
|
};
|
|
9910
9915
|
}, Bg = (x, _, S) => {
|
|
9911
|
-
const O = S.x + S.width / 2,
|
|
9916
|
+
const O = S.x + S.width / 2, N = _.y > S.y, T = N ? S.y + S.height : S.y, B = N ? _.y : _.y + _.height, L = x.source === _ ? [{ x: O, y: B }, { x: O, y: T }] : [{ x: O, y: T }, { x: O, y: B }], D = We(r), z = { ...D.edges.find((j) => j.id === x.id), waypoints: L };
|
|
9912
9917
|
return Ht(z, Un(D)).length ? !1 : (n.updateWaypoints(x, L), !0);
|
|
9913
9918
|
}, eS = () => {
|
|
9914
9919
|
const x = r.filter((B) => B.type === "bpmn:Participant"), _ = Math.min(...x.filter((B) => (B.children ?? []).length > 0).map((B) => B.x)), S = (B) => m.some((L) => L.participant.id === B.id), O = (B) => !!B && B.type === "bpmn:Participant" && !(B.children ?? []).length && Math.abs(B.x - _) <= 2 && // B-130 과 같은 판별자 — 폭이 아니라 좌변 관계
|
|
9915
|
-
!S(B),
|
|
9920
|
+
!S(B), N = (B) => !!B && B.type === "bpmn:Participant" && (B.children ?? []).length > 0 && !S(B), T = /* @__PURE__ */ new Set();
|
|
9916
9921
|
for (const B of r.getAll()) {
|
|
9917
9922
|
if (B.type !== "bpmn:MessageFlow") continue;
|
|
9918
9923
|
const L = B;
|
|
9919
9924
|
if ((L.waypoints ?? []).length !== 2) continue;
|
|
9920
|
-
const D = [L.source, L.target].find((X) => O(X) ||
|
|
9925
|
+
const D = [L.source, L.target].find((X) => O(X) || N(X)), z = D === L.source ? L.target : L.source;
|
|
9921
9926
|
if (!D || !z || z.type === "bpmn:Participant") continue;
|
|
9922
9927
|
const j = z.x + z.width / 2;
|
|
9923
|
-
|
|
9928
|
+
N(D) && (j < D.x || j > D.x + D.width) || T.add(L.id);
|
|
9924
9929
|
}
|
|
9925
9930
|
return T;
|
|
9926
9931
|
}, tS = (x) => {
|
|
9927
9932
|
var S;
|
|
9928
9933
|
const _ = /* @__PURE__ */ new Map();
|
|
9929
9934
|
for (const O of x) {
|
|
9930
|
-
const
|
|
9931
|
-
if (!
|
|
9932
|
-
const T = ((S =
|
|
9935
|
+
const N = r.get(O);
|
|
9936
|
+
if (!N || (N.waypoints ?? []).length === 2) continue;
|
|
9937
|
+
const T = ((S = N.source) == null ? void 0 : S.type) === "bpmn:Participant" ? N.source : N.target, B = T === N.source ? N.target : N.source;
|
|
9933
9938
|
if (B.x + B.width / 2 <= T.x + T.width) continue;
|
|
9934
9939
|
const L = _.get(T.id) ?? { pool: T, msgs: [] };
|
|
9935
|
-
L.msgs.push({ conn:
|
|
9940
|
+
L.msgs.push({ conn: N, other: B }), _.set(T.id, L);
|
|
9936
9941
|
}
|
|
9937
|
-
for (const { pool: O, msgs:
|
|
9938
|
-
const T = Math.max(...
|
|
9942
|
+
for (const { pool: O, msgs: N } of _.values()) {
|
|
9943
|
+
const T = Math.max(...N.map(({ other: ae }) => ae.x + ae.width / 2)) + Wp;
|
|
9939
9944
|
if (r.getAll().some((ae) => {
|
|
9940
9945
|
if (ae.type !== "bpmn:Participant" || ae.id === O.id) return !1;
|
|
9941
9946
|
const oe = ae;
|
|
@@ -9946,18 +9951,18 @@ function qA(e, t) {
|
|
|
9946
9951
|
return oe ? [{ label: oe, x: oe.x, y: oe.y }] : [];
|
|
9947
9952
|
}), X = $o();
|
|
9948
9953
|
na(O, T - O.x);
|
|
9949
|
-
const ne =
|
|
9954
|
+
const ne = N.filter(({ conn: ae, other: oe }) => Bg(ae, O, oe)).length, ce = $o();
|
|
9950
9955
|
if (!(ne > 0 && ce.messages > X.messages && ce.lines >= X.lines)) {
|
|
9951
9956
|
na(O, L.width);
|
|
9952
9957
|
for (const { c: ae, wps: oe } of z) {
|
|
9953
|
-
const
|
|
9954
|
-
|
|
9958
|
+
const ye = ae.waypoints ?? [];
|
|
9959
|
+
ye.length === oe.length && ye.every((te, Z) => Math.abs(te.x - oe[Z].x) <= 0.5 && Math.abs(te.y - oe[Z].y) <= 0.5) || n.updateWaypoints(ae, oe.map((te) => ({ x: te.x, y: te.y })));
|
|
9955
9960
|
}
|
|
9956
9961
|
for (let ae = 0; ae < 3; ae++) {
|
|
9957
9962
|
let oe = 0;
|
|
9958
|
-
for (const
|
|
9959
|
-
const
|
|
9960
|
-
Math.abs(
|
|
9963
|
+
for (const ye of j) {
|
|
9964
|
+
const ge = ye.x - ye.label.x, te = ye.y - ye.label.y;
|
|
9965
|
+
Math.abs(ge) <= 0.5 && Math.abs(te) <= 0.5 || (n.moveElements([ye.label], { x: ge, y: te }), oe++);
|
|
9961
9966
|
}
|
|
9962
9967
|
if (!oe) break;
|
|
9963
9968
|
}
|
|
@@ -10001,8 +10006,8 @@ function qA(e, t) {
|
|
|
10001
10006
|
const _ = (x.children ?? []).filter(bi);
|
|
10002
10007
|
let S = 0;
|
|
10003
10008
|
for (let O = 0; O < _.length; O++)
|
|
10004
|
-
for (let
|
|
10005
|
-
const T = _[O], B = _[
|
|
10009
|
+
for (let N = O + 1; N < _.length; N++) {
|
|
10010
|
+
const T = _[O], B = _[N];
|
|
10006
10011
|
T.x < B.x + B.width && T.x + T.width > B.x && T.y < B.y + B.height && T.y + T.height > B.y && S++;
|
|
10007
10012
|
}
|
|
10008
10013
|
return S;
|
|
@@ -10016,9 +10021,9 @@ function qA(e, t) {
|
|
|
10016
10021
|
const _ = /* @__PURE__ */ new Map();
|
|
10017
10022
|
for (const O of r.getAll()) {
|
|
10018
10023
|
if (O.type !== "bpmn:MessageFlow") continue;
|
|
10019
|
-
const
|
|
10020
|
-
if (!
|
|
10021
|
-
const T =
|
|
10024
|
+
const N = O;
|
|
10025
|
+
if (!N.waypoints || N.waypoints.length !== 2) continue;
|
|
10026
|
+
const T = N.source, B = N.target;
|
|
10022
10027
|
if (!T || !B) continue;
|
|
10023
10028
|
const L = x.has(T.id);
|
|
10024
10029
|
if (L === x.has(B.id)) continue;
|
|
@@ -10028,9 +10033,9 @@ function qA(e, t) {
|
|
|
10028
10033
|
j ? D.x < j.minX && (j.minX = D.x) : _.set(z.id, { pool: z, minX: D.x });
|
|
10029
10034
|
}
|
|
10030
10035
|
const S = [];
|
|
10031
|
-
for (const { pool: O, minX:
|
|
10036
|
+
for (const { pool: O, minX: N } of _.values()) {
|
|
10032
10037
|
const T = (O.children ?? []).filter(
|
|
10033
|
-
(B) => bi(B) && !x.has(B.id) && B.x >=
|
|
10038
|
+
(B) => bi(B) && !x.has(B.id) && B.x >= N
|
|
10034
10039
|
);
|
|
10035
10040
|
T.length && S.push({ subtree: T, pool: O });
|
|
10036
10041
|
}
|
|
@@ -10038,16 +10043,16 @@ function qA(e, t) {
|
|
|
10038
10043
|
}, iS = (x, _, S) => {
|
|
10039
10044
|
const O = new Map(
|
|
10040
10045
|
_.map((B) => [B.pool.id, { subtree: [...B.subtree], pool: B.pool }])
|
|
10041
|
-
),
|
|
10042
|
-
for (const B of _) for (const L of B.subtree)
|
|
10046
|
+
), N = new Set(x);
|
|
10047
|
+
for (const B of _) for (const L of B.subtree) N.add(L.id);
|
|
10043
10048
|
let T = !1;
|
|
10044
10049
|
for (; ; ) {
|
|
10045
10050
|
let B = 0;
|
|
10046
|
-
for (const L of zg(
|
|
10051
|
+
for (const L of zg(N)) {
|
|
10047
10052
|
if (L.pool === S) continue;
|
|
10048
10053
|
const D = O.get(L.pool.id);
|
|
10049
10054
|
D ? D.subtree.push(...L.subtree) : O.set(L.pool.id, { subtree: [...L.subtree], pool: L.pool });
|
|
10050
|
-
for (const z of L.subtree)
|
|
10055
|
+
for (const z of L.subtree) N.add(z.id);
|
|
10051
10056
|
B += L.subtree.length;
|
|
10052
10057
|
}
|
|
10053
10058
|
if (!B) break;
|
|
@@ -10056,9 +10061,9 @@ function qA(e, t) {
|
|
|
10056
10061
|
return T ? [...O.values()] : null;
|
|
10057
10062
|
}, oS = (x, _) => {
|
|
10058
10063
|
const S = /* @__PURE__ */ new Map();
|
|
10059
|
-
for (const
|
|
10060
|
-
if (
|
|
10061
|
-
const T =
|
|
10064
|
+
for (const N of r.getAll()) {
|
|
10065
|
+
if (N.type !== "bpmn:DataInputAssociation" && N.type !== "bpmn:DataOutputAssociation") continue;
|
|
10066
|
+
const T = N, B = T.waypoints;
|
|
10062
10067
|
if (!B || B.length < 2 || !B.every((ce) => Math.abs(ce.x - B[0].x) < 1)) continue;
|
|
10063
10068
|
const L = T.source, D = T.target;
|
|
10064
10069
|
if (!L || !D) continue;
|
|
@@ -10070,18 +10075,18 @@ function qA(e, t) {
|
|
|
10070
10075
|
ne ? j.x < ne.minX && (ne.minX = j.x) : S.set(X.id, { pool: X, minX: j.x });
|
|
10071
10076
|
}
|
|
10072
10077
|
const O = [];
|
|
10073
|
-
for (const { pool:
|
|
10074
|
-
const B = (
|
|
10078
|
+
for (const { pool: N, minX: T } of S.values()) {
|
|
10079
|
+
const B = (N.children ?? []).filter(
|
|
10075
10080
|
(L) => bi(L) && !x.has(L.id) && L.x >= T
|
|
10076
10081
|
);
|
|
10077
|
-
B.length && O.push({ subtree: B, pool:
|
|
10082
|
+
B.length && O.push({ subtree: B, pool: N });
|
|
10078
10083
|
}
|
|
10079
10084
|
return O;
|
|
10080
10085
|
}, Gg = (x) => {
|
|
10081
|
-
const _ = We(r), S = _.shapes.filter((
|
|
10082
|
-
for (const
|
|
10083
|
-
if (!(
|
|
10084
|
-
for (const T of Ht(
|
|
10086
|
+
const _ = We(r), S = _.shapes.filter((N) => x.has(N.id)), O = /* @__PURE__ */ new Set();
|
|
10087
|
+
for (const N of _.edges)
|
|
10088
|
+
if (!(N.type !== "bpmn:SequenceFlow" && N.type !== "bpmn:MessageFlow"))
|
|
10089
|
+
for (const T of Ht(N, S)) O.add(`${N.id}|${T.id}`);
|
|
10085
10090
|
return O;
|
|
10086
10091
|
}, Ap = /* @__PURE__ */ new Map(), rS = Bt(e, "sequenceFlow.update").flatMap(
|
|
10087
10092
|
(x) => {
|
|
@@ -10096,16 +10101,16 @@ function qA(e, t) {
|
|
|
10096
10101
|
if (!_) continue;
|
|
10097
10102
|
const S = f(x.target), O = f(x.id);
|
|
10098
10103
|
if (!S || !O) continue;
|
|
10099
|
-
const
|
|
10100
|
-
if (!
|
|
10101
|
-
const B = Dg.get(O.id) ?? { waypoints: O.waypoints, label: O.label }, L = B.waypoints && B.waypoints.length >= 3 && Math.abs(B.waypoints[0].x - B.waypoints[1].x) < 1 && Math.abs(B.waypoints[0].y - B.waypoints[1].y) > 1 ? { x: B.waypoints[0].x, y: B.waypoints[0].y } : void 0, D = L ? B.waypoints[1].y : void 0, z = L && B.label ? { x: B.label.x, y: B.label.y } : void 0, j = z && B.label && Math.abs(z.y + B.label.height / 2 - D) <=
|
|
10104
|
+
const N = x.source !== void 0 ? f(x.source) : O.source, T = O.target;
|
|
10105
|
+
if (!N || !T || T.id === S.id) continue;
|
|
10106
|
+
const B = Dg.get(O.id) ?? { waypoints: O.waypoints, label: O.label }, L = B.waypoints && B.waypoints.length >= 3 && Math.abs(B.waypoints[0].x - B.waypoints[1].x) < 1 && Math.abs(B.waypoints[0].y - B.waypoints[1].y) > 1 ? { x: B.waypoints[0].x, y: B.waypoints[0].y } : void 0, D = L ? B.waypoints[1].y : void 0, z = L && B.label ? { x: B.label.x, y: B.label.y } : void 0, j = z && B.label && Math.abs(z.y + B.label.height / 2 - D) <= me / 5 && z.x + B.label.width > L.x ? z.x + B.label.width + 6 : void 0, X = (N.outgoing ?? []).filter(
|
|
10102
10107
|
(Oe) => Oe.type === "bpmn:SequenceFlow" && Oe.id !== O.id && Oe.target && !is.has(Oe.id)
|
|
10103
10108
|
), ne = new Set(X.map((Oe) => Oe.target.id)), ce = (Oe) => {
|
|
10104
10109
|
const St = { type: "bpmn:Task", x: Oe.x + 2, y: Oe.y + 2, width: Oe.width - 4, height: Oe.height - 4 };
|
|
10105
10110
|
return X.find(
|
|
10106
10111
|
(ht) => (ht.waypoints ?? []).some((Wt, $e) => !!ht.waypoints[$e + 1] && la(Wt, ht.waypoints[$e + 1], St) === 0)
|
|
10107
10112
|
);
|
|
10108
|
-
}, ae = Bo(x.target), oe = new Set(ae.map((Oe) => Oe.id)),
|
|
10113
|
+
}, ae = Bo(x.target), oe = new Set(ae.map((Oe) => Oe.id)), ye = Et.has(x.target) ? { autoResize: !1 } : void 0, ge = Math.min(...ae.map((Oe) => Oe.x)), te = Math.max(...ae.map((Oe) => Oe.x + Oe.width)), Z = N.x + N.width, re = T.x + T.width <= N.x, J = (() => {
|
|
10109
10114
|
if (!re) return;
|
|
10110
10115
|
const Oe = g(S), St = ((Oe == null ? void 0 : Oe.children) ?? []).filter(
|
|
10111
10116
|
(He) => bi(He) && !oe.has(He.id) && He.type !== "bpmn:Group" && He.type !== "bpmn:Participant"
|
|
@@ -10123,19 +10128,19 @@ function qA(e, t) {
|
|
|
10123
10128
|
if (la(Vn.waypoints[qi], Vn.waypoints[qi + 1], bt) < vi) return !1;
|
|
10124
10129
|
return !0;
|
|
10125
10130
|
});
|
|
10126
|
-
}), Ue =
|
|
10131
|
+
}), Ue = N.x + N.width / 2, dt = N.y + N.height / 2, tt = B.waypoints ?? [], Ct = tt.length >= 2 && Math.abs(tt[0].y - tt[1].y) < 1 && tt[1].x < tt[0].x;
|
|
10127
10132
|
return [
|
|
10128
10133
|
...D !== void 0 ? [{ cx: Ue, cy: D }] : [],
|
|
10129
|
-
...Ct ? [{ cx:
|
|
10130
|
-
{ cx: Ue, cy: dt +
|
|
10131
|
-
{ cx: Ue, cy: dt -
|
|
10134
|
+
...Ct ? [{ cx: N.x - No - S.width / 2, cy: tt[0].y }] : [],
|
|
10135
|
+
{ cx: Ue, cy: dt + me },
|
|
10136
|
+
{ cx: Ue, cy: dt - me }
|
|
10132
10137
|
].find((He) => $e(He.cx - (S.x + S.width / 2), He.cy - (S.y + S.height / 2)));
|
|
10133
|
-
})(),
|
|
10138
|
+
})(), fe = re && !J ? Z : T.x, Ne = (() => {
|
|
10134
10139
|
var dt;
|
|
10135
10140
|
if (L || re) return 0;
|
|
10136
10141
|
const Oe = B.label, St = ((dt = O.businessObject) == null ? void 0 : dt.name) ?? "";
|
|
10137
10142
|
if (!Oe || Oe.width == null || !St.trim()) return 0;
|
|
10138
|
-
const ht = Z + No, Wt =
|
|
10143
|
+
const ht = Z + No, Wt = N.y + N.height / 2 - S.height / 2;
|
|
10139
10144
|
if (Math.min(Oe.y + Oe.height, Wt + S.height) - Math.max(Oe.y, Wt) < 3 || Oe.x + Oe.width - ht < 3) return 0;
|
|
10140
10145
|
const Ue = Oe.x + Oe.width + Z1 - ht;
|
|
10141
10146
|
return Ue <= S.width ? Ue : 0;
|
|
@@ -10143,25 +10148,25 @@ function qA(e, t) {
|
|
|
10143
10148
|
Ne > 0 && u.add(O.id);
|
|
10144
10149
|
const ke = S.y + S.height / 2, qe = J1(
|
|
10145
10150
|
ae,
|
|
10146
|
-
Z + No + Ne -
|
|
10147
|
-
[0,
|
|
10148
|
-
|
|
10151
|
+
Z + No + Ne - ge,
|
|
10152
|
+
[0, N.y + N.height / 2 - ke, T.y + T.height / 2 - ke],
|
|
10153
|
+
fe,
|
|
10149
10154
|
Z,
|
|
10150
|
-
|
|
10155
|
+
N.y + N.height / 2
|
|
10151
10156
|
), Ce = Z + No + Ne + qe, Me = (() => {
|
|
10152
10157
|
if (j === void 0) return 0;
|
|
10153
|
-
const Oe = Z + No, St =
|
|
10158
|
+
const Oe = Z + No, St = N.y + N.height / 2 - S.height / 2, ht = { x: Oe, y: St, width: te - ge, height: S.height }, Wt = g(N);
|
|
10154
10159
|
return ((Wt == null ? void 0 : Wt.children) ?? []).some(
|
|
10155
|
-
(Ue) => bi(Ue) && !oe.has(Ue.id) && Ue.id !==
|
|
10160
|
+
(Ue) => bi(Ue) && !oe.has(Ue.id) && Ue.id !== N.id && Ue.id !== T.id && Ue.type !== "bpmn:Group" && Ue.type !== "bpmn:Participant" && Ue.x < ht.x + ht.width && Ue.x + Ue.width > ht.x && Ue.y < ht.y + ht.height && Ue.y + Ue.height > ht.y
|
|
10156
10161
|
) || ce(ht) ? Math.max(0, j - Oe) : 0;
|
|
10157
|
-
})(), Se = J ? 0 : te -
|
|
10162
|
+
})(), Se = J ? 0 : te - ge + No * 2 + qe + Me + Ne - (re ? 0 : T.x - Z);
|
|
10158
10163
|
let Ae = [];
|
|
10159
10164
|
if (Se > 0) {
|
|
10160
10165
|
const Oe = g(S), St = (Oe == null ? void 0 : Oe.children) ?? [], ht = (tt) => tt.type === "bpmn:Lane";
|
|
10161
10166
|
Ae = (() => {
|
|
10162
10167
|
const tt = /* @__PURE__ */ new Set();
|
|
10163
10168
|
for (const ze of St)
|
|
10164
|
-
bi(ze) && !oe.has(ze.id) && ze.id !==
|
|
10169
|
+
bi(ze) && !oe.has(ze.id) && ze.id !== N.id && ze.x >= fe && tt.add(ze.id);
|
|
10165
10170
|
const Ct = [];
|
|
10166
10171
|
for (const ze of St) {
|
|
10167
10172
|
if (ze.type !== "bpmn:DataStoreReference" && ze.type !== "bpmn:DataObjectReference") continue;
|
|
@@ -10171,7 +10176,7 @@ function qA(e, t) {
|
|
|
10171
10176
|
return Ct;
|
|
10172
10177
|
})();
|
|
10173
10178
|
const $e = St.filter(
|
|
10174
|
-
(tt) => !("waypoints" in tt && tt.waypoints) && !ht(tt) && tt.type !== "label" && !oe.has(tt.id) && tt.id !==
|
|
10179
|
+
(tt) => !("waypoints" in tt && tt.waypoints) && !ht(tt) && tt.type !== "label" && !oe.has(tt.id) && tt.id !== N.id && tt.x >= fe
|
|
10175
10180
|
), Ue = $e.flatMap((tt) => tt.labels ?? []), dt = Oe ? [Oe, ...St.filter((tt) => ht(tt))] : [];
|
|
10176
10181
|
if ($e.length) {
|
|
10177
10182
|
const tt = new Set($e.map((it) => it.id)), Ct = zg(tt), ze = Ct.length ? iS(tt, Ct, Oe) : null, He = (it) => {
|
|
@@ -10193,7 +10198,7 @@ function qA(e, t) {
|
|
|
10193
10198
|
const wt = it.labelTarget;
|
|
10194
10199
|
return it.type === "label" && !!wt && "waypoints" in wt && !!wt.source && !!wt.target && Fi.has(wt.source.id) && Fi.has(wt.target.id);
|
|
10195
10200
|
}), bn = eS();
|
|
10196
|
-
n.createSpace([...$e, ...Ue, ...yt], dt, { x: Se, y: 0 }, "e",
|
|
10201
|
+
n.createSpace([...$e, ...Ue, ...yt], dt, { x: Se, y: 0 }, "e", fe - 1);
|
|
10197
10202
|
const Ut = (it, wt, Lt) => {
|
|
10198
10203
|
const mo = $o(), Bc = Lt ? Gg(Lt) : null, $c = ia(it, Se, !!Lt);
|
|
10199
10204
|
if (!$c) return !1;
|
|
@@ -10247,12 +10252,12 @@ function qA(e, t) {
|
|
|
10247
10252
|
if (!ue) return !0;
|
|
10248
10253
|
const St = Oe.y + Oe.height / 2;
|
|
10249
10254
|
return St >= ue.y && St <= ue.y + ue.height;
|
|
10250
|
-
}, Pe = !Re(
|
|
10251
|
-
const Oe =
|
|
10255
|
+
}, Pe = !Re(N) && Re(T), Be = (Oe) => Oe.y + Oe.height / 2, xt = () => {
|
|
10256
|
+
const Oe = N.x + N.width, St = T.x, ht = Be(T) - S.height / 2, Wt = Be(T) + S.height / 2;
|
|
10252
10257
|
return !r.getAll().some(
|
|
10253
|
-
($e) => bi($e) && $e.type !== "bpmn:Participant" && $e.type !== "bpmn:Group" && $e.type !== "bpmn:TextAnnotation" && $e.id !==
|
|
10258
|
+
($e) => bi($e) && $e.type !== "bpmn:Participant" && $e.type !== "bpmn:Group" && $e.type !== "bpmn:TextAnnotation" && $e.id !== N.id && $e.id !== T.id && $e.id !== S.id && $e.x < St && $e.x + $e.width > Oe && $e.y < Wt && $e.y + $e.height > ht
|
|
10254
10259
|
);
|
|
10255
|
-
}, tn = !Pe && _.band !== void 0 && Re(T) && !fn(_.node.lane, _.node.participant, _.band, Be(
|
|
10260
|
+
}, tn = !Pe && _.band !== void 0 && Re(T) && !fn(_.node.lane, _.node.participant, _.band, Be(N)) && fn(_.node.lane, _.node.participant, _.band, Be(T)) && T.x >= N.x + N.width && xt(), Gt = Pe || tn ? T : N, Vt = Gt.y + Gt.height / 2, Cn = Vt - (S.y + S.height / 2), dn = _.band !== void 0, Nc = dn ? [S] : ae, Np = (
|
|
10256
10261
|
// ── B-89. 삽입도 같은 축이다 — band 가 **상류 행의 슬롯**을 가리키면 승계한다 ──
|
|
10257
10262
|
// 🔁 「add/update 경로 갈림」의 동형이라 `freeSpot` 과 **같은 술어**를 쓴다(한쪽만 넓히면 구멍).
|
|
10258
10263
|
(_.band === void 0 || fn(_.node.lane, _.node.participant, _.band, Vt)) && ei(x.target) && Nc.every(
|
|
@@ -10261,15 +10266,15 @@ function qA(e, t) {
|
|
|
10261
10266
|
return Pc((St = P.get(Oe.id)) == null ? void 0 : St.node.lane, Oe, Oe.y + Oe.height / 2 + Cn);
|
|
10262
10267
|
}
|
|
10263
10268
|
)
|
|
10264
|
-
), PS = (Oe) => Math.abs(Oe.y + Oe.height / 2 - (S.y + S.height / 2)) <=
|
|
10269
|
+
), PS = (Oe) => Math.abs(Oe.y + Oe.height / 2 - (S.y + S.height / 2)) <= me / 2;
|
|
10265
10270
|
if (Np && dn) {
|
|
10266
|
-
const Oe = Math.abs(Cn) <=
|
|
10271
|
+
const Oe = Math.abs(Cn) <= me / 2 ? ae.filter(($e) => $e.id !== S.id && PS($e)) : [], St = S.y + S.height / 2, Wt = _.band !== void 0 && !fn(_.node.lane, _.node.participant, _.band, St) ? ae.filter(
|
|
10267
10272
|
($e) => {
|
|
10268
10273
|
var Ue, dt;
|
|
10269
|
-
return $e.id !== S.id && !Oe.includes($e) && ((Ue = P.get($e.id)) == null ? void 0 : Ue.band) === _.band && ((dt = P.get($e.id)) == null ? void 0 : dt.node.lane) === _.node.lane && (Math.abs($e.y + $e.height / 2 - St) <=
|
|
10274
|
+
return $e.id !== S.id && !Oe.includes($e) && ((Ue = P.get($e.id)) == null ? void 0 : Ue.band) === _.band && ((dt = P.get($e.id)) == null ? void 0 : dt.node.lane) === _.node.lane && (Math.abs($e.y + $e.height / 2 - St) <= me / 2 || fn(_.node.lane, _.node.participant, _.band, $e.y + $e.height / 2));
|
|
10270
10275
|
}
|
|
10271
10276
|
).map(($e) => ({ t: $e, dy: Vt - ($e.y + $e.height / 2) })).filter(({ dy: $e }) => $e !== 0) : [];
|
|
10272
|
-
if (n.moveElements(ae, { x: Ce -
|
|
10277
|
+
if (n.moveElements(ae, { x: Ce - ge, y: 0 }, void 0, ye), n.moveElements([S], { x: 0, y: Cn }, void 0, ye), Oe.length) {
|
|
10273
10278
|
const $e = () => new Set(pt(We(r)).map((He) => ft(He))), Ue = $e(), dt = r.filter((He) => He.type === "label").map((He) => ({
|
|
10274
10279
|
label: He,
|
|
10275
10280
|
x: He.x,
|
|
@@ -10294,23 +10299,23 @@ function qA(e, t) {
|
|
|
10294
10299
|
n.moveElements(
|
|
10295
10300
|
ae,
|
|
10296
10301
|
{
|
|
10297
|
-
x: Ce -
|
|
10302
|
+
x: Ce - ge,
|
|
10298
10303
|
y: Np ? Cn : 0
|
|
10299
10304
|
},
|
|
10300
10305
|
void 0,
|
|
10301
|
-
|
|
10306
|
+
ye
|
|
10302
10307
|
);
|
|
10303
10308
|
const $i = g(S);
|
|
10304
10309
|
if (!Np && _.node.lane === void 0 && _.band !== void 0 && $i) {
|
|
10305
|
-
const Oe = $i.y + U + Nt(`pool:${_.node.participant ?? ""}`, _.band) *
|
|
10306
|
-
St !== 0 && !C($i, S, S.x + S.width / 2, Oe, oe) && n.moveElements([S], { x: 0, y: St }, void 0,
|
|
10310
|
+
const Oe = $i.y + U + Nt(`pool:${_.node.participant ?? ""}`, _.band) * me, St = Oe - (S.y + S.height / 2);
|
|
10311
|
+
St !== 0 && !C($i, S, S.x + S.width / 2, Oe, oe) && n.moveElements([S], { x: 0, y: St }, void 0, ye);
|
|
10307
10312
|
}
|
|
10308
10313
|
if (J)
|
|
10309
10314
|
n.moveElements(
|
|
10310
10315
|
ae,
|
|
10311
10316
|
{ x: J.cx - (S.x + S.width / 2), y: J.cy - (S.y + S.height / 2) },
|
|
10312
10317
|
void 0,
|
|
10313
|
-
|
|
10318
|
+
ye
|
|
10314
10319
|
);
|
|
10315
10320
|
else if ($i) {
|
|
10316
10321
|
const Oe = ($i.children ?? []).filter(
|
|
@@ -10359,10 +10364,10 @@ function qA(e, t) {
|
|
|
10359
10364
|
x: it.x,
|
|
10360
10365
|
y: it.y
|
|
10361
10366
|
}));
|
|
10362
|
-
n.moveElements(ae, { x: Fi.dx, y: Fi.dy }, void 0,
|
|
10367
|
+
n.moveElements(ae, { x: Fi.dx, y: Fi.dy }, void 0, ye);
|
|
10363
10368
|
const Ar = bn(), Yi = [...Ar].filter((it) => !Ut.has(it)).length, ca = [...Ut].filter((it) => !Ar.has(it)).length;
|
|
10364
10369
|
if (Yi > ca) {
|
|
10365
|
-
n.moveElements(ae, { x: -Fi.dx, y: -Fi.dy }, void 0,
|
|
10370
|
+
n.moveElements(ae, { x: -Fi.dx, y: -Fi.dy }, void 0, ye);
|
|
10366
10371
|
for (const it of ti) {
|
|
10367
10372
|
const wt = it.x - it.label.x, Lt = it.y - it.label.y;
|
|
10368
10373
|
(wt !== 0 || Lt !== 0) && n.moveElements([it.label], { x: wt, y: Lt });
|
|
@@ -10420,16 +10425,16 @@ function qA(e, t) {
|
|
|
10420
10425
|
for (const [x, _] of Et) {
|
|
10421
10426
|
const S = f(x);
|
|
10422
10427
|
if (!S) continue;
|
|
10423
|
-
const O = _.container,
|
|
10424
|
-
if (
|
|
10428
|
+
const O = _.container, N = Math.abs(S.y + S.height / 2 - O.y - _.relCy) >= 0.5, T = S.label, B = Math.min(S.y, T && !T.hidden ? T.y : S.y), L = Math.max(S.y + S.height, T && !T.hidden ? T.y + T.height : 0);
|
|
10429
|
+
if (N && B >= O.y && L <= O.y + O.height) continue;
|
|
10425
10430
|
const D = S.y;
|
|
10426
10431
|
_.grow(), S.y !== D && n.moveElements([S], { x: 0, y: D - S.y }, void 0, { autoResize: !1 });
|
|
10427
10432
|
}
|
|
10428
10433
|
const Vg = (x, _) => {
|
|
10429
|
-
const S = _.target === x, O = d(_.source),
|
|
10434
|
+
const S = _.target === x, O = d(_.source), N = d(_.target), T = S ? "bpmn:DataOutputAssociation" : "bpmn:DataInputAssociation";
|
|
10430
10435
|
n.connect(
|
|
10431
10436
|
O,
|
|
10432
|
-
|
|
10437
|
+
N,
|
|
10433
10438
|
_.id ? { type: T, businessObject: i.create(T, { id: _.id }) } : { type: T }
|
|
10434
10439
|
);
|
|
10435
10440
|
}, Wg = (x) => {
|
|
@@ -10462,28 +10467,28 @@ function qA(e, t) {
|
|
|
10462
10467
|
(z) => L ? z.y + z.height <= T.y + 5 : z.y >= T.y + T.height - 5
|
|
10463
10468
|
);
|
|
10464
10469
|
if (D.length) {
|
|
10465
|
-
const z = [...D.reduce((re, J) => re.set(J.y, (re.get(J.y) ?? 0) + 1), /* @__PURE__ */ new Map())].sort((re, J) => J[1] - re[1] || (L ? J[0] - re[0] : re[0] - J[0]))[0][0], j = Math.min(S.width, zA), X = GA, ne = O.map((re) => re.x + re.width / 2), ce = Math.round(B(ne) - j / 2), ae = Math.max(...ne) + Wp, oe = (re) => ({ x: re, width: Math.max(j, ae - re) }),
|
|
10470
|
+
const z = [...D.reduce((re, J) => re.set(J.y, (re.get(J.y) ?? 0) + 1), /* @__PURE__ */ new Map())].sort((re, J) => J[1] - re[1] || (L ? J[0] - re[0] : re[0] - J[0]))[0][0], j = Math.min(S.width, zA), X = GA, ne = O.map((re) => re.x + re.width / 2), ce = Math.round(B(ne) - j / 2), ae = Math.max(...ne) + Wp, oe = (re) => ({ x: re, width: Math.max(j, ae - re) }), ye = D.filter((re) => Math.min(re.y + re.height, z + X) - Math.max(re.y, z) > 0), ge = (re) => {
|
|
10466
10471
|
const J = oe(re);
|
|
10467
|
-
return
|
|
10472
|
+
return ye.some((fe) => fe.x < J.x + J.width && J.x < fe.x + fe.width);
|
|
10468
10473
|
}, te = (re) => {
|
|
10469
10474
|
const J = oe(re);
|
|
10470
|
-
return ne.filter((
|
|
10475
|
+
return ne.filter((fe) => fe >= J.x + 10 && fe <= J.x + J.width - 10).length;
|
|
10471
10476
|
}, Z = (() => {
|
|
10472
|
-
if (!
|
|
10477
|
+
if (!ge(ce)) return ce;
|
|
10473
10478
|
const re = te(ce);
|
|
10474
|
-
return
|
|
10479
|
+
return ye.flatMap((J) => [J.x + J.width + hy, J.x - hy - j]).map((J) => Math.round(J)).filter((J) => !ge(J) && te(J) >= re).sort((J, fe) => Math.abs(J - ce) - Math.abs(fe - ce))[0] ?? ce;
|
|
10475
10480
|
})();
|
|
10476
10481
|
if (Z !== S.x || z !== S.y || j !== S.width || X !== S.height) {
|
|
10477
|
-
const re = () => new Set(pt(We(r)).map((Ce) => ft(Ce))), J = re(),
|
|
10482
|
+
const re = () => new Set(pt(We(r)).map((Ce) => ft(Ce))), J = re(), fe = { x: S.x, y: S.y, width: S.width, height: S.height };
|
|
10478
10483
|
n.resizeShape(S, { x: Z, y: z, width: j, height: X });
|
|
10479
10484
|
const Ne = re(), ke = [...Ne].filter((Ce) => !J.has(Ce)).length, qe = [...J].filter((Ce) => !Ne.has(Ce)).length;
|
|
10480
|
-
ke > qe && n.resizeShape(S,
|
|
10485
|
+
ke > qe && n.resizeShape(S, fe);
|
|
10481
10486
|
}
|
|
10482
10487
|
}
|
|
10483
10488
|
}
|
|
10484
10489
|
}
|
|
10485
|
-
const
|
|
10486
|
-
if (
|
|
10490
|
+
const N = Math.max(...O.map((T) => T.x + T.width / 2)) + Wp;
|
|
10491
|
+
if (N > S.x + S.width && n.resizeShape(S, { x: S.x, y: S.y, width: N - S.x, height: S.height }), !!x)
|
|
10487
10492
|
for (const T of v) {
|
|
10488
10493
|
const B = f(T.flow.id), L = T.flow.source === _.participant.id ? T.flow.target : T.flow.target === _.participant.id ? T.flow.source : void 0, D = L ? f(L) : void 0;
|
|
10489
10494
|
if (!B || !D || D.type === "bpmn:Participant") continue;
|
|
@@ -10505,9 +10510,9 @@ function qA(e, t) {
|
|
|
10505
10510
|
[...F.map((D) => D.flow.id), ...v.map((D) => D.flow.id)].filter(
|
|
10506
10511
|
(D) => !!D
|
|
10507
10512
|
)
|
|
10508
|
-
), O = r.filter((D) => !!D.waypoints),
|
|
10513
|
+
), O = r.filter((D) => !!D.waypoints), N = (D, z) => Math.abs(z.x - D.x) < 2 ? "L" : Math.abs(z.x - (D.x + D.width)) < 2 ? "R" : Math.abs(z.y - D.y) < 2 ? "T" : Math.abs(z.y - (D.y + D.height)) < 2 ? "B" : void 0, T = /* @__PURE__ */ new Map(), B = (D, z, j) => {
|
|
10509
10514
|
if (!D || !z || typeof D.x != "number") return;
|
|
10510
|
-
const X =
|
|
10515
|
+
const X = N(D, z);
|
|
10511
10516
|
if (!X) return;
|
|
10512
10517
|
let ne = T.get(D.id);
|
|
10513
10518
|
ne || T.set(D.id, ne = /* @__PURE__ */ new Map()), ne.set(X, [...ne.get(X) ?? [], j]);
|
|
@@ -10531,16 +10536,16 @@ function qA(e, t) {
|
|
|
10531
10536
|
const ce = g(j);
|
|
10532
10537
|
if (!ce || L.has(ce.id) || (ce.children ?? []).some((te) => te.type === "bpmn:Lane")) continue;
|
|
10533
10538
|
const ae = (gm = z.get("T")) != null && gm.length ? (mm = z.get("B")) != null && mm.length ? void 0 : "B" : "T";
|
|
10534
|
-
if (!ae || (ae === "T" ? j.y - ce.y : ce.y + ce.height - (j.y + j.height)) >=
|
|
10535
|
-
const
|
|
10539
|
+
if (!ae || (ae === "T" ? j.y - ce.y : ce.y + ce.height - (j.y + j.height)) >= me) continue;
|
|
10540
|
+
const ye = (ce.children ?? []).filter(
|
|
10536
10541
|
(te) => !("waypoints" in te && te.waypoints) && te.type !== "label" && typeof te.x == "number"
|
|
10537
|
-
),
|
|
10542
|
+
), ge = ce.y + ce.height;
|
|
10538
10543
|
n.resizeShape(ce, {
|
|
10539
10544
|
x: ce.x,
|
|
10540
10545
|
y: ce.y,
|
|
10541
10546
|
width: ce.width,
|
|
10542
|
-
height: ce.height +
|
|
10543
|
-
}), Xn(
|
|
10547
|
+
height: ce.height + me
|
|
10548
|
+
}), Xn(ge, ce.id, me), ae === "T" && ye.length && n.moveElements(ye, { x: 0, y: me }), L.add(ce.id);
|
|
10544
10549
|
}
|
|
10545
10550
|
}
|
|
10546
10551
|
const Pp = 20, Ug = 4, aS = 3, sS = 2, cS = 2, lS = [10, 30, 80], Er = () => {
|
|
@@ -10563,8 +10568,8 @@ function qA(e, t) {
|
|
|
10563
10568
|
return S ? Ht(S, Un(_)).length : 0;
|
|
10564
10569
|
}, os = (x) => Fo(x) > 0, oa = (x) => We(r).edges.filter(
|
|
10565
10570
|
(_) => _.type === "bpmn:MessageFlow" && _.id !== x && _.waypoints.length === 2
|
|
10566
|
-
).length, qg = (x, _, S) => ia([{ subtree: x, pool: _ }], S), Yg = (x, _) => _.bad > x.bad || _.crossings > x.crossings && _.straight <= x.straight && _.bad >= x.bad, ra = (x, _) => Yg(x, _) || _.straight < x.straight, jo = (x, _, S = () => !0, O = Yg,
|
|
10567
|
-
const T = Er(), B = ia(x, _,
|
|
10571
|
+
).length, qg = (x, _, S) => ia([{ subtree: x, pool: _ }], S), Yg = (x, _) => _.bad > x.bad || _.crossings > x.crossings && _.straight <= x.straight && _.bad >= x.bad, ra = (x, _) => Yg(x, _) || _.straight < x.straight, jo = (x, _, S = () => !0, O = Yg, N = !1) => {
|
|
10572
|
+
const T = Er(), B = ia(x, _, N);
|
|
10568
10573
|
if (!B) return !1;
|
|
10569
10574
|
const L = Er();
|
|
10570
10575
|
return O(T, L) || !S() ? (B(), !1) : !0;
|
|
@@ -10579,27 +10584,27 @@ function qA(e, t) {
|
|
|
10579
10584
|
}
|
|
10580
10585
|
const rs = [...aa.keys()], Tp = new Set(F.map((x) => x.flow.target)), Kg = (x) => Tc.findIndex(({ op: _ }) => _.participant.id === x);
|
|
10581
10586
|
rs.sort((x, _) => {
|
|
10582
|
-
var
|
|
10587
|
+
var N, T;
|
|
10583
10588
|
const S = Tp.has(x) ? 1 : 0, O = Tp.has(_) ? 1 : 0;
|
|
10584
|
-
return S !== O ? S - O : Kg((
|
|
10589
|
+
return S !== O ? S - O : Kg((N = P.get(x)) == null ? void 0 : N.node.participant) - Kg((T = P.get(_)) == null ? void 0 : T.node.participant);
|
|
10585
10590
|
});
|
|
10586
10591
|
const Ho = (x) => x.x + x.width / 2, pS = (x) => {
|
|
10587
10592
|
const _ = /* @__PURE__ */ new Map();
|
|
10588
|
-
for (const
|
|
10589
|
-
const T =
|
|
10593
|
+
for (const N of r.getAll()) {
|
|
10594
|
+
const T = N;
|
|
10590
10595
|
if (!T.waypoints || !T.source || !T.target) continue;
|
|
10591
10596
|
(_.get(T.source.id) ?? _.set(T.source.id, []).get(T.source.id)).push(T.target.id);
|
|
10592
10597
|
}
|
|
10593
10598
|
const S = /* @__PURE__ */ new Set([x]), O = [x];
|
|
10594
|
-
for (let
|
|
10595
|
-
for (const T of _.get(O[
|
|
10599
|
+
for (let N = 0; N < O.length; N++)
|
|
10600
|
+
for (const T of _.get(O[N]) ?? [])
|
|
10596
10601
|
S.has(T) || (S.add(T), O.push(T));
|
|
10597
10602
|
return S;
|
|
10598
10603
|
}, fS = (x, _) => {
|
|
10599
10604
|
const S = pS(_);
|
|
10600
10605
|
let O;
|
|
10601
|
-
for (const
|
|
10602
|
-
const T =
|
|
10606
|
+
for (const N of r.getAll()) {
|
|
10607
|
+
const T = N;
|
|
10603
10608
|
if (T.type !== "bpmn:MessageFlow" || !T.source || !T.target || T.target.id !== x || S.has(T.source.id)) continue;
|
|
10604
10609
|
const B = T.source;
|
|
10605
10610
|
if (typeof B.x != "number" || B.type === "bpmn:Participant") continue;
|
|
@@ -10624,7 +10629,7 @@ function qA(e, t) {
|
|
|
10624
10629
|
}, hS = (x) => {
|
|
10625
10630
|
const _ = dS(x);
|
|
10626
10631
|
return _ !== void 0 && Math.abs(_) < Pp;
|
|
10627
|
-
}, Dc = (x, _, S, O,
|
|
10632
|
+
}, Dc = (x, _, S, O, N) => {
|
|
10628
10633
|
var T;
|
|
10629
10634
|
for (let B = !0; B; ) {
|
|
10630
10635
|
B = !1;
|
|
@@ -10633,31 +10638,31 @@ function qA(e, t) {
|
|
|
10633
10638
|
const D = _.has(L.flow.source), z = _.has(L.flow.target);
|
|
10634
10639
|
if (D === z || O(D ? L.flow.source : L.flow.target)) continue;
|
|
10635
10640
|
const j = D ? L.flow.target : L.flow.source;
|
|
10636
|
-
if (
|
|
10641
|
+
if (N(j) || !Sr(j)) continue;
|
|
10637
10642
|
const X = f(L.flow.id);
|
|
10638
10643
|
if (!(X != null && X.waypoints) || X.waypoints.length !== 2) continue;
|
|
10639
10644
|
const ne = f(j), ce = (T = P.get(j)) == null ? void 0 : T.node.participant;
|
|
10640
10645
|
if (!ne || !ce) continue;
|
|
10641
10646
|
const ae = Bo(j, (oe) => oe.x >= ne.x).filter((oe) => !_.has(oe.id));
|
|
10642
|
-
if (!(!ae.length || ae.some((oe) =>
|
|
10647
|
+
if (!(!ae.length || ae.some((oe) => N(oe.id)))) {
|
|
10643
10648
|
for (const oe of ae) _.add(oe.id);
|
|
10644
10649
|
x.set(ce, [...x.get(ce) ?? [], ...ae]), B = !0;
|
|
10645
10650
|
}
|
|
10646
10651
|
}
|
|
10647
10652
|
}
|
|
10648
10653
|
return [...x].map(([B, L]) => ({ subtree: L, pool: d(B) }));
|
|
10649
|
-
}, Zg = (x, _, S, O,
|
|
10654
|
+
}, Zg = (x, _, S, O, N) => Dc(
|
|
10650
10655
|
/* @__PURE__ */ new Map([[_, [...x]]]),
|
|
10651
10656
|
new Set(x.map((T) => T.id)),
|
|
10652
10657
|
O,
|
|
10653
10658
|
(T) => T === S,
|
|
10654
|
-
(T) => T ===
|
|
10659
|
+
(T) => T === N
|
|
10655
10660
|
), Op = (x) => {
|
|
10656
10661
|
const _ = Xg(x);
|
|
10657
10662
|
if (!_) return null;
|
|
10658
|
-
const S = f(x), O = f(_.flow.source),
|
|
10659
|
-
if (!S || !O ||
|
|
10660
|
-
const T =
|
|
10663
|
+
const S = f(x), O = f(_.flow.source), N = kp(_, x);
|
|
10664
|
+
if (!S || !O || N === void 0) return null;
|
|
10665
|
+
const T = N - Ho(S);
|
|
10661
10666
|
if (T >= Pp) {
|
|
10662
10667
|
const B = P.get(x).node.participant, L = Bo(x, (D) => D.x >= S.x);
|
|
10663
10668
|
return { groups: Zg(L, B, x, _.flow.id, _.flow.source), dx: T };
|
|
@@ -10672,18 +10677,18 @@ function qA(e, t) {
|
|
|
10672
10677
|
).map((x) => x.id);
|
|
10673
10678
|
for (let x = 0; x < 3; x++) {
|
|
10674
10679
|
const _ = Er(), S = [];
|
|
10675
|
-
for (const
|
|
10676
|
-
const T = Op(
|
|
10680
|
+
for (const N of Jg()) {
|
|
10681
|
+
const T = Op(N);
|
|
10677
10682
|
if (!T) continue;
|
|
10678
10683
|
const B = ia(T.groups, T.dx);
|
|
10679
10684
|
B && S.push(B);
|
|
10680
10685
|
}
|
|
10681
10686
|
if (!S.length) break;
|
|
10682
10687
|
if (!ra(_, Er())) continue;
|
|
10683
|
-
for (const
|
|
10688
|
+
for (const N of S.reverse()) N();
|
|
10684
10689
|
let O = !1;
|
|
10685
|
-
for (const
|
|
10686
|
-
const T = Op(
|
|
10690
|
+
for (const N of Jg()) {
|
|
10691
|
+
const T = Op(N);
|
|
10687
10692
|
T && jo(T.groups, T.dx, () => !0, ra) && (O = !0);
|
|
10688
10693
|
}
|
|
10689
10694
|
if (!O) break;
|
|
@@ -10694,16 +10699,16 @@ function qA(e, t) {
|
|
|
10694
10699
|
if (!_ || _.node.lane !== void 0) continue;
|
|
10695
10700
|
const S = Te(_);
|
|
10696
10701
|
if (S === void 0) continue;
|
|
10697
|
-
const O = f(x),
|
|
10698
|
-
if (!O || !
|
|
10699
|
-
const T =
|
|
10700
|
-
B !== 0 && !C(
|
|
10702
|
+
const O = f(x), N = O ? g(O) : void 0;
|
|
10703
|
+
if (!O || !N) continue;
|
|
10704
|
+
const T = N.y + U + Nt(`pool:${_.node.participant ?? ""}`, S) * me, B = T - (O.y + O.height / 2);
|
|
10705
|
+
B !== 0 && !C(N, O, O.x + O.width / 2, T) && n.moveElements([O], { x: 0, y: B });
|
|
10701
10706
|
}
|
|
10702
10707
|
const Lc = () => {
|
|
10703
10708
|
const x = r.filter((O) => O.type === "bpmn:Participant"), _ = new Map(x.map((O) => [O.id, O]));
|
|
10704
10709
|
let S = 0;
|
|
10705
|
-
for (const { pools: [O,
|
|
10706
|
-
const T = _.get(O), B = _.get(
|
|
10710
|
+
for (const { pools: [O, N] } of Tw(x)) {
|
|
10711
|
+
const T = _.get(O), B = _.get(N);
|
|
10707
10712
|
S += (Math.min(T.x + T.width, B.x + B.width) - Math.max(T.x, B.x)) * (Math.min(T.y + T.height, B.y + B.height) - Math.max(T.y, B.y));
|
|
10708
10713
|
}
|
|
10709
10714
|
return S;
|
|
@@ -10714,10 +10719,10 @@ function qA(e, t) {
|
|
|
10714
10719
|
if (Dp.has(S.flow.id) || !os(S.flow.id)) continue;
|
|
10715
10720
|
const O = f(S.flow.target);
|
|
10716
10721
|
if (!O) continue;
|
|
10717
|
-
const
|
|
10722
|
+
const N = d(P.get(S.flow.target).node.participant), T = Bo(S.flow.target, (j) => j.x >= O.x), B = O.width + _e, L = Fo(S.flow.id), D = oa(S.flow.id), z = Lc();
|
|
10718
10723
|
for (let j = 1; j <= Ug; j++) {
|
|
10719
10724
|
const X = () => Fo(S.flow.id) >= L || Lc() > z ? !1 : oa(S.flow.id) >= D ? !0 : (Qg.add(S.flow.id), !1);
|
|
10720
|
-
if (uS(T,
|
|
10725
|
+
if (uS(T, N, B * j, X)) {
|
|
10721
10726
|
Dp.add(S.flow.id), _ = !0;
|
|
10722
10727
|
break;
|
|
10723
10728
|
}
|
|
@@ -10732,11 +10737,11 @@ function qA(e, t) {
|
|
|
10732
10737
|
if (Dp.has(x.flow.id) || !Qg.has(x.flow.id) || !os(x.flow.id)) continue;
|
|
10733
10738
|
const _ = f(x.flow.target);
|
|
10734
10739
|
if (!_) continue;
|
|
10735
|
-
const S = d(P.get(x.flow.target).node.participant), O = Bo(x.flow.target, (ne) => ne.x >= _.x),
|
|
10740
|
+
const S = d(P.get(x.flow.target).node.participant), O = Bo(x.flow.target, (ne) => ne.x >= _.x), N = new Set(O.map((ne) => ne.id)), T = /* @__PURE__ */ new Map();
|
|
10736
10741
|
for (const ne of r.filter((ce) => ce.type === "bpmn:MessageFlow")) {
|
|
10737
10742
|
if (((ym = ne.waypoints) == null ? void 0 : ym.length) !== 2 || !ne.source || !ne.target) continue;
|
|
10738
|
-
const ce =
|
|
10739
|
-
if (ce ===
|
|
10743
|
+
const ce = N.has(ne.source.id);
|
|
10744
|
+
if (ce === N.has(ne.target.id)) continue;
|
|
10740
10745
|
const ae = ce ? ne.target : ne.source, oe = (vm = P.get(ae.id)) == null ? void 0 : vm.node.participant;
|
|
10741
10746
|
!oe || T.has(ae.id) || T.set(ae.id, { subtree: [ae], pool: d(oe) });
|
|
10742
10747
|
}
|
|
@@ -10752,16 +10757,16 @@ function qA(e, t) {
|
|
|
10752
10757
|
if (!os(x.id)) continue;
|
|
10753
10758
|
const _ = f(x.source), S = f(x.target);
|
|
10754
10759
|
if (!_ || !S) continue;
|
|
10755
|
-
let O,
|
|
10760
|
+
let O, N, T;
|
|
10756
10761
|
if (x.preexisting) {
|
|
10757
10762
|
const [L, D] = _.type === "bpmn:Participant" ? [S, _] : [_, S];
|
|
10758
10763
|
if (O = Ho(L), O < D.x || O > D.x + D.width) continue;
|
|
10759
|
-
[
|
|
10764
|
+
[N, T] = L.y < D.y ? [L.y + L.height, D.y] : [D.y + D.height, L.y];
|
|
10760
10765
|
} else {
|
|
10761
10766
|
if (_.type === "bpmn:Participant" || S.type === "bpmn:Participant" || (O = _.x + _.width / 2, Math.abs(O - (S.x + S.width / 2)) > 15)) continue;
|
|
10762
|
-
[
|
|
10767
|
+
[N, T] = _.y < S.y ? [_.y + _.height, S.y] : [S.y + S.height, _.y];
|
|
10763
10768
|
}
|
|
10764
|
-
const B = [...P.values()].map((L) => f(L.node.id)).filter((L) => !!L && L.id !== _.id && L.id !== S.id).filter((L) => L.x <= O && O <= L.x + L.width && L.y + L.height >
|
|
10769
|
+
const B = [...P.values()].map((L) => f(L.node.id)).filter((L) => !!L && L.id !== _.id && L.id !== S.id).filter((L) => L.x <= O && O <= L.x + L.width && L.y + L.height > N && L.y < T).sort((L, D) => L.x - D.x);
|
|
10765
10770
|
for (const L of B) {
|
|
10766
10771
|
const D = (xm = P.get(L.id)) == null ? void 0 : xm.node.participant, z = D ? f(D) : void 0;
|
|
10767
10772
|
if (!D || !z) continue;
|
|
@@ -10781,11 +10786,11 @@ function qA(e, t) {
|
|
|
10781
10786
|
)
|
|
10782
10787
|
);
|
|
10783
10788
|
}
|
|
10784
|
-
const ae = L.width + _e, oe = Fo(x.id),
|
|
10789
|
+
const ae = L.width + _e, oe = Fo(x.id), ye = oa(x.id), ge = () => Fo(x.id) < oe && oa(x.id) >= ye;
|
|
10785
10790
|
let te = !1;
|
|
10786
10791
|
for (const Z of ce) {
|
|
10787
10792
|
for (let re = 1; re <= Ug; re++)
|
|
10788
|
-
if (jo(Z, ae * re,
|
|
10793
|
+
if (jo(Z, ae * re, ge)) {
|
|
10789
10794
|
te = !0;
|
|
10790
10795
|
break;
|
|
10791
10796
|
}
|
|
@@ -10804,10 +10809,10 @@ function qA(e, t) {
|
|
|
10804
10809
|
var _, S;
|
|
10805
10810
|
return Fo(x) === 0 && ((S = (_ = f(x)) == null ? void 0 : _.waypoints) == null ? void 0 : S.length) === 2;
|
|
10806
10811
|
}, mS = (x, _, S) => {
|
|
10807
|
-
const O = new Set(x.flatMap((T) => T.subtree.map((B) => B.id))),
|
|
10808
|
-
return [...new Set(
|
|
10809
|
-
}, yS = (x, _, S, O,
|
|
10810
|
-
const T = x.map((z) => ({ ...z, subtree: z.subtree.filter((j) => !
|
|
10812
|
+
const O = new Set(x.flatMap((T) => T.subtree.map((B) => B.id))), N = [...Ic()].filter((T) => !S.has(T)).map((T) => T.split(">")[1]);
|
|
10813
|
+
return [...new Set(N)].filter((T) => O.has(T) && T !== _.source && T !== _.target);
|
|
10814
|
+
}, yS = (x, _, S, O, N) => {
|
|
10815
|
+
const T = x.map((z) => ({ ...z, subtree: z.subtree.filter((j) => !N.includes(j.id)) })).filter((z) => z.subtree.length), B = new Set(T.flatMap((z) => z.subtree.map((j) => j.id))), L = () => N.every((z) => {
|
|
10811
10816
|
const j = f(z);
|
|
10812
10817
|
return !!j && F.filter((X) => X.flow.target === z && B.has(X.flow.source)).every((X) => {
|
|
10813
10818
|
const ne = f(X.flow.source);
|
|
@@ -10822,19 +10827,19 @@ function qA(e, t) {
|
|
|
10822
10827
|
if (((bm = _ == null ? void 0 : _.waypoints) == null ? void 0 : bm.length) !== 2) continue;
|
|
10823
10828
|
const S = f(x.flow.source), O = f(x.flow.target);
|
|
10824
10829
|
if (!S || !O || S.type === "bpmn:Participant" || O.type === "bpmn:Participant" || !Sr(x.flow.source) || !Sr(x.flow.target) || Math.abs(Ho(S) - Ho(O)) > cS) continue;
|
|
10825
|
-
const
|
|
10826
|
-
(oe) => oe.id !== S.id && oe.id !== O.id && oe.x <
|
|
10830
|
+
const N = Ho(S), T = _.waypoints.map((oe) => oe.y), [B, L] = [Math.min(...T), Math.max(...T)], D = Un(We(r)).filter(
|
|
10831
|
+
(oe) => oe.id !== S.id && oe.id !== O.id && oe.x < N && N < oe.x + oe.width && B < oe.y + oe.height && oe.y < L
|
|
10827
10832
|
);
|
|
10828
10833
|
if (!D.length) continue;
|
|
10829
10834
|
const z = (wm = P.get(x.flow.source)) == null ? void 0 : wm.node.participant, j = (_m = P.get(x.flow.target)) == null ? void 0 : _m.node.participant;
|
|
10830
10835
|
if (!z || !j) continue;
|
|
10831
10836
|
const X = /* @__PURE__ */ new Map();
|
|
10832
|
-
for (const [oe,
|
|
10837
|
+
for (const [oe, ye, ge] of [
|
|
10833
10838
|
[x.flow.source, S, z],
|
|
10834
10839
|
[x.flow.target, O, j]
|
|
10835
10840
|
]) {
|
|
10836
|
-
const te = X.get(
|
|
10837
|
-
X.set(
|
|
10841
|
+
const te = X.get(ge) ?? [], Z = Bo(oe, (re) => re.x >= ye.x).filter((re) => !te.some((J) => J.id === re.id));
|
|
10842
|
+
X.set(ge, [...te, ...Z]);
|
|
10838
10843
|
}
|
|
10839
10844
|
const ne = new Set([...X.values()].flat().map((oe) => oe.id)), ce = Dc(
|
|
10840
10845
|
X,
|
|
@@ -10844,13 +10849,13 @@ function qA(e, t) {
|
|
|
10844
10849
|
() => !1
|
|
10845
10850
|
), ae = Math.max(...D.map((oe) => oe.x + oe.width));
|
|
10846
10851
|
for (const oe of lS) {
|
|
10847
|
-
const
|
|
10848
|
-
if (
|
|
10849
|
-
const
|
|
10852
|
+
const ye = ae + oe - N;
|
|
10853
|
+
if (ye <= 0) continue;
|
|
10854
|
+
const ge = Er().bad, te = Ic();
|
|
10850
10855
|
let Z = [], re = !0;
|
|
10851
|
-
const J = () => !nm(x.flow.id) || re && (Z = mS(ce, x.flow, te), Z.length) ? !1 : !gS(
|
|
10852
|
-
if (jo(ce,
|
|
10853
|
-
if (Z.length && (yS(ce,
|
|
10856
|
+
const J = () => !nm(x.flow.id) || re && (Z = mS(ce, x.flow, te), Z.length) ? !1 : !gS(ge, te);
|
|
10857
|
+
if (jo(ce, ye, J, ra)) break;
|
|
10858
|
+
if (Z.length && (yS(ce, ye, x.flow, te, Z) || (re = !1, jo(ce, ye, J, ra))))
|
|
10854
10859
|
break;
|
|
10855
10860
|
}
|
|
10856
10861
|
}
|
|
@@ -10875,16 +10880,16 @@ function qA(e, t) {
|
|
|
10875
10880
|
}
|
|
10876
10881
|
}
|
|
10877
10882
|
return D;
|
|
10878
|
-
}, O = () => ({ ...Er(), grazes: S() }),
|
|
10883
|
+
}, O = () => ({ ...Er(), grazes: S() }), N = [];
|
|
10879
10884
|
for (const T of P.keys()) {
|
|
10880
10885
|
if (!Sr(T)) continue;
|
|
10881
10886
|
const B = F.filter((z) => z.flow.target === T);
|
|
10882
10887
|
if (B.length !== 1) continue;
|
|
10883
10888
|
const L = f(B[0].flow.source), D = f(T);
|
|
10884
|
-
!L || !D || !P.has(L.id) || Math.abs(x(L) - x(D)) > 1 || D.x - (L.x + L.width) <= _e + 1 ||
|
|
10889
|
+
!L || !D || !P.has(L.id) || Math.abs(x(L) - x(D)) > 1 || D.x - (L.x + L.width) <= _e + 1 || N.push({ id: T, pred: L, node: D });
|
|
10885
10890
|
}
|
|
10886
|
-
|
|
10887
|
-
for (const { id: T } of
|
|
10891
|
+
N.sort((T, B) => T.node.x - B.node.x);
|
|
10892
|
+
for (const { id: T } of N) {
|
|
10888
10893
|
const B = P.get(T), L = f(T), D = f(F.find((Z) => Z.flow.target === T).flow.source);
|
|
10889
10894
|
if (!L || !D) continue;
|
|
10890
10895
|
const z = L.x - (D.x + D.width);
|
|
@@ -10895,21 +10900,21 @@ function qA(e, t) {
|
|
|
10895
10900
|
"",
|
|
10896
10901
|
() => !1,
|
|
10897
10902
|
() => !1
|
|
10898
|
-
), oe = ae.some((Z) => Z.pool !== j) || ae.reduce((Z, re) => Z + re.subtree.length, 0) > X.length,
|
|
10899
|
-
if (!
|
|
10903
|
+
), oe = ae.some((Z) => Z.pool !== j) || ae.reduce((Z, re) => Z + re.subtree.length, 0) > X.length, ye = O(), ge = qg(X, j, ne);
|
|
10904
|
+
if (!ge) continue;
|
|
10900
10905
|
const te = O();
|
|
10901
|
-
if (oe && !ce(
|
|
10902
|
-
|
|
10906
|
+
if (oe && !ce(ye, te)) {
|
|
10907
|
+
ge();
|
|
10903
10908
|
const Z = ia(ae, ne);
|
|
10904
10909
|
if (Z) {
|
|
10905
10910
|
const re = O();
|
|
10906
|
-
if (!ce(
|
|
10911
|
+
if (!ce(ye, re) && re.bad <= te.bad && re.crossings <= te.crossings) continue;
|
|
10907
10912
|
Z();
|
|
10908
10913
|
}
|
|
10909
10914
|
qg(X, j, ne);
|
|
10910
10915
|
continue;
|
|
10911
10916
|
}
|
|
10912
|
-
ce(
|
|
10917
|
+
ce(ye, te) && ge();
|
|
10913
10918
|
}
|
|
10914
10919
|
}
|
|
10915
10920
|
Wg(!0);
|
|
@@ -10917,18 +10922,18 @@ function qA(e, t) {
|
|
|
10917
10922
|
(x) => x.type === "bpmn:DataStoreReference" && h.has(x.id)
|
|
10918
10923
|
), _S = (x, _) => {
|
|
10919
10924
|
const S = x.x + x.width / 2, O = x.y + x.height / 2;
|
|
10920
|
-
let
|
|
10925
|
+
let N;
|
|
10921
10926
|
for (const T of wS) {
|
|
10922
10927
|
if ((g(T) ?? p()) !== _ || T.y < x.y + x.height) continue;
|
|
10923
10928
|
const B = Math.abs(T.x + T.width / 2 - S);
|
|
10924
10929
|
B > xS || B < T.width || !bS(T).some(
|
|
10925
10930
|
(D) => D.height === x.height && Math.abs(D.y + D.height / 2 - O) <= vS && T.y >= D.y + D.height
|
|
10926
|
-
) || (!
|
|
10931
|
+
) || (!N || B < N.dx || B === N.dx && T.id < N.id) && (N = { dx: B, id: T.id, cy: T.y + T.height / 2 });
|
|
10927
10932
|
}
|
|
10928
|
-
return
|
|
10933
|
+
return N == null ? void 0 : N.cy;
|
|
10929
10934
|
};
|
|
10930
10935
|
for (const x of b) {
|
|
10931
|
-
const _ = x.associations ?? [], S = _.map((T) => T.source === x.dataStore.id ? T.target : T.source).map(f).find(Boolean), O = S ? g(S) ?? p() : p(),
|
|
10936
|
+
const _ = x.associations ?? [], S = _.map((T) => T.source === x.dataStore.id ? T.target : T.source).map(f).find(Boolean), O = S ? g(S) ?? p() : p(), N = S ? {
|
|
10932
10937
|
x: S.x + S.width / 2,
|
|
10933
10938
|
y: _S(S, O) ?? S.y + S.height + 110
|
|
10934
10939
|
} : { x: 200, y: ts + 60 };
|
|
@@ -10940,7 +10945,7 @@ function qA(e, t) {
|
|
|
10940
10945
|
name: x.dataStore.name
|
|
10941
10946
|
})
|
|
10942
10947
|
},
|
|
10943
|
-
|
|
10948
|
+
N,
|
|
10944
10949
|
O
|
|
10945
10950
|
);
|
|
10946
10951
|
for (const T of _) Vg(x.dataStore.id, T);
|
|
@@ -10965,17 +10970,17 @@ function qA(e, t) {
|
|
|
10965
10970
|
Math.abs(x.x + x.width - ce) < z && (x.width = ce - z - x.x);
|
|
10966
10971
|
}
|
|
10967
10972
|
if (!S.length) return;
|
|
10968
|
-
const O = Math.min(...S.map((D) => D.y)),
|
|
10973
|
+
const O = Math.min(...S.map((D) => D.y)), N = Math.max(...S.map((D) => D.y + D.height)), T = O - x.y, B = x.y + x.height - N, L = om - Rr;
|
|
10969
10974
|
if (T > 0 != B > 0)
|
|
10970
10975
|
if (T > 0 && T < L) {
|
|
10971
10976
|
const D = T + Rr;
|
|
10972
10977
|
x.y += D, x.height -= D;
|
|
10973
10978
|
} else B > 0 && B < L && (x.height -= B + Rr);
|
|
10974
10979
|
}, SS = (x, _) => {
|
|
10975
|
-
const S = Rr, O = 30,
|
|
10980
|
+
const S = Rr, O = 30, N = r.filter(
|
|
10976
10981
|
(T) => T.type === "bpmn:Group" && T.id !== _
|
|
10977
10982
|
);
|
|
10978
|
-
for (const T of
|
|
10983
|
+
for (const T of N) {
|
|
10979
10984
|
const B = T.x, L = T.x + T.width, D = T.y, z = T.y + T.height, j = x.y < z && D < x.y + x.height, X = x.x < L && B < x.x + x.width;
|
|
10980
10985
|
if (j) {
|
|
10981
10986
|
if (Math.abs(x.x - L) < S) {
|
|
@@ -10999,11 +11004,11 @@ function qA(e, t) {
|
|
|
10999
11004
|
}
|
|
11000
11005
|
}
|
|
11001
11006
|
}, Ip = (x, _) => {
|
|
11002
|
-
const S = om, O = Math.min(...x.map((D) => D.x)) - S,
|
|
11007
|
+
const S = om, O = Math.min(...x.map((D) => D.x)) - S, N = Math.min(...x.map((D) => D.y)) - S, T = Math.max(...x.map((D) => D.x + D.width)) + S, B = Math.max(...x.map((D) => D.y + D.height)) + S, L = { x: O, y: N, width: T - O, height: B - N };
|
|
11003
11008
|
return ES(L, x), SS(L, _), L;
|
|
11004
11009
|
};
|
|
11005
|
-
for (const x of
|
|
11006
|
-
const _ = (x.group.members ?? []).map(f).filter((
|
|
11010
|
+
for (const x of I) {
|
|
11011
|
+
const _ = (x.group.members ?? []).map(f).filter((N) => !!N);
|
|
11007
11012
|
let S;
|
|
11008
11013
|
_.length ? S = Ip(_, x.group.id) : (S = { x: 300 + im * 350, y: 40, width: 300, height: 200 }, im++);
|
|
11009
11014
|
const O = n.createShape(
|
|
@@ -11019,41 +11024,41 @@ function qA(e, t) {
|
|
|
11019
11024
|
x.group.name && n.updateLabel(O, x.group.name), (Em = x.group.members) != null && Em.length && se(O, "bwl:Members", { refs: x.group.members.join(" ") });
|
|
11020
11025
|
}
|
|
11021
11026
|
{
|
|
11022
|
-
const x = r.filter((
|
|
11023
|
-
!
|
|
11027
|
+
const x = r.filter((N) => !!N.waypoints), _ = /* @__PURE__ */ new Map(), S = (N, T) => {
|
|
11028
|
+
!N || !T || (_.has(N) || _.set(N, /* @__PURE__ */ new Set()), _.get(N).add(T));
|
|
11024
11029
|
};
|
|
11025
|
-
for (const
|
|
11026
|
-
const T = (Sm =
|
|
11027
|
-
S(T, B), ((Cm =
|
|
11030
|
+
for (const N of x) {
|
|
11031
|
+
const T = (Sm = N.source) == null ? void 0 : Sm.id, B = (Rm = N.target) == null ? void 0 : Rm.id;
|
|
11032
|
+
S(T, B), ((Cm = N.type) != null && Cm.includes("DataOutputAssociation") || (Mm = N.type) != null && Mm.includes("DataInputAssociation") || N.type === "bpmn:Association") && S(B, T);
|
|
11028
11033
|
}
|
|
11029
|
-
const O = r.filter((
|
|
11030
|
-
for (const
|
|
11031
|
-
const B = (((Am =
|
|
11034
|
+
const O = r.filter((N) => N.type === "bpmn:Group");
|
|
11035
|
+
for (const N of O) {
|
|
11036
|
+
const B = (((Am = N.businessObject.extensionElements) == null ? void 0 : Am.values) ?? []).find((ge) => ge.$type === "bwl:Members"), L = ((B == null ? void 0 : B.refs) ?? "").split(" ").filter(Boolean);
|
|
11032
11037
|
if (!L.length) continue;
|
|
11033
11038
|
const D = new Set(L), z = [...L];
|
|
11034
11039
|
for (; z.length; ) {
|
|
11035
|
-
const
|
|
11036
|
-
for (const te of _.get(
|
|
11040
|
+
const ge = z.shift();
|
|
11041
|
+
for (const te of _.get(ge) ?? []) D.has(te) || (D.add(te), z.push(te));
|
|
11037
11042
|
}
|
|
11038
|
-
const j =
|
|
11043
|
+
const j = N.x, X = N.x + N.width, ne = N.y, ce = N.y + N.height, ae = (ge) => F.filter((te) => te.flow.target === ge).length, oe = (ge) => {
|
|
11039
11044
|
var Z;
|
|
11040
|
-
const te = ((Z = f(
|
|
11041
|
-
if (te === "bpmn:StartEvent" && ae(
|
|
11045
|
+
const te = ((Z = f(ge)) == null ? void 0 : Z.type) ?? "";
|
|
11046
|
+
if (te === "bpmn:StartEvent" && ae(ge) === 0) return !1;
|
|
11042
11047
|
if (te.endsWith("Gateway")) {
|
|
11043
|
-
const re = F.filter((J) => J.flow.target ===
|
|
11048
|
+
const re = F.filter((J) => J.flow.target === ge).map((J) => J.flow.source);
|
|
11044
11049
|
if (re.length && re.every((J) => {
|
|
11045
|
-
var
|
|
11046
|
-
return ((
|
|
11050
|
+
var fe;
|
|
11051
|
+
return ((fe = f(J)) == null ? void 0 : fe.type) === "bpmn:StartEvent" && ae(J) === 0;
|
|
11047
11052
|
}))
|
|
11048
11053
|
return !1;
|
|
11049
11054
|
}
|
|
11050
11055
|
return !0;
|
|
11051
|
-
},
|
|
11052
|
-
(
|
|
11056
|
+
}, ye = r.filter((ge) => bi(ge)).filter(
|
|
11057
|
+
(ge) => ge.type !== "bpmn:Group" && ge.type !== "bpmn:Participant" && ge.type !== "bpmn:TextAnnotation" && !D.has(ge.id) && Sr(ge.id) && oe(ge.id) && ge.x < X && ge.x + ge.width > j && ge.y < ce && ge.y + ge.height > ne
|
|
11053
11058
|
);
|
|
11054
|
-
if (
|
|
11055
|
-
for (const
|
|
11056
|
-
const te =
|
|
11059
|
+
if (ye.length)
|
|
11060
|
+
for (const ge of [-1, 1]) {
|
|
11061
|
+
const te = ye.filter((Me) => (Me.x + Me.width - j <= X - Me.x ? -1 : 1) === ge);
|
|
11057
11062
|
if (!te.length) continue;
|
|
11058
11063
|
const Z = [];
|
|
11059
11064
|
for (const Me of te) {
|
|
@@ -11062,28 +11067,28 @@ function qA(e, t) {
|
|
|
11062
11067
|
}
|
|
11063
11068
|
const re = /* @__PURE__ */ new Map();
|
|
11064
11069
|
for (const Me of Z) {
|
|
11065
|
-
let Se =
|
|
11066
|
-
for (const Ae of [...Me].sort((ue, Re) =>
|
|
11067
|
-
const ue =
|
|
11068
|
-
Se =
|
|
11070
|
+
let Se = ge < 0 ? j - Rr : X + Rr;
|
|
11071
|
+
for (const Ae of [...Me].sort((ue, Re) => ge < 0 ? Re.x - ue.x : ue.x - Re.x)) {
|
|
11072
|
+
const ue = ge < 0 ? Math.min(Ae.x, Se - Ae.width) : Math.max(Ae.x, Se);
|
|
11073
|
+
Se = ge < 0 ? ue - xi : ue + Ae.width + xi, ue !== Ae.x && Math.sign(ue - Ae.x) === ge && re.set(Ae.id, ue - Ae.x);
|
|
11069
11074
|
}
|
|
11070
11075
|
}
|
|
11071
|
-
const J = /* @__PURE__ */ new Map(),
|
|
11076
|
+
const J = /* @__PURE__ */ new Map(), fe = (Me) => J.get(Me) === Me || !J.get(Me) ? Me : fe(J.get(Me));
|
|
11072
11077
|
for (const Me of te) J.set(Me.id, Me.id);
|
|
11073
11078
|
for (const Me of v) {
|
|
11074
11079
|
const Se = re.has(Me.flow.source) ? Me.flow.source : void 0, Ae = re.has(Me.flow.target) ? Me.flow.target : void 0;
|
|
11075
11080
|
if (!Se || !Ae) continue;
|
|
11076
11081
|
const ue = f(Me.flow.id);
|
|
11077
|
-
((Pm = ue == null ? void 0 : ue.waypoints) == null ? void 0 : Pm.length) === 2 && J.set(
|
|
11082
|
+
((Pm = ue == null ? void 0 : ue.waypoints) == null ? void 0 : Pm.length) === 2 && J.set(fe(Se), fe(Ae));
|
|
11078
11083
|
}
|
|
11079
11084
|
const Ne = /* @__PURE__ */ new Map();
|
|
11080
11085
|
for (const Me of te) {
|
|
11081
11086
|
if (!re.has(Me.id)) continue;
|
|
11082
|
-
const Se =
|
|
11087
|
+
const Se = fe(Me.id);
|
|
11083
11088
|
Ne.set(Se, [...Ne.get(Se) ?? [], Me]);
|
|
11084
11089
|
}
|
|
11085
11090
|
const ke = [...Ne.values()].sort(
|
|
11086
|
-
(Me, Se) =>
|
|
11091
|
+
(Me, Se) => ge < 0 ? Math.min(...Me.map((Ae) => Ae.x)) - Math.min(...Se.map((Ae) => Ae.x)) : Math.max(...Se.map((Ae) => Ae.x)) - Math.max(...Me.map((Ae) => Ae.x))
|
|
11087
11092
|
), qe = [];
|
|
11088
11093
|
let Ce = !0;
|
|
11089
11094
|
for (const Me of ke) {
|
|
@@ -11106,25 +11111,25 @@ function qA(e, t) {
|
|
|
11106
11111
|
}
|
|
11107
11112
|
{
|
|
11108
11113
|
const x = /* @__PURE__ */ new Set([
|
|
11109
|
-
...
|
|
11114
|
+
...I.map((_) => _.group.id),
|
|
11110
11115
|
...Bt(e, "group.update").map((_) => _.id)
|
|
11111
11116
|
]);
|
|
11112
11117
|
for (const _ of r.filter((S) => S.type === "bpmn:Group")) {
|
|
11113
11118
|
if (x.has(_.id)) continue;
|
|
11114
|
-
const O = (((Tm = _.businessObject.extensionElements) == null ? void 0 : Tm.values) ?? []).find((L) => L.$type === "bwl:Members"),
|
|
11115
|
-
!
|
|
11119
|
+
const O = (((Tm = _.businessObject.extensionElements) == null ? void 0 : Tm.values) ?? []).find((L) => L.$type === "bwl:Members"), N = ((O == null ? void 0 : O.refs) ?? "").split(" ").filter(Boolean).map(f).filter((L) => !!L);
|
|
11120
|
+
!N.length || !N.some((L) => {
|
|
11116
11121
|
const D = h.get(L.id);
|
|
11117
11122
|
return !D || D.x !== L.x || D.y !== L.y;
|
|
11118
|
-
}) || !
|
|
11123
|
+
}) || !N.some((L) => L.x < _.x || L.y < _.y || L.x + L.width > _.x + _.width || L.y + L.height > _.y + _.height) || n.resizeShape(_, Ip(N, _.id));
|
|
11119
11124
|
}
|
|
11120
11125
|
}
|
|
11121
11126
|
{
|
|
11122
|
-
const _ = new Map(Fr(We(r)).map((L) => [L.owner, L.rect])), S = r.filter((L) => !!L.waypoints), O = /* @__PURE__ */ new Map(),
|
|
11127
|
+
const _ = new Map(Fr(We(r)).map((L) => [L.owner, L.rect])), S = r.filter((L) => !!L.waypoints), O = /* @__PURE__ */ new Map(), N = (L, D) => {
|
|
11123
11128
|
!L || !D || (O.has(L) || O.set(L, /* @__PURE__ */ new Set()), O.get(L).add(D));
|
|
11124
11129
|
};
|
|
11125
11130
|
for (const L of S) {
|
|
11126
11131
|
const D = (km = L.source) == null ? void 0 : km.id, z = (Om = L.target) == null ? void 0 : Om.id;
|
|
11127
|
-
|
|
11132
|
+
N(D, z), ((Dm = L.type) != null && Dm.includes("DataOutputAssociation") || (Lm = L.type) != null && Lm.includes("DataInputAssociation") || L.type === "bpmn:Association") && N(z, D);
|
|
11128
11133
|
}
|
|
11129
11134
|
const T = (L) => F.filter((D) => D.flow.target === L).length, B = (L) => {
|
|
11130
11135
|
var z;
|
|
@@ -11144,7 +11149,7 @@ function qA(e, t) {
|
|
|
11144
11149
|
const z = (((Im = L.businessObject.extensionElements) == null ? void 0 : Im.values) ?? []).find((ue) => ue.$type === "bwl:Members"), j = ((z == null ? void 0 : z.refs) ?? "").split(" ").filter(Boolean);
|
|
11145
11150
|
if (!j.length) continue;
|
|
11146
11151
|
const X = j.map(f).filter((ue) => !!ue);
|
|
11147
|
-
if (!X.length || !(
|
|
11152
|
+
if (!X.length || !(I.some((ue) => ue.group.id === L.id) || Bt(e, "group.update").some((ue) => ue.id === L.id) || X.some((ue) => {
|
|
11148
11153
|
const Re = h.get(ue.id);
|
|
11149
11154
|
return !Re || Re.x !== ue.x || Re.y !== ue.y;
|
|
11150
11155
|
}))) continue;
|
|
@@ -11153,16 +11158,16 @@ function qA(e, t) {
|
|
|
11153
11158
|
const ue = ae.shift();
|
|
11154
11159
|
for (const Re of O.get(ue) ?? []) ce.has(Re) || (ce.add(Re), ae.push(Re));
|
|
11155
11160
|
}
|
|
11156
|
-
const oe = L.x,
|
|
11161
|
+
const oe = L.x, ye = L.x + L.width, ge = L.y, te = L.y + L.height, Z = (ue) => {
|
|
11157
11162
|
const Re = _.get(ue.id), Pe = { x: ue.x, y: ue.y, width: ue.width, height: ue.height };
|
|
11158
11163
|
return Re ? [Pe, { x: Re.x, y: Re.y, width: Re.width, height: Re.height }] : [Pe];
|
|
11159
|
-
}, re = X.flatMap(Z), J = Math.min(...re.map((ue) => ue.x)),
|
|
11160
|
-
(ue) => ue.type !== "bpmn:Group" && ue.type !== "bpmn:Participant" && ue.type !== "bpmn:TextAnnotation" && !Ce.has(ue.id) && (!ce.has(ue.id) || !Me(ue)) && B(ue.id) && ue.x <
|
|
11164
|
+
}, re = X.flatMap(Z), J = Math.min(...re.map((ue) => ue.x)), fe = Math.max(...re.map((ue) => ue.x + ue.width)), Ne = Math.min(...re.map((ue) => ue.y)), ke = Math.max(...re.map((ue) => ue.y + ue.height)), qe = { L: J - oe, R: ye - fe, T: Ne - ge, B: te - ke }, Ce = new Set(j), Me = (ue) => ue.x >= oe && ue.x + ue.width <= ye && ue.y >= ge && ue.y + ue.height <= te, Se = r.filter((ue) => bi(ue)).filter(
|
|
11165
|
+
(ue) => ue.type !== "bpmn:Group" && ue.type !== "bpmn:Participant" && ue.type !== "bpmn:TextAnnotation" && !Ce.has(ue.id) && (!ce.has(ue.id) || !Me(ue)) && B(ue.id) && ue.x < ye && ue.x + ue.width > oe && ue.y < te && ue.y + ue.height > ge
|
|
11161
11166
|
);
|
|
11162
11167
|
if (!Se.length) continue;
|
|
11163
11168
|
const Ae = { L: 0, R: 0, T: 0, B: 0 };
|
|
11164
11169
|
for (const ue of Se) {
|
|
11165
|
-
const Re = Z(ue), Pe = Math.min(...Re.map((dn) => dn.x)), Be = Math.max(...Re.map((dn) => dn.x + dn.width)), xt = Math.min(...Re.map((dn) => dn.y)), tn = Math.max(...Re.map((dn) => dn.y + dn.height)), Gt = { L: Be - oe, R:
|
|
11170
|
+
const Re = Z(ue), Pe = Math.min(...Re.map((dn) => dn.x)), Be = Math.max(...Re.map((dn) => dn.x + dn.width)), xt = Math.min(...Re.map((dn) => dn.y)), tn = Math.max(...Re.map((dn) => dn.y + dn.height)), Gt = { L: Be - oe, R: ye - Pe, T: tn - ge, B: te - xt }, Vt = ["L", "R", "T", "B"].filter((dn) => Gt[dn] <= qe[dn] + 1e-3);
|
|
11166
11171
|
if (!Vt.length) continue;
|
|
11167
11172
|
const Cn = Vt.reduce((dn, Nc) => Gt[Nc] < Gt[dn] ? Nc : dn, Vt[0]);
|
|
11168
11173
|
Ae[Cn] = Math.max(Ae[Cn], Math.min(Gt[Cn] + 10, qe[Cn]));
|
|
@@ -11187,24 +11192,24 @@ function qA(e, t) {
|
|
|
11187
11192
|
let as = 0;
|
|
11188
11193
|
const am = 12, sm = 14, RS = 15, CS = 300, MS = (x) => {
|
|
11189
11194
|
const _ = x.split(`
|
|
11190
|
-
`), S = Math.max(..._.map((T) => $s(T, am))), O = Math.max(100, Math.min(CS, Math.ceil(S) + sm)),
|
|
11191
|
-
return { width: O, height: Math.max(30,
|
|
11195
|
+
`), S = Math.max(..._.map((T) => $s(T, am))), O = Math.max(100, Math.min(CS, Math.ceil(S) + sm)), N = _.reduce((T, B) => T + Math.max(1, Math.ceil(($s(B, am) + sm) / O)), 0);
|
|
11196
|
+
return { width: O, height: Math.max(30, N * RS + 10) };
|
|
11192
11197
|
};
|
|
11193
11198
|
for (const x of A) {
|
|
11194
|
-
const _ = x.association, S = ((Nm = x.placement) == null ? void 0 : Nm.anchor) ?? (_ ? _.source === x.annotation.id ? _.target : _.source : void 0), O = S ? f(S) : void 0,
|
|
11199
|
+
const _ = x.association, S = ((Nm = x.placement) == null ? void 0 : Nm.anchor) ?? (_ ? _.source === x.annotation.id ? _.target : _.source : void 0), O = S ? f(S) : void 0, N = O ? rm(O) : void 0, T = MS(x.annotation.text ?? "");
|
|
11195
11200
|
let B;
|
|
11196
|
-
if (
|
|
11201
|
+
if (N && x.placement) {
|
|
11197
11202
|
const [j, X] = eu[x.placement.side], ne = x.placement.offset ?? 50;
|
|
11198
11203
|
B = {
|
|
11199
|
-
x:
|
|
11200
|
-
y:
|
|
11204
|
+
x: N.x + N.width / 2 + j * (N.width / 2 + T.width / 2 + ne),
|
|
11205
|
+
y: N.y + N.height / 2 + X * (N.height / 2 + T.height / 2 + ne)
|
|
11201
11206
|
};
|
|
11202
|
-
} else
|
|
11203
|
-
x:
|
|
11204
|
-
y:
|
|
11207
|
+
} else N ? (B = {
|
|
11208
|
+
x: N.x + N.width / 2 + 180 + as % 3 * 260,
|
|
11209
|
+
y: N.y - 110 - as % 2 * 95
|
|
11205
11210
|
}, as++) : (B = { x: 300 + as * 260, y: 60 }, as++);
|
|
11206
11211
|
const L = O ? g(O) ?? p() : p(), D = L;
|
|
11207
|
-
|
|
11212
|
+
N && typeof D.x == "number" && typeof D.width == "number" && D.type === "bpmn:Participant" && (B = nu(r, N, T, D, x.placement ? { placement: x.placement } : { from: B }));
|
|
11208
11213
|
const z = n.createShape(
|
|
11209
11214
|
{
|
|
11210
11215
|
type: "bpmn:TextAnnotation",
|
|
@@ -11243,16 +11248,16 @@ function qA(e, t) {
|
|
|
11243
11248
|
);
|
|
11244
11249
|
}
|
|
11245
11250
|
const AS = (x, _, S, O) => {
|
|
11246
|
-
const
|
|
11247
|
-
if (!
|
|
11251
|
+
const N = x.parent;
|
|
11252
|
+
if (!N) return O;
|
|
11248
11253
|
const T = x.x + x.width / 2, B = /* @__PURE__ */ new Set([x.id]);
|
|
11249
|
-
if (!C(
|
|
11254
|
+
if (!C(N, x, T, O, B)) return O;
|
|
11250
11255
|
const L = _ ? _.y + Math.min(_.height / 2, le) : S ? S.y + U : void 0;
|
|
11251
11256
|
if (L === void 0) return O;
|
|
11252
|
-
const D = Math.floor((O - L) /
|
|
11257
|
+
const D = Math.floor((O - L) / me + 1e-6);
|
|
11253
11258
|
for (let z = 1; z <= 3; z++) {
|
|
11254
|
-
const j = D + z, X = L + j *
|
|
11255
|
-
if (!C(
|
|
11259
|
+
const j = D + z, X = L + j * me, ne = kg(_ == null ? void 0 : _.id, j);
|
|
11260
|
+
if (!C(N, x, T, X, ne ? /* @__PURE__ */ new Set([...B, ...ne]) : B))
|
|
11256
11261
|
return go(_ == null ? void 0 : _.id, j, S), X;
|
|
11257
11262
|
}
|
|
11258
11263
|
return O;
|
|
@@ -11260,7 +11265,7 @@ function qA(e, t) {
|
|
|
11260
11265
|
for (const x of Bt(e, "node.update")) {
|
|
11261
11266
|
let _ = d(x.id);
|
|
11262
11267
|
if (x.type && qc(x.type) !== _.type) {
|
|
11263
|
-
const S = _.x + _.width / 2, O = _.y + _.height / 2,
|
|
11268
|
+
const S = _.x + _.width / 2, O = _.y + _.height / 2, N = cm();
|
|
11264
11269
|
_ = c.replaceElement(
|
|
11265
11270
|
_,
|
|
11266
11271
|
{
|
|
@@ -11268,7 +11273,7 @@ function qA(e, t) {
|
|
|
11268
11273
|
...x.eventDefinition ? { eventDefinitionType: Cf[x.eventDefinition] } : {}
|
|
11269
11274
|
}
|
|
11270
11275
|
);
|
|
11271
|
-
const T = cm(), B = [...
|
|
11276
|
+
const T = cm(), B = [...N].filter((z) => z !== x.id && !T.has(z));
|
|
11272
11277
|
if (B.length)
|
|
11273
11278
|
throw new Nw({
|
|
11274
11279
|
kind: "type-change-drops-elements",
|
|
@@ -11285,13 +11290,13 @@ function qA(e, t) {
|
|
|
11285
11290
|
}
|
|
11286
11291
|
if (x.name !== void 0 && n.updateProperties(_, { name: x.name ?? void 0 }), x.lane || x.band !== void 0) {
|
|
11287
11292
|
x.band !== void 0 && n.updateProperties(_, { "bwl:band": x.band });
|
|
11288
|
-
const S = _.y + _.height / 2, O = g(_),
|
|
11293
|
+
const S = _.y + _.height / 2, O = g(_), N = x.lane ? d(x.lane) : ((O == null ? void 0 : O.children) ?? []).find(
|
|
11289
11294
|
(B) => B.type === "bpmn:Lane" && S >= B.y && S <= B.y + B.height
|
|
11290
11295
|
);
|
|
11291
|
-
x.band !== void 0 && go(
|
|
11292
|
-
const T =
|
|
11296
|
+
x.band !== void 0 && go(N == null ? void 0 : N.id, x.band, O);
|
|
11297
|
+
const T = N ? N.y + (x.band === void 0 ? N.height / 2 : Math.min(N.height / 2, le) + Nt(N.id, x.band) * me) : x.band !== void 0 && O ? O.y + U + Nt(`pool:${O.id}`, x.band) * me : void 0;
|
|
11293
11298
|
if (T !== void 0) {
|
|
11294
|
-
const B = AS(_,
|
|
11299
|
+
const B = AS(_, N, O, T), L = B === T ? T - S : B - (_.y + _.height / 2);
|
|
11295
11300
|
L !== 0 && n.moveElements([_], { x: 0, y: L });
|
|
11296
11301
|
}
|
|
11297
11302
|
}
|
|
@@ -11299,20 +11304,20 @@ function qA(e, t) {
|
|
|
11299
11304
|
for (const x of Bt(e, "sequenceFlow.update")) {
|
|
11300
11305
|
const _ = d(x.id), S = k.get(x.id);
|
|
11301
11306
|
if (S) {
|
|
11302
|
-
const O = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 }),
|
|
11303
|
-
L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1 ? n.updateWaypoints(B, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]) : (n.reconnect(B,
|
|
11307
|
+
const O = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 }), N = d(S.flow.source), T = d(S.flow.target), B = n.connect(N, T, { type: "bpmn:SequenceFlow", businessObject: kc(S.flow) }), L = Ap.get(x.id), D = T.y + T.height / 2;
|
|
11308
|
+
L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1 ? n.updateWaypoints(B, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]) : (n.reconnect(B, N, T, [O(N), O(T)]), Math.abs(D - (N.y + N.height / 2)) > 1 && Oc(B));
|
|
11304
11309
|
} else if ((x.source !== void 0 || x.target !== void 0) && !Lg.has(x.id)) {
|
|
11305
|
-
const O = _,
|
|
11306
|
-
n.reconnect(O,
|
|
11310
|
+
const O = _, N = x.source !== void 0 ? d(x.source) : O.source, T = x.target !== void 0 ? d(x.target) : O.target, B = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 });
|
|
11311
|
+
n.reconnect(O, N, T, [B(N), B(T)]);
|
|
11307
11312
|
const L = Ap.get(O.id), D = T.y + T.height / 2;
|
|
11308
11313
|
if (L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1) {
|
|
11309
11314
|
n.updateWaypoints(O, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]);
|
|
11310
11315
|
const z = O.label;
|
|
11311
11316
|
if (z && L.label) {
|
|
11312
|
-
const X = Math.abs(L.label.y + z.height / 2 - L.channelY) <=
|
|
11317
|
+
const X = Math.abs(L.label.y + z.height / 2 - L.channelY) <= me / 5 && L.label.x + z.width > L.exit.x, ne = L.exit.x + 6, ce = T.x - 6 - z.width, ae = X ? ce >= ne ? { x: Math.max(ne, Math.min(L.label.x, ce)), y: L.label.y + (D - L.channelY) } : void 0 : L.label;
|
|
11313
11318
|
ae && (ae.x !== z.x || ae.y !== z.y) && n.moveElements([z], { x: ae.x - z.x, y: ae.y - z.y });
|
|
11314
11319
|
}
|
|
11315
|
-
} else Math.abs(D - (
|
|
11320
|
+
} else Math.abs(D - (N.y + N.height / 2)) > 1 && Oc(O);
|
|
11316
11321
|
}
|
|
11317
11322
|
x.name !== void 0 && n.updateProperties(_, { name: x.name ?? void 0 }), x.condition !== void 0 && n.updateProperties(_, { name: ((Bm = x.condition) == null ? void 0 : Bm.label) ?? void 0 });
|
|
11318
11323
|
}
|
|
@@ -11325,10 +11330,10 @@ function qA(e, t) {
|
|
|
11325
11330
|
if (x.text !== void 0 && n.updateProperties(_, { text: x.text }), x.placement === null)
|
|
11326
11331
|
se(_, "bwl:Placement", null);
|
|
11327
11332
|
else if (x.placement) {
|
|
11328
|
-
const S = d(x.placement.anchor), O = rm(S),
|
|
11333
|
+
const S = d(x.placement.anchor), O = rm(S), N = g(S) ?? p(), T = typeof N.x == "number" && typeof N.width == "number" && N.type === "bpmn:Participant", [B, L] = eu[x.placement.side], D = x.placement.offset ?? 50, z = {
|
|
11329
11334
|
x: O.x + O.width / 2 + B * (O.width / 2 + _.width / 2 + D),
|
|
11330
11335
|
y: O.y + O.height / 2 + L * (O.height / 2 + _.height / 2 + D)
|
|
11331
|
-
}, j = T ? nu(r, O, { width: _.width, height: _.height },
|
|
11336
|
+
}, j = T ? nu(r, O, { width: _.width, height: _.height }, N, { placement: x.placement, selfId: x.id }) : z;
|
|
11332
11337
|
n.moveElements([_], { x: j.x - (_.x + _.width / 2), y: j.y - (_.y + _.height / 2) }), se(_, "bwl:Placement", ie(x.placement));
|
|
11333
11338
|
}
|
|
11334
11339
|
}
|
|
@@ -11392,11 +11397,11 @@ function KA(e, t, n) {
|
|
|
11392
11397
|
g = g.parent;
|
|
11393
11398
|
}
|
|
11394
11399
|
if (!h) {
|
|
11395
|
-
const ve = d.x + d.width / 2,
|
|
11396
|
-
h = i.getAll().find((
|
|
11397
|
-
if (
|
|
11398
|
-
const _e =
|
|
11399
|
-
return typeof _e.x == "number" && typeof _e.width == "number" && ve >= _e.x && ve <= _e.x + _e.width &&
|
|
11400
|
+
const ve = d.x + d.width / 2, de = d.y + d.height / 2;
|
|
11401
|
+
h = i.getAll().find((me) => {
|
|
11402
|
+
if (me.type !== "bpmn:Participant") return !1;
|
|
11403
|
+
const _e = me;
|
|
11404
|
+
return typeof _e.x == "number" && typeof _e.width == "number" && ve >= _e.x && ve <= _e.x + _e.width && de >= _e.y && de <= _e.y + _e.height;
|
|
11400
11405
|
});
|
|
11401
11406
|
}
|
|
11402
11407
|
if (!h || typeof h.x != "number" || typeof h.width != "number") continue;
|
|
@@ -11404,31 +11409,31 @@ function KA(e, t, n) {
|
|
|
11404
11409
|
(ve) => ve.type === "bpmn:Association"
|
|
11405
11410
|
), v = (w != null && w.anchor ? i.get(w.anchor) : void 0) ?? (y ? ((p = y.source) == null ? void 0 : p.id) === f ? y.target : y.source : void 0);
|
|
11406
11411
|
if (!v) continue;
|
|
11407
|
-
const b = v.waypoints, E = b != null && b.length ? { x: b[Math.floor((b.length - 1) / 2)].x, y: b[Math.floor((b.length - 1) / 2)].y, width: 0, height: 0 } : { x: v.x, y: v.y, width: v.width, height: v.height }, A = { width: d.width, height: d.height },
|
|
11408
|
-
if (P && P in eu && H.push(nu(i, E, A, h, { placement: { side: P, offset: (w == null ? void 0 : w.offset) ?? null }, selfId: f })), k && !tu(
|
|
11412
|
+
const b = v.waypoints, E = b != null && b.length ? { x: b[Math.floor((b.length - 1) / 2)].x, y: b[Math.floor((b.length - 1) / 2)].y, width: 0, height: 0 } : { x: v.x, y: v.y, width: v.width, height: v.height }, A = { width: d.width, height: d.height }, I = { x: d.x + d.width / 2, y: d.y + d.height / 2 }, P = w == null ? void 0 : w.side, k = Lw(i, E, h), H = [];
|
|
11413
|
+
if (P && P in eu && H.push(nu(i, E, A, h, { placement: { side: P, offset: (w == null ? void 0 : w.offset) ?? null }, selfId: f })), k && !tu(I, A, k))
|
|
11409
11414
|
for (const ve of WA)
|
|
11410
11415
|
H.push(nu(i, E, A, h, { placement: { side: ve, offset: null }, selfId: f }));
|
|
11411
|
-
for (const [ve,
|
|
11412
|
-
for (let
|
|
11413
|
-
H.push({ x:
|
|
11416
|
+
for (const [ve, de] of [[-1, 0], [1, 0], [0, -1], [0, 1]])
|
|
11417
|
+
for (let me = 1; me <= VA; me++)
|
|
11418
|
+
H.push({ x: I.x + ve * gy * me, y: I.y + de * gy * me });
|
|
11414
11419
|
const F = { ...s, edges: s.edges.filter((ve) => ve.id !== (y == null ? void 0 : y.id)) }, G = r(F), ee = G.filter((ve) => Up(ve).includes(f)).length;
|
|
11415
11420
|
if (!ee) continue;
|
|
11416
11421
|
let se, ie = !1;
|
|
11417
11422
|
for (const ve of H) {
|
|
11418
|
-
const
|
|
11419
|
-
if (!
|
|
11423
|
+
const de = ve.x - I.x, me = ve.y - I.y;
|
|
11424
|
+
if (!de && !me || ve.x - A.width / 2 < h.x || ve.x + A.width / 2 > h.x + h.width || ve.y - A.height / 2 < h.y || ve.y + A.height / 2 > h.y + h.height || k && !tu(ve, A, k)) continue;
|
|
11420
11425
|
const _e = {
|
|
11421
11426
|
...F,
|
|
11422
|
-
shapes: F.shapes.map((Q) => Q.id === f ? { ...Q, x: Q.x +
|
|
11427
|
+
shapes: F.shapes.map((Q) => Q.id === f ? { ...Q, x: Q.x + de, y: Q.y + me } : Q)
|
|
11423
11428
|
}, U = r(_e), le = U.filter((Q) => Up(Q).includes(f)).length;
|
|
11424
11429
|
if (le >= ee || U.length > G.length) continue;
|
|
11425
|
-
const K = Math.abs(
|
|
11426
|
-
if (ie || ((!se || le < se.mine || le === se.mine && (U.length < se.all || U.length === se.all && K < se.dist)) && (se = { x: ve.x, y: ve.y, mine: le, all: U.length, dist: K }), se.mine === 0 && se.all < G.length && (ie = !0)), le === 0 && U.length < G.length && YA(e, d,
|
|
11430
|
+
const K = Math.abs(de) + Math.abs(me);
|
|
11431
|
+
if (ie || ((!se || le < se.mine || le === se.mine && (U.length < se.all || U.length === se.all && K < se.dist)) && (se = { x: ve.x, y: ve.y, mine: le, all: U.length, dist: K }), se.mine === 0 && se.all < G.length && (ie = !0)), le === 0 && U.length < G.length && YA(e, d, de, me) === 0) {
|
|
11427
11432
|
se = { x: ve.x, y: ve.y, mine: le, all: U.length, dist: K };
|
|
11428
11433
|
break;
|
|
11429
11434
|
}
|
|
11430
11435
|
}
|
|
11431
|
-
se && o.moveElements([d], { x: se.x -
|
|
11436
|
+
se && o.moveElements([d], { x: se.x - I.x, y: se.y - I.y });
|
|
11432
11437
|
}
|
|
11433
11438
|
}
|
|
11434
11439
|
const XA = 60;
|
|
@@ -11447,21 +11452,21 @@ function ZA(e, t, n) {
|
|
|
11447
11452
|
if (!s.get(w)) return [w];
|
|
11448
11453
|
const v = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set([w]);
|
|
11449
11454
|
for (let A = 0; A < 4; A++) {
|
|
11450
|
-
let
|
|
11455
|
+
let I = !1;
|
|
11451
11456
|
for (const P of n.shapes)
|
|
11452
11457
|
P.type !== "bpmn:Group" || v.has(P.id) || [...b].some((k) => {
|
|
11453
11458
|
const H = s.get(k);
|
|
11454
11459
|
return H && c(P, H);
|
|
11455
|
-
}) && (v.add(P.id),
|
|
11460
|
+
}) && (v.add(P.id), I = !0);
|
|
11456
11461
|
for (const P of n.shapes)
|
|
11457
11462
|
P.type !== "bpmn:Participant" || b.has(P.id) || [...v].some((k) => {
|
|
11458
11463
|
const H = s.get(k);
|
|
11459
11464
|
return H && c(H, P);
|
|
11460
|
-
}) && (b.add(P.id),
|
|
11461
|
-
if (!
|
|
11465
|
+
}) && (b.add(P.id), I = !0);
|
|
11466
|
+
if (!I) break;
|
|
11462
11467
|
}
|
|
11463
|
-
const E = n.shapes.filter((A) => !A.parent && !b.has(A.id) && !v.has(A.id) && A.type !== "bpmn:Group" && A.type !== "bpmn:Participant").filter((A) => [...v].some((
|
|
11464
|
-
const P = s.get(
|
|
11468
|
+
const E = n.shapes.filter((A) => !A.parent && !b.has(A.id) && !v.has(A.id) && A.type !== "bpmn:Group" && A.type !== "bpmn:Participant").filter((A) => [...v].some((I) => {
|
|
11469
|
+
const P = s.get(I);
|
|
11465
11470
|
return P && c(P, A);
|
|
11466
11471
|
})).map((A) => A.id);
|
|
11467
11472
|
return [...b, ...v, ...E];
|
|
@@ -11480,7 +11485,7 @@ function ZA(e, t, n) {
|
|
|
11480
11485
|
if (!G || !ee) continue;
|
|
11481
11486
|
const [se, ie] = G.x <= ee.x ? [G, ee] : [ee, G];
|
|
11482
11487
|
if (k.contained) continue;
|
|
11483
|
-
const ve = s.get(se.id),
|
|
11488
|
+
const ve = s.get(se.id), de = s.get(ie.id), me = ve && de ? Math.max(de.x - (ve.x + ve.width), 0) : XA, _e = se.x + se.width + me - ie.x;
|
|
11484
11489
|
if (_e <= 0) continue;
|
|
11485
11490
|
const U = l(ie.id).filter((le) => i.get(le));
|
|
11486
11491
|
U.length && (!E || _e > E.dx) && (E = { movers: U, dx: _e });
|
|
@@ -11489,8 +11494,8 @@ function ZA(e, t, n) {
|
|
|
11489
11494
|
const A = E.movers.map((k) => i.get(k)).filter((k) => !!k && typeof k.x == "number");
|
|
11490
11495
|
if (!A.length) break;
|
|
11491
11496
|
o.moveElements(A, { x: E.dx, y: 0 }), d.push({ els: A, dx: E.dx });
|
|
11492
|
-
const
|
|
11493
|
-
P < p &&
|
|
11497
|
+
const I = r(We(i)), P = a(I).length;
|
|
11498
|
+
P < p && I.length <= f && (P < h || P === h && I.length < m || g === 0) && (g = d.length, h = P, m = I.length);
|
|
11494
11499
|
}
|
|
11495
11500
|
for (const { els: w, dx: y } of d.slice(g).reverse()) o.moveElements(w, { x: -y, y: 0 });
|
|
11496
11501
|
}
|
|
@@ -11618,8 +11623,8 @@ function nP(e, t, n, i) {
|
|
|
11618
11623
|
if (!(!m || Math.abs(m.x - h.x) >= 0.5 || Math.abs(m.y - h.y) >= 0.5 || Math.abs(m.width - h.width) >= 0.5 || Math.abs(m.height - h.height) >= 0.5)) continue;
|
|
11619
11624
|
const y = h.members.map((Fe) => o.get(Fe)).filter((Fe) => !!Fe && typeof Fe.x == "number");
|
|
11620
11625
|
if (!y.length) continue;
|
|
11621
|
-
const v = Math.min(...y.map((Fe) => Fe.x)), b = Math.min(...y.map((Fe) => Fe.y)), E = Math.max(...y.map((Fe) => Fe.x + Fe.width)), A = Math.max(...y.map((Fe) => Fe.y + Fe.height)),
|
|
11622
|
-
let F =
|
|
11626
|
+
const v = Math.min(...y.map((Fe) => Fe.x)), b = Math.min(...y.map((Fe) => Fe.y)), E = Math.max(...y.map((Fe) => Fe.x + Fe.width)), A = Math.max(...y.map((Fe) => Fe.y + Fe.height)), I = h.x, P = h.y, k = h.x + h.width, H = h.y + h.height;
|
|
11627
|
+
let F = I, G = P, ee = k, se = H;
|
|
11623
11628
|
for (const Fe of g) {
|
|
11624
11629
|
const $ = s.edges.find((R) => R.id === Fe.edge);
|
|
11625
11630
|
if (!$) continue;
|
|
@@ -11627,17 +11632,17 @@ function nP(e, t, n, i) {
|
|
|
11627
11632
|
const W = s.shapes.find((Te) => Te.id === R);
|
|
11628
11633
|
if (!W || W.container) return !1;
|
|
11629
11634
|
const q = W.x + W.width / 2, pe = W.y + W.height / 2;
|
|
11630
|
-
return
|
|
11635
|
+
return I < q && q < k && P < pe && pe < H;
|
|
11631
11636
|
});
|
|
11632
11637
|
for (const R of xn($)) {
|
|
11633
|
-
const W = R.axis === "v" ? [P, H] : [
|
|
11634
|
-
Math.min(R.hi, W[1]) - Math.max(R.lo, W[0]) < _w || (R.axis === "v" ?
|
|
11638
|
+
const W = R.axis === "v" ? [P, H] : [I, k];
|
|
11639
|
+
Math.min(R.hi, W[1]) - Math.max(R.lo, W[0]) < _w || (R.axis === "v" ? I < R.at && R.at < k : P < R.at && R.at < H) && C || (R.axis === "v" ? (Math.abs(R.at - I) <= Cs && (F = Math.max(F, R.at + Yc)), Math.abs(R.at - k) <= Cs && (ee = Math.min(ee, R.at - Yc))) : (Math.abs(R.at - P) <= Cs && (G = Math.max(G, R.at + Yc)), Math.abs(R.at - H) <= Cs && (se = Math.min(se, R.at - Yc))));
|
|
11635
11640
|
}
|
|
11636
11641
|
}
|
|
11637
|
-
if (F > v - Kc && (F =
|
|
11638
|
-
const ie = o.get(d), ve = { x: ie.x, y: ie.y, width: ie.width, height: ie.height },
|
|
11642
|
+
if (F > v - Kc && (F = I), G > b - Kc && (G = P), ee < E + Kc && (ee = k), se < A + Kc && (se = H), F === I && G === P && ee === k && se === H) continue;
|
|
11643
|
+
const ie = o.get(d), ve = { x: ie.x, y: ie.y, width: ie.width, height: ie.height }, de = We(o), me = new Set(pt(de).map(ft)), _e = a(de);
|
|
11639
11644
|
r.resizeShape(ie, { x: F, y: G, width: ee - F, height: se - G });
|
|
11640
|
-
let U = We(o), le = pt(U).filter((Fe) => !
|
|
11645
|
+
let U = We(o), le = pt(U).filter((Fe) => !me.has(ft(Fe)));
|
|
11641
11646
|
const K = [];
|
|
11642
11647
|
if (le.length > 0 && le.every(
|
|
11643
11648
|
(Fe) => Fe.kind === "label-over-line" && !i.has(Fe.edge) && U.edges.some(($) => $.id === Fe.edge)
|
|
@@ -11649,10 +11654,10 @@ function nP(e, t, n, i) {
|
|
|
11649
11654
|
const W = C.x - R.x, q = C.y - R.y;
|
|
11650
11655
|
r.moveElements([R], { x: W, y: q }), K.push({ label: R, dx: W, dy: q });
|
|
11651
11656
|
}
|
|
11652
|
-
U = We(o), le = pt(U).filter((Fe) => !
|
|
11657
|
+
U = We(o), le = pt(U).filter((Fe) => !me.has(ft(Fe)));
|
|
11653
11658
|
}
|
|
11654
|
-
const
|
|
11655
|
-
if (le.length || Ee ||
|
|
11659
|
+
const he = a(U), Ee = [...he].some((Fe) => !_e.has(Fe));
|
|
11660
|
+
if (le.length || Ee || he.size >= _e.size) {
|
|
11656
11661
|
for (const Fe of K.reverse()) r.moveElements([Fe.label], { x: -Fe.dx, y: -Fe.dy });
|
|
11657
11662
|
r.resizeShape(ie, ve);
|
|
11658
11663
|
}
|
|
@@ -11690,29 +11695,29 @@ function oP(e, t, n = {}) {
|
|
|
11690
11695
|
};
|
|
11691
11696
|
if (s.length) return { ok: !1, issues: s, findings: [], stats: c };
|
|
11692
11697
|
const l = BA(t, a, i), u = i && l.writes.size ? iP(l.writes, r.elementRegistry, r.canvas, i) : void 0, p = We(r.elementRegistry), f = new Set(pt(p).map(ft)), d = new Set(pt(p, { includeObservationOnly: !0 }).map(ft)), g = new Set(
|
|
11693
|
-
Iw(l.ops, (
|
|
11694
|
-
var
|
|
11695
|
-
return (_e = (
|
|
11698
|
+
Iw(l.ops, (de) => {
|
|
11699
|
+
var me, _e;
|
|
11700
|
+
return (_e = (me = r.elementRegistry.get(de)) == null ? void 0 : me.source) == null ? void 0 : _e.id;
|
|
11696
11701
|
}).keys()
|
|
11697
|
-
), h = new Set(p.edges.map((
|
|
11702
|
+
), h = new Set(p.edges.map((de) => de.id).filter((de) => !g.has(de))), m = new Set(
|
|
11698
11703
|
t.flatMap(
|
|
11699
|
-
(
|
|
11704
|
+
(de) => de.kind === "sequenceFlow.update" && (de.source !== void 0 || de.target !== void 0) ? [de.id] : []
|
|
11700
11705
|
)
|
|
11701
11706
|
), w = () => new Set(
|
|
11702
|
-
p.edges.filter((
|
|
11707
|
+
p.edges.filter((de) => {
|
|
11703
11708
|
var _e;
|
|
11704
|
-
const
|
|
11705
|
-
return
|
|
11706
|
-
}).map((
|
|
11707
|
-
), y = (
|
|
11708
|
-
for (const
|
|
11709
|
-
(
|
|
11709
|
+
const me = (_e = r.elementRegistry.get(de.id)) == null ? void 0 : _e.waypoints;
|
|
11710
|
+
return me ? !(me.length === de.waypoints.length && de.waypoints.every((U, le) => Math.round(U.x) === Math.round(me[le].x) && Math.round(U.y) === Math.round(me[le].y))) : !1;
|
|
11711
|
+
}).map((de) => de.id)
|
|
11712
|
+
), y = (de, me) => new Set([...de].filter((_e) => !me.has(_e))), v = new Set(p.shapes.map((de) => de.id)), b = er(p), E = b.length, A = new Set(b.map(([de, me]) => `${de}|${me}`)), I = to(p), P = new Set(I.map(([de, me]) => `${de}|${me}`)), k = /* @__PURE__ */ new Map();
|
|
11713
|
+
for (const de of r.elementRegistry.filter(
|
|
11714
|
+
(me) => "waypoints" in me && !!me.waypoints
|
|
11710
11715
|
))
|
|
11711
|
-
|
|
11712
|
-
wps:
|
|
11713
|
-
label: { x:
|
|
11714
|
-
source: (ie =
|
|
11715
|
-
target: (ve =
|
|
11716
|
+
de.label && k.set(de.id, {
|
|
11717
|
+
wps: de.waypoints.map((me) => ({ x: me.x, y: me.y })),
|
|
11718
|
+
label: { x: de.label.x, y: de.label.y },
|
|
11719
|
+
source: (ie = de.source) == null ? void 0 : ie.id,
|
|
11720
|
+
target: (ve = de.target) == null ? void 0 : ve.id
|
|
11716
11721
|
});
|
|
11717
11722
|
const H = e.get("commandStack");
|
|
11718
11723
|
try {
|
|
@@ -11720,29 +11725,29 @@ function oP(e, t, n = {}) {
|
|
|
11720
11725
|
o(l.ops, r);
|
|
11721
11726
|
for (const U of (u == null ? void 0 : u.contexts()) ?? []) H.execute(ew, U);
|
|
11722
11727
|
ZA(r, f, p), JA(r, p), tP(r, f, p), JM(r, p, m), YM(r, h, v), QM(r, h);
|
|
11723
|
-
const
|
|
11728
|
+
const de = Zm(r, f);
|
|
11724
11729
|
FM(r, A, h);
|
|
11725
|
-
const
|
|
11730
|
+
const me = w(), _e = EA(
|
|
11726
11731
|
r,
|
|
11727
11732
|
f,
|
|
11728
|
-
y(h,
|
|
11729
|
-
|
|
11733
|
+
y(h, me),
|
|
11734
|
+
me
|
|
11730
11735
|
);
|
|
11731
|
-
dA(r, h), fA(r, h, m), bA(r, f, h), _A(r, f, h), WM(r, P, h), rA(r, h, p), kA(r, f, y(h, w())), TA(r, h, /* @__PURE__ */ new Set([...m, ..._e])), DA(r, v), KA(r, f, v), Zm(r, f,
|
|
11736
|
+
dA(r, h), fA(r, h, m), bA(r, f, h), _A(r, f, h), WM(r, P, h), rA(r, h, p), kA(r, f, y(h, w())), TA(r, h, /* @__PURE__ */ new Set([...m, ..._e])), DA(r, v), KA(r, f, v), Zm(r, f, de), nP(r, d, p, h), IA(r, f), PA(r, k, UA(r));
|
|
11732
11737
|
});
|
|
11733
|
-
} catch (
|
|
11738
|
+
} catch (de) {
|
|
11734
11739
|
return {
|
|
11735
11740
|
ok: !1,
|
|
11736
11741
|
// 하강 중에야 드러나는 거부 중 **구조화할 수 있는 것**은 그 issue 를 그대로 낸다(B-128) — 나머지는 자유 문장
|
|
11737
11742
|
issues: [
|
|
11738
|
-
|
|
11743
|
+
de instanceof Nw ? de.issue : { kind: "lower-failed", message: de instanceof Error ? de.message : String(de) }
|
|
11739
11744
|
],
|
|
11740
11745
|
findings: [],
|
|
11741
11746
|
stats: c
|
|
11742
11747
|
};
|
|
11743
11748
|
}
|
|
11744
11749
|
const F = We(r.elementRegistry), G = pt(F, { includeObservationOnly: !0 }).filter(
|
|
11745
|
-
(
|
|
11750
|
+
(de) => !d.has(ft(de))
|
|
11746
11751
|
), ee = xM(F), se = to(F);
|
|
11747
11752
|
return {
|
|
11748
11753
|
ok: !0,
|
|
@@ -11759,7 +11764,7 @@ function oP(e, t, n = {}) {
|
|
|
11759
11764
|
crossPoolMessages: ee.crossPoolMessages
|
|
11760
11765
|
},
|
|
11761
11766
|
sharedEndpointCrossings: {
|
|
11762
|
-
before:
|
|
11767
|
+
before: I.length,
|
|
11763
11768
|
after: se.length,
|
|
11764
11769
|
pairs: se
|
|
11765
11770
|
}
|
|
@@ -11794,7 +11799,7 @@ function sP(e, t = {}) {
|
|
|
11794
11799
|
n.filter((U) => U.$type === "bpmn:Process").map((U) => [U.id, U])
|
|
11795
11800
|
), r = [], a = [], s = [], c = [], l = [], u = [], p = { poolOrders: {}, bands: {}, placements: {}, afterColumns: {} }, f = [], d = [], g = [], h = [], m = [], w = [], y = [], v = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), A = (U) => {
|
|
11796
11801
|
U && b.add(U);
|
|
11797
|
-
},
|
|
11802
|
+
}, I = (U) => {
|
|
11798
11803
|
b.add(U), E.add(U);
|
|
11799
11804
|
}, P = (U) => {
|
|
11800
11805
|
const le = yy(U, "bwl:Placement");
|
|
@@ -11811,7 +11816,7 @@ function sP(e, t = {}) {
|
|
|
11811
11816
|
for (const K of U)
|
|
11812
11817
|
switch (A(K.id), K.$type) {
|
|
11813
11818
|
case "bpmn:TextAnnotation":
|
|
11814
|
-
|
|
11819
|
+
I(K.id), v.set(K.id, K), c.push({ id: K.id, text: typeof K.text == "string" ? K.text : "" }), P(K);
|
|
11815
11820
|
break;
|
|
11816
11821
|
case "bpmn:Association":
|
|
11817
11822
|
g.push({
|
|
@@ -11822,7 +11827,7 @@ function sP(e, t = {}) {
|
|
|
11822
11827
|
});
|
|
11823
11828
|
break;
|
|
11824
11829
|
case "bpmn:Group": {
|
|
11825
|
-
|
|
11830
|
+
I(K.id), v.set(K.id, K);
|
|
11826
11831
|
const Q = (le = K.categoryValueRef) == null ? void 0 : le.value;
|
|
11827
11832
|
l.push({ id: K.id, ...typeof Q == "string" && Q ? { name: Q } : {} }), k(K);
|
|
11828
11833
|
break;
|
|
@@ -11836,12 +11841,12 @@ function sP(e, t = {}) {
|
|
|
11836
11841
|
for (const le of U.artifacts ?? [])
|
|
11837
11842
|
A(le.id), u.push({ id: le.id, type: le.$type, reason: "inside-container" });
|
|
11838
11843
|
}, G = (U, le) => {
|
|
11839
|
-
const K = U.flowElements ?? [], Q = (U.laneSets ?? []).flatMap((Ee) => Ee.lanes ?? []),
|
|
11844
|
+
const K = U.flowElements ?? [], Q = (U.laneSets ?? []).flatMap((Ee) => Ee.lanes ?? []), he = /* @__PURE__ */ new Map();
|
|
11840
11845
|
for (const Ee of Q) {
|
|
11841
11846
|
A(Ee.id), v.set(Ee.id, Ee);
|
|
11842
11847
|
for (const Fe of Ee.flowNodeRef ?? []) {
|
|
11843
11848
|
const $ = Hi(Fe);
|
|
11844
|
-
$ &&
|
|
11849
|
+
$ && he.set($, Ee.id);
|
|
11845
11850
|
}
|
|
11846
11851
|
}
|
|
11847
11852
|
for (const Ee of K) {
|
|
@@ -11855,7 +11860,7 @@ function sP(e, t = {}) {
|
|
|
11855
11860
|
continue;
|
|
11856
11861
|
}
|
|
11857
11862
|
if (Ee.$type === "bpmn:DataStoreReference") {
|
|
11858
|
-
|
|
11863
|
+
I(Ee.id), s.push({ id: Ee.id, ...Ee.name ? { name: Ee.name } : {} });
|
|
11859
11864
|
continue;
|
|
11860
11865
|
}
|
|
11861
11866
|
const Fe = rP(Ee.$type), $ = Fe === "intermediateCatchEvent" ? Wb((Ee.eventDefinitions ?? []).map((q) => q.$type)) : void 0;
|
|
@@ -11863,14 +11868,14 @@ function sP(e, t = {}) {
|
|
|
11863
11868
|
u.push({ id: Ee.id, type: Ee.$type, reason: "type-outside-mvp" });
|
|
11864
11869
|
continue;
|
|
11865
11870
|
}
|
|
11866
|
-
|
|
11871
|
+
I(Ee.id);
|
|
11867
11872
|
const C = Fe === "boundaryEvent" ? Hi(Ee.attachedToRef) : void 0;
|
|
11868
11873
|
a.push({
|
|
11869
11874
|
id: Ee.id,
|
|
11870
11875
|
type: Fe,
|
|
11871
11876
|
...Ee.name ? { name: Ee.name } : {},
|
|
11872
11877
|
...le ? { participant: le } : {},
|
|
11873
|
-
...
|
|
11878
|
+
...he.has(Ee.id) ? { lane: he.get(Ee.id) } : {},
|
|
11874
11879
|
...C ? { attachedTo: C } : {},
|
|
11875
11880
|
...$ ? { eventDefinition: $ } : {}
|
|
11876
11881
|
}), Fe === "subProcess" && F(Ee);
|
|
@@ -11899,12 +11904,12 @@ function sP(e, t = {}) {
|
|
|
11899
11904
|
if (i) {
|
|
11900
11905
|
const U = /* @__PURE__ */ new Set();
|
|
11901
11906
|
for (const le of i.participants ?? []) {
|
|
11902
|
-
|
|
11907
|
+
I(le.id), v.set(le.id, le);
|
|
11903
11908
|
const K = Hi(le.processRef);
|
|
11904
11909
|
K && U.add(K);
|
|
11905
|
-
const Q = K ? o.get(K) : void 0,
|
|
11906
|
-
for (const C of Ee)
|
|
11907
|
-
const Fe = !Q || (Q.flowElements ?? []).length === 0 &&
|
|
11910
|
+
const Q = K ? o.get(K) : void 0, he = ((Q == null ? void 0 : Q.laneSets) ?? []).flatMap((C) => C.lanes ?? []), Ee = he.map((C) => ({ id: C.id, ...C.name ? { name: C.name } : {} }));
|
|
11911
|
+
for (const C of Ee) I(C.id);
|
|
11912
|
+
const Fe = !Q || (Q.flowElements ?? []).length === 0 && he.length === 0 && (Q.artifacts ?? []).length === 0;
|
|
11908
11913
|
r.push({
|
|
11909
11914
|
id: le.id,
|
|
11910
11915
|
...le.name ? { name: le.name } : {},
|
|
@@ -11926,38 +11931,38 @@ function sP(e, t = {}) {
|
|
|
11926
11931
|
!U.has(le) && (K.flowElements ?? []).length > 0 && u.push({ id: le, type: K.$type, reason: "unreachable-process" });
|
|
11927
11932
|
} else
|
|
11928
11933
|
for (const U of o.values()) G(U);
|
|
11929
|
-
const ee = [], se = [], ie = [], ve = [],
|
|
11934
|
+
const ee = [], se = [], ie = [], ve = [], de = (U, le) => !!U && !!le && E.has(U) && E.has(le);
|
|
11930
11935
|
for (const U of f) {
|
|
11931
|
-
if (!
|
|
11936
|
+
if (!de(U.source, U.target)) {
|
|
11932
11937
|
u.push({ id: U.id, type: "bpmn:SequenceFlow", reason: "endpoint-outside-mvp" });
|
|
11933
11938
|
continue;
|
|
11934
11939
|
}
|
|
11935
11940
|
ee.push({ id: U.id, source: U.source, target: U.target, ...U.name ? { name: U.name } : {} }), E.add(U.id);
|
|
11936
11941
|
}
|
|
11937
11942
|
for (const U of d) {
|
|
11938
|
-
if (!
|
|
11943
|
+
if (!de(U.source, U.target)) {
|
|
11939
11944
|
u.push({ id: U.id, type: "bpmn:MessageFlow", reason: "endpoint-outside-mvp" });
|
|
11940
11945
|
continue;
|
|
11941
11946
|
}
|
|
11942
11947
|
se.push({ id: U.id, source: U.source, target: U.target, ...U.name ? { name: U.name } : {} }), E.add(U.id);
|
|
11943
11948
|
}
|
|
11944
11949
|
for (const U of h) {
|
|
11945
|
-
if (!
|
|
11950
|
+
if (!de(U.source, U.target)) {
|
|
11946
11951
|
u.push({ id: U.id ?? "", type: U.type, reason: "endpoint-outside-mvp" });
|
|
11947
11952
|
continue;
|
|
11948
11953
|
}
|
|
11949
11954
|
ve.push({ ...U.id ? { id: U.id } : {}, source: U.source, target: U.target }), U.id && E.add(U.id);
|
|
11950
11955
|
}
|
|
11951
11956
|
for (const U of g) {
|
|
11952
|
-
if (!
|
|
11957
|
+
if (!de(U.source, U.target)) {
|
|
11953
11958
|
u.push({ id: U.id ?? "", type: U.type, reason: "endpoint-outside-mvp" });
|
|
11954
11959
|
continue;
|
|
11955
11960
|
}
|
|
11956
11961
|
ie.push({ ...U.id ? { id: U.id } : {}, source: U.source, target: U.target });
|
|
11957
11962
|
}
|
|
11958
|
-
const
|
|
11963
|
+
const me = new Map(l.map((U) => [U.id, U]));
|
|
11959
11964
|
for (const { owner: U, refs: le } of y) {
|
|
11960
|
-
const K = le.filter((
|
|
11965
|
+
const K = le.filter((he) => b.has(he)), Q = me.get(U);
|
|
11961
11966
|
Q && K.length && (Q.members = K);
|
|
11962
11967
|
}
|
|
11963
11968
|
for (const U of m)
|
|
@@ -13108,7 +13113,7 @@ function Zw(e, t) {
|
|
|
13108
13113
|
v = Tl(v.slice());
|
|
13109
13114
|
else
|
|
13110
13115
|
throw s(`Cannot invoke "${v}". Expected a function!`);
|
|
13111
|
-
const A = (v.$inject || aT(v)).map((
|
|
13116
|
+
const A = (v.$inject || aT(v)).map((I) => Jp(b, I) ? b[I] : c(I));
|
|
13112
13117
|
return {
|
|
13113
13118
|
fn: v,
|
|
13114
13119
|
dependencies: A
|
|
@@ -13124,19 +13129,19 @@ function Zw(e, t) {
|
|
|
13124
13129
|
function p(v, b, E) {
|
|
13125
13130
|
const {
|
|
13126
13131
|
fn: A,
|
|
13127
|
-
dependencies:
|
|
13132
|
+
dependencies: I
|
|
13128
13133
|
} = l(v, E);
|
|
13129
|
-
return A.apply(b,
|
|
13134
|
+
return A.apply(b, I);
|
|
13130
13135
|
}
|
|
13131
13136
|
function f(v) {
|
|
13132
13137
|
return Tl((b) => v.get(b));
|
|
13133
13138
|
}
|
|
13134
13139
|
function d(v, b) {
|
|
13135
13140
|
if (b && b.length) {
|
|
13136
|
-
const E = /* @__PURE__ */ Object.create(null), A = /* @__PURE__ */ Object.create(null),
|
|
13141
|
+
const E = /* @__PURE__ */ Object.create(null), A = /* @__PURE__ */ Object.create(null), I = [], P = [], k = [];
|
|
13137
13142
|
let H, F, G, ee;
|
|
13138
13143
|
for (let se in o)
|
|
13139
|
-
H = o[se], b.indexOf(se) !== -1 && (H[2] === "private" ? (F =
|
|
13144
|
+
H = o[se], b.indexOf(se) !== -1 && (H[2] === "private" ? (F = I.indexOf(H[3]), F === -1 ? (G = H[3].createChild([], b), ee = f(G), I.push(H[3]), P.push(G), k.push(ee), E[se] = [ee, se, "private", G]) : E[se] = [k[F], se, "private", P[F]]) : E[se] = [H[2], H[1]], A[se] = !0), (H[2] === "factory" || H[2] === "type") && H[1].$scope && b.forEach((ie) => {
|
|
13140
13145
|
H[1].$scope.indexOf(ie) !== -1 && (E[se] = [H[2], H[1]], A[ie] = !0);
|
|
13141
13146
|
});
|
|
13142
13147
|
b.forEach((se) => {
|
|
@@ -13164,7 +13169,7 @@ function Zw(e, t) {
|
|
|
13164
13169
|
function m(v) {
|
|
13165
13170
|
const b = v.__exports__;
|
|
13166
13171
|
if (b) {
|
|
13167
|
-
const E = v.__modules__, A = Object.keys(v).reduce((F, G) => (G !== "__exports__" && G !== "__modules__" && G !== "__init__" && G !== "__depends__" && (F[G] = v[G]), F), /* @__PURE__ */ Object.create(null)),
|
|
13172
|
+
const E = v.__modules__, A = Object.keys(v).reduce((F, G) => (G !== "__exports__" && G !== "__modules__" && G !== "__init__" && G !== "__depends__" && (F[G] = v[G]), F), /* @__PURE__ */ Object.create(null)), I = (E || []).concat(A), P = d(I), k = Tl(function(F) {
|
|
13168
13173
|
return P.get(F);
|
|
13169
13174
|
});
|
|
13170
13175
|
b.forEach(function(F) {
|
|
@@ -13188,8 +13193,8 @@ function Zw(e, t) {
|
|
|
13188
13193
|
o[E] = A;
|
|
13189
13194
|
return;
|
|
13190
13195
|
}
|
|
13191
|
-
const
|
|
13192
|
-
o[E] = [g[
|
|
13196
|
+
const I = A[0], P = A[1];
|
|
13197
|
+
o[E] = [g[I], sT(I, P), I];
|
|
13193
13198
|
}), h(v, a);
|
|
13194
13199
|
}
|
|
13195
13200
|
function w(v, b) {
|
|
@@ -13623,11 +13628,11 @@ function TT(e, t, n) {
|
|
|
13623
13628
|
h = Ly(...t, d / c), u[d] = { x: h.x, y: h.y, t: d / c };
|
|
13624
13629
|
for (d = 0; d < s; d++)
|
|
13625
13630
|
for (g = 0; g < c; g++) {
|
|
13626
|
-
var m = l[d], w = l[d + 1], y = u[g], v = u[g + 1], b = Xo(w.x - m.x) < 0.01 ? "y" : "x", E = Xo(v.x - y.x) < 0.01 ? "y" : "x", A = PT(m.x, m.y, w.x, w.y, y.x, y.y, v.x, v.y),
|
|
13631
|
+
var m = l[d], w = l[d + 1], y = u[g], v = u[g + 1], b = Xo(w.x - m.x) < 0.01 ? "y" : "x", E = Xo(v.x - y.x) < 0.01 ? "y" : "x", A = PT(m.x, m.y, w.x, w.y, y.x, y.y, v.x, v.y), I;
|
|
13627
13632
|
if (A) {
|
|
13628
|
-
if (
|
|
13633
|
+
if (I = A.x.toFixed(9) + "#" + A.y.toFixed(9), p[I])
|
|
13629
13634
|
continue;
|
|
13630
|
-
p[
|
|
13635
|
+
p[I] = !0;
|
|
13631
13636
|
var P = m.t + Xo((A[b] - m[b]) / (w[b] - m[b])) * (w.t - m.t), k = y.t + Xo((A[E] - y[E]) / (v[E] - y[E])) * (v.t - y.t);
|
|
13632
13637
|
P >= 0 && P <= 1 && k >= 0 && k <= 1 && f.push({
|
|
13633
13638
|
x: A.x,
|
|
@@ -13742,27 +13747,27 @@ function t_(e, t, n, i, o, r, a, s, c, l) {
|
|
|
13742
13747
|
return { x: W, y: q };
|
|
13743
13748
|
});
|
|
13744
13749
|
if (l)
|
|
13745
|
-
|
|
13750
|
+
I = l[0], P = l[1], E = l[2], A = l[3];
|
|
13746
13751
|
else {
|
|
13747
13752
|
d = g(e, t, -p), e = d.x, t = d.y, d = g(s, c, -p), s = d.x, c = d.y;
|
|
13748
13753
|
var h = (e - s) / 2, m = (t - c) / 2, w = h * h / (n * n) + m * m / (i * i);
|
|
13749
13754
|
w > 1 && (w = rn.sqrt(w), n = w * n, i = w * i);
|
|
13750
|
-
var y = n * n, v = i * i, b = (r == a ? -1 : 1) * rn.sqrt(Xo((y * v - y * m * m - v * h * h) / (y * m * m + v * h * h))), E = b * n * m / i + (e + s) / 2, A = b * -i * h / n + (t + c) / 2,
|
|
13751
|
-
|
|
13755
|
+
var y = n * n, v = i * i, b = (r == a ? -1 : 1) * rn.sqrt(Xo((y * v - y * m * m - v * h * h) / (y * m * m + v * h * h))), E = b * n * m / i + (e + s) / 2, A = b * -i * h / n + (t + c) / 2, I = rn.asin(((t - A) / i).toFixed(9)), P = rn.asin(((c - A) / i).toFixed(9));
|
|
13756
|
+
I = e < E ? Go - I : I, P = s < E ? Go - P : P, I < 0 && (I = Go * 2 + I), P < 0 && (P = Go * 2 + P), a && I > P && (I = I - Go * 2), !a && P > I && (P = P - Go * 2);
|
|
13752
13757
|
}
|
|
13753
|
-
var k = P -
|
|
13758
|
+
var k = P - I;
|
|
13754
13759
|
if (Xo(k) > u) {
|
|
13755
13760
|
var H = P, F = s, G = c;
|
|
13756
|
-
P =
|
|
13761
|
+
P = I + u * (a && P > I ? 1 : -1), s = E + n * rn.cos(P), c = A + i * rn.sin(P), f = t_(s, c, n, i, o, 0, a, F, G, [P, H, E, A]);
|
|
13757
13762
|
}
|
|
13758
|
-
k = P -
|
|
13759
|
-
var ee = rn.cos(
|
|
13763
|
+
k = P - I;
|
|
13764
|
+
var ee = rn.cos(I), se = rn.sin(I), ie = rn.cos(P), ve = rn.sin(P), de = rn.tan(k / 4), me = 4 / 3 * n * de, _e = 4 / 3 * i * de, U = [e, t], le = [e + me * se, t - _e * ee], K = [s + me * ve, c - _e * ie], Q = [s, c];
|
|
13760
13765
|
if (le[0] = 2 * U[0] - le[0], le[1] = 2 * U[1] - le[1], l)
|
|
13761
13766
|
return [le, K, Q].concat(f);
|
|
13762
13767
|
f = [le, K, Q].concat(f).join().split(",");
|
|
13763
|
-
for (var
|
|
13764
|
-
|
|
13765
|
-
return
|
|
13768
|
+
for (var he = [], Ee = 0, Fe = f.length; Ee < Fe; Ee++)
|
|
13769
|
+
he[Ee] = Ee % 2 ? g(f[Ee - 1], f[Ee], p).y : g(f[Ee], f[Ee + 1], p).x;
|
|
13770
|
+
return he;
|
|
13766
13771
|
}
|
|
13767
13772
|
function DT(e, t, n, i, o, r, a, s) {
|
|
13768
13773
|
for (var c = [], l = [[], []], u, p, f, d, g, h, m, w, y = 0; y < 2; ++y) {
|
|
@@ -14837,8 +14842,8 @@ function r2(e) {
|
|
|
14837
14842
|
function a2(e) {
|
|
14838
14843
|
var t = {}, n = [], i = {};
|
|
14839
14844
|
function o(K, Q) {
|
|
14840
|
-
return function(
|
|
14841
|
-
K(
|
|
14845
|
+
return function(he) {
|
|
14846
|
+
K(he, Q);
|
|
14842
14847
|
};
|
|
14843
14848
|
}
|
|
14844
14849
|
function r(K) {
|
|
@@ -14848,8 +14853,8 @@ function a2(e) {
|
|
|
14848
14853
|
return t[K.id];
|
|
14849
14854
|
}
|
|
14850
14855
|
function s(K, Q) {
|
|
14851
|
-
var
|
|
14852
|
-
if (
|
|
14856
|
+
var he = K.gfx;
|
|
14857
|
+
if (he)
|
|
14853
14858
|
throw new Error(
|
|
14854
14859
|
`already rendered ${jn(K)}`
|
|
14855
14860
|
);
|
|
@@ -14860,8 +14865,8 @@ function a2(e) {
|
|
|
14860
14865
|
}
|
|
14861
14866
|
function l(K, Q) {
|
|
14862
14867
|
try {
|
|
14863
|
-
var
|
|
14864
|
-
return r(K),
|
|
14868
|
+
var he = i[K.id] && s(K, Q);
|
|
14869
|
+
return r(K), he;
|
|
14865
14870
|
} catch (Ee) {
|
|
14866
14871
|
u(Ee.message, { element: K, error: Ee }), console.error(`failed to import ${jn(K)}`, Ee);
|
|
14867
14872
|
}
|
|
@@ -14870,11 +14875,11 @@ function a2(e) {
|
|
|
14870
14875
|
e.error(K, Q);
|
|
14871
14876
|
}
|
|
14872
14877
|
var p = this.registerDi = function(Q) {
|
|
14873
|
-
var
|
|
14874
|
-
|
|
14875
|
-
`multiple DI elements defined for ${jn(
|
|
14876
|
-
{ element:
|
|
14877
|
-
) : i[
|
|
14878
|
+
var he = Q.bpmnElement;
|
|
14879
|
+
he ? i[he.id] ? u(
|
|
14880
|
+
`multiple DI elements defined for ${jn(he)}`,
|
|
14881
|
+
{ element: he }
|
|
14882
|
+
) : i[he.id] = Q : u(
|
|
14878
14883
|
`no bpmnElement referenced in ${jn(Q)}`,
|
|
14879
14884
|
{ element: Q }
|
|
14880
14885
|
);
|
|
@@ -14888,17 +14893,17 @@ function a2(e) {
|
|
|
14888
14893
|
function g(K) {
|
|
14889
14894
|
p(K);
|
|
14890
14895
|
}
|
|
14891
|
-
this.handleDefinitions = function(Q,
|
|
14896
|
+
this.handleDefinitions = function(Q, he) {
|
|
14892
14897
|
var Ee = Q.diagrams;
|
|
14893
|
-
if (
|
|
14898
|
+
if (he && Ee.indexOf(he) === -1)
|
|
14894
14899
|
throw new Error("diagram not part of <bpmn:Definitions />");
|
|
14895
|
-
if (!
|
|
14900
|
+
if (!he && Ee && Ee.length && (he = Ee[0]), !he)
|
|
14896
14901
|
throw new Error("no diagram to display");
|
|
14897
|
-
i = {}, f(
|
|
14898
|
-
var Fe =
|
|
14902
|
+
i = {}, f(he);
|
|
14903
|
+
var Fe = he.plane;
|
|
14899
14904
|
if (!Fe)
|
|
14900
14905
|
throw new Error(
|
|
14901
|
-
`no plane for ${jn(
|
|
14906
|
+
`no plane for ${jn(he)}`
|
|
14902
14907
|
);
|
|
14903
14908
|
var $ = Fe.bpmnElement;
|
|
14904
14909
|
if (!$)
|
|
@@ -14924,13 +14929,13 @@ function a2(e) {
|
|
|
14924
14929
|
Q = n.shift(), Q();
|
|
14925
14930
|
};
|
|
14926
14931
|
function m(K, Q) {
|
|
14927
|
-
|
|
14932
|
+
de(K, Q), k(K.ioSpecification, Q), P(K.artifacts, Q), r(K);
|
|
14928
14933
|
}
|
|
14929
14934
|
function w(K, Q) {
|
|
14930
|
-
var
|
|
14935
|
+
var he = st(K, function(Ee) {
|
|
14931
14936
|
return !a(Ee) && Zn(Ee, "bpmn:Process") && Ee.laneSets;
|
|
14932
14937
|
});
|
|
14933
|
-
|
|
14938
|
+
he.forEach(o(m, Q));
|
|
14934
14939
|
}
|
|
14935
14940
|
function y(K, Q) {
|
|
14936
14941
|
l(K, Q);
|
|
@@ -14947,25 +14952,25 @@ function a2(e) {
|
|
|
14947
14952
|
function A(K, Q) {
|
|
14948
14953
|
l(K, Q);
|
|
14949
14954
|
}
|
|
14950
|
-
function
|
|
14955
|
+
function I(K, Q) {
|
|
14951
14956
|
l(K, Q);
|
|
14952
14957
|
}
|
|
14953
14958
|
function P(K, Q) {
|
|
14954
|
-
V(K, function(
|
|
14955
|
-
Zn(
|
|
14956
|
-
|
|
14957
|
-
}) :
|
|
14959
|
+
V(K, function(he) {
|
|
14960
|
+
Zn(he, "bpmn:Association") ? n.push(function() {
|
|
14961
|
+
I(he, Q);
|
|
14962
|
+
}) : I(he, Q);
|
|
14958
14963
|
});
|
|
14959
14964
|
}
|
|
14960
14965
|
function k(K, Q) {
|
|
14961
14966
|
K && (V(K.dataInputs, o(E, Q)), V(K.dataOutputs, o(A, Q)));
|
|
14962
14967
|
}
|
|
14963
|
-
var H = this.handleSubProcess = function(Q,
|
|
14964
|
-
|
|
14968
|
+
var H = this.handleSubProcess = function(Q, he) {
|
|
14969
|
+
de(Q, he), P(Q.artifacts, he);
|
|
14965
14970
|
};
|
|
14966
14971
|
function F(K, Q) {
|
|
14967
|
-
var
|
|
14968
|
-
Zn(K, "bpmn:SubProcess") && H(K,
|
|
14972
|
+
var he = l(K, Q);
|
|
14973
|
+
Zn(K, "bpmn:SubProcess") && H(K, he || Q), Zn(K, "bpmn:Activity") && k(K.ioSpecification, Q), n.push(function() {
|
|
14969
14974
|
V(K.dataInputAssociations, o(b, Q)), V(K.dataOutputAssociations, o(b, Q));
|
|
14970
14975
|
});
|
|
14971
14976
|
}
|
|
@@ -14977,8 +14982,8 @@ function a2(e) {
|
|
|
14977
14982
|
}
|
|
14978
14983
|
function se(K, Q) {
|
|
14979
14984
|
n.push(function() {
|
|
14980
|
-
var
|
|
14981
|
-
K.childLaneSet && ie(K.childLaneSet,
|
|
14985
|
+
var he = l(K, Q);
|
|
14986
|
+
K.childLaneSet && ie(K.childLaneSet, he || Q), le(K);
|
|
14982
14987
|
});
|
|
14983
14988
|
}
|
|
14984
14989
|
function ie(K, Q) {
|
|
@@ -14987,27 +14992,27 @@ function a2(e) {
|
|
|
14987
14992
|
function ve(K, Q) {
|
|
14988
14993
|
V(K, o(ie, Q));
|
|
14989
14994
|
}
|
|
14990
|
-
function
|
|
14991
|
-
|
|
14992
|
-
}
|
|
14993
|
-
function
|
|
14994
|
-
V(K, function(
|
|
14995
|
-
Zn(
|
|
14996
|
-
G(
|
|
14997
|
-
}) : Zn(
|
|
14998
|
-
F(
|
|
14999
|
-
}) : Zn(
|
|
15000
|
-
`unrecognized flowElement ${jn(
|
|
14995
|
+
function de(K, Q) {
|
|
14996
|
+
me(K.flowElements, Q), K.laneSets && ve(K.laneSets, Q);
|
|
14997
|
+
}
|
|
14998
|
+
function me(K, Q) {
|
|
14999
|
+
V(K, function(he) {
|
|
15000
|
+
Zn(he, "bpmn:SequenceFlow") ? n.push(function() {
|
|
15001
|
+
G(he, Q);
|
|
15002
|
+
}) : Zn(he, "bpmn:BoundaryEvent") ? n.unshift(function() {
|
|
15003
|
+
F(he, Q);
|
|
15004
|
+
}) : Zn(he, "bpmn:FlowNode") ? F(he, Q) : Zn(he, "bpmn:DataObject") || (Zn(he, "bpmn:DataStoreReference") || Zn(he, "bpmn:DataObjectReference") ? ee(he, Q) : u(
|
|
15005
|
+
`unrecognized flowElement ${jn(he)} in context ${jn(Q && Q.businessObject)}`,
|
|
15001
15006
|
{
|
|
15002
|
-
element:
|
|
15007
|
+
element: he,
|
|
15003
15008
|
context: Q
|
|
15004
15009
|
}
|
|
15005
15010
|
));
|
|
15006
15011
|
});
|
|
15007
15012
|
}
|
|
15008
15013
|
function _e(K, Q) {
|
|
15009
|
-
var
|
|
15010
|
-
Ee && m(Ee,
|
|
15014
|
+
var he = l(K, Q), Ee = K.processRef;
|
|
15015
|
+
Ee && m(Ee, he || Q);
|
|
15011
15016
|
}
|
|
15012
15017
|
function U(K, Q) {
|
|
15013
15018
|
V(K.participants, o(_e, Q)), n.push(function() {
|
|
@@ -15016,8 +15021,8 @@ function a2(e) {
|
|
|
15016
15021
|
}
|
|
15017
15022
|
function le(K) {
|
|
15018
15023
|
V(K.flowNodeRef, function(Q) {
|
|
15019
|
-
var
|
|
15020
|
-
|
|
15024
|
+
var he = Q.get("lanes");
|
|
15025
|
+
he && he.push(K);
|
|
15021
15026
|
});
|
|
15022
15027
|
}
|
|
15023
15028
|
}
|
|
@@ -15779,7 +15784,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
15779
15784
|
function A($) {
|
|
15780
15785
|
return Fe[$];
|
|
15781
15786
|
}
|
|
15782
|
-
function
|
|
15787
|
+
function I($) {
|
|
15783
15788
|
return function(C, R, W) {
|
|
15784
15789
|
return A($)(C, R, W);
|
|
15785
15790
|
};
|
|
@@ -16229,7 +16234,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16229
16234
|
Ol(pe, 0, -Te, 270);
|
|
16230
16235
|
}
|
|
16231
16236
|
}
|
|
16232
|
-
function
|
|
16237
|
+
function de($, C, R = {}) {
|
|
16233
16238
|
var {
|
|
16234
16239
|
width: W,
|
|
16235
16240
|
height: q
|
|
@@ -16241,7 +16246,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16241
16246
|
stroke: Le(C, c, R.stroke)
|
|
16242
16247
|
});
|
|
16243
16248
|
}
|
|
16244
|
-
function
|
|
16249
|
+
function me($, C, R = {}) {
|
|
16245
16250
|
var W = we(C), q = ct(C, s, R.fill), pe = Le(C, c, R.stroke);
|
|
16246
16251
|
return (W.get("associationDirection") === "One" || W.get("associationDirection") === "Both") && (R.markerEnd = d($, "association-end", q, pe)), W.get("associationDirection") === "Both" && (R.markerStart = d($, "association-start", q, pe)), R = gt(R, [
|
|
16247
16252
|
"markerStart",
|
|
@@ -16315,17 +16320,17 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16315
16320
|
return W;
|
|
16316
16321
|
}
|
|
16317
16322
|
function Q($, C, R = {}) {
|
|
16318
|
-
var W =
|
|
16323
|
+
var W = de($, C, R), q = lt(C);
|
|
16319
16324
|
if (zn(C) && (De(W, {
|
|
16320
16325
|
strokeDasharray: "0, 5.5",
|
|
16321
16326
|
strokeWidth: 2.5
|
|
16322
16327
|
}), !q)) {
|
|
16323
16328
|
var pe = we(C).flowElements || [], Te = pe.filter((Qe) => M(Qe, "bpmn:StartEvent"));
|
|
16324
|
-
Te.length === 1 &&
|
|
16329
|
+
Te.length === 1 && he(Te[0], $, R, C);
|
|
16325
16330
|
}
|
|
16326
16331
|
return se($, C, q ? "center-top" : "center-middle", R), q ? G($, C, void 0, R) : G($, C, ["SubProcessMarker"], R), W;
|
|
16327
16332
|
}
|
|
16328
|
-
function
|
|
16333
|
+
function he($, C, R, W) {
|
|
16329
16334
|
var q = 22, pe = {
|
|
16330
16335
|
fill: ct(W, s, R.fill),
|
|
16331
16336
|
stroke: Le(W, c, R.stroke),
|
|
@@ -16341,7 +16346,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16341
16346
|
}), k($, C, pe, W);
|
|
16342
16347
|
}
|
|
16343
16348
|
function Ee($, C, R = {}) {
|
|
16344
|
-
var W =
|
|
16349
|
+
var W = de($, C, R);
|
|
16345
16350
|
return se($, C, "center-middle", R), G($, C, void 0, R), W;
|
|
16346
16351
|
}
|
|
16347
16352
|
var Fe = this.handlers = {
|
|
@@ -16360,7 +16365,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16360
16365
|
return R = gt(R, [
|
|
16361
16366
|
"fill",
|
|
16362
16367
|
"stroke"
|
|
16363
|
-
]),
|
|
16368
|
+
]), me($, C, R);
|
|
16364
16369
|
},
|
|
16365
16370
|
"bpmn:BoundaryEvent": function($, C, R = {}) {
|
|
16366
16371
|
var { renderIcon: W = !0 } = R;
|
|
@@ -16455,7 +16460,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16455
16460
|
return R = gt(R, [
|
|
16456
16461
|
"fill",
|
|
16457
16462
|
"stroke"
|
|
16458
|
-
]),
|
|
16463
|
+
]), me($, C, {
|
|
16459
16464
|
...R,
|
|
16460
16465
|
markerEnd: d($, "association-end", ct(C, s, R.fill), Le(C, c, R.stroke))
|
|
16461
16466
|
});
|
|
@@ -16466,7 +16471,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16466
16471
|
"stroke"
|
|
16467
16472
|
]), _e($, C, R);
|
|
16468
16473
|
},
|
|
16469
|
-
"bpmn:DataObjectReference":
|
|
16474
|
+
"bpmn:DataObjectReference": I("bpmn:DataObject"),
|
|
16470
16475
|
"bpmn:DataOutput": function($, C, R = {}) {
|
|
16471
16476
|
R = gt(R, [
|
|
16472
16477
|
"fill",
|
|
@@ -16483,7 +16488,7 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16483
16488
|
return R = gt(R, [
|
|
16484
16489
|
"fill",
|
|
16485
16490
|
"stroke"
|
|
16486
|
-
]),
|
|
16491
|
+
]), me($, C, {
|
|
16487
16492
|
...R,
|
|
16488
16493
|
markerEnd: d($, "association-end", ct(C, s, R.fill), Le(C, c, R.stroke))
|
|
16489
16494
|
});
|
|
@@ -16645,8 +16650,8 @@ function Kr(e, t, n, i, o, r, a) {
|
|
|
16645
16650
|
strokeWidth: 1.5
|
|
16646
16651
|
}), W && k(C, $, R), q;
|
|
16647
16652
|
},
|
|
16648
|
-
"bpmn:IntermediateCatchEvent":
|
|
16649
|
-
"bpmn:IntermediateThrowEvent":
|
|
16653
|
+
"bpmn:IntermediateCatchEvent": I("bpmn:IntermediateEvent"),
|
|
16654
|
+
"bpmn:IntermediateThrowEvent": I("bpmn:IntermediateEvent"),
|
|
16650
16655
|
"bpmn:Lane": function($, C, R = {}) {
|
|
16651
16656
|
return R = gt(R, [
|
|
16652
16657
|
"fill",
|
|
@@ -21177,7 +21182,7 @@ function E0(e, t, n) {
|
|
|
21177
21182
|
throw new Error("invalid hit type <" + k + ">");
|
|
21178
21183
|
return De(P, H), P;
|
|
21179
21184
|
}
|
|
21180
|
-
function
|
|
21185
|
+
function I(P, k) {
|
|
21181
21186
|
et(P, k);
|
|
21182
21187
|
}
|
|
21183
21188
|
this.removeHits = function(P) {
|
|
@@ -21191,14 +21196,14 @@ function E0(e, t, n) {
|
|
|
21191
21196
|
}));
|
|
21192
21197
|
}, this.createWaypointsHit = function(P, k) {
|
|
21193
21198
|
var H = tc(k);
|
|
21194
|
-
return A(H, "stroke"),
|
|
21199
|
+
return A(H, "stroke"), I(P, H), H;
|
|
21195
21200
|
}, this.createBoxHit = function(P, k, H) {
|
|
21196
21201
|
H = Y({
|
|
21197
21202
|
x: 0,
|
|
21198
21203
|
y: 0
|
|
21199
21204
|
}, H);
|
|
21200
21205
|
var F = je("rect");
|
|
21201
|
-
return A(F, k), De(F, H),
|
|
21206
|
+
return A(F, k), De(F, H), I(P, F), F;
|
|
21202
21207
|
}, this.updateDefaultHit = function(P, k) {
|
|
21203
21208
|
var H = Rt(".djs-hit", k);
|
|
21204
21209
|
if (H)
|
|
@@ -21423,7 +21428,7 @@ function P0(e, t, n, i) {
|
|
|
21423
21428
|
b.length && n.select(b);
|
|
21424
21429
|
}
|
|
21425
21430
|
function l(v, b) {
|
|
21426
|
-
var E = r.payload, A = r.displacement,
|
|
21431
|
+
var E = r.payload, A = r.displacement, I = r.globalStart, P = Hr(v), k = Gi(P, I), H = r.localStart, F = a(P), G = Gi(F, H);
|
|
21427
21432
|
if (!r.active && (b || HD(k) > r.threshold)) {
|
|
21428
21433
|
if (Y(E, {
|
|
21429
21434
|
x: va(H.x + A.x),
|
|
@@ -21479,10 +21484,10 @@ function P0(e, t, n, i) {
|
|
|
21479
21484
|
}
|
|
21480
21485
|
function y(v, b, E, A) {
|
|
21481
21486
|
r && m(!1), typeof b == "string" && (A = E, E = b, b = null), A = Y({}, o, A || {});
|
|
21482
|
-
var
|
|
21487
|
+
var I = A.data || {}, P, k, H, F, G;
|
|
21483
21488
|
if (A.trapClick ? F = f : F = u, v ? (P = Va(v) || v, k = Hr(v), tf(v), P.type === "dragstart" && Or(P)) : (P = null, k = { x: 0, y: 0 }), H = a(k), b || (b = H), G = jD(P), r = Y({
|
|
21484
21489
|
prefix: E,
|
|
21485
|
-
data:
|
|
21490
|
+
data: I,
|
|
21486
21491
|
payload: {},
|
|
21487
21492
|
globalStart: k,
|
|
21488
21493
|
displacement: Gi(b, H),
|
|
@@ -22673,10 +22678,10 @@ function mL(e, t, n, i, o) {
|
|
|
22673
22678
|
return !kt(G) && !ot(G) && !u.has(G) && !p.has(G);
|
|
22674
22679
|
}), w = st(g, function(G) {
|
|
22675
22680
|
return !kt(G) && !ot(G) && u.has(G);
|
|
22676
|
-
}), y, v, b, E = [], A = [],
|
|
22681
|
+
}), y, v, b, E = [], A = [], I, P, k, H;
|
|
22677
22682
|
m.length && (v = Gv(Ve(ln(m))), y = i - h[qo[n]] + v[qo[n]], n === "n" ? s.bottom = l = Ke(l) ? Math.min(l, y) : y : n === "w" ? s.right = l = Ke(l) ? Math.min(l, y) : y : n === "s" ? s.top = c = Ke(c) ? Math.max(c, y) : y : n === "e" && (s.left = c = Ke(c) ? Math.max(c, y) : y)), w.length && (b = Gv(Ve(ln(w))), y = i - b[qo[ll[n]]] + h[qo[ll[n]]], n === "n" ? s.bottom = l = Ke(l) ? Math.min(l, y) : y : n === "w" ? s.right = l = Ke(l) ? Math.min(l, y) : y : n === "s" ? s.top = c = Ke(c) ? Math.max(c, y) : y : n === "e" && (s.left = c = Ke(c) ? Math.max(c, y) : y)), d && d.length && (d.forEach(function(G) {
|
|
22678
22683
|
u.has(G) ? E.push(G) : A.push(G);
|
|
22679
|
-
}), E.length && (
|
|
22684
|
+
}), E.length && (I = Ve(ln(E.map(Xe))), P = h[qo[ll[n]]] - (I[qo[ll[n]]] - i)), A.length && (k = Ve(ln(A.map(Xe))), H = k[qo[n]] - (h[qo[n]] - i)), n === "n" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.bottom = l = Ke(l) ? Math.min(l, y) : y) : n === "w" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.right = l = Ke(l) ? Math.min(l, y) : y) : n === "s" ? (y = Math.max(P || -1 / 0, H || -1 / 0), s.top = c = Ke(c) ? Math.max(c, y) : y) : n === "e" && (y = Math.max(P || -1 / 0, H || -1 / 0), s.left = c = Ke(c) ? Math.max(c, y) : y));
|
|
22680
22685
|
var F = o && o[f.id];
|
|
22681
22686
|
F && (n === "n" ? (y = i + f[yo[t]] - F[yo[t]], s.bottom = l = Ke(l) ? Math.min(l, y) : y) : n === "w" ? (y = i + f[yo[t]] - F[yo[t]], s.right = l = Ke(l) ? Math.min(l, y) : y) : n === "s" ? (y = i - f[yo[t]] + F[yo[t]], s.top = c = Ke(c) ? Math.max(c, y) : y) : n === "e" && (y = i - f[yo[t]] + F[yo[t]], s.left = c = Ke(c) ? Math.max(c, y) : y));
|
|
22682
22687
|
}), s;
|
|
@@ -22722,8 +22727,8 @@ function $0(e, t, n, i, o) {
|
|
|
22722
22727
|
});
|
|
22723
22728
|
var h = /* @__PURE__ */ new Set(), m = s.movingConnections = [];
|
|
22724
22729
|
g.forEach(function(A) {
|
|
22725
|
-
V(A.outgoing, function(
|
|
22726
|
-
h.has(
|
|
22730
|
+
V(A.outgoing, function(I) {
|
|
22731
|
+
h.has(I) || !kt(I) || !g.has(I.target) || (h.add(I), m.push(I));
|
|
22727
22732
|
});
|
|
22728
22733
|
}), r(m, d), s.dragGroup = d;
|
|
22729
22734
|
}
|
|
@@ -22732,9 +22737,9 @@ function $0(e, t, n, i, o) {
|
|
|
22732
22737
|
De(w, i.cls("djs-frame-group", ["no-events"])), et(n.getActiveLayer(), w);
|
|
22733
22738
|
var y = [];
|
|
22734
22739
|
V(p, function(A) {
|
|
22735
|
-
var
|
|
22740
|
+
var I = o.addFrame(A, w), P = I.getBBox();
|
|
22736
22741
|
y.push({
|
|
22737
|
-
element:
|
|
22742
|
+
element: I,
|
|
22738
22743
|
initialBounds: P
|
|
22739
22744
|
}), n.addMarker(A, Wv);
|
|
22740
22745
|
}), s.frameGroup = w, s.frames = y;
|
|
@@ -22746,15 +22751,15 @@ function $0(e, t, n, i, o) {
|
|
|
22746
22751
|
De(c, { d: v[l] });
|
|
22747
22752
|
var b = { x: "y", y: "x" }, E = { x: a.dx, y: a.dy };
|
|
22748
22753
|
E[b[s.axis]] = 0, Ln(s.dragGroup, E.x, E.y), V(s.frames, function(A) {
|
|
22749
|
-
var
|
|
22750
|
-
s.direction === "e" ? De(
|
|
22754
|
+
var I = A.element, P = A.initialBounds, k, H;
|
|
22755
|
+
s.direction === "e" ? De(I, {
|
|
22751
22756
|
width: pl(P.width + E.x, 5)
|
|
22752
|
-
}) : (k = pl(P.width - E.x, 5), De(
|
|
22757
|
+
}) : (k = pl(P.width - E.x, 5), De(I, {
|
|
22753
22758
|
width: k,
|
|
22754
22759
|
x: P.x + P.width - k
|
|
22755
|
-
})), s.direction === "s" ? De(
|
|
22760
|
+
})), s.direction === "s" ? De(I, {
|
|
22756
22761
|
height: pl(P.height + E.y, 5)
|
|
22757
|
-
}) : (H = pl(P.height - E.y, 5), De(
|
|
22762
|
+
}) : (H = pl(P.height - E.y, 5), De(I, {
|
|
22758
22763
|
height: H,
|
|
22759
22764
|
y: P.y + P.height - H
|
|
22760
22765
|
}));
|
|
@@ -24832,8 +24837,8 @@ bc.prototype._computeUpdates = function(e, t) {
|
|
|
24832
24837
|
var b = cf(y), E = f.get(b) || [], A = Pa(
|
|
24833
24838
|
E,
|
|
24834
24839
|
y
|
|
24835
|
-
),
|
|
24836
|
-
|
|
24840
|
+
), I = Object.keys(A).length > 0;
|
|
24841
|
+
I && (v = u(y));
|
|
24837
24842
|
}
|
|
24838
24843
|
s(y, v, !0);
|
|
24839
24844
|
}), t.forEach(function(y) {
|
|
@@ -24846,19 +24851,19 @@ bc.prototype._computeUpdates = function(e, t) {
|
|
|
24846
24851
|
var b = y.present;
|
|
24847
24852
|
if (b) {
|
|
24848
24853
|
var E = m.get(b.root) || [], A = Pa(E, v);
|
|
24849
|
-
E.forEach(function(
|
|
24850
|
-
if (A[
|
|
24851
|
-
var P = h.get(
|
|
24852
|
-
P || (P = /* @__PURE__ */ new Set(), h.set(
|
|
24854
|
+
E.forEach(function(I) {
|
|
24855
|
+
if (A[I.id]) {
|
|
24856
|
+
var P = h.get(I);
|
|
24857
|
+
P || (P = /* @__PURE__ */ new Set(), h.set(I, P)), P.add(b.categoryValue);
|
|
24853
24858
|
}
|
|
24854
24859
|
});
|
|
24855
24860
|
}
|
|
24856
24861
|
});
|
|
24857
24862
|
var w = d.reduce(function(y, v) {
|
|
24858
|
-
var b = o.get(v), E = b.get(ig), A = new Set(E),
|
|
24863
|
+
var b = o.get(v), E = b.get(ig), A = new Set(E), I = h.get(v) || /* @__PURE__ */ new Set(), P = Array.from(I).filter(function(H) {
|
|
24859
24864
|
return !A.has(H);
|
|
24860
24865
|
}), k = E.filter(function(H) {
|
|
24861
|
-
return g.has(H) && !
|
|
24866
|
+
return g.has(H) && !I.has(H);
|
|
24862
24867
|
});
|
|
24863
24868
|
return (P.length || k.length) && y.push({
|
|
24864
24869
|
businessObject: b,
|
|
@@ -27803,7 +27808,7 @@ function Rx(e) {
|
|
|
27803
27808
|
};
|
|
27804
27809
|
}
|
|
27805
27810
|
function mg(e, t, n, i, o, r, a, s, c, l) {
|
|
27806
|
-
var u, p, f, d, g, h, m, w, y, v, b, E, A,
|
|
27811
|
+
var u, p, f, d, g, h, m, w, y, v, b, E, A, I, P, k, H = t.type;
|
|
27807
27812
|
if (t.constructor !== void 0) return null;
|
|
27808
27813
|
128 & n.__u && (c = !!(32 & n.__u), r = [s = t.__e = n.__e]), (u = Yt.__b) && u(t);
|
|
27809
27814
|
e: if (typeof H == "function") {
|
|
@@ -27821,10 +27826,10 @@ function mg(e, t, n, i, o, r, a, s, c, l) {
|
|
|
27821
27826
|
f.componentDidUpdate(g, h, m);
|
|
27822
27827
|
});
|
|
27823
27828
|
}
|
|
27824
|
-
if (f.context = E, f.props = y, f.__P = e, f.__e = !1, A = Yt.__r,
|
|
27829
|
+
if (f.context = E, f.props = y, f.__P = e, f.__e = !1, A = Yt.__r, I = 0, v) f.state = f.__s, f.__d = !1, A && A(t), u = f.render(f.props, f.state, f.context), hu.push.apply(f.__h, f._sb), f._sb = [];
|
|
27825
27830
|
else do
|
|
27826
27831
|
f.__d = !1, A && A(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
|
|
27827
|
-
while (f.__d && ++
|
|
27832
|
+
while (f.__d && ++I < 25);
|
|
27828
27833
|
f.state = f.__s, f.getChildContext != null && (i = bo(bo({}, i), f.getChildContext())), v && !d && f.getSnapshotBeforeUpdate != null && (m = f.getSnapshotBeforeUpdate(g, h)), P = u != null && u.type === dp && u.key == null ? HE(u.props.children) : u, s = BE(e, fp(P) ? P : [P], t, n, i, o, r, a, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && a.push(f), w && (f.__E = f.__ = null);
|
|
27829
27834
|
} catch (F) {
|
|
27830
27835
|
if (a.length = p, t.__v = null, c || r != null) {
|
|
@@ -28381,24 +28386,24 @@ function mB(e) {
|
|
|
28381
28386
|
w,
|
|
28382
28387
|
{ keys: ["label", "search", "description"] }
|
|
28383
28388
|
).map(({ item: Q }) => Q) : K.filter(({ rank: Q = 0 }) => Q >= 0) : K;
|
|
28384
|
-
}, [E, v, b, w, p, h, f]),
|
|
28389
|
+
}, [E, v, b, w, p, h, f]), I = vo(() => v ? A.length ? [{ id: "default", entries: A }] : [] : bB(A), [A, v]), [P, k] = hf(A[0]), H = mu(null), F = mu(!1), G = vo(() => gB.next(), []), ee = `${G}-results`, se = P && YE(G, P);
|
|
28385
28390
|
Gl(() => {
|
|
28386
28391
|
const K = H.current;
|
|
28387
28392
|
K && A.includes(K) ? k(K) : k(A[0]), H.current = null;
|
|
28388
28393
|
}, [A]);
|
|
28389
28394
|
const ie = xs((K) => {
|
|
28390
|
-
const Q = vB(
|
|
28395
|
+
const Q = vB(I);
|
|
28391
28396
|
let Ee = Q.indexOf(P) + K;
|
|
28392
28397
|
Ee < 0 && (Ee = Q.length - 1), Ee >= Q.length && (Ee = 0), F.current = !0, k(Q[Ee]);
|
|
28393
|
-
}, [
|
|
28398
|
+
}, [I, P]), ve = xs((K) => {
|
|
28394
28399
|
K > 0 && P && P.entries && (F.current = !0, m((Q) => [...Q, P])), K < 0 && h.length > 0 && (F.current = !0, H.current = h[h.length + K], m((Q) => Q.slice(0, K)));
|
|
28395
|
-
}, [P, h]),
|
|
28400
|
+
}, [P, h]), de = xs((K, Q, he) => {
|
|
28396
28401
|
if (!(!Q || Q.disabled))
|
|
28397
|
-
return Q.entries ? (K.preventDefault(), ve(1)) : n(K, Q,
|
|
28398
|
-
}, [n, ve]),
|
|
28402
|
+
return Q.entries ? (K.preventDefault(), ve(1)) : n(K, Q, he);
|
|
28403
|
+
}, [n, ve]), me = xs((K) => {
|
|
28399
28404
|
if (K.key === "Enter" && P) {
|
|
28400
28405
|
const Q = K.target;
|
|
28401
|
-
return !!Ur(Q, "a, button", !0) || P.disabled ? void 0 :
|
|
28406
|
+
return !!Ur(Q, "a, button", !0) || P.disabled ? void 0 : de(K, P);
|
|
28402
28407
|
}
|
|
28403
28408
|
if (K.key === "Backspace") {
|
|
28404
28409
|
const Q = K.target;
|
|
@@ -28413,7 +28418,7 @@ function mB(e) {
|
|
|
28413
28418
|
return ve(1), K.preventDefault();
|
|
28414
28419
|
if (K.key === "ArrowLeft")
|
|
28415
28420
|
return ve(-1), K.preventDefault();
|
|
28416
|
-
}, [P, ie, ve,
|
|
28421
|
+
}, [P, ie, ve, de]), _e = xs((K) => {
|
|
28417
28422
|
Hf(K.target, "input") && y(() => K.target.value);
|
|
28418
28423
|
}, [y]);
|
|
28419
28424
|
Gl(() => (d(), () => {
|
|
@@ -28424,7 +28429,7 @@ function mB(e) {
|
|
|
28424
28429
|
<${Nx}
|
|
28425
28430
|
onClose=${t}
|
|
28426
28431
|
onKeyup=${_e}
|
|
28427
|
-
onKeydown=${
|
|
28432
|
+
onKeydown=${me}
|
|
28428
28433
|
className=${i}
|
|
28429
28434
|
position=${r}
|
|
28430
28435
|
width=${s}
|
|
@@ -28474,11 +28479,11 @@ function mB(e) {
|
|
|
28474
28479
|
`}
|
|
28475
28480
|
|
|
28476
28481
|
<${dB}
|
|
28477
|
-
groupedEntries=${
|
|
28482
|
+
groupedEntries=${I}
|
|
28478
28483
|
selectedEntry=${P}
|
|
28479
28484
|
setSelectedEntry=${k}
|
|
28480
28485
|
keyboardSelection=${F}
|
|
28481
|
-
onAction=${
|
|
28486
|
+
onAction=${de}
|
|
28482
28487
|
idPrefix=${G}
|
|
28483
28488
|
id=${ee}
|
|
28484
28489
|
ariaLabel=${a || "Results"}
|
|
@@ -29288,22 +29293,22 @@ function $B(e, t) {
|
|
|
29288
29293
|
}
|
|
29289
29294
|
function i1(e, t, n, i, o) {
|
|
29290
29295
|
function r(v, b, E) {
|
|
29291
|
-
var A = v.index,
|
|
29292
|
-
return A <= 0 || v.bendpoint ? !1 : (P = b[A - 1], k = b[A], H = Vf(P, k), F = xo(P, k), G = Math.abs(
|
|
29296
|
+
var A = v.index, I = v.point, P, k, H, F, G, ee;
|
|
29297
|
+
return A <= 0 || v.bendpoint ? !1 : (P = b[A - 1], k = b[A], H = Vf(P, k), F = xo(P, k), G = Math.abs(I.x - H.x), ee = Math.abs(I.y - H.y), F && G <= E && ee <= E);
|
|
29293
29298
|
}
|
|
29294
29299
|
function a(v, b) {
|
|
29295
|
-
var E = v.waypoints, A,
|
|
29300
|
+
var E = v.waypoints, A, I, P, k;
|
|
29296
29301
|
return b.index <= 0 || b.bendpoint || (A = {
|
|
29297
29302
|
start: E[b.index - 1],
|
|
29298
29303
|
end: E[b.index]
|
|
29299
|
-
},
|
|
29304
|
+
}, I = xo(A.start, A.end), !I) ? null : (I === "h" ? P = A.end.x - A.start.x : P = A.end.y - A.start.y, k = dd(P) / 2, k);
|
|
29300
29305
|
}
|
|
29301
29306
|
function s(v, b) {
|
|
29302
|
-
var E = b.waypoints, A = pd(t, E, v),
|
|
29307
|
+
var E = b.waypoints, A = pd(t, E, v), I;
|
|
29303
29308
|
if (A) {
|
|
29304
|
-
|
|
29309
|
+
I = a(b, A);
|
|
29305
29310
|
var P;
|
|
29306
|
-
if (r(A, E,
|
|
29311
|
+
if (r(A, E, I) ? P = o.start(v, b, A.index) : P = i.start(v, b, A.index, !A.bendpoint), P !== !1)
|
|
29307
29312
|
return !0;
|
|
29308
29313
|
}
|
|
29309
29314
|
}
|
|
@@ -29324,13 +29329,13 @@ function i1(e, t, n, i, o) {
|
|
|
29324
29329
|
}
|
|
29325
29330
|
function p(v, b) {
|
|
29326
29331
|
b.waypoints.forEach(function(E, A) {
|
|
29327
|
-
var
|
|
29328
|
-
et(v,
|
|
29332
|
+
var I = fd(v);
|
|
29333
|
+
et(v, I), Ln(I, E.x, E.y);
|
|
29329
29334
|
}), fd(v, "floating");
|
|
29330
29335
|
}
|
|
29331
29336
|
function f(v, b) {
|
|
29332
|
-
for (var E = b.waypoints, A,
|
|
29333
|
-
A = E[k - 1],
|
|
29337
|
+
for (var E = b.waypoints, A, I, P, k = 1; k < E.length; k++)
|
|
29338
|
+
A = E[k - 1], I = E[k], xo(A, I) && (P = n1(v, A, I), De(P, { "data-segment-idx": k }), c(P, "mousemove", b));
|
|
29334
29339
|
}
|
|
29335
29340
|
function d(v) {
|
|
29336
29341
|
V(Fs("." + e1, v), function(b) {
|
|
@@ -29355,7 +29360,7 @@ function i1(e, t, n, i, o) {
|
|
|
29355
29360
|
E && (Ln(E, A.x, A.y), ut(E).add("positioned"));
|
|
29356
29361
|
}
|
|
29357
29362
|
function y(v, b, E) {
|
|
29358
|
-
var A = u(b.index, v),
|
|
29363
|
+
var A = u(b.index, v), I = E[b.index - 1], P = E[b.index], k = b.point, H = Vf(I, P), F = xo(I, P), G, ee;
|
|
29359
29364
|
A && (G = FB(A), ee = {
|
|
29360
29365
|
x: k.x - H.x,
|
|
29361
29366
|
y: k.y - H.y
|
|
@@ -29373,11 +29378,11 @@ function i1(e, t, n, i, o) {
|
|
|
29373
29378
|
var b = v.element, E;
|
|
29374
29379
|
b.waypoints && (E = h(b), v.add ? ut(E).add(v.marker) : ut(E).remove(v.marker));
|
|
29375
29380
|
}), e.on("element.mousemove", function(v) {
|
|
29376
|
-
var b = v.element, E = b.waypoints, A,
|
|
29381
|
+
var b = v.element, E = b.waypoints, A, I;
|
|
29377
29382
|
if (E) {
|
|
29378
|
-
if (A = l(b, !0),
|
|
29383
|
+
if (A = l(b, !0), I = pd(t, E, v.originalEvent), !I)
|
|
29379
29384
|
return;
|
|
29380
|
-
w(A,
|
|
29385
|
+
w(A, I), I.bendpoint || y(A, I, E);
|
|
29381
29386
|
}
|
|
29382
29387
|
}), e.on("element.mousedown", function(v) {
|
|
29383
29388
|
if (ur(v)) {
|
|
@@ -29569,9 +29574,9 @@ function Zx(e, t, n) {
|
|
|
29569
29574
|
function a1(e, t, n, i, o, r) {
|
|
29570
29575
|
var a = e.get("connectionDocking", !1);
|
|
29571
29576
|
this.start = function(p, f, d) {
|
|
29572
|
-
var g, h = n.getGraphics(f), m = d - 1, w = d, y = f.waypoints, v = y[m], b = y[w], E = pd(n, y, p), A,
|
|
29577
|
+
var g, h = n.getGraphics(f), m = d - 1, w = d, y = f.waypoints, v = y[m], b = y[w], E = pd(n, y, p), A, I, P;
|
|
29573
29578
|
if (A = xo(v, b), !!A)
|
|
29574
|
-
return
|
|
29579
|
+
return I = A === "v" ? "x" : "y", m === 0 && (v = Zx(v, f.source, I)), w === y.length - 1 && (b = Zx(b, f.target, I)), E ? P = E.point : P = {
|
|
29575
29580
|
x: (v.x + b.x) / 2,
|
|
29576
29581
|
y: (v.y + b.y) / 2
|
|
29577
29582
|
}, g = {
|
|
@@ -29580,10 +29585,10 @@ function a1(e, t, n, i, o, r) {
|
|
|
29580
29585
|
segmentEndIndex: w,
|
|
29581
29586
|
segmentStart: v,
|
|
29582
29587
|
segmentEnd: b,
|
|
29583
|
-
axis:
|
|
29588
|
+
axis: I,
|
|
29584
29589
|
dragPosition: P
|
|
29585
29590
|
}, i.init(p, P, "connectionSegment.move", {
|
|
29586
|
-
cursor:
|
|
29591
|
+
cursor: I === "x" ? "resize-ew" : "resize-ns",
|
|
29587
29592
|
data: {
|
|
29588
29593
|
connection: f,
|
|
29589
29594
|
connectionGfx: h,
|
|
@@ -29617,10 +29622,10 @@ function a1(e, t, n, i, o, r) {
|
|
|
29617
29622
|
var f = p.context, d = p.connection, g = n.getLayer("overlays");
|
|
29618
29623
|
f.originalWaypoints = d.waypoints.slice(), f.draggerGfx = n1(g, f.segmentStart, f.segmentEnd), ut(f.draggerGfx).add("djs-dragging"), n.addMarker(d, Kx);
|
|
29619
29624
|
}), t.on("connectionSegment.move.move", function(p) {
|
|
29620
|
-
var f = p.context, d = f.connection, g = f.segmentStartIndex, h = f.segmentEndIndex, m = f.segmentStart, w = f.segmentEnd, y = f.axis, v = f.originalWaypoints.slice(), b = Xx(m, y, p["d" + y]), E = Xx(w, y, p["d" + y]), A = v.length,
|
|
29625
|
+
var f = p.context, d = f.connection, g = f.segmentStartIndex, h = f.segmentEndIndex, m = f.segmentStart, w = f.segmentEnd, y = f.axis, v = f.originalWaypoints.slice(), b = Xx(m, y, p["d" + y]), E = Xx(w, y, p["d" + y]), A = v.length, I = 0;
|
|
29621
29626
|
v[g] = b, v[h] = E;
|
|
29622
29627
|
var P, k;
|
|
29623
|
-
g < 2 && (P = In(d.source, b), g === 1 ? P === "intersect" && (v.shift(), v[0] = b,
|
|
29628
|
+
g < 2 && (P = In(d.source, b), g === 1 ? P === "intersect" && (v.shift(), v[0] = b, I--) : P !== "intersect" && (v.unshift(m), I++)), h > A - 3 && (k = In(d.target, E), h === A - 2 ? k === "intersect" && (v.pop(), v[v.length - 1] = E) : k !== "intersect" && v.push(w)), f.newWaypoints = d.waypoints = s(d, v), l(f, I, p), f.newSegmentStartIndex = g + I, c(p);
|
|
29624
29629
|
}), t.on("connectionSegment.move.hover", function(p) {
|
|
29625
29630
|
p.context.hover = p.hover, n.addMarker(p.hover, Yx);
|
|
29626
29631
|
}), t.on([
|
|
@@ -31463,14 +31468,14 @@ Ec.prototype.getContextPadEntries = function(e) {
|
|
|
31463
31468
|
};
|
|
31464
31469
|
}
|
|
31465
31470
|
function h(v) {
|
|
31466
|
-
var b = 5, E = t.getPad(v).html, A = E.getBoundingClientRect(),
|
|
31471
|
+
var b = 5, E = t.getPad(v).html, A = E.getBoundingClientRect(), I = {
|
|
31467
31472
|
x: A.left,
|
|
31468
31473
|
y: A.bottom + b
|
|
31469
31474
|
};
|
|
31470
|
-
return
|
|
31475
|
+
return I;
|
|
31471
31476
|
}
|
|
31472
31477
|
function m(v, b, E, A) {
|
|
31473
|
-
function
|
|
31478
|
+
function I(H, F) {
|
|
31474
31479
|
var G = i.createShape(Y({ type: v }, A));
|
|
31475
31480
|
r.start(H, G, {
|
|
31476
31481
|
source: F
|
|
@@ -31479,7 +31484,7 @@ Ec.prototype.getContextPadEntries = function(e) {
|
|
|
31479
31484
|
var P = s ? function(H, F) {
|
|
31480
31485
|
var G = i.createShape(Y({ type: v }, A));
|
|
31481
31486
|
s.append(F, G);
|
|
31482
|
-
} :
|
|
31487
|
+
} : I, k = s ? function(H, F) {
|
|
31483
31488
|
return l.create(F, v, A), () => {
|
|
31484
31489
|
l.cleanUp();
|
|
31485
31490
|
};
|
|
@@ -31489,7 +31494,7 @@ Ec.prototype.getContextPadEntries = function(e) {
|
|
|
31489
31494
|
className: b,
|
|
31490
31495
|
title: E,
|
|
31491
31496
|
action: {
|
|
31492
|
-
dragstart:
|
|
31497
|
+
dragstart: I,
|
|
31493
31498
|
click: P,
|
|
31494
31499
|
hover: k
|
|
31495
31500
|
}
|
|
@@ -32798,11 +32803,11 @@ Mc.prototype.getEditingBBox = function(e) {
|
|
|
32798
32803
|
y: b.y,
|
|
32799
32804
|
width: 0,
|
|
32800
32805
|
height: 0
|
|
32801
|
-
}), A = l,
|
|
32806
|
+
}), A = l, I = jr.width * a + 2 * y;
|
|
32802
32807
|
Y(r, {
|
|
32803
|
-
width:
|
|
32808
|
+
width: I,
|
|
32804
32809
|
height: A + 2 * y,
|
|
32805
|
-
x: E.x -
|
|
32810
|
+
x: E.x - I / 2,
|
|
32806
32811
|
y: E.y - A / 2 - y
|
|
32807
32812
|
}), Y(d, {
|
|
32808
32813
|
fontSize: l + "px",
|