UNPKG

39.6 kBJavaScriptView Raw
1import { c as Y, g as Ht, s as Xt, a as Kt, b as Wt, z as Jt, A as qt, m as Qt, l as x, f as ht, B as Zt, a6 as te } from "./mermaid-9357f3d0.js";
2var mt = function() {
3 var t = function(D, r, a, i) {
4 for (a = a || {}, i = D.length; i--; a[D[i]] = r)
5 ;
6 return a;
7 }, s = [1, 2], n = [1, 3], h = [1, 5], u = [1, 7], f = [2, 5], p = [1, 15], v = [1, 17], d = [1, 21], k = [1, 22], T = [1, 23], G = [1, 24], R = [1, 37], j = [1, 25], U = [1, 26], z = [1, 27], M = [1, 28], H = [1, 29], X = [1, 32], K = [1, 33], W = [1, 34], J = [1, 35], q = [1, 36], Q = [1, 39], Z = [1, 40], tt = [1, 41], et = [1, 42], w = [1, 38], Ct = [1, 45], o = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], st = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], ut = [1, 4, 5, 7, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], At = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], dt = {
8 trace: function() {
9 },
10 yy: {},
11 symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, directive: 6, SD: 7, document: 8, line: 9, statement: 10, classDefStatement: 11, cssClassStatement: 12, idStatement: 13, DESCR: 14, "-->": 15, HIDE_EMPTY: 16, scale: 17, WIDTH: 18, COMPOSIT_STATE: 19, STRUCT_START: 20, STRUCT_STOP: 21, STATE_DESCR: 22, AS: 23, ID: 24, FORK: 25, JOIN: 26, CHOICE: 27, CONCURRENT: 28, note: 29, notePosition: 30, NOTE_TEXT: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, classDef: 38, CLASSDEF_ID: 39, CLASSDEF_STYLEOPTS: 40, DEFAULT: 41, class: 42, CLASSENTITY_IDS: 43, STYLECLASS: 44, openDirective: 45, typeDirective: 46, closeDirective: 47, ":": 48, argDirective: 49, direction_tb: 50, direction_bt: 51, direction_rl: 52, direction_lr: 53, eol: 54, ";": 55, EDGE_STATE: 56, STYLE_SEPARATOR: 57, left_of: 58, right_of: 59, open_directive: 60, type_directive: 61, arg_directive: 62, close_directive: 63, $accept: 0, $end: 1 },
12 terminals_: { 2: "error", 4: "SPACE", 5: "NL", 7: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "class", 43: "CLASSENTITY_IDS", 44: "STYLECLASS", 48: ":", 50: "direction_tb", 51: "direction_bt", 52: "direction_rl", 53: "direction_lr", 55: ";", 56: "EDGE_STATE", 57: "STYLE_SEPARATOR", 58: "left_of", 59: "right_of", 60: "open_directive", 61: "type_directive", 62: "arg_directive", 63: "close_directive" },
13 productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 3], [10, 4], [10, 1], [10, 2], [10, 1], [10, 4], [10, 3], [10, 6], [10, 1], [10, 1], [10, 1], [10, 1], [10, 4], [10, 4], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [11, 3], [11, 3], [12, 3], [6, 3], [6, 5], [32, 1], [32, 1], [32, 1], [32, 1], [54, 1], [54, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1], [45, 1], [46, 1], [49, 1], [47, 1]],
14 performAction: function(r, a, i, l, y, e, B) {
15 var c = e.length - 1;
16 switch (y) {
17 case 4:
18 return l.setRootDoc(e[c]), e[c];
19 case 5:
20 this.$ = [];
21 break;
22 case 6:
23 e[c] != "nl" && (e[c - 1].push(e[c]), this.$ = e[c - 1]);
24 break;
25 case 7:
26 case 8:
27 this.$ = e[c];
28 break;
29 case 9:
30 this.$ = "nl";
31 break;
32 case 12:
33 this.$ = e[c];
34 break;
35 case 13:
36 const $ = e[c - 1];
37 $.description = l.trimColon(e[c]), this.$ = $;
38 break;
39 case 14:
40 this.$ = { stmt: "relation", state1: e[c - 2], state2: e[c] };
41 break;
42 case 15:
43 const pt = l.trimColon(e[c]);
44 this.$ = { stmt: "relation", state1: e[c - 3], state2: e[c - 1], description: pt };
45 break;
46 case 19:
47 this.$ = { stmt: "state", id: e[c - 3], type: "default", description: "", doc: e[c - 1] };
48 break;
49 case 20:
50 var C = e[c], O = e[c - 2].trim();
51 if (e[c].match(":")) {
52 var it = e[c].split(":");
53 C = it[0], O = [O, it[1]];
54 }
55 this.$ = { stmt: "state", id: C, type: "default", description: O };
56 break;
57 case 21:
58 this.$ = { stmt: "state", id: e[c - 3], type: "default", description: e[c - 5], doc: e[c - 1] };
59 break;
60 case 22:
61 this.$ = { stmt: "state", id: e[c], type: "fork" };
62 break;
63 case 23:
64 this.$ = { stmt: "state", id: e[c], type: "join" };
65 break;
66 case 24:
67 this.$ = { stmt: "state", id: e[c], type: "choice" };
68 break;
69 case 25:
70 this.$ = { stmt: "state", id: l.getDividerId(), type: "divider" };
71 break;
72 case 26:
73 this.$ = { stmt: "state", id: e[c - 1].trim(), note: { position: e[c - 2].trim(), text: e[c].trim() } };
74 break;
75 case 30:
76 this.$ = e[c].trim(), l.setAccTitle(this.$);
77 break;
78 case 31:
79 case 32:
80 this.$ = e[c].trim(), l.setAccDescription(this.$);
81 break;
82 case 33:
83 case 34:
84 this.$ = { stmt: "classDef", id: e[c - 1].trim(), classes: e[c].trim() };
85 break;
86 case 35:
87 this.$ = { stmt: "applyClass", id: e[c - 1].trim(), styleClass: e[c].trim() };
88 break;
89 case 38:
90 l.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
91 break;
92 case 39:
93 l.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
94 break;
95 case 40:
96 l.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
97 break;
98 case 41:
99 l.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
100 break;
101 case 44:
102 case 45:
103 this.$ = { stmt: "state", id: e[c].trim(), type: "default", description: "" };
104 break;
105 case 46:
106 this.$ = { stmt: "state", id: e[c - 2].trim(), classes: [e[c].trim()], type: "default", description: "" };
107 break;
108 case 47:
109 this.$ = { stmt: "state", id: e[c - 2].trim(), classes: [e[c].trim()], type: "default", description: "" };
110 break;
111 case 50:
112 l.parseDirective("%%{", "open_directive");
113 break;
114 case 51:
115 l.parseDirective(e[c], "type_directive");
116 break;
117 case 52:
118 e[c] = e[c].trim().replace(/'/g, '"'), l.parseDirective(e[c], "arg_directive");
119 break;
120 case 53:
121 l.parseDirective("}%%", "close_directive", "state");
122 break;
123 }
124 },
125 table: [{ 3: 1, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 1: [3] }, { 3: 8, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 3: 9, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 3: 10, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], f, { 8: 11 }), { 46: 12, 61: [1, 13] }, { 61: [2, 50] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: p, 5: v, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, { 47: 43, 48: [1, 44], 63: Ct }, t([48, 63], [2, 51]), t(o, [2, 6]), { 6: 30, 10: 46, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 8]), t(o, [2, 9]), t(o, [2, 10]), t(o, [2, 11]), t(o, [2, 12], { 14: [1, 47], 15: [1, 48] }), t(o, [2, 16]), { 18: [1, 49] }, t(o, [2, 18], { 20: [1, 50] }), { 23: [1, 51] }, t(o, [2, 22]), t(o, [2, 23]), t(o, [2, 24]), t(o, [2, 25]), { 30: 52, 31: [1, 53], 58: [1, 54], 59: [1, 55] }, t(o, [2, 28]), t(o, [2, 29]), { 34: [1, 56] }, { 36: [1, 57] }, t(o, [2, 32]), { 39: [1, 58], 41: [1, 59] }, { 43: [1, 60] }, t(st, [2, 44], { 57: [1, 61] }), t(st, [2, 45], { 57: [1, 62] }), t(o, [2, 38]), t(o, [2, 39]), t(o, [2, 40]), t(o, [2, 41]), t(ut, [2, 36]), { 49: 63, 62: [1, 64] }, t(ut, [2, 53]), t(o, [2, 7]), t(o, [2, 13]), { 13: 65, 24: R, 56: w }, t(o, [2, 17]), t(At, f, { 8: 66 }), { 24: [1, 67] }, { 24: [1, 68] }, { 23: [1, 69] }, { 24: [2, 48] }, { 24: [2, 49] }, t(o, [2, 30]), t(o, [2, 31]), { 40: [1, 70] }, { 40: [1, 71] }, { 44: [1, 72] }, { 24: [1, 73] }, { 24: [1, 74] }, { 47: 75, 63: Ct }, { 63: [2, 52] }, t(o, [2, 14], { 14: [1, 76] }), { 4: p, 5: v, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 21: [1, 77], 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 20], { 20: [1, 78] }), { 31: [1, 79] }, { 24: [1, 80] }, t(o, [2, 33]), t(o, [2, 34]), t(o, [2, 35]), t(st, [2, 46]), t(st, [2, 47]), t(ut, [2, 37]), t(o, [2, 15]), t(o, [2, 19]), t(At, f, { 8: 81 }), t(o, [2, 26]), t(o, [2, 27]), { 4: p, 5: v, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 21: [1, 82], 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 21])],
126 defaultActions: { 7: [2, 50], 8: [2, 1], 9: [2, 2], 10: [2, 3], 54: [2, 48], 55: [2, 49], 64: [2, 52] },
127 parseError: function(r, a) {
128 if (a.recoverable)
129 this.trace(r);
130 else {
131 var i = new Error(r);
132 throw i.hash = a, i;
133 }
134 },
135 parse: function(r) {
136 var a = this, i = [0], l = [], y = [null], e = [], B = this.table, c = "", C = 0, O = 0, it = 2, $ = 1, pt = e.slice.call(arguments, 1), S = Object.create(this.lexer), A = { yy: {} };
137 for (var yt in this.yy)
138 Object.prototype.hasOwnProperty.call(this.yy, yt) && (A.yy[yt] = this.yy[yt]);
139 S.setInput(r, A.yy), A.yy.lexer = S, A.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
140 var St = S.yylloc;
141 e.push(St);
142 var zt = S.options && S.options.ranges;
143 typeof A.yy.parseError == "function" ? this.parseError = A.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
144 function Mt() {
145 var E;
146 return E = l.pop() || S.lex() || $, typeof E != "number" && (E instanceof Array && (l = E, E = l.pop()), E = a.symbols_[E] || E), E;
147 }
148 for (var _, L, m, gt, N = {}, rt, b, Lt, nt; ; ) {
149 if (L = i[i.length - 1], this.defaultActions[L] ? m = this.defaultActions[L] : ((_ === null || typeof _ > "u") && (_ = Mt()), m = B[L] && B[L][_]), typeof m > "u" || !m.length || !m[0]) {
150 var _t = "";
151 nt = [];
152 for (rt in B[L])
153 this.terminals_[rt] && rt > it && nt.push("'" + this.terminals_[rt] + "'");
154 S.showPosition ? _t = "Parse error on line " + (C + 1) + `:
155` + S.showPosition() + `
156Expecting ` + nt.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : _t = "Parse error on line " + (C + 1) + ": Unexpected " + (_ == $ ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(_t, {
157 text: S.match,
158 token: this.terminals_[_] || _,
159 line: S.yylineno,
160 loc: St,
161 expected: nt
162 });
163 }
164 if (m[0] instanceof Array && m.length > 1)
165 throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + _);
166 switch (m[0]) {
167 case 1:
168 i.push(_), y.push(S.yytext), e.push(S.yylloc), i.push(m[1]), _ = null, O = S.yyleng, c = S.yytext, C = S.yylineno, St = S.yylloc;
169 break;
170 case 2:
171 if (b = this.productions_[m[1]][1], N.$ = y[y.length - b], N._$ = {
172 first_line: e[e.length - (b || 1)].first_line,
173 last_line: e[e.length - 1].last_line,
174 first_column: e[e.length - (b || 1)].first_column,
175 last_column: e[e.length - 1].last_column
176 }, zt && (N._$.range = [
177 e[e.length - (b || 1)].range[0],
178 e[e.length - 1].range[1]
179 ]), gt = this.performAction.apply(N, [
180 c,
181 O,
182 C,
183 A.yy,
184 m[1],
185 y,
186 e
187 ].concat(pt)), typeof gt < "u")
188 return gt;
189 b && (i = i.slice(0, -1 * b * 2), y = y.slice(0, -1 * b), e = e.slice(0, -1 * b)), i.push(this.productions_[m[1]][0]), y.push(N.$), e.push(N._$), Lt = B[i[i.length - 2]][i[i.length - 1]], i.push(Lt);
190 break;
191 case 3:
192 return !0;
193 }
194 }
195 return !0;
196 }
197 }, Ut = function() {
198 var D = {
199 EOF: 1,
200 parseError: function(a, i) {
201 if (this.yy.parser)
202 this.yy.parser.parseError(a, i);
203 else
204 throw new Error(a);
205 },
206 // resets the lexer, sets new input
207 setInput: function(r, a) {
208 return this.yy = a || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
209 first_line: 1,
210 first_column: 0,
211 last_line: 1,
212 last_column: 0
213 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
214 },
215 // consumes and returns one char from the input
216 input: function() {
217 var r = this._input[0];
218 this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
219 var a = r.match(/(?:\r\n?|\n).*/g);
220 return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
221 },
222 // unshifts one char (or a string) into the input
223 unput: function(r) {
224 var a = r.length, i = r.split(/(?:\r\n?|\n)/g);
225 this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
226 var l = this.match.split(/(?:\r\n?|\n)/g);
227 this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
228 var y = this.yylloc.range;
229 return this.yylloc = {
230 first_line: this.yylloc.first_line,
231 last_line: this.yylineno + 1,
232 first_column: this.yylloc.first_column,
233 last_column: i ? (i.length === l.length ? this.yylloc.first_column : 0) + l[l.length - i.length].length - i[0].length : this.yylloc.first_column - a
234 }, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
235 },
236 // When called from action, caches matched text and appends it on next action
237 more: function() {
238 return this._more = !0, this;
239 },
240 // 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.
241 reject: function() {
242 if (this.options.backtrack_lexer)
243 this._backtrack = !0;
244 else
245 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).
246` + this.showPosition(), {
247 text: "",
248 token: null,
249 line: this.yylineno
250 });
251 return this;
252 },
253 // retain first n characters of the match
254 less: function(r) {
255 this.unput(this.match.slice(r));
256 },
257 // displays already matched input, i.e. for error messages
258 pastInput: function() {
259 var r = this.matched.substr(0, this.matched.length - this.match.length);
260 return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
261 },
262 // displays upcoming input, i.e. for error messages
263 upcomingInput: function() {
264 var r = this.match;
265 return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
266 },
267 // displays the character position where the lexing error occurred, i.e. for error messages
268 showPosition: function() {
269 var r = this.pastInput(), a = new Array(r.length + 1).join("-");
270 return r + this.upcomingInput() + `
271` + a + "^";
272 },
273 // test the lexed token: return FALSE when not a match, otherwise return token
274 test_match: function(r, a) {
275 var i, l, y;
276 if (this.options.backtrack_lexer && (y = {
277 yylineno: this.yylineno,
278 yylloc: {
279 first_line: this.yylloc.first_line,
280 last_line: this.last_line,
281 first_column: this.yylloc.first_column,
282 last_column: this.yylloc.last_column
283 },
284 yytext: this.yytext,
285 match: this.match,
286 matches: this.matches,
287 matched: this.matched,
288 yyleng: this.yyleng,
289 offset: this.offset,
290 _more: this._more,
291 _input: this._input,
292 yy: this.yy,
293 conditionStack: this.conditionStack.slice(0),
294 done: this.done
295 }, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), l = r[0].match(/(?:\r\n?|\n).*/g), l && (this.yylineno += l.length), this.yylloc = {
296 first_line: this.yylloc.last_line,
297 last_line: this.yylineno + 1,
298 first_column: this.yylloc.last_column,
299 last_column: l ? l[l.length - 1].length - l[l.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
300 }, this.yytext += r[0], this.match += r[0], this.matches = r, 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(r[0].length), this.matched += r[0], i = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i)
301 return i;
302 if (this._backtrack) {
303 for (var e in y)
304 this[e] = y[e];
305 return !1;
306 }
307 return !1;
308 },
309 // return next match in input
310 next: function() {
311 if (this.done)
312 return this.EOF;
313 this._input || (this.done = !0);
314 var r, a, i, l;
315 this._more || (this.yytext = "", this.match = "");
316 for (var y = this._currentRules(), e = 0; e < y.length; e++)
317 if (i = this._input.match(this.rules[y[e]]), i && (!a || i[0].length > a[0].length)) {
318 if (a = i, l = e, this.options.backtrack_lexer) {
319 if (r = this.test_match(i, y[e]), r !== !1)
320 return r;
321 if (this._backtrack) {
322 a = !1;
323 continue;
324 } else
325 return !1;
326 } else if (!this.options.flex)
327 break;
328 }
329 return a ? (r = this.test_match(a, y[l]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
330` + this.showPosition(), {
331 text: "",
332 token: null,
333 line: this.yylineno
334 });
335 },
336 // return next match that has a token
337 lex: function() {
338 var a = this.next();
339 return a || this.lex();
340 },
341 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
342 begin: function(a) {
343 this.conditionStack.push(a);
344 },
345 // pop the previously active lexer condition state off the condition stack
346 popState: function() {
347 var a = this.conditionStack.length - 1;
348 return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
349 },
350 // produce the lexer rule set which is active for the currently active lexer condition state
351 _currentRules: function() {
352 return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
353 },
354 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
355 topState: function(a) {
356 return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
357 },
358 // alias for begin(condition)
359 pushState: function(a) {
360 this.begin(a);
361 },
362 // return the number of states currently on the stack
363 stateStackSize: function() {
364 return this.conditionStack.length;
365 },
366 options: { "case-insensitive": !0 },
367 performAction: function(a, i, l, y) {
368 switch (l) {
369 case 0:
370 return 41;
371 case 1:
372 return 50;
373 case 2:
374 return 51;
375 case 3:
376 return 52;
377 case 4:
378 return 53;
379 case 5:
380 return this.begin("open_directive"), 60;
381 case 6:
382 return this.begin("type_directive"), 61;
383 case 7:
384 return this.popState(), this.begin("arg_directive"), 48;
385 case 8:
386 return this.popState(), this.popState(), 63;
387 case 9:
388 return 62;
389 case 10:
390 break;
391 case 11:
392 break;
393 case 12:
394 return 5;
395 case 13:
396 break;
397 case 14:
398 break;
399 case 15:
400 break;
401 case 16:
402 break;
403 case 17:
404 return this.pushState("SCALE"), 17;
405 case 18:
406 return 18;
407 case 19:
408 this.popState();
409 break;
410 case 20:
411 return this.begin("acc_title"), 33;
412 case 21:
413 return this.popState(), "acc_title_value";
414 case 22:
415 return this.begin("acc_descr"), 35;
416 case 23:
417 return this.popState(), "acc_descr_value";
418 case 24:
419 this.begin("acc_descr_multiline");
420 break;
421 case 25:
422 this.popState();
423 break;
424 case 26:
425 return "acc_descr_multiline_value";
426 case 27:
427 return this.pushState("CLASSDEF"), 38;
428 case 28:
429 return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
430 case 29:
431 return this.popState(), this.pushState("CLASSDEFID"), 39;
432 case 30:
433 return this.popState(), 40;
434 case 31:
435 return this.pushState("CLASS"), 42;
436 case 32:
437 return this.popState(), this.pushState("CLASS_STYLE"), 43;
438 case 33:
439 return this.popState(), 44;
440 case 34:
441 return this.pushState("SCALE"), 17;
442 case 35:
443 return 18;
444 case 36:
445 this.popState();
446 break;
447 case 37:
448 this.pushState("STATE");
449 break;
450 case 38:
451 return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 25;
452 case 39:
453 return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 26;
454 case 40:
455 return this.popState(), i.yytext = i.yytext.slice(0, -10).trim(), 27;
456 case 41:
457 return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 25;
458 case 42:
459 return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 26;
460 case 43:
461 return this.popState(), i.yytext = i.yytext.slice(0, -10).trim(), 27;
462 case 44:
463 return 50;
464 case 45:
465 return 51;
466 case 46:
467 return 52;
468 case 47:
469 return 53;
470 case 48:
471 this.pushState("STATE_STRING");
472 break;
473 case 49:
474 return this.pushState("STATE_ID"), "AS";
475 case 50:
476 return this.popState(), "ID";
477 case 51:
478 this.popState();
479 break;
480 case 52:
481 return "STATE_DESCR";
482 case 53:
483 return 19;
484 case 54:
485 this.popState();
486 break;
487 case 55:
488 return this.popState(), this.pushState("struct"), 20;
489 case 56:
490 break;
491 case 57:
492 return this.popState(), 21;
493 case 58:
494 break;
495 case 59:
496 return this.begin("NOTE"), 29;
497 case 60:
498 return this.popState(), this.pushState("NOTE_ID"), 58;
499 case 61:
500 return this.popState(), this.pushState("NOTE_ID"), 59;
501 case 62:
502 this.popState(), this.pushState("FLOATING_NOTE");
503 break;
504 case 63:
505 return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
506 case 64:
507 break;
508 case 65:
509 return "NOTE_TEXT";
510 case 66:
511 return this.popState(), "ID";
512 case 67:
513 return this.popState(), this.pushState("NOTE_TEXT"), 24;
514 case 68:
515 return this.popState(), i.yytext = i.yytext.substr(2).trim(), 31;
516 case 69:
517 return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 31;
518 case 70:
519 return 7;
520 case 71:
521 return 7;
522 case 72:
523 return 16;
524 case 73:
525 return 56;
526 case 74:
527 return 24;
528 case 75:
529 return i.yytext = i.yytext.trim(), 14;
530 case 76:
531 return 15;
532 case 77:
533 return 28;
534 case 78:
535 return 57;
536 case 79:
537 return 5;
538 case 80:
539 return "INVALID";
540 }
541 },
542 rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
543 conditions: { LINE: { rules: [14, 15], inclusive: !1 }, close_directive: { rules: [14, 15], inclusive: !1 }, arg_directive: { rules: [8, 9, 14, 15], inclusive: !1 }, type_directive: { rules: [7, 8, 14, 15], inclusive: !1 }, open_directive: { rules: [6, 14, 15], inclusive: !1 }, struct: { rules: [14, 15, 27, 31, 37, 44, 45, 46, 47, 56, 57, 58, 59, 73, 74, 75, 76, 77], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [66], inclusive: !1 }, FLOATING_NOTE: { rules: [63, 64, 65], inclusive: !1 }, NOTE_TEXT: { rules: [68, 69], inclusive: !1 }, NOTE_ID: { rules: [67], inclusive: !1 }, NOTE: { rules: [60, 61, 62], inclusive: !1 }, CLASS_STYLE: { rules: [33], inclusive: !1 }, CLASS: { rules: [32], inclusive: !1 }, CLASSDEFID: { rules: [30], inclusive: !1 }, CLASSDEF: { rules: [28, 29], inclusive: !1 }, acc_descr_multiline: { rules: [25, 26], inclusive: !1 }, acc_descr: { rules: [23], inclusive: !1 }, acc_title: { rules: [21], inclusive: !1 }, SCALE: { rules: [18, 19, 35, 36], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [50], inclusive: !1 }, STATE_STRING: { rules: [51, 52], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [14, 15, 38, 39, 40, 41, 42, 43, 48, 49, 53, 54, 55], inclusive: !1 }, ID: { rules: [14, 15], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 15, 16, 17, 20, 22, 24, 27, 31, 34, 37, 55, 59, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80], inclusive: !0 } }
544 };
545 return D;
546 }();
547 dt.lexer = Ut;
548 function ft() {
549 this.yy = {};
550 }
551 return ft.prototype = dt, dt.Parser = ft, new ft();
552}();
553mt.parser = mt;
554const Ie = mt, ee = "LR", Oe = "TB", Tt = "state", Rt = "relation", se = "classDef", ie = "applyClass", xt = "default", re = "divider", vt = "[*]", wt = "start", Bt = vt, $t = "end", It = "color", Ot = "fill", ne = "bgFill", ae = ",";
555function Pt() {
556 return {};
557}
558let Vt = ee, lt = [], P = Pt();
559const Ft = () => ({
560 relations: [],
561 states: {},
562 documents: {}
563});
564let ot = {
565 root: Ft()
566}, g = ot.root, V = 0, Nt = 0;
567const ce = {
568 LINE: 0,
569 DOTTED_LINE: 1
570}, le = {
571 AGGREGATION: 0,
572 EXTENSION: 1,
573 COMPOSITION: 2,
574 DEPENDENCY: 3
575}, at = (t) => JSON.parse(JSON.stringify(t)), oe = function(t, s, n) {
576 Qt.parseDirective(this, t, s, n);
577}, he = (t) => {
578 x.info("Setting root doc", t), lt = t;
579}, ue = () => lt, ct = (t, s, n) => {
580 if (s.stmt === Rt)
581 ct(t, s.state1, !0), ct(t, s.state2, !1);
582 else if (s.stmt === Tt && (s.id === "[*]" ? (s.id = n ? t.id + "_start" : t.id + "_end", s.start = n) : s.id = s.id.trim()), s.doc) {
583 const h = [];
584 let u = [], f;
585 for (f = 0; f < s.doc.length; f++)
586 if (s.doc[f].type === re) {
587 const p = at(s.doc[f]);
588 p.doc = at(u), h.push(p), u = [];
589 } else
590 u.push(s.doc[f]);
591 if (h.length > 0 && u.length > 0) {
592 const p = {
593 stmt: Tt,
594 id: te(),
595 type: "divider",
596 doc: at(u)
597 };
598 h.push(at(p)), s.doc = h;
599 }
600 s.doc.forEach((p) => ct(s, p, !0));
601 }
602}, de = () => (ct({ id: "root" }, { id: "root", doc: lt }, !0), { id: "root", doc: lt }), fe = (t) => {
603 let s;
604 t.doc ? s = t.doc : s = t, x.info(s), Yt(!0), x.info("Extract", s), s.forEach((n) => {
605 switch (n.stmt) {
606 case Tt:
607 I(
608 n.id.trim(),
609 n.type,
610 n.doc,
611 n.description,
612 n.note,
613 n.classes,
614 n.styles,
615 n.textStyles
616 );
617 break;
618 case Rt:
619 Gt(n.state1, n.state2, n.description);
620 break;
621 case se:
622 jt(n.id.trim(), n.classes);
623 break;
624 case ie:
625 Dt(n.id.trim(), n.styleClass);
626 break;
627 }
628 });
629}, I = function(t, s = xt, n = null, h = null, u = null, f = null, p = null, v = null) {
630 const d = t == null ? void 0 : t.trim();
631 g.states[d] === void 0 ? (x.info("Adding state ", d, h), g.states[d] = {
632 id: d,
633 descriptions: [],
634 type: s,
635 doc: n,
636 note: u,
637 classes: [],
638 styles: [],
639 textStyles: []
640 }) : (g.states[d].doc || (g.states[d].doc = n), g.states[d].type || (g.states[d].type = s)), h && (x.info("Setting state description", d, h), typeof h == "string" && Et(d, h.trim()), typeof h == "object" && h.forEach((k) => Et(d, k.trim()))), u && (g.states[d].note = u, g.states[d].note.text = ht.sanitizeText(
641 g.states[d].note.text,
642 Y()
643 )), f && (x.info("Setting state classes", d, f), (typeof f == "string" ? [f] : f).forEach((T) => Dt(d, T.trim()))), p && (x.info("Setting state styles", d, p), (typeof p == "string" ? [p] : p).forEach((T) => Ee(d, T.trim()))), v && (x.info("Setting state styles", d, p), (typeof v == "string" ? [v] : v).forEach((T) => xe(d, T.trim())));
644}, Yt = function(t) {
645 ot = {
646 root: Ft()
647 }, g = ot.root, V = 0, P = Pt(), t || Zt();
648}, F = function(t) {
649 return g.states[t];
650}, pe = function() {
651 return g.states;
652}, ye = function() {
653 x.info("Documents = ", ot);
654}, Se = function() {
655 return g.relations;
656};
657function kt(t = "") {
658 let s = t;
659 return t === vt && (V++, s = `${wt}${V}`), s;
660}
661function bt(t = "", s = xt) {
662 return t === vt ? wt : s;
663}
664function ge(t = "") {
665 let s = t;
666 return t === Bt && (V++, s = `${$t}${V}`), s;
667}
668function _e(t = "", s = xt) {
669 return t === Bt ? $t : s;
670}
671function me(t, s, n) {
672 let h = kt(t.id.trim()), u = bt(t.id.trim(), t.type), f = kt(s.id.trim()), p = bt(s.id.trim(), s.type);
673 I(
674 h,
675 u,
676 t.doc,
677 t.description,
678 t.note,
679 t.classes,
680 t.styles,
681 t.textStyles
682 ), I(
683 f,
684 p,
685 s.doc,
686 s.description,
687 s.note,
688 s.classes,
689 s.styles,
690 s.textStyles
691 ), g.relations.push({
692 id1: h,
693 id2: f,
694 relationTitle: ht.sanitizeText(n, Y())
695 });
696}
697const Gt = function(t, s, n) {
698 if (typeof t == "object")
699 me(t, s, n);
700 else {
701 const h = kt(t.trim()), u = bt(t), f = ge(s.trim()), p = _e(s);
702 I(h, u), I(f, p), g.relations.push({
703 id1: h,
704 id2: f,
705 title: ht.sanitizeText(n, Y())
706 });
707 }
708}, Et = function(t, s) {
709 const n = g.states[t], h = s.startsWith(":") ? s.replace(":", "").trim() : s;
710 n.descriptions.push(ht.sanitizeText(h, Y()));
711}, Te = function(t) {
712 return t.substring(0, 1) === ":" ? t.substr(2).trim() : t.trim();
713}, ke = () => (Nt++, "divider-id-" + Nt), jt = function(t, s = "") {
714 P[t] === void 0 && (P[t] = { id: t, styles: [], textStyles: [] });
715 const n = P[t];
716 s != null && s.split(ae).forEach((h) => {
717 const u = h.replace(/([^;]*);/, "$1").trim();
718 if (h.match(It)) {
719 const p = u.replace(Ot, ne).replace(It, Ot);
720 n.textStyles.push(p);
721 }
722 n.styles.push(u);
723 });
724}, be = function() {
725 return P;
726}, Dt = function(t, s) {
727 t.split(",").forEach(function(n) {
728 let h = F(n);
729 if (h === void 0) {
730 const u = n.trim();
731 I(u), h = F(u);
732 }
733 h.classes.push(s);
734 });
735}, Ee = function(t, s) {
736 const n = F(t);
737 n !== void 0 && n.textStyles.push(s);
738}, xe = function(t, s) {
739 const n = F(t);
740 n !== void 0 && n.textStyles.push(s);
741}, ve = () => Vt, De = (t) => {
742 Vt = t;
743}, Ce = (t) => t && t[0] === ":" ? t.substr(1).trim() : t.trim(), Ne = {
744 parseDirective: oe,
745 getConfig: () => Y().state,
746 addState: I,
747 clear: Yt,
748 getState: F,
749 getStates: pe,
750 getRelations: Se,
751 getClasses: be,
752 getDirection: ve,
753 addRelation: Gt,
754 getDividerId: ke,
755 setDirection: De,
756 cleanupLabel: Te,
757 lineType: ce,
758 relationType: le,
759 logDocuments: ye,
760 getRootDoc: ue,
761 setRootDoc: he,
762 getRootDocV2: de,
763 extract: fe,
764 trimColon: Ce,
765 getAccTitle: Ht,
766 setAccTitle: Xt,
767 getAccDescription: Kt,
768 setAccDescription: Wt,
769 addStyleClass: jt,
770 setCssClass: Dt,
771 addDescription: Et,
772 setDiagramTitle: Jt,
773 getDiagramTitle: qt
774}, Ae = (t) => `
775defs #statediagram-barbEnd {
776 fill: ${t.transitionColor};
777 stroke: ${t.transitionColor};
778 }
779g.stateGroup text {
780 fill: ${t.nodeBorder};
781 stroke: none;
782 font-size: 10px;
783}
784g.stateGroup text {
785 fill: ${t.textColor};
786 stroke: none;
787 font-size: 10px;
788
789}
790g.stateGroup .state-title {
791 font-weight: bolder;
792 fill: ${t.stateLabelColor};
793}
794
795g.stateGroup rect {
796 fill: ${t.mainBkg};
797 stroke: ${t.nodeBorder};
798}
799
800g.stateGroup line {
801 stroke: ${t.lineColor};
802 stroke-width: 1;
803}
804
805.transition {
806 stroke: ${t.transitionColor};
807 stroke-width: 1;
808 fill: none;
809}
810
811.stateGroup .composit {
812 fill: ${t.background};
813 border-bottom: 1px
814}
815
816.stateGroup .alt-composit {
817 fill: #e0e0e0;
818 border-bottom: 1px
819}
820
821.state-note {
822 stroke: ${t.noteBorderColor};
823 fill: ${t.noteBkgColor};
824
825 text {
826 fill: ${t.noteTextColor};
827 stroke: none;
828 font-size: 10px;
829 }
830}
831
832.stateLabel .box {
833 stroke: none;
834 stroke-width: 0;
835 fill: ${t.mainBkg};
836 opacity: 0.5;
837}
838
839.edgeLabel .label rect {
840 fill: ${t.labelBackgroundColor};
841 opacity: 0.5;
842}
843.edgeLabel .label text {
844 fill: ${t.transitionLabelColor || t.tertiaryTextColor};
845}
846.label div .edgeLabel {
847 color: ${t.transitionLabelColor || t.tertiaryTextColor};
848}
849
850.stateLabel text {
851 fill: ${t.stateLabelColor};
852 font-size: 10px;
853 font-weight: bold;
854}
855
856.node circle.state-start {
857 fill: ${t.specialStateColor};
858 stroke: ${t.specialStateColor};
859}
860
861.node .fork-join {
862 fill: ${t.specialStateColor};
863 stroke: ${t.specialStateColor};
864}
865
866.node circle.state-end {
867 fill: ${t.innerEndBackground};
868 stroke: ${t.background};
869 stroke-width: 1.5
870}
871.end-state-inner {
872 fill: ${t.compositeBackground || t.background};
873 // stroke: ${t.background};
874 stroke-width: 1.5
875}
876
877.node rect {
878 fill: ${t.stateBkg || t.mainBkg};
879 stroke: ${t.stateBorder || t.nodeBorder};
880 stroke-width: 1px;
881}
882.node polygon {
883 fill: ${t.mainBkg};
884 stroke: ${t.stateBorder || t.nodeBorder};;
885 stroke-width: 1px;
886}
887#statediagram-barbEnd {
888 fill: ${t.lineColor};
889}
890
891.statediagram-cluster rect {
892 fill: ${t.compositeTitleBackground};
893 stroke: ${t.stateBorder || t.nodeBorder};
894 stroke-width: 1px;
895}
896
897.cluster-label, .nodeLabel {
898 color: ${t.stateLabelColor};
899}
900
901.statediagram-cluster rect.outer {
902 rx: 5px;
903 ry: 5px;
904}
905.statediagram-state .divider {
906 stroke: ${t.stateBorder || t.nodeBorder};
907}
908
909.statediagram-state .title-state {
910 rx: 5px;
911 ry: 5px;
912}
913.statediagram-cluster.statediagram-cluster .inner {
914 fill: ${t.compositeBackground || t.background};
915}
916.statediagram-cluster.statediagram-cluster-alt .inner {
917 fill: ${t.altBackground ? t.altBackground : "#efefef"};
918}
919
920.statediagram-cluster .inner {
921 rx:0;
922 ry:0;
923}
924
925.statediagram-state rect.basic {
926 rx: 5px;
927 ry: 5px;
928}
929.statediagram-state rect.divider {
930 stroke-dasharray: 10,10;
931 fill: ${t.altBackground ? t.altBackground : "#efefef"};
932}
933
934.note-edge {
935 stroke-dasharray: 5;
936}
937
938.statediagram-note rect {
939 fill: ${t.noteBkgColor};
940 stroke: ${t.noteBorderColor};
941 stroke-width: 1px;
942 rx: 0;
943 ry: 0;
944}
945.statediagram-note rect {
946 fill: ${t.noteBkgColor};
947 stroke: ${t.noteBorderColor};
948 stroke-width: 1px;
949 rx: 0;
950 ry: 0;
951}
952
953.statediagram-note text {
954 fill: ${t.noteTextColor};
955}
956
957.statediagram-note .nodeLabel {
958 color: ${t.noteTextColor};
959}
960.statediagram .edgeLabel {
961 color: red; // ${t.noteTextColor};
962}
963
964#dependencyStart, #dependencyEnd {
965 fill: ${t.lineColor};
966 stroke: ${t.lineColor};
967 stroke-width: 1;
968}
969
970.statediagramTitleText {
971 text-anchor: middle;
972 font-size: 18px;
973 fill: ${t.textColor};
974}
975`, Re = Ae;
976export {
977 xt as D,
978 Rt as S,
979 re as a,
980 Tt as b,
981 Oe as c,
982 Ne as d,
983 Ie as p,
984 Re as s
985};