azs-markdown 1.0.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 (61) hide show
  1. package/README.en.md +36 -0
  2. package/README.md +39 -0
  3. package/dist/_basePickBy-DjPeYAOj.js +151 -0
  4. package/dist/_baseUniq-Cbb7mysM.js +614 -0
  5. package/dist/arc-Bn6Alo2g.js +83 -0
  6. package/dist/architecture-O4VJ6CD3-BHN7g-2W.js +5 -0
  7. package/dist/architectureDiagram-W76B3OCA-BFPasfQ9.js +4664 -0
  8. package/dist/azs-markdown.es.js +4 -0
  9. package/dist/azs-markdown.umd.js +2801 -0
  10. package/dist/blockDiagram-QIGZ2CNN-CCiv1h3G.js +2265 -0
  11. package/dist/c4Diagram-FPNF74CW--GeMhuxl.js +1581 -0
  12. package/dist/channel-pJBKfyR5.js +5 -0
  13. package/dist/chunk-4BX2VUAB-BhsyR2tA.js +9 -0
  14. package/dist/chunk-55IACEB6-CpxGzG7i.js +8 -0
  15. package/dist/chunk-FMBD7UC4-CSgFSgO1.js +19 -0
  16. package/dist/chunk-K7UQS3LO-AlhLVktY.js +1376 -0
  17. package/dist/chunk-QN33PNHL-CSc1NEE9.js +20 -0
  18. package/dist/chunk-QZHKN3VN-DPftrMRl.js +15 -0
  19. package/dist/chunk-TVAH2DTR-DPsIoQiW.js +1382 -0
  20. package/dist/chunk-TZMSLE5B-Dt-jkS_2.js +64 -0
  21. package/dist/classDiagram-KNZD7YFC-gcA5Ncmn.js +16 -0
  22. package/dist/classDiagram-v2-RKCZMP56-gcA5Ncmn.js +16 -0
  23. package/dist/clone-D6Iiaiqs.js +8 -0
  24. package/dist/cose-bilkent-S5V4N54A-BN35nGOy.js +2605 -0
  25. package/dist/cytoscape.esm-ZmItrg9y.js +18731 -0
  26. package/dist/dagre-5GWH7T2D-1e21gdtX.js +447 -0
  27. package/dist/defaultLocale-D7EN2tov.js +171 -0
  28. package/dist/diagram-N5W7TBWH-DiV77aoy.js +534 -0
  29. package/dist/diagram-QEK2KX5R-CWNqqht5.js +221 -0
  30. package/dist/diagram-S2PKOQOG-D1xaBogc.js +143 -0
  31. package/dist/erDiagram-AWTI2OKA-BXXE2d-L.js +842 -0
  32. package/dist/flowDiagram-PVAE7QVJ-DkPNPF8O.js +1627 -0
  33. package/dist/ganttDiagram-OWAHRB6G-Cu5LXDhu.js +2498 -0
  34. package/dist/gitGraph-ZV4HHKMB-DSEbhMgr.js +5 -0
  35. package/dist/gitGraphDiagram-NY62KEGX-BxOXYKuv.js +712 -0
  36. package/dist/graph-GD3Esuds.js +247 -0
  37. package/dist/index-DRursjyi.js +42003 -0
  38. package/dist/info-63CPKGFF-DAWzHRDb.js +5 -0
  39. package/dist/infoDiagram-STP46IZ2-Cf70rL_w.js +24 -0
  40. package/dist/init-DjUOC4st.js +16 -0
  41. package/dist/journeyDiagram-BIP6EPQ6-DoCeL-xS.js +836 -0
  42. package/dist/kanban-definition-6OIFK2YF-DIKRnHl9.js +720 -0
  43. package/dist/layout-_mj7J9CL.js +1324 -0
  44. package/dist/linear-BPT4Wp0A.js +259 -0
  45. package/dist/mermaid-parser.core-CcQSz1Ic.js +12921 -0
  46. package/dist/mindmap-definition-Q6HEUPPD-C2gtgHlK.js +783 -0
  47. package/dist/ordinal-DfAQgscy.js +61 -0
  48. package/dist/packet-HUATNLJX-Bb3J_dPx.js +5 -0
  49. package/dist/pie-WTHONI2E-Cs_KOqQS.js +5 -0
  50. package/dist/pieDiagram-ADFJNKIX-B3nba9oA.js +161 -0
  51. package/dist/quadrantDiagram-LMRXKWRM-2wvLFJoV.js +1024 -0
  52. package/dist/radar-NJJJXTRR-DoYGDBdR.js +5 -0
  53. package/dist/requirementDiagram-4UW4RH46-BIZl5822.js +852 -0
  54. package/dist/sankeyDiagram-GR3RE2ED-DfYknNGS.js +810 -0
  55. package/dist/sequenceDiagram-C3RYC4MD-D04lbayJ.js +2518 -0
  56. package/dist/stateDiagram-KXAO66HF-DsQmarPC.js +263 -0
  57. package/dist/stateDiagram-v2-UMBNRL4Z-DFZTM-kb.js +16 -0
  58. package/dist/timeline-definition-XQNQX7LJ-Dw9YlHXJ.js +801 -0
  59. package/dist/treemap-75Q7IDZK-iFewXvrK.js +5 -0
  60. package/dist/xychartDiagram-6GGTOJPD-2ogwTg3g.js +1340 -0
  61. package/package.json +41 -0
