@wandox/sdk 0.1.0
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/README.md +59 -0
- package/dist/arc-BJMRTG9S.cjs +1 -0
- package/dist/arc-Vdco0qfw.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BjEqcvey.js +4695 -0
- package/dist/architectureDiagram-3BPJPVTR-BvjJfAkh.cjs +36 -0
- package/dist/blockDiagram-GPEHLZMM-B1xf7RE9.js +2427 -0
- package/dist/blockDiagram-GPEHLZMM-B5VqovGY.cjs +132 -0
- package/dist/c4Diagram-AAUBKEIU-C4kjMRea.js +1578 -0
- package/dist/c4Diagram-AAUBKEIU-Ck5uEnJI.cjs +10 -0
- package/dist/channel-DlRtLuYv.js +5 -0
- package/dist/channel-Dm_yrRYJ.cjs +1 -0
- package/dist/chunk-2J33WTMH-CG2n_n4y.cjs +1 -0
- package/dist/chunk-2J33WTMH-CWvmGb4H.js +20 -0
- package/dist/chunk-4BX2VUAB-Bq3GzsD8.js +9 -0
- package/dist/chunk-4BX2VUAB-CdMctZeT.cjs +1 -0
- package/dist/chunk-55IACEB6-BdJhzL0d.js +8 -0
- package/dist/chunk-55IACEB6-sHyHtvg8.cjs +1 -0
- package/dist/chunk-727SXJPM-D-Vmam30.cjs +206 -0
- package/dist/chunk-727SXJPM-DmruCqjM.js +1529 -0
- package/dist/chunk-AQP2D5EJ-CWhKjcV3.cjs +231 -0
- package/dist/chunk-AQP2D5EJ-Ca0ak6w7.js +1399 -0
- package/dist/chunk-FMBD7UC4-CqV0NWQQ.js +19 -0
- package/dist/chunk-FMBD7UC4-DOxtd0OO.cjs +15 -0
- package/dist/chunk-ND2GUHAM-6EMX5Mu8.js +68 -0
- package/dist/chunk-ND2GUHAM-BXeDBtSC.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B7FSI55w.js +15 -0
- package/dist/chunk-QZHKN3VN-CbbdNKnD.cjs +1 -0
- package/dist/classDiagram-4FO5ZUOK-0Kaf7WfA.js +16 -0
- package/dist/classDiagram-4FO5ZUOK-C4it2xBI.cjs +1 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Byom5adL.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-C4it2xBI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CuUv9oIm.js +2606 -0
- package/dist/cose-bilkent-S5V4N54A-Dh6nTopA.cjs +1 -0
- package/dist/cytoscape.esm-Cp8cXbK2.js +18729 -0
- package/dist/cytoscape.esm-fcqEUasK.cjs +331 -0
- package/dist/dagre-BM42HDAG-CwxJjZ2n.cjs +4 -0
- package/dist/dagre-BM42HDAG-DMBidMxP.js +448 -0
- package/dist/defaultLocale-BDVPUiG2.js +171 -0
- package/dist/defaultLocale-k2G_58r6.cjs +1 -0
- package/dist/diagram-2AECGRRQ-B2a4nXgJ.js +221 -0
- package/dist/diagram-2AECGRRQ-r7De7taS.cjs +43 -0
- package/dist/diagram-5GNKFQAL-CDiO79WC.cjs +10 -0
- package/dist/diagram-5GNKFQAL-DrHBNZzF.js +123 -0
- package/dist/diagram-KO2AKTUF-BcjWCXZr.js +466 -0
- package/dist/diagram-KO2AKTUF-CDlJCxVO.cjs +3 -0
- package/dist/diagram-LMA3HP47-BXFSAyNV.cjs +24 -0
- package/dist/diagram-LMA3HP47-DJxmyqn0.js +143 -0
- package/dist/diagram-OG6HWLK6-ATK__ca8.js +531 -0
- package/dist/diagram-OG6HWLK6-CgIyEO8_.cjs +24 -0
- package/dist/erDiagram-TEJ5UH35-D4baWNzQ.js +900 -0
- package/dist/erDiagram-TEJ5UH35-Dyuc5EB6.cjs +85 -0
- package/dist/flowDiagram-I6XJVG4X-BMZOncyU.js +1635 -0
- package/dist/flowDiagram-I6XJVG4X-C45fICr4.cjs +162 -0
- package/dist/ganttDiagram-6RSMTGT7-CiYZmmke.js +2526 -0
- package/dist/ganttDiagram-6RSMTGT7-Cxoj6IK8.cjs +292 -0
- package/dist/gitGraphDiagram-PVQCEYII-CQ9bNuwN.js +828 -0
- package/dist/gitGraphDiagram-PVQCEYII-rlaY9dfj.cjs +106 -0
- package/dist/graph-CBizzZ7K.js +1545 -0
- package/dist/graph-V5BNIbHU.cjs +1 -0
- package/dist/index-jBRold1l.js +173159 -0
- package/dist/index-sFrjovbM.cjs +804 -0
- package/dist/index.d.ts +54 -0
- package/dist/infoDiagram-5YYISTIA-CAzYIvUX.js +24 -0
- package/dist/infoDiagram-5YYISTIA-zX5rQglQ.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-09prKBsn.cjs +70 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Co8BnN24.js +622 -0
- package/dist/journeyDiagram-JHISSGLW-DkdWRF_-.cjs +139 -0
- package/dist/journeyDiagram-JHISSGLW-riCLiMCC.js +836 -0
- package/dist/kanban-definition-UN3LZRKU-DWipOCsx.cjs +89 -0
- package/dist/kanban-definition-UN3LZRKU-SRyCSn2H.js +725 -0
- package/dist/katex-Cf_UVKIT.cjs +257 -0
- package/dist/katex-RNjvZ8pg.js +11681 -0
- package/dist/layout-CbksXFOD.js +1728 -0
- package/dist/layout-Dh52gsIJ.cjs +1 -0
- package/dist/linear-C3xSMJV8.cjs +1 -0
- package/dist/linear-CmUCzX9U.js +259 -0
- package/dist/mermaid.core-BzNKr-OJ.cjs +308 -0
- package/dist/mermaid.core-CdBIz6FY.js +15475 -0
- package/dist/mindmap-definition-RKZ34NQL-Cs63oyIX.cjs +96 -0
- package/dist/mindmap-definition-RKZ34NQL-Gcma5iTd.js +830 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pieDiagram-4H26LBE5-CBGkD8dp.cjs +30 -0
- package/dist/pieDiagram-4H26LBE5-DSL8cVK1.js +164 -0
- package/dist/quadrantDiagram-W4KKPZXB-D3nCWRjF.cjs +7 -0
- package/dist/quadrantDiagram-W4KKPZXB-uod6bhUy.js +1026 -0
- package/dist/requirementDiagram-4Y6WPE33-Bc_6y7SM.js +884 -0
- package/dist/requirementDiagram-4Y6WPE33-D2mHlh5i.cjs +84 -0
- package/dist/sankeyDiagram-5OEKKPKP-DL_kXejW.cjs +40 -0
- package/dist/sankeyDiagram-5OEKKPKP-DMsjY4G4.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-CBGalGOV.cjs +162 -0
- package/dist/sequenceDiagram-3UESZ5HK-CH2Z-Pis.js +2901 -0
- package/dist/stateDiagram-AJRCARHV-gEqlAI6t.js +263 -0
- package/dist/stateDiagram-AJRCARHV-rNMrAI-A.cjs +1 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CDj7L1wi.js +16 -0
- package/dist/stateDiagram-v2-BHNVJYJU-LLlFJ1GM.cjs +1 -0
- package/dist/timeline-definition-PNZ67QCA-Bbuv3uu-.cjs +120 -0
- package/dist/timeline-definition-PNZ67QCA-DrGFbQdC.js +1068 -0
- package/dist/types.d.ts +295 -0
- package/dist/vennDiagram-CIIHVFJN-CGcAwVxU.js +1564 -0
- package/dist/vennDiagram-CIIHVFJN-DsSjXluJ.cjs +34 -0
- package/dist/wandox.cjs +1 -0
- package/dist/wandox.css +1 -0
- package/dist/wandox.js +6 -0
- package/dist/wandox.umd.js +4172 -0
- package/dist/wardley-L42UT6IY-DUnkyH_z.js +22539 -0
- package/dist/wardley-L42UT6IY-tDp0NbFW.cjs +165 -0
- package/dist/wardleyDiagram-YWT4CUSO-CB_Qa4lR.js +684 -0
- package/dist/wardleyDiagram-YWT4CUSO-D0BUmvVW.cjs +78 -0
- package/dist/xychartDiagram-2RQKCTM6-Bcq-ACuw.js +1342 -0
- package/dist/xychartDiagram-2RQKCTM6-BjeAPKLo.cjs +7 -0
- package/package.json +42 -0
|
@@ -0,0 +1,2427 @@
|
|
|
1
|
+
import { g as ye } from "./chunk-FMBD7UC4-CqV0NWQQ.js";
|
|
2
|
+
import { au as xe, ab as Vt, av as be, be as we, bd as me, bg as Se, bf as Le, bb as ve, b9 as Ee, b4 as _e, aR as ke, aJ as Te, aI as De, aC as Ne, an as Ie, am as Ce, ao as Be, X as Oe, W as Re, N as Ae, n as ze, M as Me, h as Pe, i as Fe, f as We, b as d, a1 as ct, aZ as O, E as Ye, aB as v, t as He, aW as Ke, a7 as Ue, ay as Xe, K as Ve, a2 as M, ad as je, a5 as H, I as Et, B as at, aa as Ze, bj as st, z as Ge, a9 as qe, aX as Ot, O as Rt, D as Je } from "./mermaid.core-CdBIz6FY.js";
|
|
3
|
+
import { G as Qe } from "./graph-CBizzZ7K.js";
|
|
4
|
+
import { c as $e } from "./channel-DlRtLuYv.js";
|
|
5
|
+
function tr(e) {
|
|
6
|
+
return Array.isArray(e);
|
|
7
|
+
}
|
|
8
|
+
function er(e) {
|
|
9
|
+
if (xe(e)) return e;
|
|
10
|
+
const t = Vt(e);
|
|
11
|
+
if (!rr(e)) return {};
|
|
12
|
+
if (tr(e)) {
|
|
13
|
+
const s = Array.from(e);
|
|
14
|
+
return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (s.index = e.index, s.input = e.input), s;
|
|
15
|
+
}
|
|
16
|
+
if (be(e)) {
|
|
17
|
+
const s = e, i = s.constructor;
|
|
18
|
+
return new i(s.buffer, s.byteOffset, s.length);
|
|
19
|
+
}
|
|
20
|
+
if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
|
|
21
|
+
if (t === "[object DataView]") {
|
|
22
|
+
const s = e, i = s.buffer, c = s.byteOffset, r = s.byteLength, n = new ArrayBuffer(r), l = new Uint8Array(i, c, r);
|
|
23
|
+
return new Uint8Array(n).set(l), new DataView(n);
|
|
24
|
+
}
|
|
25
|
+
if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
|
|
26
|
+
const s = e.constructor, i = new s(e.valueOf());
|
|
27
|
+
return t === "[object String]" ? sr(i, e) : xt(i, e), i;
|
|
28
|
+
}
|
|
29
|
+
if (t === "[object Date]") return new Date(Number(e));
|
|
30
|
+
if (t === "[object RegExp]") {
|
|
31
|
+
const s = e, i = new RegExp(s.source, s.flags);
|
|
32
|
+
return i.lastIndex = s.lastIndex, i;
|
|
33
|
+
}
|
|
34
|
+
if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
|
|
35
|
+
if (t === "[object Map]") {
|
|
36
|
+
const s = e, i = /* @__PURE__ */ new Map();
|
|
37
|
+
return s.forEach((c, r) => {
|
|
38
|
+
i.set(r, c);
|
|
39
|
+
}), i;
|
|
40
|
+
}
|
|
41
|
+
if (t === "[object Set]") {
|
|
42
|
+
const s = e, i = /* @__PURE__ */ new Set();
|
|
43
|
+
return s.forEach((c) => {
|
|
44
|
+
i.add(c);
|
|
45
|
+
}), i;
|
|
46
|
+
}
|
|
47
|
+
if (t === "[object Arguments]") {
|
|
48
|
+
const s = e, i = {};
|
|
49
|
+
return xt(i, s), i.length = s.length, i[Symbol.iterator] = s[Symbol.iterator], i;
|
|
50
|
+
}
|
|
51
|
+
const a = {};
|
|
52
|
+
return ir(a, e), xt(a, e), ar(a, e), a;
|
|
53
|
+
}
|
|
54
|
+
function rr(e) {
|
|
55
|
+
switch (Vt(e)) {
|
|
56
|
+
case We:
|
|
57
|
+
case Fe:
|
|
58
|
+
case Pe:
|
|
59
|
+
case Me:
|
|
60
|
+
case ze:
|
|
61
|
+
case Ae:
|
|
62
|
+
case Re:
|
|
63
|
+
case Oe:
|
|
64
|
+
case Be:
|
|
65
|
+
case Ce:
|
|
66
|
+
case Ie:
|
|
67
|
+
case Ne:
|
|
68
|
+
case De:
|
|
69
|
+
case Te:
|
|
70
|
+
case ke:
|
|
71
|
+
case _e:
|
|
72
|
+
case Ee:
|
|
73
|
+
case ve:
|
|
74
|
+
case Le:
|
|
75
|
+
case Se:
|
|
76
|
+
case me:
|
|
77
|
+
case we:
|
|
78
|
+
return !0;
|
|
79
|
+
default:
|
|
80
|
+
return !1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function xt(e, t) {
|
|
84
|
+
for (const a in t) Object.hasOwn(t, a) && (e[a] = t[a]);
|
|
85
|
+
}
|
|
86
|
+
function ar(e, t) {
|
|
87
|
+
const a = Object.getOwnPropertySymbols(t);
|
|
88
|
+
for (let s = 0; s < a.length; s++) {
|
|
89
|
+
const i = a[s];
|
|
90
|
+
Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function sr(e, t) {
|
|
94
|
+
const a = t.valueOf().length;
|
|
95
|
+
for (const s in t) Object.hasOwn(t, s) && (Number.isNaN(Number(s)) || Number(s) >= a) && (e[s] = t[s]);
|
|
96
|
+
}
|
|
97
|
+
function ir(e, t) {
|
|
98
|
+
const a = Object.getPrototypeOf(t);
|
|
99
|
+
a !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, a);
|
|
100
|
+
}
|
|
101
|
+
var wt = function() {
|
|
102
|
+
var e = /* @__PURE__ */ d(function(N, x, p, f) {
|
|
103
|
+
for (p = p || {}, f = N.length; f--; p[N[f]] = x) ;
|
|
104
|
+
return p;
|
|
105
|
+
}, "o"), t = [1, 15], a = [1, 7], s = [1, 13], i = [1, 14], c = [1, 19], r = [1, 16], n = [1, 17], l = [1, 18], u = [8, 30], g = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], y = [1, 23], w = [1, 24], b = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], m = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], _ = [1, 49], L = {
|
|
106
|
+
trace: /* @__PURE__ */ d(function() {
|
|
107
|
+
}, "trace"),
|
|
108
|
+
yy: {},
|
|
109
|
+
symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
|
|
110
|
+
terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
|
|
111
|
+
productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
|
|
112
|
+
performAction: /* @__PURE__ */ d(function(x, p, f, S, E, o, k) {
|
|
113
|
+
var h = o.length - 1;
|
|
114
|
+
switch (E) {
|
|
115
|
+
case 4:
|
|
116
|
+
S.getLogger().debug("Rule: separator (NL) ");
|
|
117
|
+
break;
|
|
118
|
+
case 5:
|
|
119
|
+
S.getLogger().debug("Rule: separator (Space) ");
|
|
120
|
+
break;
|
|
121
|
+
case 6:
|
|
122
|
+
S.getLogger().debug("Rule: separator (EOF) ");
|
|
123
|
+
break;
|
|
124
|
+
case 7:
|
|
125
|
+
S.getLogger().debug("Rule: hierarchy: ", o[h - 1]), S.setHierarchy(o[h - 1]);
|
|
126
|
+
break;
|
|
127
|
+
case 8:
|
|
128
|
+
S.getLogger().debug("Stop NL ");
|
|
129
|
+
break;
|
|
130
|
+
case 9:
|
|
131
|
+
S.getLogger().debug("Stop EOF ");
|
|
132
|
+
break;
|
|
133
|
+
case 10:
|
|
134
|
+
S.getLogger().debug("Stop NL2 ");
|
|
135
|
+
break;
|
|
136
|
+
case 11:
|
|
137
|
+
S.getLogger().debug("Stop EOF2 ");
|
|
138
|
+
break;
|
|
139
|
+
case 12:
|
|
140
|
+
S.getLogger().debug("Rule: statement: ", o[h]), typeof o[h].length == "number" ? this.$ = o[h] : this.$ = [o[h]];
|
|
141
|
+
break;
|
|
142
|
+
case 13:
|
|
143
|
+
S.getLogger().debug("Rule: statement #2: ", o[h - 1]), this.$ = [o[h - 1]].concat(o[h]);
|
|
144
|
+
break;
|
|
145
|
+
case 14:
|
|
146
|
+
S.getLogger().debug("Rule: link: ", o[h], x), this.$ = { edgeTypeStr: o[h], label: "" };
|
|
147
|
+
break;
|
|
148
|
+
case 15:
|
|
149
|
+
S.getLogger().debug("Rule: LABEL link: ", o[h - 3], o[h - 1], o[h]), this.$ = { edgeTypeStr: o[h], label: o[h - 1] };
|
|
150
|
+
break;
|
|
151
|
+
case 18:
|
|
152
|
+
const T = parseInt(o[h]), D = S.generateId();
|
|
153
|
+
this.$ = { id: D, type: "space", label: "", width: T, children: [] };
|
|
154
|
+
break;
|
|
155
|
+
case 23:
|
|
156
|
+
S.getLogger().debug("Rule: (nodeStatement link node) ", o[h - 2], o[h - 1], o[h], " typestr: ", o[h - 1].edgeTypeStr);
|
|
157
|
+
const U = S.edgeStrToEdgeData(o[h - 1].edgeTypeStr), F = S.edgeStrToEdgeStartData(o[h - 1].edgeTypeStr), J = S.edgeStrToThickness(o[h - 1].edgeTypeStr), B = S.edgeStrToPattern(o[h - 1].edgeTypeStr);
|
|
158
|
+
this.$ = [
|
|
159
|
+
{ id: o[h - 2].id, label: o[h - 2].label, type: o[h - 2].type, directions: o[h - 2].directions },
|
|
160
|
+
{ id: o[h - 2].id + "-" + o[h].id, start: o[h - 2].id, end: o[h].id, label: o[h - 1].label, type: "edge", thickness: J, pattern: B, directions: o[h].directions, arrowTypeEnd: U, arrowTypeStart: F },
|
|
161
|
+
{ id: o[h].id, label: o[h].label, type: S.typeStr2Type(o[h].typeStr), directions: o[h].directions }
|
|
162
|
+
];
|
|
163
|
+
break;
|
|
164
|
+
case 24:
|
|
165
|
+
S.getLogger().debug("Rule: nodeStatement (abc88 node size) ", o[h - 1], o[h]), this.$ = { id: o[h - 1].id, label: o[h - 1].label, type: S.typeStr2Type(o[h - 1].typeStr), directions: o[h - 1].directions, widthInColumns: parseInt(o[h], 10) };
|
|
166
|
+
break;
|
|
167
|
+
case 25:
|
|
168
|
+
S.getLogger().debug("Rule: nodeStatement (node) ", o[h]), this.$ = { id: o[h].id, label: o[h].label, type: S.typeStr2Type(o[h].typeStr), directions: o[h].directions, widthInColumns: 1 };
|
|
169
|
+
break;
|
|
170
|
+
case 26:
|
|
171
|
+
S.getLogger().debug("APA123", this ? this : "na"), S.getLogger().debug("COLUMNS: ", o[h]), this.$ = { type: "column-setting", columns: o[h] === "auto" ? -1 : parseInt(o[h]) };
|
|
172
|
+
break;
|
|
173
|
+
case 27:
|
|
174
|
+
S.getLogger().debug("Rule: id-block statement : ", o[h - 2], o[h - 1]), S.generateId(), this.$ = { ...o[h - 2], type: "composite", children: o[h - 1] };
|
|
175
|
+
break;
|
|
176
|
+
case 28:
|
|
177
|
+
S.getLogger().debug("Rule: blockStatement : ", o[h - 2], o[h - 1], o[h]);
|
|
178
|
+
const Y = S.generateId();
|
|
179
|
+
this.$ = { id: Y, type: "composite", label: "", children: o[h - 1] };
|
|
180
|
+
break;
|
|
181
|
+
case 29:
|
|
182
|
+
S.getLogger().debug("Rule: node (NODE_ID separator): ", o[h]), this.$ = { id: o[h] };
|
|
183
|
+
break;
|
|
184
|
+
case 30:
|
|
185
|
+
S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", o[h - 1], o[h]), this.$ = { id: o[h - 1], label: o[h].label, typeStr: o[h].typeStr, directions: o[h].directions };
|
|
186
|
+
break;
|
|
187
|
+
case 31:
|
|
188
|
+
S.getLogger().debug("Rule: dirList: ", o[h]), this.$ = [o[h]];
|
|
189
|
+
break;
|
|
190
|
+
case 32:
|
|
191
|
+
S.getLogger().debug("Rule: dirList: ", o[h - 1], o[h]), this.$ = [o[h - 1]].concat(o[h]);
|
|
192
|
+
break;
|
|
193
|
+
case 33:
|
|
194
|
+
S.getLogger().debug("Rule: nodeShapeNLabel: ", o[h - 2], o[h - 1], o[h]), this.$ = { typeStr: o[h - 2] + o[h], label: o[h - 1] };
|
|
195
|
+
break;
|
|
196
|
+
case 34:
|
|
197
|
+
S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", o[h - 3], o[h - 2], " #3:", o[h - 1], o[h]), this.$ = { typeStr: o[h - 3] + o[h], label: o[h - 2], directions: o[h - 1] };
|
|
198
|
+
break;
|
|
199
|
+
case 35:
|
|
200
|
+
case 36:
|
|
201
|
+
this.$ = { type: "classDef", id: o[h - 1].trim(), css: o[h].trim() };
|
|
202
|
+
break;
|
|
203
|
+
case 37:
|
|
204
|
+
this.$ = { type: "applyClass", id: o[h - 1].trim(), styleClass: o[h].trim() };
|
|
205
|
+
break;
|
|
206
|
+
case 38:
|
|
207
|
+
this.$ = { type: "applyStyles", id: o[h - 1].trim(), stylesStr: o[h].trim() };
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
}, "anonymous"),
|
|
211
|
+
table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }), e(g, [2, 16], { 14: 22, 15: y, 16: w }), e(g, [2, 17]), e(g, [2, 18]), e(g, [2, 19]), e(g, [2, 20]), e(g, [2, 21]), e(g, [2, 22]), e(b, [2, 25], { 27: [1, 25] }), e(g, [2, 26]), { 19: 26, 26: 12, 31: c }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(m, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 31: c }, { 31: [2, 14] }, { 17: [1, 36] }, e(b, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: y, 16: w, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(m, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(b, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(g, [2, 28]), e(g, [2, 35]), e(g, [2, 36]), e(g, [2, 37]), e(g, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: _ }, { 15: [1, 50] }, e(g, [2, 27]), e(m, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: _, 38: [2, 31] }, { 31: [2, 15] }, e(m, [2, 34]), { 38: [2, 32] }],
|
|
212
|
+
defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
|
|
213
|
+
parseError: /* @__PURE__ */ d(function(x, p) {
|
|
214
|
+
if (p.recoverable)
|
|
215
|
+
this.trace(x);
|
|
216
|
+
else {
|
|
217
|
+
var f = new Error(x);
|
|
218
|
+
throw f.hash = p, f;
|
|
219
|
+
}
|
|
220
|
+
}, "parseError"),
|
|
221
|
+
parse: /* @__PURE__ */ d(function(x) {
|
|
222
|
+
var p = this, f = [0], S = [], E = [null], o = [], k = this.table, h = "", T = 0, D = 0, U = 2, F = 1, J = o.slice.call(arguments, 1), B = Object.create(this.lexer), Y = { yy: {} };
|
|
223
|
+
for (var et in this.yy)
|
|
224
|
+
Object.prototype.hasOwnProperty.call(this.yy, et) && (Y.yy[et] = this.yy[et]);
|
|
225
|
+
B.setInput(x, Y.yy), Y.yy.lexer = B, Y.yy.parser = this, typeof B.yylloc > "u" && (B.yylloc = {});
|
|
226
|
+
var rt = B.yylloc;
|
|
227
|
+
o.push(rt);
|
|
228
|
+
var pe = B.options && B.options.ranges;
|
|
229
|
+
typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
230
|
+
function fe(X) {
|
|
231
|
+
f.length = f.length - 2 * X, E.length = E.length - X, o.length = o.length - X;
|
|
232
|
+
}
|
|
233
|
+
d(fe, "popStack");
|
|
234
|
+
function Ct() {
|
|
235
|
+
var X;
|
|
236
|
+
return X = S.pop() || B.lex() || F, typeof X != "number" && (X instanceof Array && (S = X, X = S.pop()), X = p.symbols_[X] || X), X;
|
|
237
|
+
}
|
|
238
|
+
d(Ct, "lex");
|
|
239
|
+
for (var K, $, j, ft, tt = {}, lt, Q, Bt, ot; ; ) {
|
|
240
|
+
if ($ = f[f.length - 1], this.defaultActions[$] ? j = this.defaultActions[$] : ((K === null || typeof K > "u") && (K = Ct()), j = k[$] && k[$][K]), typeof j > "u" || !j.length || !j[0]) {
|
|
241
|
+
var yt = "";
|
|
242
|
+
ot = [];
|
|
243
|
+
for (lt in k[$])
|
|
244
|
+
this.terminals_[lt] && lt > U && ot.push("'" + this.terminals_[lt] + "'");
|
|
245
|
+
B.showPosition ? yt = "Parse error on line " + (T + 1) + `:
|
|
246
|
+
` + B.showPosition() + `
|
|
247
|
+
Expecting ` + ot.join(", ") + ", got '" + (this.terminals_[K] || K) + "'" : yt = "Parse error on line " + (T + 1) + ": Unexpected " + (K == F ? "end of input" : "'" + (this.terminals_[K] || K) + "'"), this.parseError(yt, {
|
|
248
|
+
text: B.match,
|
|
249
|
+
token: this.terminals_[K] || K,
|
|
250
|
+
line: B.yylineno,
|
|
251
|
+
loc: rt,
|
|
252
|
+
expected: ot
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
if (j[0] instanceof Array && j.length > 1)
|
|
256
|
+
throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + K);
|
|
257
|
+
switch (j[0]) {
|
|
258
|
+
case 1:
|
|
259
|
+
f.push(K), E.push(B.yytext), o.push(B.yylloc), f.push(j[1]), K = null, D = B.yyleng, h = B.yytext, T = B.yylineno, rt = B.yylloc;
|
|
260
|
+
break;
|
|
261
|
+
case 2:
|
|
262
|
+
if (Q = this.productions_[j[1]][1], tt.$ = E[E.length - Q], tt._$ = {
|
|
263
|
+
first_line: o[o.length - (Q || 1)].first_line,
|
|
264
|
+
last_line: o[o.length - 1].last_line,
|
|
265
|
+
first_column: o[o.length - (Q || 1)].first_column,
|
|
266
|
+
last_column: o[o.length - 1].last_column
|
|
267
|
+
}, pe && (tt._$.range = [
|
|
268
|
+
o[o.length - (Q || 1)].range[0],
|
|
269
|
+
o[o.length - 1].range[1]
|
|
270
|
+
]), ft = this.performAction.apply(tt, [
|
|
271
|
+
h,
|
|
272
|
+
D,
|
|
273
|
+
T,
|
|
274
|
+
Y.yy,
|
|
275
|
+
j[1],
|
|
276
|
+
E,
|
|
277
|
+
o
|
|
278
|
+
].concat(J)), typeof ft < "u")
|
|
279
|
+
return ft;
|
|
280
|
+
Q && (f = f.slice(0, -1 * Q * 2), E = E.slice(0, -1 * Q), o = o.slice(0, -1 * Q)), f.push(this.productions_[j[1]][0]), E.push(tt.$), o.push(tt._$), Bt = k[f[f.length - 2]][f[f.length - 1]], f.push(Bt);
|
|
281
|
+
break;
|
|
282
|
+
case 3:
|
|
283
|
+
return !0;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return !0;
|
|
287
|
+
}, "parse")
|
|
288
|
+
}, C = /* @__PURE__ */ function() {
|
|
289
|
+
var N = {
|
|
290
|
+
EOF: 1,
|
|
291
|
+
parseError: /* @__PURE__ */ d(function(p, f) {
|
|
292
|
+
if (this.yy.parser)
|
|
293
|
+
this.yy.parser.parseError(p, f);
|
|
294
|
+
else
|
|
295
|
+
throw new Error(p);
|
|
296
|
+
}, "parseError"),
|
|
297
|
+
// resets the lexer, sets new input
|
|
298
|
+
setInput: /* @__PURE__ */ d(function(x, p) {
|
|
299
|
+
return this.yy = p || this.yy || {}, this._input = x, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
300
|
+
first_line: 1,
|
|
301
|
+
first_column: 0,
|
|
302
|
+
last_line: 1,
|
|
303
|
+
last_column: 0
|
|
304
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
305
|
+
}, "setInput"),
|
|
306
|
+
// consumes and returns one char from the input
|
|
307
|
+
input: /* @__PURE__ */ d(function() {
|
|
308
|
+
var x = this._input[0];
|
|
309
|
+
this.yytext += x, this.yyleng++, this.offset++, this.match += x, this.matched += x;
|
|
310
|
+
var p = x.match(/(?:\r\n?|\n).*/g);
|
|
311
|
+
return p ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), x;
|
|
312
|
+
}, "input"),
|
|
313
|
+
// unshifts one char (or a string) into the input
|
|
314
|
+
unput: /* @__PURE__ */ d(function(x) {
|
|
315
|
+
var p = x.length, f = x.split(/(?:\r\n?|\n)/g);
|
|
316
|
+
this._input = x + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - p), this.offset -= p;
|
|
317
|
+
var S = this.match.split(/(?:\r\n?|\n)/g);
|
|
318
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), f.length - 1 && (this.yylineno -= f.length - 1);
|
|
319
|
+
var E = this.yylloc.range;
|
|
320
|
+
return this.yylloc = {
|
|
321
|
+
first_line: this.yylloc.first_line,
|
|
322
|
+
last_line: this.yylineno + 1,
|
|
323
|
+
first_column: this.yylloc.first_column,
|
|
324
|
+
last_column: f ? (f.length === S.length ? this.yylloc.first_column : 0) + S[S.length - f.length].length - f[0].length : this.yylloc.first_column - p
|
|
325
|
+
}, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - p]), this.yyleng = this.yytext.length, this;
|
|
326
|
+
}, "unput"),
|
|
327
|
+
// When called from action, caches matched text and appends it on next action
|
|
328
|
+
more: /* @__PURE__ */ d(function() {
|
|
329
|
+
return this._more = !0, this;
|
|
330
|
+
}, "more"),
|
|
331
|
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
332
|
+
reject: /* @__PURE__ */ d(function() {
|
|
333
|
+
if (this.options.backtrack_lexer)
|
|
334
|
+
this._backtrack = !0;
|
|
335
|
+
else
|
|
336
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
337
|
+
` + this.showPosition(), {
|
|
338
|
+
text: "",
|
|
339
|
+
token: null,
|
|
340
|
+
line: this.yylineno
|
|
341
|
+
});
|
|
342
|
+
return this;
|
|
343
|
+
}, "reject"),
|
|
344
|
+
// retain first n characters of the match
|
|
345
|
+
less: /* @__PURE__ */ d(function(x) {
|
|
346
|
+
this.unput(this.match.slice(x));
|
|
347
|
+
}, "less"),
|
|
348
|
+
// displays already matched input, i.e. for error messages
|
|
349
|
+
pastInput: /* @__PURE__ */ d(function() {
|
|
350
|
+
var x = this.matched.substr(0, this.matched.length - this.match.length);
|
|
351
|
+
return (x.length > 20 ? "..." : "") + x.substr(-20).replace(/\n/g, "");
|
|
352
|
+
}, "pastInput"),
|
|
353
|
+
// displays upcoming input, i.e. for error messages
|
|
354
|
+
upcomingInput: /* @__PURE__ */ d(function() {
|
|
355
|
+
var x = this.match;
|
|
356
|
+
return x.length < 20 && (x += this._input.substr(0, 20 - x.length)), (x.substr(0, 20) + (x.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
357
|
+
}, "upcomingInput"),
|
|
358
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
359
|
+
showPosition: /* @__PURE__ */ d(function() {
|
|
360
|
+
var x = this.pastInput(), p = new Array(x.length + 1).join("-");
|
|
361
|
+
return x + this.upcomingInput() + `
|
|
362
|
+
` + p + "^";
|
|
363
|
+
}, "showPosition"),
|
|
364
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
365
|
+
test_match: /* @__PURE__ */ d(function(x, p) {
|
|
366
|
+
var f, S, E;
|
|
367
|
+
if (this.options.backtrack_lexer && (E = {
|
|
368
|
+
yylineno: this.yylineno,
|
|
369
|
+
yylloc: {
|
|
370
|
+
first_line: this.yylloc.first_line,
|
|
371
|
+
last_line: this.last_line,
|
|
372
|
+
first_column: this.yylloc.first_column,
|
|
373
|
+
last_column: this.yylloc.last_column
|
|
374
|
+
},
|
|
375
|
+
yytext: this.yytext,
|
|
376
|
+
match: this.match,
|
|
377
|
+
matches: this.matches,
|
|
378
|
+
matched: this.matched,
|
|
379
|
+
yyleng: this.yyleng,
|
|
380
|
+
offset: this.offset,
|
|
381
|
+
_more: this._more,
|
|
382
|
+
_input: this._input,
|
|
383
|
+
yy: this.yy,
|
|
384
|
+
conditionStack: this.conditionStack.slice(0),
|
|
385
|
+
done: this.done
|
|
386
|
+
}, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), S = x[0].match(/(?:\r\n?|\n).*/g), S && (this.yylineno += S.length), this.yylloc = {
|
|
387
|
+
first_line: this.yylloc.last_line,
|
|
388
|
+
last_line: this.yylineno + 1,
|
|
389
|
+
first_column: this.yylloc.last_column,
|
|
390
|
+
last_column: S ? S[S.length - 1].length - S[S.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + x[0].length
|
|
391
|
+
}, this.yytext += x[0], this.match += x[0], this.matches = x, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(x[0].length), this.matched += x[0], f = this.performAction.call(this, this.yy, this, p, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), f)
|
|
392
|
+
return f;
|
|
393
|
+
if (this._backtrack) {
|
|
394
|
+
for (var o in E)
|
|
395
|
+
this[o] = E[o];
|
|
396
|
+
return !1;
|
|
397
|
+
}
|
|
398
|
+
return !1;
|
|
399
|
+
}, "test_match"),
|
|
400
|
+
// return next match in input
|
|
401
|
+
next: /* @__PURE__ */ d(function() {
|
|
402
|
+
if (this.done)
|
|
403
|
+
return this.EOF;
|
|
404
|
+
this._input || (this.done = !0);
|
|
405
|
+
var x, p, f, S;
|
|
406
|
+
this._more || (this.yytext = "", this.match = "");
|
|
407
|
+
for (var E = this._currentRules(), o = 0; o < E.length; o++)
|
|
408
|
+
if (f = this._input.match(this.rules[E[o]]), f && (!p || f[0].length > p[0].length)) {
|
|
409
|
+
if (p = f, S = o, this.options.backtrack_lexer) {
|
|
410
|
+
if (x = this.test_match(f, E[o]), x !== !1)
|
|
411
|
+
return x;
|
|
412
|
+
if (this._backtrack) {
|
|
413
|
+
p = !1;
|
|
414
|
+
continue;
|
|
415
|
+
} else
|
|
416
|
+
return !1;
|
|
417
|
+
} else if (!this.options.flex)
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
return p ? (x = this.test_match(p, E[S]), x !== !1 ? x : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
421
|
+
` + this.showPosition(), {
|
|
422
|
+
text: "",
|
|
423
|
+
token: null,
|
|
424
|
+
line: this.yylineno
|
|
425
|
+
});
|
|
426
|
+
}, "next"),
|
|
427
|
+
// return next match that has a token
|
|
428
|
+
lex: /* @__PURE__ */ d(function() {
|
|
429
|
+
var p = this.next();
|
|
430
|
+
return p || this.lex();
|
|
431
|
+
}, "lex"),
|
|
432
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
433
|
+
begin: /* @__PURE__ */ d(function(p) {
|
|
434
|
+
this.conditionStack.push(p);
|
|
435
|
+
}, "begin"),
|
|
436
|
+
// pop the previously active lexer condition state off the condition stack
|
|
437
|
+
popState: /* @__PURE__ */ d(function() {
|
|
438
|
+
var p = this.conditionStack.length - 1;
|
|
439
|
+
return p > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
440
|
+
}, "popState"),
|
|
441
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
442
|
+
_currentRules: /* @__PURE__ */ d(function() {
|
|
443
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
444
|
+
}, "_currentRules"),
|
|
445
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
446
|
+
topState: /* @__PURE__ */ d(function(p) {
|
|
447
|
+
return p = this.conditionStack.length - 1 - Math.abs(p || 0), p >= 0 ? this.conditionStack[p] : "INITIAL";
|
|
448
|
+
}, "topState"),
|
|
449
|
+
// alias for begin(condition)
|
|
450
|
+
pushState: /* @__PURE__ */ d(function(p) {
|
|
451
|
+
this.begin(p);
|
|
452
|
+
}, "pushState"),
|
|
453
|
+
// return the number of states currently on the stack
|
|
454
|
+
stateStackSize: /* @__PURE__ */ d(function() {
|
|
455
|
+
return this.conditionStack.length;
|
|
456
|
+
}, "stateStackSize"),
|
|
457
|
+
options: {},
|
|
458
|
+
performAction: /* @__PURE__ */ d(function(p, f, S, E) {
|
|
459
|
+
switch (S) {
|
|
460
|
+
case 0:
|
|
461
|
+
return p.getLogger().debug("Found block-beta"), 10;
|
|
462
|
+
case 1:
|
|
463
|
+
return p.getLogger().debug("Found id-block"), 29;
|
|
464
|
+
case 2:
|
|
465
|
+
return p.getLogger().debug("Found block"), 10;
|
|
466
|
+
case 3:
|
|
467
|
+
p.getLogger().debug(".", f.yytext);
|
|
468
|
+
break;
|
|
469
|
+
case 4:
|
|
470
|
+
p.getLogger().debug("_", f.yytext);
|
|
471
|
+
break;
|
|
472
|
+
case 5:
|
|
473
|
+
return 5;
|
|
474
|
+
case 6:
|
|
475
|
+
return f.yytext = -1, 28;
|
|
476
|
+
case 7:
|
|
477
|
+
return f.yytext = f.yytext.replace(/columns\s+/, ""), p.getLogger().debug("COLUMNS (LEX)", f.yytext), 28;
|
|
478
|
+
case 8:
|
|
479
|
+
this.pushState("md_string");
|
|
480
|
+
break;
|
|
481
|
+
case 9:
|
|
482
|
+
return "MD_STR";
|
|
483
|
+
case 10:
|
|
484
|
+
this.popState();
|
|
485
|
+
break;
|
|
486
|
+
case 11:
|
|
487
|
+
this.pushState("string");
|
|
488
|
+
break;
|
|
489
|
+
case 12:
|
|
490
|
+
p.getLogger().debug("LEX: POPPING STR:", f.yytext), this.popState();
|
|
491
|
+
break;
|
|
492
|
+
case 13:
|
|
493
|
+
return p.getLogger().debug("LEX: STR end:", f.yytext), "STR";
|
|
494
|
+
case 14:
|
|
495
|
+
return f.yytext = f.yytext.replace(/space\:/, ""), p.getLogger().debug("SPACE NUM (LEX)", f.yytext), 21;
|
|
496
|
+
case 15:
|
|
497
|
+
return f.yytext = "1", p.getLogger().debug("COLUMNS (LEX)", f.yytext), 21;
|
|
498
|
+
case 16:
|
|
499
|
+
return 42;
|
|
500
|
+
case 17:
|
|
501
|
+
return "LINKSTYLE";
|
|
502
|
+
case 18:
|
|
503
|
+
return "INTERPOLATE";
|
|
504
|
+
case 19:
|
|
505
|
+
return this.pushState("CLASSDEF"), 39;
|
|
506
|
+
case 20:
|
|
507
|
+
return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
|
|
508
|
+
case 21:
|
|
509
|
+
return this.popState(), this.pushState("CLASSDEFID"), 40;
|
|
510
|
+
case 22:
|
|
511
|
+
return this.popState(), 41;
|
|
512
|
+
case 23:
|
|
513
|
+
return this.pushState("CLASS"), 43;
|
|
514
|
+
case 24:
|
|
515
|
+
return this.popState(), this.pushState("CLASS_STYLE"), 44;
|
|
516
|
+
case 25:
|
|
517
|
+
return this.popState(), 45;
|
|
518
|
+
case 26:
|
|
519
|
+
return this.pushState("STYLE_STMNT"), 46;
|
|
520
|
+
case 27:
|
|
521
|
+
return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
|
|
522
|
+
case 28:
|
|
523
|
+
return this.popState(), 48;
|
|
524
|
+
case 29:
|
|
525
|
+
return this.pushState("acc_title"), "acc_title";
|
|
526
|
+
case 30:
|
|
527
|
+
return this.popState(), "acc_title_value";
|
|
528
|
+
case 31:
|
|
529
|
+
return this.pushState("acc_descr"), "acc_descr";
|
|
530
|
+
case 32:
|
|
531
|
+
return this.popState(), "acc_descr_value";
|
|
532
|
+
case 33:
|
|
533
|
+
this.pushState("acc_descr_multiline");
|
|
534
|
+
break;
|
|
535
|
+
case 34:
|
|
536
|
+
this.popState();
|
|
537
|
+
break;
|
|
538
|
+
case 35:
|
|
539
|
+
return "acc_descr_multiline_value";
|
|
540
|
+
case 36:
|
|
541
|
+
return 30;
|
|
542
|
+
case 37:
|
|
543
|
+
return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
|
|
544
|
+
case 38:
|
|
545
|
+
return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
|
|
546
|
+
case 39:
|
|
547
|
+
return this.popState(), p.getLogger().debug("Lex: ))"), "NODE_DEND";
|
|
548
|
+
case 40:
|
|
549
|
+
return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
|
|
550
|
+
case 41:
|
|
551
|
+
return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
|
|
552
|
+
case 42:
|
|
553
|
+
return this.popState(), p.getLogger().debug("Lex: (-"), "NODE_DEND";
|
|
554
|
+
case 43:
|
|
555
|
+
return this.popState(), p.getLogger().debug("Lex: -)"), "NODE_DEND";
|
|
556
|
+
case 44:
|
|
557
|
+
return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
|
|
558
|
+
case 45:
|
|
559
|
+
return this.popState(), p.getLogger().debug("Lex: ]]"), "NODE_DEND";
|
|
560
|
+
case 46:
|
|
561
|
+
return this.popState(), p.getLogger().debug("Lex: ("), "NODE_DEND";
|
|
562
|
+
case 47:
|
|
563
|
+
return this.popState(), p.getLogger().debug("Lex: ])"), "NODE_DEND";
|
|
564
|
+
case 48:
|
|
565
|
+
return this.popState(), p.getLogger().debug("Lex: /]"), "NODE_DEND";
|
|
566
|
+
case 49:
|
|
567
|
+
return this.popState(), p.getLogger().debug("Lex: /]"), "NODE_DEND";
|
|
568
|
+
case 50:
|
|
569
|
+
return this.popState(), p.getLogger().debug("Lex: )]"), "NODE_DEND";
|
|
570
|
+
case 51:
|
|
571
|
+
return this.popState(), p.getLogger().debug("Lex: )"), "NODE_DEND";
|
|
572
|
+
case 52:
|
|
573
|
+
return this.popState(), p.getLogger().debug("Lex: ]>"), "NODE_DEND";
|
|
574
|
+
case 53:
|
|
575
|
+
return this.popState(), p.getLogger().debug("Lex: ]"), "NODE_DEND";
|
|
576
|
+
case 54:
|
|
577
|
+
return p.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
|
|
578
|
+
case 55:
|
|
579
|
+
return p.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
|
|
580
|
+
case 56:
|
|
581
|
+
return p.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
|
|
582
|
+
case 57:
|
|
583
|
+
return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
|
|
584
|
+
case 58:
|
|
585
|
+
return p.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
|
|
586
|
+
case 59:
|
|
587
|
+
return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
|
|
588
|
+
case 60:
|
|
589
|
+
return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
|
|
590
|
+
case 61:
|
|
591
|
+
return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
|
|
592
|
+
case 62:
|
|
593
|
+
return p.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
|
|
594
|
+
case 63:
|
|
595
|
+
return p.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
|
|
596
|
+
case 64:
|
|
597
|
+
return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
|
|
598
|
+
case 65:
|
|
599
|
+
return this.pushState("NODE"), 35;
|
|
600
|
+
case 66:
|
|
601
|
+
return this.pushState("NODE"), 35;
|
|
602
|
+
case 67:
|
|
603
|
+
return this.pushState("NODE"), 35;
|
|
604
|
+
case 68:
|
|
605
|
+
return this.pushState("NODE"), 35;
|
|
606
|
+
case 69:
|
|
607
|
+
return this.pushState("NODE"), 35;
|
|
608
|
+
case 70:
|
|
609
|
+
return this.pushState("NODE"), 35;
|
|
610
|
+
case 71:
|
|
611
|
+
return this.pushState("NODE"), 35;
|
|
612
|
+
case 72:
|
|
613
|
+
return p.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
|
|
614
|
+
case 73:
|
|
615
|
+
return this.pushState("BLOCK_ARROW"), p.getLogger().debug("LEX ARR START"), 37;
|
|
616
|
+
case 74:
|
|
617
|
+
return p.getLogger().debug("Lex: NODE_ID", f.yytext), 31;
|
|
618
|
+
case 75:
|
|
619
|
+
return p.getLogger().debug("Lex: EOF", f.yytext), 8;
|
|
620
|
+
case 76:
|
|
621
|
+
this.pushState("md_string");
|
|
622
|
+
break;
|
|
623
|
+
case 77:
|
|
624
|
+
this.pushState("md_string");
|
|
625
|
+
break;
|
|
626
|
+
case 78:
|
|
627
|
+
return "NODE_DESCR";
|
|
628
|
+
case 79:
|
|
629
|
+
this.popState();
|
|
630
|
+
break;
|
|
631
|
+
case 80:
|
|
632
|
+
p.getLogger().debug("Lex: Starting string"), this.pushState("string");
|
|
633
|
+
break;
|
|
634
|
+
case 81:
|
|
635
|
+
p.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
|
|
636
|
+
break;
|
|
637
|
+
case 82:
|
|
638
|
+
return p.getLogger().debug("LEX: NODE_DESCR:", f.yytext), "NODE_DESCR";
|
|
639
|
+
case 83:
|
|
640
|
+
p.getLogger().debug("LEX POPPING"), this.popState();
|
|
641
|
+
break;
|
|
642
|
+
case 84:
|
|
643
|
+
p.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
|
|
644
|
+
break;
|
|
645
|
+
case 85:
|
|
646
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (right): dir:", f.yytext), "DIR";
|
|
647
|
+
case 86:
|
|
648
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (left):", f.yytext), "DIR";
|
|
649
|
+
case 87:
|
|
650
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (x):", f.yytext), "DIR";
|
|
651
|
+
case 88:
|
|
652
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (y):", f.yytext), "DIR";
|
|
653
|
+
case 89:
|
|
654
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (up):", f.yytext), "DIR";
|
|
655
|
+
case 90:
|
|
656
|
+
return f.yytext = f.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (down):", f.yytext), "DIR";
|
|
657
|
+
case 91:
|
|
658
|
+
return f.yytext = "]>", p.getLogger().debug("Lex (ARROW_DIR end):", f.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
|
|
659
|
+
case 92:
|
|
660
|
+
return p.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
|
|
661
|
+
case 93:
|
|
662
|
+
return p.getLogger().debug("Lex: LINK", f.yytext), 15;
|
|
663
|
+
case 94:
|
|
664
|
+
return p.getLogger().debug("Lex: LINK", f.yytext), 15;
|
|
665
|
+
case 95:
|
|
666
|
+
return p.getLogger().debug("Lex: LINK", f.yytext), 15;
|
|
667
|
+
case 96:
|
|
668
|
+
return p.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
|
|
669
|
+
case 97:
|
|
670
|
+
return p.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
|
|
671
|
+
case 98:
|
|
672
|
+
return p.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
|
|
673
|
+
case 99:
|
|
674
|
+
this.pushState("md_string");
|
|
675
|
+
break;
|
|
676
|
+
case 100:
|
|
677
|
+
return p.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
|
|
678
|
+
case 101:
|
|
679
|
+
return this.popState(), p.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
|
|
680
|
+
case 102:
|
|
681
|
+
return this.popState(), p.getLogger().debug("Lex: LINK", f.yytext), 15;
|
|
682
|
+
case 103:
|
|
683
|
+
return this.popState(), p.getLogger().debug("Lex: LINK", f.yytext), 15;
|
|
684
|
+
case 104:
|
|
685
|
+
return p.getLogger().debug("Lex: COLON", f.yytext), f.yytext = f.yytext.slice(1), 27;
|
|
686
|
+
}
|
|
687
|
+
}, "anonymous"),
|
|
688
|
+
rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
|
|
689
|
+
conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
|
|
690
|
+
};
|
|
691
|
+
return N;
|
|
692
|
+
}();
|
|
693
|
+
L.lexer = C;
|
|
694
|
+
function I() {
|
|
695
|
+
this.yy = {};
|
|
696
|
+
}
|
|
697
|
+
return d(I, "Parser"), I.prototype = L, L.Parser = I, new I();
|
|
698
|
+
}();
|
|
699
|
+
wt.parser = wt;
|
|
700
|
+
var nr = wt, G = /* @__PURE__ */ new Map(), _t = [], mt = /* @__PURE__ */ new Map(), At = "color", zt = "fill", cr = "bgFill", jt = ",", lr = M(), gt = /* @__PURE__ */ new Map(), kt = "", or = /* @__PURE__ */ d((e) => Ge.sanitizeText(e, lr), "sanitizeText"), hr = /* @__PURE__ */ d(function(e, t = "") {
|
|
701
|
+
let a = gt.get(e);
|
|
702
|
+
a || (a = { id: e, styles: [], textStyles: [] }, gt.set(e, a)), t != null && t.split(jt).forEach((s) => {
|
|
703
|
+
const i = s.replace(/([^;]*);/, "$1").trim();
|
|
704
|
+
if (RegExp(At).exec(s)) {
|
|
705
|
+
const r = i.replace(zt, cr).replace(At, zt);
|
|
706
|
+
a.textStyles.push(r);
|
|
707
|
+
}
|
|
708
|
+
a.styles.push(i);
|
|
709
|
+
});
|
|
710
|
+
}, "addStyleClass"), gr = /* @__PURE__ */ d(function(e, t = "") {
|
|
711
|
+
const a = G.get(e);
|
|
712
|
+
t != null && (a.styles = t.split(jt));
|
|
713
|
+
}, "addStyle2Node"), dr = /* @__PURE__ */ d(function(e, t) {
|
|
714
|
+
e.split(",").forEach(function(a) {
|
|
715
|
+
let s = G.get(a);
|
|
716
|
+
if (s === void 0) {
|
|
717
|
+
const i = a.trim();
|
|
718
|
+
s = { id: i, type: "na", children: [] }, G.set(i, s);
|
|
719
|
+
}
|
|
720
|
+
s.classes || (s.classes = []), s.classes.push(t);
|
|
721
|
+
});
|
|
722
|
+
}, "setCssClass"), Zt = /* @__PURE__ */ d((e, t) => {
|
|
723
|
+
const a = e.flat(), s = [], i = a.find((r) => (r == null ? void 0 : r.type) === "column-setting"), c = (i == null ? void 0 : i.columns) ?? -1;
|
|
724
|
+
for (const r of a) {
|
|
725
|
+
if (typeof c == "number" && c > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > c && v.warn(
|
|
726
|
+
`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`
|
|
727
|
+
), r.label && (r.label = or(r.label)), r.type === "classDef") {
|
|
728
|
+
hr(r.id, r.css);
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
if (r.type === "applyClass") {
|
|
732
|
+
dr(r.id, (r == null ? void 0 : r.styleClass) ?? "");
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
if (r.type === "applyStyles") {
|
|
736
|
+
r != null && r.stylesStr && gr(r.id, r == null ? void 0 : r.stylesStr);
|
|
737
|
+
continue;
|
|
738
|
+
}
|
|
739
|
+
if (r.type === "column-setting")
|
|
740
|
+
t.columns = r.columns ?? -1;
|
|
741
|
+
else if (r.type === "edge") {
|
|
742
|
+
const n = (mt.get(r.id) ?? 0) + 1;
|
|
743
|
+
mt.set(r.id, n), r.id = n + "-" + r.id, _t.push(r);
|
|
744
|
+
} else {
|
|
745
|
+
r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
|
|
746
|
+
const n = G.get(r.id);
|
|
747
|
+
if (n === void 0 ? G.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && Zt(r.children, r), r.type === "space") {
|
|
748
|
+
const l = r.width ?? 1;
|
|
749
|
+
for (let u = 0; u < l; u++) {
|
|
750
|
+
const g = er(r);
|
|
751
|
+
g.id = g.id + "-" + u, G.set(g.id, g), s.push(g);
|
|
752
|
+
}
|
|
753
|
+
} else n === void 0 && s.push(r);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
t.children = s;
|
|
757
|
+
}, "populateBlockDatabase"), Tt = [], nt = { id: "root", type: "composite", children: [], columns: -1 }, ur = /* @__PURE__ */ d(() => {
|
|
758
|
+
v.debug("Clear called"), He(), nt = { id: "root", type: "composite", children: [], columns: -1 }, G = /* @__PURE__ */ new Map([["root", nt]]), Tt = [], gt = /* @__PURE__ */ new Map(), _t = [], mt = /* @__PURE__ */ new Map(), kt = "";
|
|
759
|
+
}, "clear");
|
|
760
|
+
function Gt(e) {
|
|
761
|
+
switch (v.debug("typeStr2Type", e), e) {
|
|
762
|
+
case "[]":
|
|
763
|
+
return "square";
|
|
764
|
+
case "()":
|
|
765
|
+
return v.debug("we have a round"), "round";
|
|
766
|
+
case "(())":
|
|
767
|
+
return "circle";
|
|
768
|
+
case ">]":
|
|
769
|
+
return "rect_left_inv_arrow";
|
|
770
|
+
case "{}":
|
|
771
|
+
return "diamond";
|
|
772
|
+
case "{{}}":
|
|
773
|
+
return "hexagon";
|
|
774
|
+
case "([])":
|
|
775
|
+
return "stadium";
|
|
776
|
+
case "[[]]":
|
|
777
|
+
return "subroutine";
|
|
778
|
+
case "[()]":
|
|
779
|
+
return "cylinder";
|
|
780
|
+
case "((()))":
|
|
781
|
+
return "doublecircle";
|
|
782
|
+
case "[//]":
|
|
783
|
+
return "lean_right";
|
|
784
|
+
case "[\\\\]":
|
|
785
|
+
return "lean_left";
|
|
786
|
+
case "[/\\]":
|
|
787
|
+
return "trapezoid";
|
|
788
|
+
case "[\\/]":
|
|
789
|
+
return "inv_trapezoid";
|
|
790
|
+
case "<[]>":
|
|
791
|
+
return "block_arrow";
|
|
792
|
+
default:
|
|
793
|
+
return "na";
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
d(Gt, "typeStr2Type");
|
|
797
|
+
function qt(e) {
|
|
798
|
+
switch (v.debug("typeStr2Type", e), e) {
|
|
799
|
+
case "==":
|
|
800
|
+
return "thick";
|
|
801
|
+
default:
|
|
802
|
+
return "normal";
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
d(qt, "edgeTypeStr2Type");
|
|
806
|
+
function Jt(e) {
|
|
807
|
+
switch (e.trim().slice(-1)) {
|
|
808
|
+
case "x":
|
|
809
|
+
return "arrow_cross";
|
|
810
|
+
case "o":
|
|
811
|
+
return "arrow_circle";
|
|
812
|
+
case ">":
|
|
813
|
+
return "arrow_point";
|
|
814
|
+
default:
|
|
815
|
+
return "";
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
d(Jt, "edgeStrToEdgeData");
|
|
819
|
+
function Qt(e) {
|
|
820
|
+
switch (e.trim().charAt(0)) {
|
|
821
|
+
case "x":
|
|
822
|
+
return "arrow_cross";
|
|
823
|
+
case "o":
|
|
824
|
+
return "arrow_circle";
|
|
825
|
+
case "<":
|
|
826
|
+
return "arrow_point";
|
|
827
|
+
default:
|
|
828
|
+
return "arrow_open";
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
d(Qt, "edgeStrToEdgeStartData");
|
|
832
|
+
function $t(e) {
|
|
833
|
+
return e.includes("==") ? "thick" : "normal";
|
|
834
|
+
}
|
|
835
|
+
d($t, "edgeStrToThickness");
|
|
836
|
+
function te(e) {
|
|
837
|
+
return e.includes(".-") ? "dotted" : "solid";
|
|
838
|
+
}
|
|
839
|
+
d(te, "edgeStrToPattern");
|
|
840
|
+
var Mt = 0, pr = /* @__PURE__ */ d(() => (Mt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Mt), "generateId"), fr = /* @__PURE__ */ d((e) => {
|
|
841
|
+
nt.children = e, Zt(e, nt), Tt = nt.children;
|
|
842
|
+
}, "setHierarchy"), yr = /* @__PURE__ */ d((e) => {
|
|
843
|
+
const t = G.get(e);
|
|
844
|
+
return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
|
|
845
|
+
}, "getColumns"), xr = /* @__PURE__ */ d(() => [...G.values()], "getBlocksFlat"), br = /* @__PURE__ */ d(() => Tt || [], "getBlocks"), wr = /* @__PURE__ */ d(() => _t, "getEdges"), mr = /* @__PURE__ */ d((e) => G.get(e), "getBlock"), Sr = /* @__PURE__ */ d((e) => {
|
|
846
|
+
G.set(e.id, e);
|
|
847
|
+
}, "setBlock"), Lr = /* @__PURE__ */ d((e) => {
|
|
848
|
+
kt = e;
|
|
849
|
+
}, "setDiagramId"), vr = /* @__PURE__ */ d(() => kt, "getDiagramId"), Er = /* @__PURE__ */ d(() => v, "getLogger"), _r = /* @__PURE__ */ d(function() {
|
|
850
|
+
return gt;
|
|
851
|
+
}, "getClasses"), kr = {
|
|
852
|
+
getConfig: /* @__PURE__ */ d(() => ct().block, "getConfig"),
|
|
853
|
+
typeStr2Type: Gt,
|
|
854
|
+
edgeTypeStr2Type: qt,
|
|
855
|
+
edgeStrToEdgeData: Jt,
|
|
856
|
+
edgeStrToEdgeStartData: Qt,
|
|
857
|
+
edgeStrToThickness: $t,
|
|
858
|
+
edgeStrToPattern: te,
|
|
859
|
+
getLogger: Er,
|
|
860
|
+
getBlocksFlat: xr,
|
|
861
|
+
getBlocks: br,
|
|
862
|
+
getEdges: wr,
|
|
863
|
+
setHierarchy: fr,
|
|
864
|
+
getBlock: mr,
|
|
865
|
+
setBlock: Sr,
|
|
866
|
+
getColumns: yr,
|
|
867
|
+
getClasses: _r,
|
|
868
|
+
clear: ur,
|
|
869
|
+
generateId: pr,
|
|
870
|
+
setDiagramId: Lr,
|
|
871
|
+
getDiagramId: vr
|
|
872
|
+
}, Tr = kr, bt = /* @__PURE__ */ d((e, t) => {
|
|
873
|
+
const a = $e, s = a(e, "r"), i = a(e, "g"), c = a(e, "b");
|
|
874
|
+
return Ke(s, i, c, t);
|
|
875
|
+
}, "fade"), Dr = /* @__PURE__ */ d((e) => `.label {
|
|
876
|
+
font-family: ${e.fontFamily};
|
|
877
|
+
color: ${e.nodeTextColor || e.textColor};
|
|
878
|
+
}
|
|
879
|
+
.cluster-label text {
|
|
880
|
+
fill: ${e.titleColor};
|
|
881
|
+
}
|
|
882
|
+
.cluster-label span,p {
|
|
883
|
+
color: ${e.titleColor};
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
.label text,span,p {
|
|
889
|
+
fill: ${e.nodeTextColor || e.textColor};
|
|
890
|
+
color: ${e.nodeTextColor || e.textColor};
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.node rect,
|
|
894
|
+
.node circle,
|
|
895
|
+
.node ellipse,
|
|
896
|
+
.node polygon,
|
|
897
|
+
.node path {
|
|
898
|
+
fill: ${e.mainBkg};
|
|
899
|
+
stroke: ${e.nodeBorder};
|
|
900
|
+
stroke-width: 1px;
|
|
901
|
+
}
|
|
902
|
+
.flowchart-label text {
|
|
903
|
+
text-anchor: middle;
|
|
904
|
+
}
|
|
905
|
+
// .flowchart-label .text-outer-tspan {
|
|
906
|
+
// text-anchor: middle;
|
|
907
|
+
// }
|
|
908
|
+
// .flowchart-label .text-inner-tspan {
|
|
909
|
+
// text-anchor: start;
|
|
910
|
+
// }
|
|
911
|
+
|
|
912
|
+
.node .label {
|
|
913
|
+
text-align: center;
|
|
914
|
+
}
|
|
915
|
+
.node.clickable {
|
|
916
|
+
cursor: pointer;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.arrowheadPath {
|
|
920
|
+
fill: ${e.arrowheadColor};
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.edgePath .path {
|
|
924
|
+
stroke: ${e.lineColor};
|
|
925
|
+
stroke-width: 2.0px;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.flowchart-link {
|
|
929
|
+
stroke: ${e.lineColor};
|
|
930
|
+
fill: none;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.edgeLabel {
|
|
934
|
+
background-color: ${e.edgeLabelBackground};
|
|
935
|
+
/*
|
|
936
|
+
* This is for backward compatibility with existing code that didn't
|
|
937
|
+
* add a \`<p>\` around edge labels.
|
|
938
|
+
*
|
|
939
|
+
* TODO: We should probably remove this in a future release.
|
|
940
|
+
*/
|
|
941
|
+
p {
|
|
942
|
+
margin: 0;
|
|
943
|
+
padding: 0;
|
|
944
|
+
display: inline;
|
|
945
|
+
}
|
|
946
|
+
rect {
|
|
947
|
+
opacity: 0.5;
|
|
948
|
+
background-color: ${e.edgeLabelBackground};
|
|
949
|
+
fill: ${e.edgeLabelBackground};
|
|
950
|
+
}
|
|
951
|
+
text-align: center;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/* For html labels only */
|
|
955
|
+
.labelBkg {
|
|
956
|
+
background-color: ${e.edgeLabelBackground};
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.node .cluster {
|
|
960
|
+
// fill: ${bt(e.mainBkg, 0.5)};
|
|
961
|
+
fill: ${bt(e.clusterBkg, 0.5)};
|
|
962
|
+
stroke: ${bt(e.clusterBorder, 0.2)};
|
|
963
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
964
|
+
stroke-width: 1px;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.cluster text {
|
|
968
|
+
fill: ${e.titleColor};
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.cluster span,p {
|
|
972
|
+
color: ${e.titleColor};
|
|
973
|
+
}
|
|
974
|
+
/* .cluster div {
|
|
975
|
+
color: ${e.titleColor};
|
|
976
|
+
} */
|
|
977
|
+
|
|
978
|
+
div.mermaidTooltip {
|
|
979
|
+
position: absolute;
|
|
980
|
+
text-align: center;
|
|
981
|
+
max-width: 200px;
|
|
982
|
+
padding: 2px;
|
|
983
|
+
font-family: ${e.fontFamily};
|
|
984
|
+
font-size: 12px;
|
|
985
|
+
background: ${e.tertiaryColor};
|
|
986
|
+
border: 1px solid ${e.border2};
|
|
987
|
+
border-radius: 2px;
|
|
988
|
+
pointer-events: none;
|
|
989
|
+
z-index: 100;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.flowchartTitleText {
|
|
993
|
+
text-anchor: middle;
|
|
994
|
+
font-size: 18px;
|
|
995
|
+
fill: ${e.textColor};
|
|
996
|
+
}
|
|
997
|
+
${ye()}
|
|
998
|
+
`, "getStyles"), Nr = Dr, Ir = /* @__PURE__ */ d((e, t, a, s) => {
|
|
999
|
+
t.forEach((i) => {
|
|
1000
|
+
Wr[i](e, a, s);
|
|
1001
|
+
});
|
|
1002
|
+
}, "insertMarkers"), Cr = /* @__PURE__ */ d((e, t, a) => {
|
|
1003
|
+
v.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
1004
|
+
}, "extension"), Br = /* @__PURE__ */ d((e, t, a) => {
|
|
1005
|
+
e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
1006
|
+
}, "composition"), Or = /* @__PURE__ */ d((e, t, a) => {
|
|
1007
|
+
e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
1008
|
+
}, "aggregation"), Rr = /* @__PURE__ */ d((e, t, a) => {
|
|
1009
|
+
e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
1010
|
+
}, "dependency"), Ar = /* @__PURE__ */ d((e, t, a) => {
|
|
1011
|
+
e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
1012
|
+
}, "lollipop"), zr = /* @__PURE__ */ d((e, t, a) => {
|
|
1013
|
+
e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
1014
|
+
}, "point"), Mr = /* @__PURE__ */ d((e, t, a) => {
|
|
1015
|
+
e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
1016
|
+
}, "circle"), Pr = /* @__PURE__ */ d((e, t, a) => {
|
|
1017
|
+
e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
1018
|
+
}, "cross"), Fr = /* @__PURE__ */ d((e, t, a) => {
|
|
1019
|
+
e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
1020
|
+
}, "barb"), Wr = {
|
|
1021
|
+
extension: Cr,
|
|
1022
|
+
composition: Br,
|
|
1023
|
+
aggregation: Or,
|
|
1024
|
+
dependency: Rr,
|
|
1025
|
+
lollipop: Ar,
|
|
1026
|
+
point: zr,
|
|
1027
|
+
circle: Mr,
|
|
1028
|
+
cross: Pr,
|
|
1029
|
+
barb: Fr
|
|
1030
|
+
}, Yr = Ir, Ut, Xt, z = ((Xt = (Ut = M()) == null ? void 0 : Ut.block) == null ? void 0 : Xt.padding) ?? 8;
|
|
1031
|
+
function St(e, t) {
|
|
1032
|
+
if (e === 0 || !Number.isInteger(e))
|
|
1033
|
+
throw new Error("Columns must be an integer !== 0.");
|
|
1034
|
+
if (t < 0 || !Number.isInteger(t))
|
|
1035
|
+
throw new Error("Position must be a non-negative integer." + t);
|
|
1036
|
+
if (e < 0)
|
|
1037
|
+
return { px: t, py: 0 };
|
|
1038
|
+
if (e === 1)
|
|
1039
|
+
return { px: 0, py: t };
|
|
1040
|
+
const a = t % e, s = Math.floor(t / e);
|
|
1041
|
+
return { px: a, py: s };
|
|
1042
|
+
}
|
|
1043
|
+
d(St, "calculateBlockPosition");
|
|
1044
|
+
var Hr = /* @__PURE__ */ d((e) => {
|
|
1045
|
+
let t = 0, a = 0;
|
|
1046
|
+
for (const s of e.children) {
|
|
1047
|
+
const { width: i, height: c, x: r, y: n } = s.size ?? { width: 0, height: 0, x: 0, y: 0 };
|
|
1048
|
+
if (v.debug(
|
|
1049
|
+
"getMaxChildSize abc95 child:",
|
|
1050
|
+
s.id,
|
|
1051
|
+
"width:",
|
|
1052
|
+
i,
|
|
1053
|
+
"height:",
|
|
1054
|
+
c,
|
|
1055
|
+
"x:",
|
|
1056
|
+
r,
|
|
1057
|
+
"y:",
|
|
1058
|
+
n,
|
|
1059
|
+
s.type
|
|
1060
|
+
), s.type === "space")
|
|
1061
|
+
continue;
|
|
1062
|
+
const l = i / (s.widthInColumns ?? 1);
|
|
1063
|
+
l > t && (t = l), c > a && (a = c);
|
|
1064
|
+
}
|
|
1065
|
+
return { width: t, height: a };
|
|
1066
|
+
}, "getMaxChildSize");
|
|
1067
|
+
function dt(e, t, a = 0, s = 0) {
|
|
1068
|
+
var r, n, l, u, g, y, w, b, m, _, L;
|
|
1069
|
+
v.debug(
|
|
1070
|
+
"setBlockSizes abc95 (start)",
|
|
1071
|
+
e.id,
|
|
1072
|
+
(r = e == null ? void 0 : e.size) == null ? void 0 : r.x,
|
|
1073
|
+
"block width =",
|
|
1074
|
+
e == null ? void 0 : e.size,
|
|
1075
|
+
"siblingWidth",
|
|
1076
|
+
a
|
|
1077
|
+
), (n = e == null ? void 0 : e.size) != null && n.width || (e.size = {
|
|
1078
|
+
width: a,
|
|
1079
|
+
height: s,
|
|
1080
|
+
x: 0,
|
|
1081
|
+
y: 0
|
|
1082
|
+
});
|
|
1083
|
+
let i = 0, c = 0;
|
|
1084
|
+
if (((l = e.children) == null ? void 0 : l.length) > 0) {
|
|
1085
|
+
for (const E of e.children)
|
|
1086
|
+
dt(E, t);
|
|
1087
|
+
const C = Hr(e);
|
|
1088
|
+
i = C.width, c = C.height, v.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, c);
|
|
1089
|
+
for (const E of e.children)
|
|
1090
|
+
E.size && (v.debug(
|
|
1091
|
+
`abc95 Setting size of children of ${e.id} id=${E.id} ${i} ${c} ${JSON.stringify(E.size)}`
|
|
1092
|
+
), E.size.width = i * (E.widthInColumns ?? 1) + z * ((E.widthInColumns ?? 1) - 1), E.size.height = c, E.size.x = 0, E.size.y = 0, v.debug(
|
|
1093
|
+
`abc95 updating size of ${e.id} children child:${E.id} maxWidth:${i} maxHeight:${c}`
|
|
1094
|
+
));
|
|
1095
|
+
for (const E of e.children)
|
|
1096
|
+
dt(E, t, i, c);
|
|
1097
|
+
const I = e.columns ?? -1;
|
|
1098
|
+
let N = 0;
|
|
1099
|
+
for (const E of e.children)
|
|
1100
|
+
N += E.widthInColumns ?? 1;
|
|
1101
|
+
let x = e.children.length;
|
|
1102
|
+
I > 0 && I < N && (x = I);
|
|
1103
|
+
const p = Math.ceil(N / x);
|
|
1104
|
+
let f = x * (i + z) + z, S = p * (c + z) + z;
|
|
1105
|
+
if (f < a) {
|
|
1106
|
+
v.debug(
|
|
1107
|
+
`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${f}`
|
|
1108
|
+
), f = a, S = s;
|
|
1109
|
+
const E = (a - x * z - z) / x, o = (s - p * z - z) / p;
|
|
1110
|
+
v.debug("Size indata abc88", e.id, "childWidth", E, "maxWidth", i), v.debug("Size indata abc88", e.id, "childHeight", o, "maxHeight", c), v.debug("Size indata abc88 xSize", x, "padding", z);
|
|
1111
|
+
for (const k of e.children)
|
|
1112
|
+
k.size && (k.size.width = E, k.size.height = o, k.size.x = 0, k.size.y = 0);
|
|
1113
|
+
}
|
|
1114
|
+
if (v.debug(
|
|
1115
|
+
`abc95 (finale calc) ${e.id} xSize ${x} ySize ${p} columns ${I}${e.children.length} width=${Math.max(f, ((u = e.size) == null ? void 0 : u.width) || 0)}`
|
|
1116
|
+
), f < (((g = e == null ? void 0 : e.size) == null ? void 0 : g.width) || 0)) {
|
|
1117
|
+
f = ((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) || 0;
|
|
1118
|
+
const E = I > 0 ? Math.min(e.children.length, I) : e.children.length;
|
|
1119
|
+
if (E > 0) {
|
|
1120
|
+
const o = (f - E * z - z) / E;
|
|
1121
|
+
v.debug("abc95 (growing to fit) width", e.id, f, (w = e.size) == null ? void 0 : w.width, o);
|
|
1122
|
+
for (const k of e.children)
|
|
1123
|
+
k.size && (k.size.width = o);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
e.size = {
|
|
1127
|
+
width: f,
|
|
1128
|
+
height: S,
|
|
1129
|
+
x: 0,
|
|
1130
|
+
y: 0
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
v.debug(
|
|
1134
|
+
"setBlockSizes abc94 (done)",
|
|
1135
|
+
e.id,
|
|
1136
|
+
(b = e == null ? void 0 : e.size) == null ? void 0 : b.x,
|
|
1137
|
+
(m = e == null ? void 0 : e.size) == null ? void 0 : m.width,
|
|
1138
|
+
(_ = e == null ? void 0 : e.size) == null ? void 0 : _.y,
|
|
1139
|
+
(L = e == null ? void 0 : e.size) == null ? void 0 : L.height
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1142
|
+
d(dt, "setBlockSizes");
|
|
1143
|
+
function Dt(e, t) {
|
|
1144
|
+
var s, i, c, r, n, l, u, g, y, w, b, m, _, L, C, I, N;
|
|
1145
|
+
v.debug(
|
|
1146
|
+
`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s = e == null ? void 0 : e.size) == null ? void 0 : s.x} y: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.y} width: ${(c = e == null ? void 0 : e.size) == null ? void 0 : c.width}`
|
|
1147
|
+
);
|
|
1148
|
+
const a = e.columns ?? -1;
|
|
1149
|
+
if (v.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && // find max width of children
|
|
1150
|
+
e.children.length > 0) {
|
|
1151
|
+
const x = ((n = (r = e == null ? void 0 : e.children[0]) == null ? void 0 : r.size) == null ? void 0 : n.width) ?? 0, p = e.children.length * x + (e.children.length - 1) * z;
|
|
1152
|
+
v.debug("widthOfChildren 88", p, "posX");
|
|
1153
|
+
const f = /* @__PURE__ */ new Map();
|
|
1154
|
+
{
|
|
1155
|
+
let h = 0;
|
|
1156
|
+
for (const T of e.children) {
|
|
1157
|
+
if (!T.size)
|
|
1158
|
+
continue;
|
|
1159
|
+
const { py: D } = St(a, h), U = f.get(D) ?? 0;
|
|
1160
|
+
T.size.height > U && f.set(D, T.size.height);
|
|
1161
|
+
let F = (T == null ? void 0 : T.widthInColumns) ?? 1;
|
|
1162
|
+
a > 0 && (F = Math.min(F, a - h % a)), h += F;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
const S = /* @__PURE__ */ new Map();
|
|
1166
|
+
{
|
|
1167
|
+
let h = 0;
|
|
1168
|
+
const T = [...f.keys()].sort((D, U) => D - U);
|
|
1169
|
+
for (const D of T)
|
|
1170
|
+
S.set(D, h), h += (f.get(D) ?? 0) + z;
|
|
1171
|
+
}
|
|
1172
|
+
let E = 0;
|
|
1173
|
+
v.debug("abc91 block?.size?.x", e.id, (l = e == null ? void 0 : e.size) == null ? void 0 : l.x);
|
|
1174
|
+
let o = (u = e == null ? void 0 : e.size) != null && u.x ? ((g = e == null ? void 0 : e.size) == null ? void 0 : g.x) + (-((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) / 2 || 0) : -z, k = 0;
|
|
1175
|
+
for (const h of e.children) {
|
|
1176
|
+
const T = e;
|
|
1177
|
+
if (!h.size)
|
|
1178
|
+
continue;
|
|
1179
|
+
const { width: D, height: U } = h.size, { px: F, py: J } = St(a, E);
|
|
1180
|
+
if (J != k && (k = J, o = (w = e == null ? void 0 : e.size) != null && w.x ? ((b = e == null ? void 0 : e.size) == null ? void 0 : b.x) + (-((m = e == null ? void 0 : e.size) == null ? void 0 : m.width) / 2 || 0) : -z, v.debug("New row in layout for block", e.id, " and child ", h.id, k)), v.debug(
|
|
1181
|
+
`abc89 layout blocks (child) id: ${h.id} Pos: ${E} (px, py) ${F},${J} (${(_ = T == null ? void 0 : T.size) == null ? void 0 : _.x},${(L = T == null ? void 0 : T.size) == null ? void 0 : L.y}) parent: ${T.id} width: ${D}${z}`
|
|
1182
|
+
), T.size) {
|
|
1183
|
+
const Y = D / 2;
|
|
1184
|
+
h.size.x = o + z + Y, v.debug(
|
|
1185
|
+
`abc91 layout blocks (calc) px, pyid:${h.id} startingPos=X${o} new startingPosX${h.size.x} ${Y} padding=${z} width=${D} halfWidth=${Y} => x:${h.size.x} y:${h.size.y} ${h.widthInColumns} (width * (child?.w || 1)) / 2 ${D * ((h == null ? void 0 : h.widthInColumns) ?? 1) / 2}`
|
|
1186
|
+
), o = h.size.x + Y;
|
|
1187
|
+
const et = S.get(J) ?? 0, rt = f.get(J) ?? U;
|
|
1188
|
+
h.size.y = T.size.y - T.size.height / 2 + et + rt / 2 + z, v.debug(
|
|
1189
|
+
`abc88 layout blocks (calc) px, pyid:${h.id}startingPosX${o}${z}${Y}=>x:${h.size.x}y:${h.size.y}${h.widthInColumns}(width * (child?.w || 1)) / 2${D * ((h == null ? void 0 : h.widthInColumns) ?? 1) / 2}`
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
h.children && Dt(h);
|
|
1193
|
+
let B = (h == null ? void 0 : h.widthInColumns) ?? 1;
|
|
1194
|
+
a > 0 && (B = Math.min(B, a - E % a)), E += B, v.debug("abc88 columnsPos", h, E);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
v.debug(
|
|
1198
|
+
`layout blocks (<==layoutBlocks) ${e.id} x: ${(C = e == null ? void 0 : e.size) == null ? void 0 : C.x} y: ${(I = e == null ? void 0 : e.size) == null ? void 0 : I.y} width: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.width}`
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
d(Dt, "layoutBlocks");
|
|
1202
|
+
function Nt(e, { minX: t, minY: a, maxX: s, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
|
|
1203
|
+
if (e.size && e.id !== "root") {
|
|
1204
|
+
const { x: c, y: r, width: n, height: l } = e.size;
|
|
1205
|
+
c - n / 2 < t && (t = c - n / 2), r - l / 2 < a && (a = r - l / 2), c + n / 2 > s && (s = c + n / 2), r + l / 2 > i && (i = r + l / 2);
|
|
1206
|
+
}
|
|
1207
|
+
if (e.children)
|
|
1208
|
+
for (const c of e.children)
|
|
1209
|
+
({ minX: t, minY: a, maxX: s, maxY: i } = Nt(c, { minX: t, minY: a, maxX: s, maxY: i }));
|
|
1210
|
+
return { minX: t, minY: a, maxX: s, maxY: i };
|
|
1211
|
+
}
|
|
1212
|
+
d(Nt, "findBounds");
|
|
1213
|
+
function ee(e) {
|
|
1214
|
+
const t = e.getBlock("root");
|
|
1215
|
+
if (!t)
|
|
1216
|
+
return;
|
|
1217
|
+
dt(t, e, 0, 0), Dt(t), v.debug("getBlocks", JSON.stringify(t, null, 2));
|
|
1218
|
+
const { minX: a, minY: s, maxX: i, maxY: c } = Nt(t), r = c - s, n = i - a;
|
|
1219
|
+
return { x: a, y: s, width: n, height: r };
|
|
1220
|
+
}
|
|
1221
|
+
d(ee, "layout");
|
|
1222
|
+
var Kr = /* @__PURE__ */ d(async (e, t, a, s = !1, i = !1) => {
|
|
1223
|
+
let c = t || "";
|
|
1224
|
+
typeof c == "object" && (c = c[0]);
|
|
1225
|
+
const r = M(), n = H(r);
|
|
1226
|
+
return await Et(
|
|
1227
|
+
e,
|
|
1228
|
+
c,
|
|
1229
|
+
{
|
|
1230
|
+
style: a,
|
|
1231
|
+
isTitle: s,
|
|
1232
|
+
useHtmlLabels: n,
|
|
1233
|
+
markdown: !1,
|
|
1234
|
+
isNode: i,
|
|
1235
|
+
width: Number.POSITIVE_INFINITY
|
|
1236
|
+
},
|
|
1237
|
+
r
|
|
1238
|
+
);
|
|
1239
|
+
}, "createLabel"), Z = Kr, Ur = /* @__PURE__ */ d((e, t, a, s, i) => {
|
|
1240
|
+
t.arrowTypeStart && Pt(e, "start", t.arrowTypeStart, a, s, i), t.arrowTypeEnd && Pt(e, "end", t.arrowTypeEnd, a, s, i);
|
|
1241
|
+
}, "addEdgeMarkers"), Xr = {
|
|
1242
|
+
arrow_cross: "cross",
|
|
1243
|
+
arrow_point: "point",
|
|
1244
|
+
arrow_barb: "barb",
|
|
1245
|
+
arrow_circle: "circle",
|
|
1246
|
+
aggregation: "aggregation",
|
|
1247
|
+
extension: "extension",
|
|
1248
|
+
composition: "composition",
|
|
1249
|
+
dependency: "dependency",
|
|
1250
|
+
lollipop: "lollipop"
|
|
1251
|
+
}, Pt = /* @__PURE__ */ d((e, t, a, s, i, c) => {
|
|
1252
|
+
const r = Xr[a];
|
|
1253
|
+
if (!r) {
|
|
1254
|
+
v.warn(`Unknown arrow type: ${a}`);
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
const n = t === "start" ? "Start" : "End";
|
|
1258
|
+
e.attr(`marker-${t}`, `url(${s}#${i}_${c}-${r}${n})`);
|
|
1259
|
+
}, "addEdgeMarker"), Lt = {}, W = {}, Vr = /* @__PURE__ */ d(async (e, t) => {
|
|
1260
|
+
const a = M(), s = H(a), i = e.insert("g").attr("class", "edgeLabel"), c = i.insert("g").attr("class", "label"), r = t.labelType === "markdown", n = await Et(
|
|
1261
|
+
e,
|
|
1262
|
+
t.label,
|
|
1263
|
+
{
|
|
1264
|
+
style: t.labelStyle,
|
|
1265
|
+
useHtmlLabels: s,
|
|
1266
|
+
// TODO: The old code only set addSvgBackground when using markdown, but
|
|
1267
|
+
// this function is only used by block diagrams which never use markdown.
|
|
1268
|
+
addSvgBackground: r,
|
|
1269
|
+
isNode: !1,
|
|
1270
|
+
markdown: r,
|
|
1271
|
+
// If using markdown, wrap using default width
|
|
1272
|
+
width: r ? void 0 : Number.POSITIVE_INFINITY
|
|
1273
|
+
},
|
|
1274
|
+
a
|
|
1275
|
+
);
|
|
1276
|
+
c.node().appendChild(n);
|
|
1277
|
+
let l = n.getBBox(), u = l;
|
|
1278
|
+
if (s) {
|
|
1279
|
+
const y = n.children[0], w = O(n);
|
|
1280
|
+
l = y.getBoundingClientRect(), u = l, w.attr("width", l.width), w.attr("height", l.height);
|
|
1281
|
+
} else {
|
|
1282
|
+
const y = O(n).select("text").node();
|
|
1283
|
+
y && typeof y.getBBox == "function" && (u = y.getBBox());
|
|
1284
|
+
}
|
|
1285
|
+
c.attr("transform", at(u, s)), Lt[t.id] = i, t.width = l.width, t.height = l.height;
|
|
1286
|
+
let g;
|
|
1287
|
+
if (t.startLabelLeft) {
|
|
1288
|
+
const y = e.insert("g").attr("class", "edgeTerminals"), w = y.insert("g").attr("class", "inner"), b = await Z(w, t.startLabelLeft, t.labelStyle);
|
|
1289
|
+
g = b;
|
|
1290
|
+
let m = b.getBBox();
|
|
1291
|
+
if (s) {
|
|
1292
|
+
const _ = b.children[0], L = O(b);
|
|
1293
|
+
m = _.getBoundingClientRect(), L.attr("width", m.width), L.attr("height", m.height);
|
|
1294
|
+
}
|
|
1295
|
+
w.attr("transform", at(m, s)), W[t.id] || (W[t.id] = {}), W[t.id].startLeft = y, it(g, t.startLabelLeft);
|
|
1296
|
+
}
|
|
1297
|
+
if (t.startLabelRight) {
|
|
1298
|
+
const y = e.insert("g").attr("class", "edgeTerminals"), w = y.insert("g").attr("class", "inner"), b = await Z(w, t.startLabelRight, t.labelStyle);
|
|
1299
|
+
g = b;
|
|
1300
|
+
let m = b.getBBox();
|
|
1301
|
+
if (s) {
|
|
1302
|
+
const _ = b.children[0], L = O(b);
|
|
1303
|
+
m = _.getBoundingClientRect(), L.attr("width", m.width), L.attr("height", m.height);
|
|
1304
|
+
}
|
|
1305
|
+
w.attr("transform", at(m, s)), W[t.id] || (W[t.id] = {}), W[t.id].startRight = y, it(g, t.startLabelRight);
|
|
1306
|
+
}
|
|
1307
|
+
if (t.endLabelLeft) {
|
|
1308
|
+
const y = e.insert("g").attr("class", "edgeTerminals"), w = y.insert("g").attr("class", "inner"), b = await Z(y, t.endLabelLeft, t.labelStyle);
|
|
1309
|
+
g = b;
|
|
1310
|
+
let m = b.getBBox();
|
|
1311
|
+
if (s) {
|
|
1312
|
+
const _ = b.children[0], L = O(b);
|
|
1313
|
+
m = _.getBoundingClientRect(), L.attr("width", m.width), L.attr("height", m.height);
|
|
1314
|
+
}
|
|
1315
|
+
w.attr("transform", at(m, s)), W[t.id] || (W[t.id] = {}), W[t.id].endLeft = y, it(g, t.endLabelLeft);
|
|
1316
|
+
}
|
|
1317
|
+
if (t.endLabelRight) {
|
|
1318
|
+
const y = e.insert("g").attr("class", "edgeTerminals"), w = y.insert("g").attr("class", "inner"), b = await Z(
|
|
1319
|
+
y,
|
|
1320
|
+
t.endLabelRight,
|
|
1321
|
+
t.labelStyle
|
|
1322
|
+
);
|
|
1323
|
+
g = b;
|
|
1324
|
+
let m = b.getBBox();
|
|
1325
|
+
if (s) {
|
|
1326
|
+
const _ = b.children[0], L = O(b);
|
|
1327
|
+
m = _.getBoundingClientRect(), L.attr("width", m.width), L.attr("height", m.height);
|
|
1328
|
+
}
|
|
1329
|
+
w.attr("transform", at(m, s)), W[t.id] || (W[t.id] = {}), W[t.id].endRight = y, it(g, t.endLabelRight);
|
|
1330
|
+
}
|
|
1331
|
+
return n;
|
|
1332
|
+
}, "insertEdgeLabel");
|
|
1333
|
+
function it(e, t) {
|
|
1334
|
+
H(M()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
|
|
1335
|
+
}
|
|
1336
|
+
d(it, "setTerminalWidth");
|
|
1337
|
+
var jr = /* @__PURE__ */ d((e, t) => {
|
|
1338
|
+
v.debug("Moving label abc88 ", e.id, e.label, Lt[e.id], t);
|
|
1339
|
+
let a = t.updatedPath ? t.updatedPath : t.originalPath;
|
|
1340
|
+
const s = M(), { subGraphTitleTotalMargin: i } = Ze(s);
|
|
1341
|
+
if (e.label) {
|
|
1342
|
+
const c = Lt[e.id];
|
|
1343
|
+
let r = e.x, n = e.y;
|
|
1344
|
+
if (a) {
|
|
1345
|
+
const l = st.calcLabelPosition(a);
|
|
1346
|
+
v.debug(
|
|
1347
|
+
"Moving label " + e.label + " from (",
|
|
1348
|
+
r,
|
|
1349
|
+
",",
|
|
1350
|
+
n,
|
|
1351
|
+
") to (",
|
|
1352
|
+
l.x,
|
|
1353
|
+
",",
|
|
1354
|
+
l.y,
|
|
1355
|
+
") abc88"
|
|
1356
|
+
), t.updatedPath && (r = l.x, n = l.y);
|
|
1357
|
+
}
|
|
1358
|
+
c.attr("transform", `translate(${r}, ${n + i / 2})`);
|
|
1359
|
+
}
|
|
1360
|
+
if (e.startLabelLeft) {
|
|
1361
|
+
const c = W[e.id].startLeft;
|
|
1362
|
+
let r = e.x, n = e.y;
|
|
1363
|
+
if (a) {
|
|
1364
|
+
const l = st.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
|
|
1365
|
+
r = l.x, n = l.y;
|
|
1366
|
+
}
|
|
1367
|
+
c.attr("transform", `translate(${r}, ${n})`);
|
|
1368
|
+
}
|
|
1369
|
+
if (e.startLabelRight) {
|
|
1370
|
+
const c = W[e.id].startRight;
|
|
1371
|
+
let r = e.x, n = e.y;
|
|
1372
|
+
if (a) {
|
|
1373
|
+
const l = st.calcTerminalLabelPosition(
|
|
1374
|
+
e.arrowTypeStart ? 10 : 0,
|
|
1375
|
+
"start_right",
|
|
1376
|
+
a
|
|
1377
|
+
);
|
|
1378
|
+
r = l.x, n = l.y;
|
|
1379
|
+
}
|
|
1380
|
+
c.attr("transform", `translate(${r}, ${n})`);
|
|
1381
|
+
}
|
|
1382
|
+
if (e.endLabelLeft) {
|
|
1383
|
+
const c = W[e.id].endLeft;
|
|
1384
|
+
let r = e.x, n = e.y;
|
|
1385
|
+
if (a) {
|
|
1386
|
+
const l = st.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
|
|
1387
|
+
r = l.x, n = l.y;
|
|
1388
|
+
}
|
|
1389
|
+
c.attr("transform", `translate(${r}, ${n})`);
|
|
1390
|
+
}
|
|
1391
|
+
if (e.endLabelRight) {
|
|
1392
|
+
const c = W[e.id].endRight;
|
|
1393
|
+
let r = e.x, n = e.y;
|
|
1394
|
+
if (a) {
|
|
1395
|
+
const l = st.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
|
|
1396
|
+
r = l.x, n = l.y;
|
|
1397
|
+
}
|
|
1398
|
+
c.attr("transform", `translate(${r}, ${n})`);
|
|
1399
|
+
}
|
|
1400
|
+
}, "positionEdgeLabel"), Zr = /* @__PURE__ */ d((e, t) => {
|
|
1401
|
+
const a = e.x, s = e.y, i = Math.abs(t.x - a), c = Math.abs(t.y - s), r = e.width / 2, n = e.height / 2;
|
|
1402
|
+
return i >= r || c >= n;
|
|
1403
|
+
}, "outsideNode"), Gr = /* @__PURE__ */ d((e, t, a) => {
|
|
1404
|
+
v.debug(`intersection calc abc89:
|
|
1405
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
1406
|
+
insidePoint : ${JSON.stringify(a)}
|
|
1407
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
|
|
1408
|
+
const s = e.x, i = e.y, c = Math.abs(s - a.x), r = e.width / 2;
|
|
1409
|
+
let n = a.x < t.x ? r - c : r + c;
|
|
1410
|
+
const l = e.height / 2, u = Math.abs(t.y - a.y), g = Math.abs(t.x - a.x);
|
|
1411
|
+
if (Math.abs(i - t.y) * r > Math.abs(s - t.x) * l) {
|
|
1412
|
+
let y = a.y < t.y ? t.y - l - i : i - l - t.y;
|
|
1413
|
+
n = g * y / u;
|
|
1414
|
+
const w = {
|
|
1415
|
+
x: a.x < t.x ? a.x + n : a.x - g + n,
|
|
1416
|
+
y: a.y < t.y ? a.y + u - y : a.y - u + y
|
|
1417
|
+
};
|
|
1418
|
+
return n === 0 && (w.x = t.x, w.y = t.y), g === 0 && (w.x = t.x), u === 0 && (w.y = t.y), v.debug(`abc89 topp/bott calc, Q ${u}, q ${y}, R ${g}, r ${n}`, w), w;
|
|
1419
|
+
} else {
|
|
1420
|
+
a.x < t.x ? n = t.x - r - s : n = s - r - t.x;
|
|
1421
|
+
let y = u * n / g, w = a.x < t.x ? a.x + g - n : a.x - g + n, b = a.y < t.y ? a.y + y : a.y - y;
|
|
1422
|
+
return v.debug(`sides calc abc89, Q ${u}, q ${y}, R ${g}, r ${n}`, { _x: w, _y: b }), n === 0 && (w = t.x, b = t.y), g === 0 && (w = t.x), u === 0 && (b = t.y), { x: w, y: b };
|
|
1423
|
+
}
|
|
1424
|
+
}, "intersection"), Ft = /* @__PURE__ */ d((e, t) => {
|
|
1425
|
+
v.debug("abc88 cutPathAtIntersect", e, t);
|
|
1426
|
+
let a = [], s = e[0], i = !1;
|
|
1427
|
+
return e.forEach((c) => {
|
|
1428
|
+
if (!Zr(t, c) && !i) {
|
|
1429
|
+
const r = Gr(t, s, c);
|
|
1430
|
+
let n = !1;
|
|
1431
|
+
a.forEach((l) => {
|
|
1432
|
+
n = n || l.x === r.x && l.y === r.y;
|
|
1433
|
+
}), a.some((l) => l.x === r.x && l.y === r.y) || a.push(r), i = !0;
|
|
1434
|
+
} else
|
|
1435
|
+
s = c, i || a.push(c);
|
|
1436
|
+
}), a;
|
|
1437
|
+
}, "cutPathAtIntersect"), qr = /* @__PURE__ */ d(function(e, t, a, s, i, c, r) {
|
|
1438
|
+
let n = a.points;
|
|
1439
|
+
v.debug("abc88 InsertEdge: edge=", a, "e=", t);
|
|
1440
|
+
let l = !1;
|
|
1441
|
+
const u = c.node(t.v);
|
|
1442
|
+
var g = c.node(t.w);
|
|
1443
|
+
g != null && g.intersect && (u != null && u.intersect) && (n = n.slice(1, a.points.length - 1), n.unshift(u.intersect(n[0])), n.push(g.intersect(n[n.length - 1]))), a.toCluster && (v.debug("to cluster abc88", s[a.toCluster]), n = Ft(a.points, s[a.toCluster].node), l = !0), a.fromCluster && (v.debug("from cluster abc88", s[a.fromCluster]), n = Ft(n.reverse(), s[a.fromCluster].node).reverse(), l = !0);
|
|
1444
|
+
const y = n.filter((x) => !Number.isNaN(x.y));
|
|
1445
|
+
let w = Ve;
|
|
1446
|
+
a.curve && (i === "graph" || i === "flowchart") && (w = a.curve);
|
|
1447
|
+
const { x: b, y: m } = Ue(a), _ = Xe().x(b).y(m).curve(w);
|
|
1448
|
+
let L;
|
|
1449
|
+
switch (a.thickness) {
|
|
1450
|
+
case "normal":
|
|
1451
|
+
L = "edge-thickness-normal";
|
|
1452
|
+
break;
|
|
1453
|
+
case "thick":
|
|
1454
|
+
L = "edge-thickness-thick";
|
|
1455
|
+
break;
|
|
1456
|
+
case "invisible":
|
|
1457
|
+
L = "edge-thickness-thick";
|
|
1458
|
+
break;
|
|
1459
|
+
default:
|
|
1460
|
+
L = "";
|
|
1461
|
+
}
|
|
1462
|
+
switch (a.pattern) {
|
|
1463
|
+
case "solid":
|
|
1464
|
+
L += " edge-pattern-solid";
|
|
1465
|
+
break;
|
|
1466
|
+
case "dotted":
|
|
1467
|
+
L += " edge-pattern-dotted";
|
|
1468
|
+
break;
|
|
1469
|
+
case "dashed":
|
|
1470
|
+
L += " edge-pattern-dashed";
|
|
1471
|
+
break;
|
|
1472
|
+
}
|
|
1473
|
+
const C = e.append("path").attr("d", _(y)).attr("id", a.id).attr("class", " " + L + (a.classes ? " " + a.classes : "")).attr("style", a.style);
|
|
1474
|
+
let I = "";
|
|
1475
|
+
(M().flowchart.arrowMarkerAbsolute || M().state.arrowMarkerAbsolute) && (I = je(!0)), Ur(C, a, I, r, i);
|
|
1476
|
+
let N = {};
|
|
1477
|
+
return l && (N.updatedPath = n), N.originalPath = a.points, N;
|
|
1478
|
+
}, "insertEdge"), Jr = /* @__PURE__ */ d((e) => {
|
|
1479
|
+
const t = /* @__PURE__ */ new Set();
|
|
1480
|
+
for (const a of e)
|
|
1481
|
+
switch (a) {
|
|
1482
|
+
case "x":
|
|
1483
|
+
t.add("right"), t.add("left");
|
|
1484
|
+
break;
|
|
1485
|
+
case "y":
|
|
1486
|
+
t.add("up"), t.add("down");
|
|
1487
|
+
break;
|
|
1488
|
+
default:
|
|
1489
|
+
t.add(a);
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
return t;
|
|
1493
|
+
}, "expandAndDeduplicateDirections"), Qr = /* @__PURE__ */ d((e, t, a, s) => {
|
|
1494
|
+
const i = Jr(e), c = 2, r = t.height + 2 * a.padding, n = r / c, l = s ?? t.width + 2 * n + a.padding, u = a.padding / 2;
|
|
1495
|
+
return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
|
|
1496
|
+
// Bottom
|
|
1497
|
+
{ x: 0, y: 0 },
|
|
1498
|
+
{ x: n, y: 0 },
|
|
1499
|
+
{ x: l / 2, y: 2 * u },
|
|
1500
|
+
{ x: l - n, y: 0 },
|
|
1501
|
+
{ x: l, y: 0 },
|
|
1502
|
+
// Right
|
|
1503
|
+
{ x: l, y: -r / 3 },
|
|
1504
|
+
{ x: l + 2 * u, y: -r / 2 },
|
|
1505
|
+
{ x: l, y: -2 * r / 3 },
|
|
1506
|
+
{ x: l, y: -r },
|
|
1507
|
+
// Top
|
|
1508
|
+
{ x: l - n, y: -r },
|
|
1509
|
+
{ x: l / 2, y: -r - 2 * u },
|
|
1510
|
+
{ x: n, y: -r },
|
|
1511
|
+
// Left
|
|
1512
|
+
{ x: 0, y: -r },
|
|
1513
|
+
{ x: 0, y: -2 * r / 3 },
|
|
1514
|
+
{ x: -2 * u, y: -r / 2 },
|
|
1515
|
+
{ x: 0, y: -r / 3 }
|
|
1516
|
+
] : i.has("right") && i.has("left") && i.has("up") ? [
|
|
1517
|
+
{ x: n, y: 0 },
|
|
1518
|
+
{ x: l - n, y: 0 },
|
|
1519
|
+
{ x: l, y: -r / 2 },
|
|
1520
|
+
{ x: l - n, y: -r },
|
|
1521
|
+
{ x: n, y: -r },
|
|
1522
|
+
{ x: 0, y: -r / 2 }
|
|
1523
|
+
] : i.has("right") && i.has("left") && i.has("down") ? [
|
|
1524
|
+
{ x: 0, y: 0 },
|
|
1525
|
+
{ x: n, y: -r },
|
|
1526
|
+
{ x: l - n, y: -r },
|
|
1527
|
+
{ x: l, y: 0 }
|
|
1528
|
+
] : i.has("right") && i.has("up") && i.has("down") ? [
|
|
1529
|
+
{ x: 0, y: 0 },
|
|
1530
|
+
{ x: l, y: -n },
|
|
1531
|
+
{ x: l, y: -r + n },
|
|
1532
|
+
{ x: 0, y: -r }
|
|
1533
|
+
] : i.has("left") && i.has("up") && i.has("down") ? [
|
|
1534
|
+
{ x: l, y: 0 },
|
|
1535
|
+
{ x: 0, y: -n },
|
|
1536
|
+
{ x: 0, y: -r + n },
|
|
1537
|
+
{ x: l, y: -r }
|
|
1538
|
+
] : i.has("right") && i.has("left") ? [
|
|
1539
|
+
{ x: n, y: 0 },
|
|
1540
|
+
{ x: n, y: -u },
|
|
1541
|
+
{ x: l - n, y: -u },
|
|
1542
|
+
{ x: l - n, y: 0 },
|
|
1543
|
+
{ x: l, y: -r / 2 },
|
|
1544
|
+
{ x: l - n, y: -r },
|
|
1545
|
+
{ x: l - n, y: -r + u },
|
|
1546
|
+
{ x: n, y: -r + u },
|
|
1547
|
+
{ x: n, y: -r },
|
|
1548
|
+
{ x: 0, y: -r / 2 }
|
|
1549
|
+
] : i.has("up") && i.has("down") ? [
|
|
1550
|
+
// Bottom center
|
|
1551
|
+
{ x: l / 2, y: 0 },
|
|
1552
|
+
// Left pont of bottom arrow
|
|
1553
|
+
{ x: 0, y: -u },
|
|
1554
|
+
{ x: n, y: -u },
|
|
1555
|
+
// Left top over vertical section
|
|
1556
|
+
{ x: n, y: -r + u },
|
|
1557
|
+
{ x: 0, y: -r + u },
|
|
1558
|
+
// Top of arrow
|
|
1559
|
+
{ x: l / 2, y: -r },
|
|
1560
|
+
{ x: l, y: -r + u },
|
|
1561
|
+
// Top of right vertical bar
|
|
1562
|
+
{ x: l - n, y: -r + u },
|
|
1563
|
+
{ x: l - n, y: -u },
|
|
1564
|
+
{ x: l, y: -u }
|
|
1565
|
+
] : i.has("right") && i.has("up") ? [
|
|
1566
|
+
{ x: 0, y: 0 },
|
|
1567
|
+
{ x: l, y: -n },
|
|
1568
|
+
{ x: 0, y: -r }
|
|
1569
|
+
] : i.has("right") && i.has("down") ? [
|
|
1570
|
+
{ x: 0, y: 0 },
|
|
1571
|
+
{ x: l, y: 0 },
|
|
1572
|
+
{ x: 0, y: -r }
|
|
1573
|
+
] : i.has("left") && i.has("up") ? [
|
|
1574
|
+
{ x: l, y: 0 },
|
|
1575
|
+
{ x: 0, y: -n },
|
|
1576
|
+
{ x: l, y: -r }
|
|
1577
|
+
] : i.has("left") && i.has("down") ? [
|
|
1578
|
+
{ x: l, y: 0 },
|
|
1579
|
+
{ x: 0, y: 0 },
|
|
1580
|
+
{ x: l, y: -r }
|
|
1581
|
+
] : i.has("right") ? [
|
|
1582
|
+
{ x: n, y: -u },
|
|
1583
|
+
{ x: n, y: -u },
|
|
1584
|
+
{ x: l - n, y: -u },
|
|
1585
|
+
{ x: l - n, y: 0 },
|
|
1586
|
+
{ x: l, y: -r / 2 },
|
|
1587
|
+
{ x: l - n, y: -r },
|
|
1588
|
+
{ x: l - n, y: -r + u },
|
|
1589
|
+
// top left corner of arrow
|
|
1590
|
+
{ x: n, y: -r + u },
|
|
1591
|
+
{ x: n, y: -r + u }
|
|
1592
|
+
] : i.has("left") ? [
|
|
1593
|
+
{ x: n, y: 0 },
|
|
1594
|
+
{ x: n, y: -u },
|
|
1595
|
+
// Two points, the right corners
|
|
1596
|
+
{ x: l - n, y: -u },
|
|
1597
|
+
{ x: l - n, y: -r + u },
|
|
1598
|
+
{ x: n, y: -r + u },
|
|
1599
|
+
{ x: n, y: -r },
|
|
1600
|
+
{ x: 0, y: -r / 2 }
|
|
1601
|
+
] : i.has("up") ? [
|
|
1602
|
+
// Bottom center
|
|
1603
|
+
{ x: n, y: -u },
|
|
1604
|
+
// Left top over vertical section
|
|
1605
|
+
{ x: n, y: -r + u },
|
|
1606
|
+
{ x: 0, y: -r + u },
|
|
1607
|
+
// Top of arrow
|
|
1608
|
+
{ x: l / 2, y: -r },
|
|
1609
|
+
{ x: l, y: -r + u },
|
|
1610
|
+
// Top of right vertical bar
|
|
1611
|
+
{ x: l - n, y: -r + u },
|
|
1612
|
+
{ x: l - n, y: -u }
|
|
1613
|
+
] : i.has("down") ? [
|
|
1614
|
+
// Bottom center
|
|
1615
|
+
{ x: l / 2, y: 0 },
|
|
1616
|
+
// Left pont of bottom arrow
|
|
1617
|
+
{ x: 0, y: -u },
|
|
1618
|
+
{ x: n, y: -u },
|
|
1619
|
+
// Left top over vertical section
|
|
1620
|
+
{ x: n, y: -r + u },
|
|
1621
|
+
{ x: l - n, y: -r + u },
|
|
1622
|
+
{ x: l - n, y: -u },
|
|
1623
|
+
{ x: l, y: -u }
|
|
1624
|
+
] : [{ x: 0, y: 0 }];
|
|
1625
|
+
}, "getArrowPoints");
|
|
1626
|
+
function re(e, t) {
|
|
1627
|
+
return e.intersect(t);
|
|
1628
|
+
}
|
|
1629
|
+
d(re, "intersectNode");
|
|
1630
|
+
var $r = re;
|
|
1631
|
+
function ae(e, t, a, s) {
|
|
1632
|
+
var i = e.x, c = e.y, r = i - s.x, n = c - s.y, l = Math.sqrt(t * t * n * n + a * a * r * r), u = Math.abs(t * a * r / l);
|
|
1633
|
+
s.x < i && (u = -u);
|
|
1634
|
+
var g = Math.abs(t * a * n / l);
|
|
1635
|
+
return s.y < c && (g = -g), { x: i + u, y: c + g };
|
|
1636
|
+
}
|
|
1637
|
+
d(ae, "intersectEllipse");
|
|
1638
|
+
var se = ae;
|
|
1639
|
+
function ie(e, t, a) {
|
|
1640
|
+
return se(e, t, t, a);
|
|
1641
|
+
}
|
|
1642
|
+
d(ie, "intersectCircle");
|
|
1643
|
+
var ta = ie;
|
|
1644
|
+
function ne(e, t, a, s) {
|
|
1645
|
+
var i, c, r, n, l, u, g, y, w, b, m, _, L, C, I;
|
|
1646
|
+
if (i = t.y - e.y, r = e.x - t.x, l = t.x * e.y - e.x * t.y, w = i * a.x + r * a.y + l, b = i * s.x + r * s.y + l, !(w !== 0 && b !== 0 && vt(w, b)) && (c = s.y - a.y, n = a.x - s.x, u = s.x * a.y - a.x * s.y, g = c * e.x + n * e.y + u, y = c * t.x + n * t.y + u, !(g !== 0 && y !== 0 && vt(g, y)) && (m = i * n - c * r, m !== 0)))
|
|
1647
|
+
return _ = Math.abs(m / 2), L = r * u - n * l, C = L < 0 ? (L - _) / m : (L + _) / m, L = c * l - i * u, I = L < 0 ? (L - _) / m : (L + _) / m, { x: C, y: I };
|
|
1648
|
+
}
|
|
1649
|
+
d(ne, "intersectLine");
|
|
1650
|
+
function vt(e, t) {
|
|
1651
|
+
return e * t > 0;
|
|
1652
|
+
}
|
|
1653
|
+
d(vt, "sameSign");
|
|
1654
|
+
var ea = ne, ra = ce;
|
|
1655
|
+
function ce(e, t, a) {
|
|
1656
|
+
var s = e.x, i = e.y, c = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
|
|
1657
|
+
typeof t.forEach == "function" ? t.forEach(function(m) {
|
|
1658
|
+
r = Math.min(r, m.x), n = Math.min(n, m.y);
|
|
1659
|
+
}) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
|
|
1660
|
+
for (var l = s - e.width / 2 - r, u = i - e.height / 2 - n, g = 0; g < t.length; g++) {
|
|
1661
|
+
var y = t[g], w = t[g < t.length - 1 ? g + 1 : 0], b = ea(
|
|
1662
|
+
e,
|
|
1663
|
+
a,
|
|
1664
|
+
{ x: l + y.x, y: u + y.y },
|
|
1665
|
+
{ x: l + w.x, y: u + w.y }
|
|
1666
|
+
);
|
|
1667
|
+
b && c.push(b);
|
|
1668
|
+
}
|
|
1669
|
+
return c.length ? (c.length > 1 && c.sort(function(m, _) {
|
|
1670
|
+
var L = m.x - a.x, C = m.y - a.y, I = Math.sqrt(L * L + C * C), N = _.x - a.x, x = _.y - a.y, p = Math.sqrt(N * N + x * x);
|
|
1671
|
+
return I < p ? -1 : I === p ? 0 : 1;
|
|
1672
|
+
}), c[0]) : e;
|
|
1673
|
+
}
|
|
1674
|
+
d(ce, "intersectPolygon");
|
|
1675
|
+
var aa = /* @__PURE__ */ d((e, t) => {
|
|
1676
|
+
var a = e.x, s = e.y, i = t.x - a, c = t.y - s, r = e.width / 2, n = e.height / 2, l, u;
|
|
1677
|
+
return Math.abs(c) * r > Math.abs(i) * n ? (c < 0 && (n = -n), l = c === 0 ? 0 : n * i / c, u = n) : (i < 0 && (r = -r), l = r, u = i === 0 ? 0 : r * c / i), { x: a + l, y: s + u };
|
|
1678
|
+
}, "intersectRect"), sa = aa, R = {
|
|
1679
|
+
node: $r,
|
|
1680
|
+
circle: ta,
|
|
1681
|
+
ellipse: se,
|
|
1682
|
+
polygon: ra,
|
|
1683
|
+
rect: sa
|
|
1684
|
+
}, P = /* @__PURE__ */ d(async (e, t, a, s) => {
|
|
1685
|
+
const i = M();
|
|
1686
|
+
let c;
|
|
1687
|
+
const r = t.useHtmlLabels || H(i);
|
|
1688
|
+
a ? c = a : c = "node default";
|
|
1689
|
+
const n = e.insert("g").attr("class", c).attr("id", t.domId || t.id), l = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
|
|
1690
|
+
let u;
|
|
1691
|
+
t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
|
|
1692
|
+
let g;
|
|
1693
|
+
t.labelType === "markdown" ? g = Et(
|
|
1694
|
+
l,
|
|
1695
|
+
Ot(Rt(u), i),
|
|
1696
|
+
{
|
|
1697
|
+
useHtmlLabels: r,
|
|
1698
|
+
width: t.width || i.flowchart.wrappingWidth,
|
|
1699
|
+
classes: "markdown-node-label"
|
|
1700
|
+
},
|
|
1701
|
+
i
|
|
1702
|
+
) : g = await Z(
|
|
1703
|
+
l,
|
|
1704
|
+
Ot(Rt(u), i),
|
|
1705
|
+
t.labelStyle,
|
|
1706
|
+
!1,
|
|
1707
|
+
s
|
|
1708
|
+
);
|
|
1709
|
+
let y = g.getBBox();
|
|
1710
|
+
const w = t.padding / 2;
|
|
1711
|
+
if (H(i)) {
|
|
1712
|
+
const b = g.children[0], m = O(g);
|
|
1713
|
+
await Je(b, u), y = b.getBoundingClientRect(), m.attr("width", y.width), m.attr("height", y.height);
|
|
1714
|
+
}
|
|
1715
|
+
return r ? l.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : l.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && l.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), l.insert("rect", ":first-child"), { shapeSvg: n, bbox: y, halfPadding: w, label: l };
|
|
1716
|
+
}, "labelHelper"), A = /* @__PURE__ */ d((e, t) => {
|
|
1717
|
+
const a = t.node().getBBox();
|
|
1718
|
+
e.width = a.width, e.height = a.height;
|
|
1719
|
+
}, "updateNodeBounds");
|
|
1720
|
+
function q(e, t, a, s) {
|
|
1721
|
+
return e.insert("polygon", ":first-child").attr(
|
|
1722
|
+
"points",
|
|
1723
|
+
s.map(function(i) {
|
|
1724
|
+
return i.x + "," + i.y;
|
|
1725
|
+
}).join(" ")
|
|
1726
|
+
).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
|
|
1727
|
+
}
|
|
1728
|
+
d(q, "insertPolygonShape");
|
|
1729
|
+
var ia = /* @__PURE__ */ d(async (e, t) => {
|
|
1730
|
+
t.useHtmlLabels || H(M()) || (t.centerLabel = !0);
|
|
1731
|
+
const { shapeSvg: s, bbox: i, halfPadding: c } = await P(
|
|
1732
|
+
e,
|
|
1733
|
+
t,
|
|
1734
|
+
"node " + t.classes,
|
|
1735
|
+
!0
|
|
1736
|
+
);
|
|
1737
|
+
v.info("Classes = ", t.classes);
|
|
1738
|
+
const r = s.insert("rect", ":first-child");
|
|
1739
|
+
return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -i.width / 2 - c).attr("y", -i.height / 2 - c).attr("width", i.width + t.padding).attr("height", i.height + t.padding), A(t, r), t.intersect = function(n) {
|
|
1740
|
+
return R.rect(t, n);
|
|
1741
|
+
}, s;
|
|
1742
|
+
}, "note"), na = ia, Wt = /* @__PURE__ */ d((e) => e ? " " + e : "", "formatClass"), V = /* @__PURE__ */ d((e, t) => `${t || "node default"}${Wt(e.classes)} ${Wt(
|
|
1743
|
+
e.class
|
|
1744
|
+
)}`, "getClassesFromNode"), Yt = /* @__PURE__ */ d(async (e, t) => {
|
|
1745
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1746
|
+
e,
|
|
1747
|
+
t,
|
|
1748
|
+
V(t, void 0),
|
|
1749
|
+
!0
|
|
1750
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = i + c, n = [
|
|
1751
|
+
{ x: r / 2, y: 0 },
|
|
1752
|
+
{ x: r, y: -r / 2 },
|
|
1753
|
+
{ x: r / 2, y: -r },
|
|
1754
|
+
{ x: 0, y: -r / 2 }
|
|
1755
|
+
];
|
|
1756
|
+
v.info("Question main (Circle)");
|
|
1757
|
+
const l = q(a, r, r, n);
|
|
1758
|
+
return l.attr("style", t.style), A(t, l), t.intersect = function(u) {
|
|
1759
|
+
return v.warn("Intersect called"), R.polygon(t, n, u);
|
|
1760
|
+
}, a;
|
|
1761
|
+
}, "question"), ca = /* @__PURE__ */ d((e, t) => {
|
|
1762
|
+
const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = 28, i = [
|
|
1763
|
+
{ x: 0, y: s / 2 },
|
|
1764
|
+
{ x: s / 2, y: 0 },
|
|
1765
|
+
{ x: 0, y: -s / 2 },
|
|
1766
|
+
{ x: -s / 2, y: 0 }
|
|
1767
|
+
];
|
|
1768
|
+
return a.insert("polygon", ":first-child").attr(
|
|
1769
|
+
"points",
|
|
1770
|
+
i.map(function(r) {
|
|
1771
|
+
return r.x + "," + r.y;
|
|
1772
|
+
}).join(" ")
|
|
1773
|
+
).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
|
|
1774
|
+
return R.circle(t, 14, r);
|
|
1775
|
+
}, a;
|
|
1776
|
+
}, "choice"), la = /* @__PURE__ */ d(async (e, t) => {
|
|
1777
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1778
|
+
e,
|
|
1779
|
+
t,
|
|
1780
|
+
V(t, void 0),
|
|
1781
|
+
!0
|
|
1782
|
+
), i = 4, c = t.positioned ? t.height : s.height + t.padding, r = c / i, n = t.positioned ? t.width : s.width + 2 * r + t.padding, l = [
|
|
1783
|
+
{ x: r, y: 0 },
|
|
1784
|
+
{ x: n - r, y: 0 },
|
|
1785
|
+
{ x: n, y: -c / 2 },
|
|
1786
|
+
{ x: n - r, y: -c },
|
|
1787
|
+
{ x: r, y: -c },
|
|
1788
|
+
{ x: 0, y: -c / 2 }
|
|
1789
|
+
], u = q(a, n, c, l);
|
|
1790
|
+
return u.attr("style", t.style), A(t, u), t.intersect = function(g) {
|
|
1791
|
+
return R.polygon(t, l, g);
|
|
1792
|
+
}, a;
|
|
1793
|
+
}, "hexagon"), oa = /* @__PURE__ */ d(async (e, t) => {
|
|
1794
|
+
const { shapeSvg: a, bbox: s } = await P(e, t, void 0, !0), i = 2, c = s.height + 2 * t.padding, r = c / i, n = s.width + 2 * r + t.padding, u = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > n ? t.width : n, g = Qr(t.directions, s, t, u), y = q(a, u, c, g);
|
|
1795
|
+
return y.attr("style", t.style), A(t, y), t.intersect = function(w) {
|
|
1796
|
+
return R.polygon(t, g, w);
|
|
1797
|
+
}, a;
|
|
1798
|
+
}, "block_arrow"), ha = /* @__PURE__ */ d(async (e, t) => {
|
|
1799
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1800
|
+
e,
|
|
1801
|
+
t,
|
|
1802
|
+
V(t, void 0),
|
|
1803
|
+
!0
|
|
1804
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1805
|
+
{ x: -c / 2, y: 0 },
|
|
1806
|
+
{ x: i, y: 0 },
|
|
1807
|
+
{ x: i, y: -c },
|
|
1808
|
+
{ x: -c / 2, y: -c },
|
|
1809
|
+
{ x: 0, y: -c / 2 }
|
|
1810
|
+
];
|
|
1811
|
+
return q(a, i, c, r).attr("style", t.style), t.width = i + c, t.height = c, t.intersect = function(l) {
|
|
1812
|
+
return R.polygon(t, r, l);
|
|
1813
|
+
}, a;
|
|
1814
|
+
}, "rect_left_inv_arrow"), ga = /* @__PURE__ */ d(async (e, t) => {
|
|
1815
|
+
const { shapeSvg: a, bbox: s } = await P(e, t, V(t), !0), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1816
|
+
{ x: -2 * c / 6, y: 0 },
|
|
1817
|
+
{ x: i - c / 6, y: 0 },
|
|
1818
|
+
{ x: i + 2 * c / 6, y: -c },
|
|
1819
|
+
{ x: c / 6, y: -c }
|
|
1820
|
+
], n = q(a, i, c, r);
|
|
1821
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
1822
|
+
return R.polygon(t, r, l);
|
|
1823
|
+
}, a;
|
|
1824
|
+
}, "lean_right"), da = /* @__PURE__ */ d(async (e, t) => {
|
|
1825
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1826
|
+
e,
|
|
1827
|
+
t,
|
|
1828
|
+
V(t, void 0),
|
|
1829
|
+
!0
|
|
1830
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1831
|
+
{ x: 2 * c / 6, y: 0 },
|
|
1832
|
+
{ x: i + c / 6, y: 0 },
|
|
1833
|
+
{ x: i - 2 * c / 6, y: -c },
|
|
1834
|
+
{ x: -c / 6, y: -c }
|
|
1835
|
+
], n = q(a, i, c, r);
|
|
1836
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
1837
|
+
return R.polygon(t, r, l);
|
|
1838
|
+
}, a;
|
|
1839
|
+
}, "lean_left"), ua = /* @__PURE__ */ d(async (e, t) => {
|
|
1840
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1841
|
+
e,
|
|
1842
|
+
t,
|
|
1843
|
+
V(t, void 0),
|
|
1844
|
+
!0
|
|
1845
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1846
|
+
{ x: -2 * c / 6, y: 0 },
|
|
1847
|
+
{ x: i + 2 * c / 6, y: 0 },
|
|
1848
|
+
{ x: i - c / 6, y: -c },
|
|
1849
|
+
{ x: c / 6, y: -c }
|
|
1850
|
+
], n = q(a, i, c, r);
|
|
1851
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
1852
|
+
return R.polygon(t, r, l);
|
|
1853
|
+
}, a;
|
|
1854
|
+
}, "trapezoid"), pa = /* @__PURE__ */ d(async (e, t) => {
|
|
1855
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1856
|
+
e,
|
|
1857
|
+
t,
|
|
1858
|
+
V(t, void 0),
|
|
1859
|
+
!0
|
|
1860
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1861
|
+
{ x: c / 6, y: 0 },
|
|
1862
|
+
{ x: i - c / 6, y: 0 },
|
|
1863
|
+
{ x: i + 2 * c / 6, y: -c },
|
|
1864
|
+
{ x: -2 * c / 6, y: -c }
|
|
1865
|
+
], n = q(a, i, c, r);
|
|
1866
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
1867
|
+
return R.polygon(t, r, l);
|
|
1868
|
+
}, a;
|
|
1869
|
+
}, "inv_trapezoid"), fa = /* @__PURE__ */ d(async (e, t) => {
|
|
1870
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1871
|
+
e,
|
|
1872
|
+
t,
|
|
1873
|
+
V(t, void 0),
|
|
1874
|
+
!0
|
|
1875
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
1876
|
+
{ x: 0, y: 0 },
|
|
1877
|
+
{ x: i + c / 2, y: 0 },
|
|
1878
|
+
{ x: i, y: -c / 2 },
|
|
1879
|
+
{ x: i + c / 2, y: -c },
|
|
1880
|
+
{ x: 0, y: -c }
|
|
1881
|
+
], n = q(a, i, c, r);
|
|
1882
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
1883
|
+
return R.polygon(t, r, l);
|
|
1884
|
+
}, a;
|
|
1885
|
+
}, "rect_right_inv_arrow"), ya = /* @__PURE__ */ d(async (e, t) => {
|
|
1886
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1887
|
+
e,
|
|
1888
|
+
t,
|
|
1889
|
+
V(t, void 0),
|
|
1890
|
+
!0
|
|
1891
|
+
), i = s.width + t.padding, c = i / 2, r = c / (2.5 + i / 50), n = s.height + r + t.padding, l = "M 0," + r + " a " + c + "," + r + " 0,0,0 " + i + " 0 a " + c + "," + r + " 0,0,0 " + -i + " 0 l 0," + n + " a " + c + "," + r + " 0,0,0 " + i + " 0 l 0," + -n, u = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", l).attr("transform", "translate(" + -i / 2 + "," + -(n / 2 + r) + ")");
|
|
1892
|
+
return A(t, u), t.intersect = function(g) {
|
|
1893
|
+
const y = R.rect(t, g), w = y.x - t.x;
|
|
1894
|
+
if (c != 0 && (Math.abs(w) < t.width / 2 || Math.abs(w) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - r)) {
|
|
1895
|
+
let b = r * r * (1 - w * w / (c * c));
|
|
1896
|
+
b != 0 && (b = Math.sqrt(b)), b = r - b, g.y - t.y > 0 && (b = -b), y.y += b;
|
|
1897
|
+
}
|
|
1898
|
+
return y;
|
|
1899
|
+
}, a;
|
|
1900
|
+
}, "cylinder"), xa = /* @__PURE__ */ d(async (e, t) => {
|
|
1901
|
+
const { shapeSvg: a, bbox: s, halfPadding: i } = await P(
|
|
1902
|
+
e,
|
|
1903
|
+
t,
|
|
1904
|
+
"node " + t.classes + " " + t.class,
|
|
1905
|
+
!0
|
|
1906
|
+
), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, u = t.positioned ? -n / 2 : -s.height / 2 - i;
|
|
1907
|
+
if (c.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", r).attr("height", n), t.props) {
|
|
1908
|
+
const g = new Set(Object.keys(t.props));
|
|
1909
|
+
t.props.borders && (ut(c, t.props.borders, r, n), g.delete("borders")), g.forEach((y) => {
|
|
1910
|
+
v.warn(`Unknown node property ${y}`);
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
return A(t, c), t.intersect = function(g) {
|
|
1914
|
+
return R.rect(t, g);
|
|
1915
|
+
}, a;
|
|
1916
|
+
}, "rect"), ba = /* @__PURE__ */ d(async (e, t) => {
|
|
1917
|
+
const { shapeSvg: a, bbox: s, halfPadding: i } = await P(
|
|
1918
|
+
e,
|
|
1919
|
+
t,
|
|
1920
|
+
"node " + t.classes,
|
|
1921
|
+
!0
|
|
1922
|
+
), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, u = t.positioned ? -n / 2 : -s.height / 2 - i;
|
|
1923
|
+
if (c.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", r).attr("height", n), t.props) {
|
|
1924
|
+
const g = new Set(Object.keys(t.props));
|
|
1925
|
+
t.props.borders && (ut(c, t.props.borders, r, n), g.delete("borders")), g.forEach((y) => {
|
|
1926
|
+
v.warn(`Unknown node property ${y}`);
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
return A(t, c), t.intersect = function(g) {
|
|
1930
|
+
return R.rect(t, g);
|
|
1931
|
+
}, a;
|
|
1932
|
+
}, "composite"), wa = /* @__PURE__ */ d(async (e, t) => {
|
|
1933
|
+
const { shapeSvg: a } = await P(e, t, "label", !0);
|
|
1934
|
+
v.trace("Classes = ", t.class);
|
|
1935
|
+
const s = a.insert("rect", ":first-child"), i = 0, c = 0;
|
|
1936
|
+
if (s.attr("width", i).attr("height", c), a.attr("class", "label edgeLabel"), t.props) {
|
|
1937
|
+
const r = new Set(Object.keys(t.props));
|
|
1938
|
+
t.props.borders && (ut(s, t.props.borders, i, c), r.delete("borders")), r.forEach((n) => {
|
|
1939
|
+
v.warn(`Unknown node property ${n}`);
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
return A(t, s), t.intersect = function(r) {
|
|
1943
|
+
return R.rect(t, r);
|
|
1944
|
+
}, a;
|
|
1945
|
+
}, "labelRect");
|
|
1946
|
+
function ut(e, t, a, s) {
|
|
1947
|
+
const i = [], c = /* @__PURE__ */ d((n) => {
|
|
1948
|
+
i.push(n, 0);
|
|
1949
|
+
}, "addBorder"), r = /* @__PURE__ */ d((n) => {
|
|
1950
|
+
i.push(0, n);
|
|
1951
|
+
}, "skipBorder");
|
|
1952
|
+
t.includes("t") ? (v.debug("add top border"), c(a)) : r(a), t.includes("r") ? (v.debug("add right border"), c(s)) : r(s), t.includes("b") ? (v.debug("add bottom border"), c(a)) : r(a), t.includes("l") ? (v.debug("add left border"), c(s)) : r(s), e.attr("stroke-dasharray", i.join(" "));
|
|
1953
|
+
}
|
|
1954
|
+
d(ut, "applyNodePropertyBorders");
|
|
1955
|
+
var ma = /* @__PURE__ */ d(async (e, t) => {
|
|
1956
|
+
let a;
|
|
1957
|
+
t.classes ? a = "node " + t.classes : a = "node default";
|
|
1958
|
+
const s = e.insert("g").attr("class", a).attr("id", t.domId || t.id), i = s.insert("rect", ":first-child"), c = s.insert("line"), r = s.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
|
|
1959
|
+
let l = "";
|
|
1960
|
+
typeof n == "object" ? l = n[0] : l = n, v.info("Label text abc79", l, n, typeof n == "object");
|
|
1961
|
+
const u = await Z(r, l, t.labelStyle, !0, !0);
|
|
1962
|
+
let g = { width: 0, height: 0 };
|
|
1963
|
+
if (H(M())) {
|
|
1964
|
+
const _ = u.children[0], L = O(u);
|
|
1965
|
+
g = _.getBoundingClientRect(), L.attr("width", g.width), L.attr("height", g.height);
|
|
1966
|
+
}
|
|
1967
|
+
v.info("Text 2", n);
|
|
1968
|
+
const y = n.slice(1, n.length);
|
|
1969
|
+
let w = u.getBBox();
|
|
1970
|
+
const b = await Z(
|
|
1971
|
+
r,
|
|
1972
|
+
y.join ? y.join("<br/>") : y,
|
|
1973
|
+
t.labelStyle,
|
|
1974
|
+
!0,
|
|
1975
|
+
!0
|
|
1976
|
+
);
|
|
1977
|
+
if (H(M())) {
|
|
1978
|
+
const _ = b.children[0], L = O(b);
|
|
1979
|
+
g = _.getBoundingClientRect(), L.attr("width", g.width), L.attr("height", g.height);
|
|
1980
|
+
}
|
|
1981
|
+
const m = t.padding / 2;
|
|
1982
|
+
return O(b).attr(
|
|
1983
|
+
"transform",
|
|
1984
|
+
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
1985
|
+
(g.width > w.width ? 0 : (w.width - g.width) / 2) + ", " + (w.height + m + 5) + ")"
|
|
1986
|
+
), O(u).attr(
|
|
1987
|
+
"transform",
|
|
1988
|
+
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
1989
|
+
(g.width < w.width ? 0 : -(w.width - g.width) / 2) + ", 0)"
|
|
1990
|
+
), g = r.node().getBBox(), r.attr(
|
|
1991
|
+
"transform",
|
|
1992
|
+
"translate(" + -g.width / 2 + ", " + (-g.height / 2 - m + 3) + ")"
|
|
1993
|
+
), i.attr("class", "outer title-state").attr("x", -g.width / 2 - m).attr("y", -g.height / 2 - m).attr("width", g.width + t.padding).attr("height", g.height + t.padding), c.attr("class", "divider").attr("x1", -g.width / 2 - m).attr("x2", g.width / 2 + m).attr("y1", -g.height / 2 - m + w.height + m).attr("y2", -g.height / 2 - m + w.height + m), A(t, i), t.intersect = function(_) {
|
|
1994
|
+
return R.rect(t, _);
|
|
1995
|
+
}, s;
|
|
1996
|
+
}, "rectWithTitle"), Sa = /* @__PURE__ */ d(async (e, t) => {
|
|
1997
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
1998
|
+
e,
|
|
1999
|
+
t,
|
|
2000
|
+
V(t, void 0),
|
|
2001
|
+
!0
|
|
2002
|
+
), i = s.height + t.padding, c = s.width + i / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -c / 2).attr("y", -i / 2).attr("width", c).attr("height", i);
|
|
2003
|
+
return A(t, r), t.intersect = function(n) {
|
|
2004
|
+
return R.rect(t, n);
|
|
2005
|
+
}, a;
|
|
2006
|
+
}, "stadium"), La = /* @__PURE__ */ d(async (e, t) => {
|
|
2007
|
+
const { shapeSvg: a, bbox: s, halfPadding: i } = await P(
|
|
2008
|
+
e,
|
|
2009
|
+
t,
|
|
2010
|
+
V(t, void 0),
|
|
2011
|
+
!0
|
|
2012
|
+
), c = a.insert("circle", ":first-child");
|
|
2013
|
+
return c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), v.info("Circle main"), A(t, c), t.intersect = function(r) {
|
|
2014
|
+
return v.info("Circle intersect", t, s.width / 2 + i, r), R.circle(t, s.width / 2 + i, r);
|
|
2015
|
+
}, a;
|
|
2016
|
+
}, "circle"), va = /* @__PURE__ */ d(async (e, t) => {
|
|
2017
|
+
const { shapeSvg: a, bbox: s, halfPadding: i } = await P(
|
|
2018
|
+
e,
|
|
2019
|
+
t,
|
|
2020
|
+
V(t, void 0),
|
|
2021
|
+
!0
|
|
2022
|
+
), c = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), l = r.insert("circle");
|
|
2023
|
+
return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i + c).attr("width", s.width + t.padding + c * 2).attr("height", s.height + t.padding + c * 2), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), v.info("DoubleCircle main"), A(t, n), t.intersect = function(u) {
|
|
2024
|
+
return v.info("DoubleCircle intersect", t, s.width / 2 + i + c, u), R.circle(t, s.width / 2 + i + c, u);
|
|
2025
|
+
}, a;
|
|
2026
|
+
}, "doublecircle"), Ea = /* @__PURE__ */ d(async (e, t) => {
|
|
2027
|
+
const { shapeSvg: a, bbox: s } = await P(
|
|
2028
|
+
e,
|
|
2029
|
+
t,
|
|
2030
|
+
V(t, void 0),
|
|
2031
|
+
!0
|
|
2032
|
+
), i = s.width + t.padding, c = s.height + t.padding, r = [
|
|
2033
|
+
{ x: 0, y: 0 },
|
|
2034
|
+
{ x: i, y: 0 },
|
|
2035
|
+
{ x: i, y: -c },
|
|
2036
|
+
{ x: 0, y: -c },
|
|
2037
|
+
{ x: 0, y: 0 },
|
|
2038
|
+
{ x: -8, y: 0 },
|
|
2039
|
+
{ x: i + 8, y: 0 },
|
|
2040
|
+
{ x: i + 8, y: -c },
|
|
2041
|
+
{ x: -8, y: -c },
|
|
2042
|
+
{ x: -8, y: 0 }
|
|
2043
|
+
], n = q(a, i, c, r);
|
|
2044
|
+
return n.attr("style", t.style), A(t, n), t.intersect = function(l) {
|
|
2045
|
+
return R.polygon(t, r, l);
|
|
2046
|
+
}, a;
|
|
2047
|
+
}, "subroutine"), _a = /* @__PURE__ */ d((e, t) => {
|
|
2048
|
+
const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child");
|
|
2049
|
+
return s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), A(t, s), t.intersect = function(i) {
|
|
2050
|
+
return R.circle(t, 7, i);
|
|
2051
|
+
}, a;
|
|
2052
|
+
}, "start"), Ht = /* @__PURE__ */ d((e, t, a) => {
|
|
2053
|
+
const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
|
|
2054
|
+
let i = 70, c = 10;
|
|
2055
|
+
a === "LR" && (i = 10, c = 70);
|
|
2056
|
+
const r = s.append("rect").attr("x", -1 * i / 2).attr("y", -1 * c / 2).attr("width", i).attr("height", c).attr("class", "fork-join");
|
|
2057
|
+
return A(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
|
|
2058
|
+
return R.rect(t, n);
|
|
2059
|
+
}, s;
|
|
2060
|
+
}, "forkJoin"), ka = /* @__PURE__ */ d((e, t) => {
|
|
2061
|
+
const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child"), i = a.insert("circle", ":first-child");
|
|
2062
|
+
return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), s.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), A(t, i), t.intersect = function(c) {
|
|
2063
|
+
return R.circle(t, 7, c);
|
|
2064
|
+
}, a;
|
|
2065
|
+
}, "end"), Ta = /* @__PURE__ */ d(async (e, t) => {
|
|
2066
|
+
var E;
|
|
2067
|
+
const a = t.padding / 2, s = 4, i = 8;
|
|
2068
|
+
let c;
|
|
2069
|
+
t.classes ? c = "node " + t.classes : c = "node default";
|
|
2070
|
+
const r = e.insert("g").attr("class", c).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), l = r.insert("line"), u = r.insert("line");
|
|
2071
|
+
let g = 0, y = s;
|
|
2072
|
+
const w = r.insert("g").attr("class", "label");
|
|
2073
|
+
let b = 0;
|
|
2074
|
+
const m = (E = t.classData.annotations) == null ? void 0 : E[0], _ = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", L = await Z(
|
|
2075
|
+
w,
|
|
2076
|
+
_,
|
|
2077
|
+
t.labelStyle,
|
|
2078
|
+
!0,
|
|
2079
|
+
!0
|
|
2080
|
+
);
|
|
2081
|
+
let C = L.getBBox();
|
|
2082
|
+
if (H(M())) {
|
|
2083
|
+
const o = L.children[0], k = O(L);
|
|
2084
|
+
C = o.getBoundingClientRect(), k.attr("width", C.width), k.attr("height", C.height);
|
|
2085
|
+
}
|
|
2086
|
+
t.classData.annotations[0] && (y += C.height + s, g += C.width);
|
|
2087
|
+
let I = t.classData.label;
|
|
2088
|
+
t.classData.type !== void 0 && t.classData.type !== "" && (H(M()) ? I += "<" + t.classData.type + ">" : I += "<" + t.classData.type + ">");
|
|
2089
|
+
const N = await Z(
|
|
2090
|
+
w,
|
|
2091
|
+
I,
|
|
2092
|
+
t.labelStyle,
|
|
2093
|
+
!0,
|
|
2094
|
+
!0
|
|
2095
|
+
);
|
|
2096
|
+
O(N).attr("class", "classTitle");
|
|
2097
|
+
let x = N.getBBox();
|
|
2098
|
+
if (H(M())) {
|
|
2099
|
+
const o = N.children[0], k = O(N);
|
|
2100
|
+
x = o.getBoundingClientRect(), k.attr("width", x.width), k.attr("height", x.height);
|
|
2101
|
+
}
|
|
2102
|
+
y += x.height + s, x.width > g && (g = x.width);
|
|
2103
|
+
const p = [];
|
|
2104
|
+
t.classData.members.forEach(async (o) => {
|
|
2105
|
+
const k = o.getDisplayDetails();
|
|
2106
|
+
let h = k.displayText;
|
|
2107
|
+
H(M()) && (h = h.replace(/</g, "<").replace(/>/g, ">"));
|
|
2108
|
+
const T = await Z(
|
|
2109
|
+
w,
|
|
2110
|
+
h,
|
|
2111
|
+
k.cssStyle ? k.cssStyle : t.labelStyle,
|
|
2112
|
+
!0,
|
|
2113
|
+
!0
|
|
2114
|
+
);
|
|
2115
|
+
let D = T.getBBox();
|
|
2116
|
+
if (H(M())) {
|
|
2117
|
+
const U = T.children[0], F = O(T);
|
|
2118
|
+
D = U.getBoundingClientRect(), F.attr("width", D.width), F.attr("height", D.height);
|
|
2119
|
+
}
|
|
2120
|
+
D.width > g && (g = D.width), y += D.height + s, p.push(T);
|
|
2121
|
+
}), y += i;
|
|
2122
|
+
const f = [];
|
|
2123
|
+
if (t.classData.methods.forEach(async (o) => {
|
|
2124
|
+
const k = o.getDisplayDetails();
|
|
2125
|
+
let h = k.displayText;
|
|
2126
|
+
H(M()) && (h = h.replace(/</g, "<").replace(/>/g, ">"));
|
|
2127
|
+
const T = await Z(
|
|
2128
|
+
w,
|
|
2129
|
+
h,
|
|
2130
|
+
k.cssStyle ? k.cssStyle : t.labelStyle,
|
|
2131
|
+
!0,
|
|
2132
|
+
!0
|
|
2133
|
+
);
|
|
2134
|
+
let D = T.getBBox();
|
|
2135
|
+
if (H(M())) {
|
|
2136
|
+
const U = T.children[0], F = O(T);
|
|
2137
|
+
D = U.getBoundingClientRect(), F.attr("width", D.width), F.attr("height", D.height);
|
|
2138
|
+
}
|
|
2139
|
+
D.width > g && (g = D.width), y += D.height + s, f.push(T);
|
|
2140
|
+
}), y += i, m) {
|
|
2141
|
+
let o = (g - C.width) / 2;
|
|
2142
|
+
O(L).attr(
|
|
2143
|
+
"transform",
|
|
2144
|
+
"translate( " + (-1 * g / 2 + o) + ", " + -1 * y / 2 + ")"
|
|
2145
|
+
), b = C.height + s;
|
|
2146
|
+
}
|
|
2147
|
+
let S = (g - x.width) / 2;
|
|
2148
|
+
return O(N).attr(
|
|
2149
|
+
"transform",
|
|
2150
|
+
"translate( " + (-1 * g / 2 + S) + ", " + (-1 * y / 2 + b) + ")"
|
|
2151
|
+
), b += x.height + s, l.attr("class", "divider").attr("x1", -g / 2 - a).attr("x2", g / 2 + a).attr("y1", -y / 2 - a + i + b).attr("y2", -y / 2 - a + i + b), b += i, p.forEach((o) => {
|
|
2152
|
+
O(o).attr(
|
|
2153
|
+
"transform",
|
|
2154
|
+
"translate( " + -g / 2 + ", " + (-1 * y / 2 + b + i / 2) + ")"
|
|
2155
|
+
);
|
|
2156
|
+
const k = o == null ? void 0 : o.getBBox();
|
|
2157
|
+
b += ((k == null ? void 0 : k.height) ?? 0) + s;
|
|
2158
|
+
}), b += i, u.attr("class", "divider").attr("x1", -g / 2 - a).attr("x2", g / 2 + a).attr("y1", -y / 2 - a + i + b).attr("y2", -y / 2 - a + i + b), b += i, f.forEach((o) => {
|
|
2159
|
+
O(o).attr(
|
|
2160
|
+
"transform",
|
|
2161
|
+
"translate( " + -g / 2 + ", " + (-1 * y / 2 + b) + ")"
|
|
2162
|
+
);
|
|
2163
|
+
const k = o == null ? void 0 : o.getBBox();
|
|
2164
|
+
b += ((k == null ? void 0 : k.height) ?? 0) + s;
|
|
2165
|
+
}), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -g / 2 - a).attr("y", -(y / 2) - a).attr("width", g + t.padding).attr("height", y + t.padding), A(t, n), t.intersect = function(o) {
|
|
2166
|
+
return R.rect(t, o);
|
|
2167
|
+
}, r;
|
|
2168
|
+
}, "class_box"), Kt = {
|
|
2169
|
+
rhombus: Yt,
|
|
2170
|
+
composite: ba,
|
|
2171
|
+
question: Yt,
|
|
2172
|
+
rect: xa,
|
|
2173
|
+
labelRect: wa,
|
|
2174
|
+
rectWithTitle: ma,
|
|
2175
|
+
choice: ca,
|
|
2176
|
+
circle: La,
|
|
2177
|
+
doublecircle: va,
|
|
2178
|
+
stadium: Sa,
|
|
2179
|
+
hexagon: la,
|
|
2180
|
+
block_arrow: oa,
|
|
2181
|
+
rect_left_inv_arrow: ha,
|
|
2182
|
+
lean_right: ga,
|
|
2183
|
+
lean_left: da,
|
|
2184
|
+
trapezoid: ua,
|
|
2185
|
+
inv_trapezoid: pa,
|
|
2186
|
+
rect_right_inv_arrow: fa,
|
|
2187
|
+
cylinder: ya,
|
|
2188
|
+
start: _a,
|
|
2189
|
+
end: ka,
|
|
2190
|
+
note: na,
|
|
2191
|
+
subroutine: Ea,
|
|
2192
|
+
fork: Ht,
|
|
2193
|
+
join: Ht,
|
|
2194
|
+
class_box: Ta
|
|
2195
|
+
}, ht = {}, le = /* @__PURE__ */ d(async (e, t, a) => {
|
|
2196
|
+
let s, i;
|
|
2197
|
+
if (t.link) {
|
|
2198
|
+
let c;
|
|
2199
|
+
M().securityLevel === "sandbox" ? c = "_top" : t.linkTarget && (c = t.linkTarget || "_blank"), s = e.insert("svg:a").attr("xlink:href", t.link).attr("target", c), i = await Kt[t.shape](s, t, a);
|
|
2200
|
+
} else
|
|
2201
|
+
i = await Kt[t.shape](e, t, a), s = i;
|
|
2202
|
+
return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), ht[t.id] = s, t.haveCallback && ht[t.id].attr("class", ht[t.id].attr("class") + " clickable"), s;
|
|
2203
|
+
}, "insertNode"), Da = /* @__PURE__ */ d((e) => {
|
|
2204
|
+
const t = ht[e.id];
|
|
2205
|
+
v.trace(
|
|
2206
|
+
"Transforming node",
|
|
2207
|
+
e.diff,
|
|
2208
|
+
e,
|
|
2209
|
+
"translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
|
|
2210
|
+
);
|
|
2211
|
+
const a = 8, s = e.diff || 0;
|
|
2212
|
+
return e.clusterNode ? t.attr(
|
|
2213
|
+
"transform",
|
|
2214
|
+
"translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
|
|
2215
|
+
) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
|
|
2216
|
+
}, "positionNode");
|
|
2217
|
+
function It(e, t, a = !1) {
|
|
2218
|
+
var b, m, _;
|
|
2219
|
+
const s = e;
|
|
2220
|
+
let i = "default";
|
|
2221
|
+
(((b = s == null ? void 0 : s.classes) == null ? void 0 : b.length) || 0) > 0 && (i = ((s == null ? void 0 : s.classes) ?? []).join(" ")), i = i + " flowchart-label";
|
|
2222
|
+
let c = 0, r = "", n;
|
|
2223
|
+
switch (s.type) {
|
|
2224
|
+
case "round":
|
|
2225
|
+
c = 5, r = "rect";
|
|
2226
|
+
break;
|
|
2227
|
+
case "composite":
|
|
2228
|
+
c = 0, r = "composite", n = 0;
|
|
2229
|
+
break;
|
|
2230
|
+
case "square":
|
|
2231
|
+
r = "rect";
|
|
2232
|
+
break;
|
|
2233
|
+
case "diamond":
|
|
2234
|
+
r = "question";
|
|
2235
|
+
break;
|
|
2236
|
+
case "hexagon":
|
|
2237
|
+
r = "hexagon";
|
|
2238
|
+
break;
|
|
2239
|
+
case "block_arrow":
|
|
2240
|
+
r = "block_arrow";
|
|
2241
|
+
break;
|
|
2242
|
+
case "odd":
|
|
2243
|
+
r = "rect_left_inv_arrow";
|
|
2244
|
+
break;
|
|
2245
|
+
case "lean_right":
|
|
2246
|
+
r = "lean_right";
|
|
2247
|
+
break;
|
|
2248
|
+
case "lean_left":
|
|
2249
|
+
r = "lean_left";
|
|
2250
|
+
break;
|
|
2251
|
+
case "trapezoid":
|
|
2252
|
+
r = "trapezoid";
|
|
2253
|
+
break;
|
|
2254
|
+
case "inv_trapezoid":
|
|
2255
|
+
r = "inv_trapezoid";
|
|
2256
|
+
break;
|
|
2257
|
+
case "rect_left_inv_arrow":
|
|
2258
|
+
r = "rect_left_inv_arrow";
|
|
2259
|
+
break;
|
|
2260
|
+
case "circle":
|
|
2261
|
+
r = "circle";
|
|
2262
|
+
break;
|
|
2263
|
+
case "ellipse":
|
|
2264
|
+
r = "ellipse";
|
|
2265
|
+
break;
|
|
2266
|
+
case "stadium":
|
|
2267
|
+
r = "stadium";
|
|
2268
|
+
break;
|
|
2269
|
+
case "subroutine":
|
|
2270
|
+
r = "subroutine";
|
|
2271
|
+
break;
|
|
2272
|
+
case "cylinder":
|
|
2273
|
+
r = "cylinder";
|
|
2274
|
+
break;
|
|
2275
|
+
case "group":
|
|
2276
|
+
r = "rect";
|
|
2277
|
+
break;
|
|
2278
|
+
case "doublecircle":
|
|
2279
|
+
r = "doublecircle";
|
|
2280
|
+
break;
|
|
2281
|
+
default:
|
|
2282
|
+
r = "rect";
|
|
2283
|
+
}
|
|
2284
|
+
const l = qe((s == null ? void 0 : s.styles) ?? []), u = s.label, g = s.size ?? { width: 0, height: 0, x: 0, y: 0 }, y = t.getDiagramId();
|
|
2285
|
+
return {
|
|
2286
|
+
labelStyle: l.labelStyle,
|
|
2287
|
+
shape: r,
|
|
2288
|
+
labelText: u,
|
|
2289
|
+
rx: c,
|
|
2290
|
+
ry: c,
|
|
2291
|
+
class: i,
|
|
2292
|
+
style: l.style,
|
|
2293
|
+
id: s.id,
|
|
2294
|
+
domId: y ? `${y}-${s.id}` : s.id,
|
|
2295
|
+
directions: s.directions,
|
|
2296
|
+
width: g.width,
|
|
2297
|
+
height: g.height,
|
|
2298
|
+
x: g.x,
|
|
2299
|
+
y: g.y,
|
|
2300
|
+
positioned: a,
|
|
2301
|
+
intersect: void 0,
|
|
2302
|
+
type: s.type,
|
|
2303
|
+
padding: n ?? ((_ = (m = ct()) == null ? void 0 : m.block) == null ? void 0 : _.padding) ?? 0,
|
|
2304
|
+
widthInColumns: s.widthInColumns ?? 1
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
d(It, "getNodeFromBlock");
|
|
2308
|
+
async function oe(e, t, a) {
|
|
2309
|
+
const s = It(t, a, !1);
|
|
2310
|
+
if (s.type === "group")
|
|
2311
|
+
return;
|
|
2312
|
+
const i = ct(), c = await le(e, s, { config: i }), r = c.node().getBBox(), n = a.getBlock(s.id);
|
|
2313
|
+
n.size = { width: r.width, height: r.height, x: 0, y: 0, node: c }, a.setBlock(n), c.remove();
|
|
2314
|
+
}
|
|
2315
|
+
d(oe, "calculateBlockSize");
|
|
2316
|
+
async function he(e, t, a) {
|
|
2317
|
+
const s = It(t, a, !0);
|
|
2318
|
+
if (a.getBlock(s.id).type !== "space") {
|
|
2319
|
+
const c = ct();
|
|
2320
|
+
await le(e, s, { config: c }), t.intersect = s == null ? void 0 : s.intersect, Da(s);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
d(he, "insertBlockPositioned");
|
|
2324
|
+
async function pt(e, t, a, s) {
|
|
2325
|
+
for (const i of t)
|
|
2326
|
+
await s(e, i, a), i.children && await pt(e, i.children, a, s);
|
|
2327
|
+
}
|
|
2328
|
+
d(pt, "performOperations");
|
|
2329
|
+
async function ge(e, t, a) {
|
|
2330
|
+
await pt(e, t, a, oe);
|
|
2331
|
+
}
|
|
2332
|
+
d(ge, "calculateBlockSizes");
|
|
2333
|
+
async function de(e, t, a) {
|
|
2334
|
+
await pt(e, t, a, he);
|
|
2335
|
+
}
|
|
2336
|
+
d(de, "insertBlocks");
|
|
2337
|
+
async function ue(e, t, a, s, i) {
|
|
2338
|
+
const c = new Qe({
|
|
2339
|
+
multigraph: !0,
|
|
2340
|
+
compound: !0
|
|
2341
|
+
});
|
|
2342
|
+
c.setGraph({
|
|
2343
|
+
rankdir: "TB",
|
|
2344
|
+
nodesep: 10,
|
|
2345
|
+
ranksep: 10,
|
|
2346
|
+
marginx: 8,
|
|
2347
|
+
marginy: 8
|
|
2348
|
+
});
|
|
2349
|
+
for (const r of a)
|
|
2350
|
+
r.size && c.setNode(r.id, {
|
|
2351
|
+
width: r.size.width,
|
|
2352
|
+
height: r.size.height,
|
|
2353
|
+
intersect: r.intersect
|
|
2354
|
+
});
|
|
2355
|
+
for (const r of t)
|
|
2356
|
+
if (r.start && r.end) {
|
|
2357
|
+
const n = s.getBlock(r.start), l = s.getBlock(r.end);
|
|
2358
|
+
if (n != null && n.size && (l != null && l.size)) {
|
|
2359
|
+
const u = n.size, g = l.size, y = [
|
|
2360
|
+
{ x: u.x, y: u.y },
|
|
2361
|
+
{ x: u.x + (g.x - u.x) / 2, y: u.y + (g.y - u.y) / 2 },
|
|
2362
|
+
{ x: g.x, y: g.y }
|
|
2363
|
+
], w = i ? `${i}-${r.id}` : r.id, b = r.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal", m = r.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid", _ = `${b} ${m} flowchart-link LS-a1 LE-b1`;
|
|
2364
|
+
qr(
|
|
2365
|
+
e,
|
|
2366
|
+
{ v: r.start, w: r.end, name: w },
|
|
2367
|
+
{
|
|
2368
|
+
...r,
|
|
2369
|
+
id: w,
|
|
2370
|
+
arrowTypeEnd: r.arrowTypeEnd,
|
|
2371
|
+
arrowTypeStart: r.arrowTypeStart,
|
|
2372
|
+
points: y,
|
|
2373
|
+
classes: _
|
|
2374
|
+
},
|
|
2375
|
+
void 0,
|
|
2376
|
+
"block",
|
|
2377
|
+
c,
|
|
2378
|
+
i
|
|
2379
|
+
), r.label && (await Vr(e, {
|
|
2380
|
+
...r,
|
|
2381
|
+
label: r.label,
|
|
2382
|
+
labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
|
|
2383
|
+
arrowTypeEnd: r.arrowTypeEnd,
|
|
2384
|
+
arrowTypeStart: r.arrowTypeStart,
|
|
2385
|
+
points: y,
|
|
2386
|
+
classes: _
|
|
2387
|
+
}), jr(
|
|
2388
|
+
{ ...r, x: y[1].x, y: y[1].y },
|
|
2389
|
+
{
|
|
2390
|
+
originalPath: y
|
|
2391
|
+
}
|
|
2392
|
+
));
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
d(ue, "insertEdges");
|
|
2397
|
+
var Na = /* @__PURE__ */ d(function(e, t) {
|
|
2398
|
+
return t.db.getClasses();
|
|
2399
|
+
}, "getClasses"), Ia = /* @__PURE__ */ d(async function(e, t, a, s) {
|
|
2400
|
+
const { securityLevel: i, block: c } = ct(), r = s.db;
|
|
2401
|
+
r.setDiagramId(t);
|
|
2402
|
+
let n;
|
|
2403
|
+
i === "sandbox" && (n = O("#i" + t));
|
|
2404
|
+
const l = i === "sandbox" ? O(n.nodes()[0].contentDocument.body) : O("body"), u = i === "sandbox" ? l.select(`[id="${t}"]`) : O(`[id="${t}"]`);
|
|
2405
|
+
Yr(u, ["point", "circle", "cross"], s.type, t);
|
|
2406
|
+
const y = r.getBlocks(), w = r.getBlocksFlat(), b = r.getEdges(), m = u.insert("g").attr("class", "block");
|
|
2407
|
+
await ge(m, y, r);
|
|
2408
|
+
const _ = ee(r);
|
|
2409
|
+
if (await de(m, y, r), await ue(m, b, w, r, t), _) {
|
|
2410
|
+
const L = _, C = Math.max(1, Math.round(0.125 * (L.width / L.height))), I = L.height + C + 10, N = L.width + 10, { useMaxWidth: x } = c;
|
|
2411
|
+
Ye(u, I, N, !!x), v.debug("Here Bounds", _, L), u.attr(
|
|
2412
|
+
"viewBox",
|
|
2413
|
+
`${L.x - 5} ${L.y - 5} ${L.width + 10} ${L.height + 10}`
|
|
2414
|
+
);
|
|
2415
|
+
}
|
|
2416
|
+
}, "draw"), Ca = {
|
|
2417
|
+
draw: Ia,
|
|
2418
|
+
getClasses: Na
|
|
2419
|
+
}, za = {
|
|
2420
|
+
parser: nr,
|
|
2421
|
+
db: Tr,
|
|
2422
|
+
renderer: Ca,
|
|
2423
|
+
styles: Nr
|
|
2424
|
+
};
|
|
2425
|
+
export {
|
|
2426
|
+
za as diagram
|
|
2427
|
+
};
|