@prefecthq/prefab-ui-docs 0.16.3 → 0.18.0

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