@@ -0,0 +1,783 @@
1
+ import { g as le } from "./chunk-55IACEB6-CpxGzG7i.js";
2
+ import { s as he } from "./chunk-QN33PNHL-CSc1NEE9.js";
3
+ import { _ as l, l as C, o as de, r as ge, F as B, c as z, i as F, aH as ue, W as pe, X as fe, Y as ye } from "./index-DRursjyi.js";
4
+ const E = [];
5
+ for (let t = 0; t < 256; ++t)
6
+ E.push((t + 256).toString(16).slice(1));
7
+ function me(t, e = 0) {
8
+ return (E[t[e + 0]] + E[t[e + 1]] + E[t[e + 2]] + E[t[e + 3]] + "-" + E[t[e + 4]] + E[t[e + 5]] + "-" + E[t[e + 6]] + E[t[e + 7]] + "-" + E[t[e + 8]] + E[t[e + 9]] + "-" + E[t[e + 10]] + E[t[e + 11]] + E[t[e + 12]] + E[t[e + 13]] + E[t[e + 14]] + E[t[e + 15]]).toLowerCase();
9
+ }
10
+ let X;
11
+ const Ee = new Uint8Array(16);
12
+ function _e() {
13
+ if (!X) {
14
+ if (typeof crypto > "u" || !crypto.getRandomValues)
15
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16
+ X = crypto.getRandomValues.bind(crypto);
17
+ }
18
+ return X(Ee);
19
+ }
20
+ const be = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ne = { randomUUID: be };
21
+ function Se(t, e, n) {
22
+ var u;
23
+ if (ne.randomUUID && !t)
24
+ return ne.randomUUID();
25
+ t = t || {};
26
+ const c = t.random ?? ((u = t.rng) == null ? void 0 : u.call(t)) ?? _e();
27
+ if (c.length < 16)
28
+ throw new Error("Random bytes length must be >= 16");
29
+ return c[6] = c[6] & 15 | 64, c[8] = c[8] & 63 | 128, me(c);
30
+ }
31
+ var Y = function() {
32
+ var t = /* @__PURE__ */ l(function(v, s, i, a) {
33
+ for (i = i || {}, a = v.length; a--; i[v[a]] = s) ;
34
+ return i;
35
+ }, "o"), e = [1, 4], n = [1, 13], c = [1, 12], u = [1, 15], h = [1, 16], p = [1, 20], f = [1, 19], N = [6, 7, 8], _ = [1, 26], m = [1, 24], q = [1, 25], S = [6, 7, 11], J = [1, 6, 13, 15, 16, 19, 22], K = [1, 33], Q = [1, 34], w = [1, 6, 7, 11, 13, 15, 16, 19, 22], j = {
36
+ trace: /* @__PURE__ */ l(function() {
37
+ }, "trace"),
38
+ yy: {},
39
+ symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 },
40
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" },
41
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]],
42
+ performAction: /* @__PURE__ */ l(function(s, i, a, o, g, r, A) {
43
+ var d = r.length - 1;
44
+ switch (g) {
45
+ case 6:
46
+ case 7:
47
+ return o;
48
+ case 8:
49
+ o.getLogger().trace("Stop NL ");
50
+ break;
51
+ case 9:
52
+ o.getLogger().trace("Stop EOF ");
53
+ break;
54
+ case 11:
55
+ o.getLogger().trace("Stop NL2 ");
56
+ break;
57
+ case 12:
58
+ o.getLogger().trace("Stop EOF2 ");
59
+ break;
60
+ case 15:
61
+ o.getLogger().info("Node: ", r[d].id), o.addNode(r[d - 1].length, r[d].id, r[d].descr, r[d].type);
62
+ break;
63
+ case 16:
64
+ o.getLogger().trace("Icon: ", r[d]), o.decorateNode({ icon: r[d] });
65
+ break;
66
+ case 17:
67
+ case 21:
68
+ o.decorateNode({ class: r[d] });
69
+ break;
70
+ case 18:
71
+ o.getLogger().trace("SPACELIST");
72
+ break;
73
+ case 19:
74
+ o.getLogger().trace("Node: ", r[d].id), o.addNode(0, r[d].id, r[d].descr, r[d].type);
75
+ break;
76
+ case 20:
77
+ o.decorateNode({ icon: r[d] });
78
+ break;
79
+ case 25:
80
+ o.getLogger().trace("node found ..", r[d - 2]), this.$ = { id: r[d - 1], descr: r[d - 1], type: o.getType(r[d - 2], r[d]) };
81
+ break;
82
+ case 26:
83
+ this.$ = { id: r[d], descr: r[d], type: o.nodeType.DEFAULT };
84
+ break;
85
+ case 27:
86
+ o.getLogger().trace("node found ..", r[d - 3]), this.$ = { id: r[d - 3], descr: r[d - 1], type: o.getType(r[d - 2], r[d]) };
87
+ break;
88
+ }
89
+ }, "anonymous"),
90
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: e }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: e }, { 6: n, 7: [1, 10], 9: 9, 12: 11, 13: c, 14: 14, 15: u, 16: h, 17: 17, 18: 18, 19: p, 22: f }, t(N, [2, 3]), { 1: [2, 2] }, t(N, [2, 4]), t(N, [2, 5]), { 1: [2, 6], 6: n, 12: 21, 13: c, 14: 14, 15: u, 16: h, 17: 17, 18: 18, 19: p, 22: f }, { 6: n, 9: 22, 12: 11, 13: c, 14: 14, 15: u, 16: h, 17: 17, 18: 18, 19: p, 22: f }, { 6: _, 7: m, 10: 23, 11: q }, t(S, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: p, 22: f }), t(S, [2, 18]), t(S, [2, 19]), t(S, [2, 20]), t(S, [2, 21]), t(S, [2, 23]), t(S, [2, 24]), t(S, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: _, 7: m, 10: 32, 11: q }, { 1: [2, 7], 6: n, 12: 21, 13: c, 14: 14, 15: u, 16: h, 17: 17, 18: 18, 19: p, 22: f }, t(J, [2, 14], { 7: K, 11: Q }), t(w, [2, 8]), t(w, [2, 9]), t(w, [2, 10]), t(S, [2, 15]), t(S, [2, 16]), t(S, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, t(J, [2, 13], { 7: K, 11: Q }), t(w, [2, 11]), t(w, [2, 12]), { 21: [1, 37] }, t(S, [2, 25]), t(S, [2, 27])],
91
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
92
+ parseError: /* @__PURE__ */ l(function(s, i) {
93
+ if (i.recoverable)
94
+ this.trace(s);
95
+ else {
96
+ var a = new Error(s);
97
+ throw a.hash = i, a;
98
+ }
99
+ }, "parseError"),
100
+ parse: /* @__PURE__ */ l(function(s) {
101
+ var i = this, a = [0], o = [], g = [null], r = [], A = this.table, d = "", P = 0, Z = 0, re = 2, ee = 1, ae = r.slice.call(arguments, 1), y = Object.create(this.lexer), T = { yy: {} };
102
+ for (var G in this.yy)
103
+ Object.prototype.hasOwnProperty.call(this.yy, G) && (T.yy[G] = this.yy[G]);
104
+ y.setInput(s, T.yy), T.yy.lexer = y, T.yy.parser = this, typeof y.yylloc > "u" && (y.yylloc = {});
105
+ var H = y.yylloc;
106
+ r.push(H);
107
+ var oe = y.options && y.options.ranges;
108
+ typeof T.yy.parseError == "function" ? this.parseError = T.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
109
+ function ce(D) {
110
+ a.length = a.length - 2 * D, g.length = g.length - D, r.length = r.length - D;
111
+ }
112
+ l(ce, "popStack");
113
+ function te() {
114
+ var D;
115
+ return D = o.pop() || y.lex() || ee, typeof D != "number" && (D instanceof Array && (o = D, D = o.pop()), D = i.symbols_[D] || D), D;
116
+ }
117
+ l(te, "lex");
118
+ for (var b, O, k, $, I = {}, M, L, ie, V; ; ) {
119
+ if (O = a[a.length - 1], this.defaultActions[O] ? k = this.defaultActions[O] : ((b === null || typeof b > "u") && (b = te()), k = A[O] && A[O][b]), typeof k > "u" || !k.length || !k[0]) {
120
+ var W = "";
121
+ V = [];
122
+ for (M in A[O])
123
+ this.terminals_[M] && M > re && V.push("'" + this.terminals_[M] + "'");
124
+ y.showPosition ? W = "Parse error on line " + (P + 1) + `:
125
+ ` + y.showPosition() + `
126
+ Expecting ` + V.join(", ") + ", got '" + (this.terminals_[b] || b) + "'" : W = "Parse error on line " + (P + 1) + ": Unexpected " + (b == ee ? "end of input" : "'" + (this.terminals_[b] || b) + "'"), this.parseError(W, {
127
+ text: y.match,
128
+ token: this.terminals_[b] || b,
129
+ line: y.yylineno,
130
+ loc: H,
131
+ expected: V
132
+ });
133
+ }
134
+ if (k[0] instanceof Array && k.length > 1)
135
+ throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + b);
136
+ switch (k[0]) {
137
+ case 1:
138
+ a.push(b), g.push(y.yytext), r.push(y.yylloc), a.push(k[1]), b = null, Z = y.yyleng, d = y.yytext, P = y.yylineno, H = y.yylloc;
139
+ break;
140
+ case 2:
141
+ if (L = this.productions_[k[1]][1], I.$ = g[g.length - L], I._$ = {
142
+ first_line: r[r.length - (L || 1)].first_line,
143
+ last_line: r[r.length - 1].last_line,
144
+ first_column: r[r.length - (L || 1)].first_column,
145
+ last_column: r[r.length - 1].last_column
146
+ }, oe && (I._$.range = [
147
+ r[r.length - (L || 1)].range[0],
148
+ r[r.length - 1].range[1]
149
+ ]), $ = this.performAction.apply(I, [
150
+ d,
151
+ Z,
152
+ P,
153
+ T.yy,
154
+ k[1],
155
+ g,
156
+ r
157
+ ].concat(ae)), typeof $ < "u")
158
+ return $;
159
+ L && (a = a.slice(0, -1 * L * 2), g = g.slice(0, -1 * L), r = r.slice(0, -1 * L)), a.push(this.productions_[k[1]][0]), g.push(I.$), r.push(I._$), ie = A[a[a.length - 2]][a[a.length - 1]], a.push(ie);
160
+ break;
161
+ case 3:
162
+ return !0;
163
+ }
164
+ }
165
+ return !0;
166
+ }, "parse")
167
+ }, se = /* @__PURE__ */ function() {
168
+ var v = {
169
+ EOF: 1,
170
+ parseError: /* @__PURE__ */ l(function(i, a) {
171
+ if (this.yy.parser)
172
+ this.yy.parser.parseError(i, a);
173
+ else
174
+ throw new Error(i);
175
+ }, "parseError"),
176
+ // resets the lexer, sets new input
177
+ setInput: /* @__PURE__ */ l(function(s, i) {
178
+ return this.yy = i || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
179
+ first_line: 1,
180
+ first_column: 0,
181
+ last_line: 1,
182
+ last_column: 0
183
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
184
+ }, "setInput"),
185
+ // consumes and returns one char from the input
186
+ input: /* @__PURE__ */ l(function() {
187
+ var s = this._input[0];
188
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
189
+ var i = s.match(/(?:\r\n?|\n).*/g);
190
+ return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
191
+ }, "input"),
192
+ // unshifts one char (or a string) into the input
193
+ unput: /* @__PURE__ */ l(function(s) {
194
+ var i = s.length, a = s.split(/(?:\r\n?|\n)/g);
195
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
196
+ var o = this.match.split(/(?:\r\n?|\n)/g);
197
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), a.length - 1 && (this.yylineno -= a.length - 1);
198
+ var g = this.yylloc.range;
199
+ return this.yylloc = {
200
+ first_line: this.yylloc.first_line,
201
+ last_line: this.yylineno + 1,
202
+ first_column: this.yylloc.first_column,
203
+ last_column: a ? (a.length === o.length ? this.yylloc.first_column : 0) + o[o.length - a.length].length - a[0].length : this.yylloc.first_column - i
204
+ }, this.options.ranges && (this.yylloc.range = [g[0], g[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
205
+ }, "unput"),
206
+ // When called from action, caches matched text and appends it on next action
207
+ more: /* @__PURE__ */ l(function() {
208
+ return this._more = !0, this;
209
+ }, "more"),
210
+ // 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.
211
+ reject: /* @__PURE__ */ l(function() {
212
+ if (this.options.backtrack_lexer)
213
+ this._backtrack = !0;
214
+ else
215
+ 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).
216
+ ` + this.showPosition(), {
217
+ text: "",
218
+ token: null,
219
+ line: this.yylineno
220
+ });
221
+ return this;
222
+ }, "reject"),
223
+ // retain first n characters of the match
224
+ less: /* @__PURE__ */ l(function(s) {
225
+ this.unput(this.match.slice(s));
226
+ }, "less"),
227
+ // displays already matched input, i.e. for error messages
228
+ pastInput: /* @__PURE__ */ l(function() {
229
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
230
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
231
+ }, "pastInput"),
232
+ // displays upcoming input, i.e. for error messages
233
+ upcomingInput: /* @__PURE__ */ l(function() {
234
+ var s = this.match;
235
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
236
+ }, "upcomingInput"),
237
+ // displays the character position where the lexing error occurred, i.e. for error messages
238
+ showPosition: /* @__PURE__ */ l(function() {
239
+ var s = this.pastInput(), i = new Array(s.length + 1).join("-");
240
+ return s + this.upcomingInput() + `
241
+ ` + i + "^";
242
+ }, "showPosition"),
243
+ // test the lexed token: return FALSE when not a match, otherwise return token
244
+ test_match: /* @__PURE__ */ l(function(s, i) {
245
+ var a, o, g;
246
+ if (this.options.backtrack_lexer && (g = {
247
+ yylineno: this.yylineno,
248
+ yylloc: {
249
+ first_line: this.yylloc.first_line,
250
+ last_line: this.last_line,
251
+ first_column: this.yylloc.first_column,
252
+ last_column: this.yylloc.last_column
253
+ },
254
+ yytext: this.yytext,
255
+ match: this.match,
256
+ matches: this.matches,
257
+ matched: this.matched,
258
+ yyleng: this.yyleng,
259
+ offset: this.offset,
260
+ _more: this._more,
261
+ _input: this._input,
262
+ yy: this.yy,
263
+ conditionStack: this.conditionStack.slice(0),
264
+ done: this.done
265
+ }, this.options.ranges && (g.yylloc.range = this.yylloc.range.slice(0))), o = s[0].match(/(?:\r\n?|\n).*/g), o && (this.yylineno += o.length), this.yylloc = {
266
+ first_line: this.yylloc.last_line,
267
+ last_line: this.yylineno + 1,
268
+ first_column: this.yylloc.last_column,
269
+ last_column: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
270
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], a = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), a)
271
+ return a;
272
+ if (this._backtrack) {
273
+ for (var r in g)
274
+ this[r] = g[r];
275
+ return !1;
276
+ }
277
+ return !1;
278
+ }, "test_match"),
279
+ // return next match in input
280
+ next: /* @__PURE__ */ l(function() {
281
+ if (this.done)
282
+ return this.EOF;
283
+ this._input || (this.done = !0);
284
+ var s, i, a, o;
285
+ this._more || (this.yytext = "", this.match = "");
286
+ for (var g = this._currentRules(), r = 0; r < g.length; r++)
287
+ if (a = this._input.match(this.rules[g[r]]), a && (!i || a[0].length > i[0].length)) {
288
+ if (i = a, o = r, this.options.backtrack_lexer) {
289
+ if (s = this.test_match(a, g[r]), s !== !1)
290
+ return s;
291
+ if (this._backtrack) {
292
+ i = !1;
293
+ continue;
294
+ } else
295
+ return !1;
296
+ } else if (!this.options.flex)
297
+ break;
298
+ }
299
+ return i ? (s = this.test_match(i, g[o]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
300
+ ` + this.showPosition(), {
301
+ text: "",
302
+ token: null,
303
+ line: this.yylineno
304
+ });
305
+ }, "next"),
306
+ // return next match that has a token
307
+ lex: /* @__PURE__ */ l(function() {
308
+ var i = this.next();
309
+ return i || this.lex();
310
+ }, "lex"),
311
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
312
+ begin: /* @__PURE__ */ l(function(i) {
313
+ this.conditionStack.push(i);
314
+ }, "begin"),
315
+ // pop the previously active lexer condition state off the condition stack
316
+ popState: /* @__PURE__ */ l(function() {
317
+ var i = this.conditionStack.length - 1;
318
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
319
+ }, "popState"),
320
+ // produce the lexer rule set which is active for the currently active lexer condition state
321
+ _currentRules: /* @__PURE__ */ l(function() {
322
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
323
+ }, "_currentRules"),
324
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
325
+ topState: /* @__PURE__ */ l(function(i) {
326
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
327
+ }, "topState"),
328
+ // alias for begin(condition)
329
+ pushState: /* @__PURE__ */ l(function(i) {
330
+ this.begin(i);
331
+ }, "pushState"),
332
+ // return the number of states currently on the stack
333
+ stateStackSize: /* @__PURE__ */ l(function() {
334
+ return this.conditionStack.length;
335
+ }, "stateStackSize"),
336
+ options: { "case-insensitive": !0 },
337
+ performAction: /* @__PURE__ */ l(function(i, a, o, g) {
338
+ switch (o) {
339
+ case 0:
340
+ return i.getLogger().trace("Found comment", a.yytext), 6;
341
+ case 1:
342
+ return 8;
343
+ case 2:
344
+ this.begin("CLASS");
345
+ break;
346
+ case 3:
347
+ return this.popState(), 16;
348
+ case 4:
349
+ this.popState();
350
+ break;
351
+ case 5:
352
+ i.getLogger().trace("Begin icon"), this.begin("ICON");
353
+ break;
354
+ case 6:
355
+ return i.getLogger().trace("SPACELINE"), 6;
356
+ case 7:
357
+ return 7;
358
+ case 8:
359
+ return 15;
360
+ case 9:
361
+ i.getLogger().trace("end icon"), this.popState();
362
+ break;
363
+ case 10:
364
+ return i.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
365
+ case 11:
366
+ return i.getLogger().trace("Cloud"), this.begin("NODE"), 19;
367
+ case 12:
368
+ return i.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
369
+ case 13:
370
+ return i.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19;
371
+ case 14:
372
+ return this.begin("NODE"), 19;
373
+ case 15:
374
+ return this.begin("NODE"), 19;
375
+ case 16:
376
+ return this.begin("NODE"), 19;
377
+ case 17:
378
+ return this.begin("NODE"), 19;
379
+ case 18:
380
+ return 13;
381
+ case 19:
382
+ return 22;
383
+ case 20:
384
+ return 11;
385
+ case 21:
386
+ this.begin("NSTR2");
387
+ break;
388
+ case 22:
389
+ return "NODE_DESCR";
390
+ case 23:
391
+ this.popState();
392
+ break;
393
+ case 24:
394
+ i.getLogger().trace("Starting NSTR"), this.begin("NSTR");
395
+ break;
396
+ case 25:
397
+ return i.getLogger().trace("description:", a.yytext), "NODE_DESCR";
398
+ case 26:
399
+ this.popState();
400
+ break;
401
+ case 27:
402
+ return this.popState(), i.getLogger().trace("node end ))"), "NODE_DEND";
403
+ case 28:
404
+ return this.popState(), i.getLogger().trace("node end )"), "NODE_DEND";
405
+ case 29:
406
+ return this.popState(), i.getLogger().trace("node end ...", a.yytext), "NODE_DEND";
407
+ case 30:
408
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
409
+ case 31:
410
+ return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
411
+ case 32:
412
+ return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
413
+ case 33:
414
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
415
+ case 34:
416
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
417
+ case 35:
418
+ return i.getLogger().trace("Long description:", a.yytext), 20;
419
+ case 36:
420
+ return i.getLogger().trace("Long description:", a.yytext), 20;
421
+ }
422
+ }, "anonymous"),
423
+ rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
424
+ conditions: { CLASS: { rules: [3, 4], inclusive: !1 }, ICON: { rules: [8, 9], inclusive: !1 }, NSTR2: { rules: [22, 23], inclusive: !1 }, NSTR: { rules: [25, 26], inclusive: !1 }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: !0 } }
425
+ };
426
+ return v;
427
+ }();
428
+ j.lexer = se;
429
+ function U() {
430
+ this.yy = {};
431
+ }
432
+ return l(U, "Parser"), U.prototype = j, j.Parser = U, new U();
433
+ }();
434
+ Y.parser = Y;
435
+ var De = Y, x = {
436
+ DEFAULT: 0,
437
+ NO_BORDER: 0,
438
+ ROUNDED_RECT: 1,
439
+ RECT: 2,
440
+ CIRCLE: 3,
441
+ CLOUD: 4,
442
+ BANG: 5,
443
+ HEXAGON: 6
444
+ }, R, Ne = (R = class {
445
+ constructor() {
446
+ this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = x, this.clear(), this.getType = this.getType.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
447
+ }
448
+ clear() {
449
+ this.nodes = [], this.count = 0, this.elements = {};
450
+ }
451
+ getParent(e) {
452
+ for (let n = this.nodes.length - 1; n >= 0; n--)
453
+ if (this.nodes[n].level < e)
454
+ return this.nodes[n];
455
+ return null;
456
+ }
457
+ getMindmap() {
458
+ return this.nodes.length > 0 ? this.nodes[0] : null;
459
+ }
460
+ addNode(e, n, c, u) {
461
+ var _, m;
462
+ C.info("addNode", e, n, c, u);
463
+ const h = z();
464
+ let p = ((_ = h.mindmap) == null ? void 0 : _.padding) ?? B.mindmap.padding;
465
+ switch (u) {
466
+ case this.nodeType.ROUNDED_RECT:
467
+ case this.nodeType.RECT:
468
+ case this.nodeType.HEXAGON:
469
+ p *= 2;
470
+ break;
471
+ }
472
+ const f = {
473
+ id: this.count++,
474
+ nodeId: F(n, h),
475
+ level: e,
476
+ descr: F(c, h),
477
+ type: u,
478
+ children: [],
479
+ width: ((m = h.mindmap) == null ? void 0 : m.maxNodeWidth) ?? B.mindmap.maxNodeWidth,
480
+ padding: p
481
+ }, N = this.getParent(e);
482
+ if (N)
483
+ N.children.push(f), this.nodes.push(f);
484
+ else if (this.nodes.length === 0)
485
+ this.nodes.push(f);
486
+ else
487
+ throw new Error(
488
+ `There can be only one root. No parent could be found for ("${f.descr}")`
489
+ );
490
+ }
491
+ getType(e, n) {
492
+ switch (C.debug("In get type", e, n), e) {
493
+ case "[":
494
+ return this.nodeType.RECT;
495
+ case "(":
496
+ return n === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
497
+ case "((":
498
+ return this.nodeType.CIRCLE;
499
+ case ")":
500
+ return this.nodeType.CLOUD;
501
+ case "))":
502
+ return this.nodeType.BANG;
503
+ case "{{":
504
+ return this.nodeType.HEXAGON;
505
+ default:
506
+ return this.nodeType.DEFAULT;
507
+ }
508
+ }
509
+ setElementForId(e, n) {
510
+ this.elements[e] = n;
511
+ }
512
+ getElementById(e) {
513
+ return this.elements[e];
514
+ }
515
+ decorateNode(e) {
516
+ if (!e)
517
+ return;
518
+ const n = z(), c = this.nodes[this.nodes.length - 1];
519
+ e.icon && (c.icon = F(e.icon, n)), e.class && (c.class = F(e.class, n));
520
+ }
521
+ type2Str(e) {
522
+ switch (e) {
523
+ case this.nodeType.DEFAULT:
524
+ return "no-border";
525
+ case this.nodeType.RECT:
526
+ return "rect";
527
+ case this.nodeType.ROUNDED_RECT:
528
+ return "rounded-rect";
529
+ case this.nodeType.CIRCLE:
530
+ return "circle";
531
+ case this.nodeType.CLOUD:
532
+ return "cloud";
533
+ case this.nodeType.BANG:
534
+ return "bang";
535
+ case this.nodeType.HEXAGON:
536
+ return "hexgon";
537
+ default:
538
+ return "no-border";
539
+ }
540
+ }
541
+ /**
542
+ * Assign section numbers to nodes based on their position relative to root
543
+ * @param node - The mindmap node to process
544
+ * @param sectionNumber - The section number to assign (undefined for root)
545
+ */
546
+ assignSections(e, n) {
547
+ if (e.level === 0 ? e.section = void 0 : e.section = n, e.children)
548
+ for (const [c, u] of e.children.entries()) {
549
+ const h = e.level === 0 ? c : n;
550
+ this.assignSections(u, h);
551
+ }
552
+ }
553
+ /**
554
+ * Convert mindmap tree structure to flat array of nodes
555
+ * @param node - The mindmap node to process
556
+ * @param processedNodes - Array to collect processed nodes
557
+ */
558
+ flattenNodes(e, n) {
559
+ const c = ["mindmap-node"];
560
+ e.level === 0 ? c.push("section-root", "section--1") : e.section !== void 0 && c.push(`section-${e.section}`), e.class && c.push(e.class);
561
+ const u = c.join(" "), h = /* @__PURE__ */ l((f) => {
562
+ switch (f) {
563
+ case x.CIRCLE:
564
+ return "mindmapCircle";
565
+ case x.RECT:
566
+ return "rect";
567
+ case x.ROUNDED_RECT:
568
+ return "rounded";
569
+ case x.CLOUD:
570
+ return "cloud";
571
+ case x.BANG:
572
+ return "bang";
573
+ case x.HEXAGON:
574
+ return "hexagon";
575
+ case x.DEFAULT:
576
+ return "defaultMindmapNode";
577
+ case x.NO_BORDER:
578
+ default:
579
+ return "rect";
580
+ }
581
+ }, "getShapeFromType"), p = {
582
+ id: e.id.toString(),
583
+ domId: "node_" + e.id.toString(),
584
+ label: e.descr,
585
+ isGroup: !1,
586
+ shape: h(e.type),
587
+ width: e.width,
588
+ height: e.height ?? 0,
589
+ padding: e.padding,
590
+ cssClasses: u,
591
+ cssStyles: [],
592
+ look: "default",
593
+ icon: e.icon,
594
+ x: e.x,
595
+ y: e.y,
596
+ // Mindmap-specific properties
597
+ level: e.level,
598
+ nodeId: e.nodeId,
599
+ type: e.type,
600
+ section: e.section
601
+ };
602
+ if (n.push(p), e.children)
603
+ for (const f of e.children)
604
+ this.flattenNodes(f, n);
605
+ }
606
+ /**
607
+ * Generate edges from parent-child relationships in mindmap tree
608
+ * @param node - The mindmap node to process
609
+ * @param edges - Array to collect edges
610
+ */
611
+ generateEdges(e, n) {
612
+ if (e.children)
613
+ for (const c of e.children) {
614
+ let u = "edge";
615
+ c.section !== void 0 && (u += ` section-edge-${c.section}`);
616
+ const h = e.level + 1;
617
+ u += ` edge-depth-${h}`;
618
+ const p = {
619
+ id: `edge_${e.id}_${c.id}`,
620
+ start: e.id.toString(),
621
+ end: c.id.toString(),
622
+ type: "normal",
623
+ curve: "basis",
624
+ thickness: "normal",
625
+ look: "default",
626
+ classes: u,
627
+ // Store mindmap-specific data
628
+ depth: e.level,
629
+ section: c.section
630
+ };
631
+ n.push(p), this.generateEdges(c, n);
632
+ }
633
+ }
634
+ /**
635
+ * Get structured data for layout algorithms
636
+ * Following the pattern established by ER diagrams
637
+ * @returns Structured data containing nodes, edges, and config
638
+ */
639
+ getData() {
640
+ const e = this.getMindmap(), n = z(), u = ue().layout !== void 0, h = n;
641
+ if (u || (h.layout = "cose-bilkent"), !e)
642
+ return {
643
+ nodes: [],
644
+ edges: [],
645
+ config: h
646
+ };
647
+ C.debug("getData: mindmapRoot", e, n), this.assignSections(e);
648
+ const p = [], f = [];
649
+ this.flattenNodes(e, p), this.generateEdges(e, f), C.debug(
650
+ `getData: processed ${p.length} nodes and ${f.length} edges`
651
+ );
652
+ const N = /* @__PURE__ */ new Map();
653
+ for (const _ of p)
654
+ N.set(_.id, {
655
+ shape: _.shape,
656
+ width: _.width,
657
+ height: _.height,
658
+ padding: _.padding
659
+ });
660
+ return {
661
+ nodes: p,
662
+ edges: f,
663
+ config: h,
664
+ // Store the root node for mindmap-specific layout algorithms
665
+ rootNode: e,
666
+ // Properties required by dagre layout algorithm
667
+ markers: ["point"],
668
+ // Mindmaps don't use markers
669
+ direction: "TB",
670
+ // Top-to-bottom direction for mindmaps
671
+ nodeSpacing: 50,
672
+ // Default spacing between nodes
673
+ rankSpacing: 50,
674
+ // Default spacing between ranks
675
+ // Add shapes for ELK compatibility
676
+ shapes: Object.fromEntries(N),
677
+ // Additional properties that layout algorithms might expect
678
+ type: "mindmap",
679
+ diagramId: "mindmap-" + Se()
680
+ };
681
+ }
682
+ // Expose logger to grammar
683
+ getLogger() {
684
+ return C;
685
+ }
686
+ }, l(R, "MindmapDB"), R), ke = /* @__PURE__ */ l(async (t, e, n, c) => {
687
+ var N, _;
688
+ C.debug(`Rendering mindmap diagram
689
+ ` + t);
690
+ const u = c.db, h = u.getData(), p = le(e, h.config.securityLevel);
691
+ h.type = c.type, h.layoutAlgorithm = de(h.config.layout, {
692
+ fallback: "cose-bilkent"
693
+ }), h.diagramId = e, u.getMindmap() && (h.nodes.forEach((m) => {
694
+ m.shape === "rounded" ? (m.radius = 15, m.taper = 15, m.stroke = "none", m.width = 0, m.padding = 15) : m.shape === "circle" ? m.padding = 10 : m.shape === "rect" && (m.width = 0, m.padding = 10);
695
+ }), await ge(h, p), he(
696
+ p,
697
+ ((N = h.config.mindmap) == null ? void 0 : N.padding) ?? B.mindmap.padding,
698
+ "mindmapDiagram",
699
+ ((_ = h.config.mindmap) == null ? void 0 : _.useMaxWidth) ?? B.mindmap.useMaxWidth
700
+ ));
701
+ }, "draw"), Le = {
702
+ draw: ke
703
+ }, xe = /* @__PURE__ */ l((t) => {
704
+ let e = "";
705
+ for (let n = 0; n < t.THEME_COLOR_LIMIT; n++)
706
+ t["lineColor" + n] = t["lineColor" + n] || t["cScaleInv" + n], pe(t["lineColor" + n]) ? t["lineColor" + n] = fe(t["lineColor" + n], 20) : t["lineColor" + n] = ye(t["lineColor" + n], 20);
707
+ for (let n = 0; n < t.THEME_COLOR_LIMIT; n++) {
708
+ const c = "" + (17 - 3 * n);
709
+ e += `
710
+ .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} polygon, .section-${n - 1} path {
711
+ fill: ${t["cScale" + n]};
712
+ }
713
+ .section-${n - 1} text {
714
+ fill: ${t["cScaleLabel" + n]};
715
+ }
716
+ .node-icon-${n - 1} {
717
+ font-size: 40px;
718
+ color: ${t["cScaleLabel" + n]};
719
+ }
720
+ .section-edge-${n - 1}{
721
+ stroke: ${t["cScale" + n]};
722
+ }
723
+ .edge-depth-${n - 1}{
724
+ stroke-width: ${c};
725
+ }
726
+ .section-${n - 1} line {
727
+ stroke: ${t["cScaleInv" + n]} ;
728
+ stroke-width: 3;
729
+ }
730
+
731
+ .disabled, .disabled circle, .disabled text {
732
+ fill: lightgray;
733
+ }
734
+ .disabled text {
735
+ fill: #efefef;
736
+ }
737
+ `;
738
+ }
739
+ return e;
740
+ }, "genSections"), ve = /* @__PURE__ */ l((t) => `
741
+ .edge {
742
+ stroke-width: 3;
743
+ }
744
+ ${xe(t)}
745
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
746
+ fill: ${t.git0};
747
+ }
748
+ .section-root text {
749
+ fill: ${t.gitBranchLabel0};
750
+ }
751
+ .section-root span {
752
+ color: ${t.gitBranchLabel0};
753
+ }
754
+ .section-2 span {
755
+ color: ${t.gitBranchLabel0};
756
+ }
757
+ .icon-container {
758
+ height:100%;
759
+ display: flex;
760
+ justify-content: center;
761
+ align-items: center;
762
+ }
763
+ .edge {
764
+ fill: none;
765
+ }
766
+ .mindmap-node-label {
767
+ dy: 1em;
768
+ alignment-baseline: middle;
769
+ text-anchor: middle;
770
+ dominant-baseline: middle;
771
+ text-align: center;
772
+ }
773
+ `, "getStyles"), Te = ve, Re = {
774
+ get db() {
775
+ return new Ne();
776
+ },
777
+ renderer: Le,
778
+ parser: De,
779
+ styles: Te
780
+ };
781
+ export {
782
+ Re as diagram
783
+ };