hub-ui-x 0.0.1

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