UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

1,655 lines (1,640 loc) 107 kB
import { n as u } from "./chunk-Y2CYZVJY-0JxdZxki.js"; import { m as L, p as T } from "./src-DtRLxcYO.js"; import { O as fe, T as M, a as pe, b as et, c as xe, it as ye, s as be, x as C, z as Ct } from "./chunk-WYO6CB5R-DDHkKowO.js"; import { t as me } from "./channel-k5-UxdcV.js"; import { A as we, B as Se, C as Le, D as ke, E as ve, F as Ee, G as Ut, H as _e, I as Te, L as De, M as Ne, N as Ie, O as Be, P as Oe, R as Ce, T as Re, U as Ae, V as ze, W as Me, a as Rt, b as Pe, et as Fe, g as J, j as We, k as Ye, l as He, v as Ke, w as Ue, z as Xe } from "./chunk-ICXQ74PX-DR8rL-xF.js"; import { t as Ve } from "./line-BIPmUVxO.js"; import "./chunk-HOUHSVGY-DRQcQeMT.js"; import { n as _t } from "./chunk-Q4XR5HBZ-3BHjjc9u.js"; import { t as je } from "./chunk-5VM5RSS4-Cni2Ogq2.js"; import { n as Ge, t as Q } from "./chunk-7BUUIJ7U-9hiBbc7O.js"; import { n as Ze, t as qe } from "./chunk-OGEWGWER-BV51ll2w.js"; import { t as Je } from "./graphlib-CCKThIKP.js"; function Qe(e) { return Array.isArray(e); } function $e(e) { if (Pe(e)) return e; const t = Ut(e); if (!tr(e)) return {}; if (Qe(e)) { const n = Array.from(e); return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (n.index = e.index, n.input = e.input), n; } if (Ke(e)) { const n = e, s = n.constructor; return new s(n.buffer, n.byteOffset, n.length); } if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength); if (t === "[object DataView]") { const n = e, s = n.buffer, i = n.byteOffset, a = n.byteLength, c = new ArrayBuffer(a), l = new Uint8Array(s, i, a); return new Uint8Array(c).set(l), new DataView(c); } if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") { const n = e.constructor, s = new n(e.valueOf()); return t === "[object String]" ? rr(s, e) : yt(s, e), s; } if (t === "[object Date]") return new Date(Number(e)); if (t === "[object RegExp]") { const n = e, s = new RegExp(n.source, n.flags); return s.lastIndex = n.lastIndex, s; } if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e)); if (t === "[object Map]") { const n = e, s = /* @__PURE__ */ new Map(); return n.forEach((i, a) => { s.set(a, i); }), s; } if (t === "[object Set]") { const n = e, s = /* @__PURE__ */ new Set(); return n.forEach((i) => { s.add(i); }), s; } if (t === "[object Arguments]") { const n = e, s = {}; return yt(s, n), s.length = n.length, s[Symbol.iterator] = n[Symbol.iterator], s; } const r = {}; return ar(r, e), yt(r, e), er(r, e), r; } function tr(e) { switch (Ut(e)) { case Le: case Re: case Ue: case ke: case ve: case Be: case Ye: case we: case Ie: case We: case Ne: case Oe: case Ee: case Te: case De: case Ce: case Xe: case Se: case Ae: case Me: case ze: case _e: return !0; default: return !1; } } function yt(e, t) { for (const r in t) Object.hasOwn(t, r) && (e[r] = t[r]); } function er(e, t) { const r = Object.getOwnPropertySymbols(t); for (let n = 0; n < r.length; n++) { const s = r[n]; Object.prototype.propertyIsEnumerable.call(t, s) && (e[s] = t[s]); } } function rr(e, t) { const r = t.valueOf().length; for (const n in t) Object.hasOwn(t, n) && (Number.isNaN(Number(n)) || Number(n) >= r) && (e[n] = t[n]); } function ar(e, t) { const r = Object.getPrototypeOf(t); r !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, r); } var mt = (function() { var e = /* @__PURE__ */ u(function(w, f, b, E) { for (b = b || {}, E = w.length; E--; b[w[E]] = f) ; return b; }, "o"), t = [1, 15], r = [1, 7], n = [1, 13], s = [1, 14], i = [1, 19], a = [1, 16], c = [1, 17], l = [1, 18], g = [8, 30], o = [ 8, 10, 21, 28, 29, 30, 31, 39, 43, 46 ], d = [1, 23], x = [1, 24], m = [ 8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46 ], y = [ 8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46 ], v = [1, 49], S = { trace: /* @__PURE__ */ u(function() { }, "trace"), yy: {}, 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 }, 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" }, 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] ], performAction: /* @__PURE__ */ u(function(f, b, E, k, _, h, P) { var p = h.length - 1; switch (_) { case 4: k.getLogger().debug("Rule: separator (NL) "); break; case 5: k.getLogger().debug("Rule: separator (Space) "); break; case 6: k.getLogger().debug("Rule: separator (EOF) "); break; case 7: k.getLogger().debug("Rule: hierarchy: ", h[p - 1]), k.setHierarchy(h[p - 1]); break; case 8: k.getLogger().debug("Stop NL "); break; case 9: k.getLogger().debug("Stop EOF "); break; case 10: k.getLogger().debug("Stop NL2 "); break; case 11: k.getLogger().debug("Stop EOF2 "); break; case 12: k.getLogger().debug("Rule: statement: ", h[p]), typeof h[p].length == "number" ? this.$ = h[p] : this.$ = [h[p]]; break; case 13: k.getLogger().debug("Rule: statement #2: ", h[p - 1]), this.$ = [h[p - 1]].concat(h[p]); break; case 14: k.getLogger().debug("Rule: link: ", h[p], f), this.$ = { edgeTypeStr: h[p], label: "" }; break; case 15: k.getLogger().debug("Rule: LABEL link: ", h[p - 3], h[p - 1], h[p]), this.$ = { edgeTypeStr: h[p], label: h[p - 1] }; break; case 18: const B = parseInt(h[p]), j = k.generateId(); this.$ = { id: j, type: "space", label: "", width: B, children: [] }; break; case 23: k.getLogger().debug("Rule: (nodeStatement link node) ", h[p - 2], h[p - 1], h[p], " typestr: ", h[p - 1].edgeTypeStr); const X = k.edgeStrToEdgeData(h[p - 1].edgeTypeStr), ht = k.edgeStrToEdgeStartData(h[p - 1].edgeTypeStr), rt = k.edgeStrToThickness(h[p - 1].edgeTypeStr), gt = k.edgeStrToPattern(h[p - 1].edgeTypeStr); this.$ = [ { id: h[p - 2].id, label: h[p - 2].label, type: h[p - 2].type, directions: h[p - 2].directions }, { id: h[p - 2].id + "-" + h[p].id, start: h[p - 2].id, end: h[p].id, label: h[p - 1].label, type: "edge", thickness: rt, pattern: gt, directions: h[p].directions, arrowTypeEnd: X, arrowTypeStart: ht }, { id: h[p].id, label: h[p].label, type: k.typeStr2Type(h[p].typeStr), directions: h[p].directions } ]; break; case 24: k.getLogger().debug("Rule: nodeStatement (abc88 node size) ", h[p - 1], h[p]), this.$ = { id: h[p - 1].id, label: h[p - 1].label, type: k.typeStr2Type(h[p - 1].typeStr), directions: h[p - 1].directions, widthInColumns: parseInt(h[p], 10) }; break; case 25: k.getLogger().debug("Rule: nodeStatement (node) ", h[p]), this.$ = { id: h[p].id, label: h[p].label, type: k.typeStr2Type(h[p].typeStr), directions: h[p].directions, widthInColumns: 1 }; break; case 26: k.getLogger().debug("APA123", this ? this : "na"), k.getLogger().debug("COLUMNS: ", h[p]), this.$ = { type: "column-setting", columns: h[p] === "auto" ? -1 : parseInt(h[p]) }; break; case 27: k.getLogger().debug("Rule: id-block statement : ", h[p - 2], h[p - 1]), k.generateId(), this.$ = { ...h[p - 2], type: "composite", children: h[p - 1] }; break; case 28: k.getLogger().debug("Rule: blockStatement : ", h[p - 2], h[p - 1], h[p]); const O = k.generateId(); this.$ = { id: O, type: "composite", label: "", children: h[p - 1] }; break; case 29: k.getLogger().debug("Rule: node (NODE_ID separator): ", h[p]), this.$ = { id: h[p] }; break; case 30: k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", h[p - 1], h[p]), this.$ = { id: h[p - 1], label: h[p].label, typeStr: h[p].typeStr, directions: h[p].directions }; break; case 31: k.getLogger().debug("Rule: dirList: ", h[p]), this.$ = [h[p]]; break; case 32: k.getLogger().debug("Rule: dirList: ", h[p - 1], h[p]), this.$ = [h[p - 1]].concat(h[p]); break; case 33: k.getLogger().debug("Rule: nodeShapeNLabel: ", h[p - 2], h[p - 1], h[p]), this.$ = { typeStr: h[p - 2] + h[p], label: h[p - 1] }; break; case 34: k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", h[p - 3], h[p - 2], " #3:", h[p - 1], h[p]), this.$ = { typeStr: h[p - 3] + h[p], label: h[p - 2], directions: h[p - 1] }; break; case 35: case 36: this.$ = { type: "classDef", id: h[p - 1].trim(), css: h[p].trim() }; break; case 37: this.$ = { type: "applyClass", id: h[p - 1].trim(), styleClass: h[p].trim() }; break; case 38: this.$ = { type: "applyStyles", id: h[p - 1].trim(), stylesStr: h[p].trim() }; break; } }, "anonymous"), table: [ { 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: r, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: n, 29: s, 31: i, 39: a, 43: c, 46: l }, { 8: [1, 20] }, e(g, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: r, 28: n, 29: s, 31: i, 39: a, 43: c, 46: l }), e(o, [2, 16], { 14: 22, 15: d, 16: x }), e(o, [2, 17]), e(o, [2, 18]), e(o, [2, 19]), e(o, [2, 20]), e(o, [2, 21]), e(o, [2, 22]), e(m, [2, 25], { 27: [1, 25] }), e(o, [2, 26]), { 19: 26, 26: 12, 31: i }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: r, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: n, 29: s, 31: i, 39: a, 43: c, 46: l }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(y, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(g, [2, 13]), { 26: 35, 31: i }, { 31: [2, 14] }, { 17: [1, 36] }, e(m, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: d, 16: x, 19: 5, 20: 6, 21: r, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: n, 29: s, 31: i, 39: a, 43: c, 46: l }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(y, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(m, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(o, [2, 28]), e(o, [2, 35]), e(o, [2, 36]), e(o, [2, 37]), e(o, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: v }, { 15: [1, 50] }, e(o, [2, 27]), e(y, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: v, 38: [2, 31] }, { 31: [2, 15] }, e(y, [2, 34]), { 38: [2, 32] } ], defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] }, parseError: /* @__PURE__ */ u(function(f, b) { if (b.recoverable) this.trace(f); else { var E = new Error(f); throw E.hash = b, E; } }, "parseError"), parse: /* @__PURE__ */ u(function(f) { var b = this, E = [0], k = [], _ = [null], h = [], P = this.table, p = "", B = 0, j = 0, X = 0, ht = 2, rt = 1, gt = h.slice.call(arguments, 1), O = Object.create(this.lexer), G = { yy: {} }; for (var ut in this.yy) Object.prototype.hasOwnProperty.call(this.yy, ut) && (G.yy[ut] = this.yy[ut]); O.setInput(f, G.yy), G.yy.lexer = O, G.yy.parser = this, typeof O.yylloc > "u" && (O.yylloc = {}); var dt = O.yylloc; h.push(dt); var ue = O.options && O.options.ranges; typeof G.yy.parseError == "function" ? this.parseError = G.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function de(Y) { E.length = E.length - 2 * Y, _.length = _.length - Y, h.length = h.length - Y; } u(de, "popStack"); function Bt() { var Y = k.pop() || O.lex() || rt; return typeof Y != "number" && (Y instanceof Array && (k = Y, Y = k.pop()), Y = b.symbols_[Y] || Y), Y; } u(Bt, "lex"); for (var z, ft, Z, W, pt, q = {}, at, V, Ot, st; ; ) { if (Z = E[E.length - 1], this.defaultActions[Z] ? W = this.defaultActions[Z] : ((z === null || typeof z > "u") && (z = Bt()), W = P[Z] && P[Z][z]), typeof W > "u" || !W.length || !W[0]) { var xt = ""; st = []; for (at in P[Z]) this.terminals_[at] && at > ht && st.push("'" + this.terminals_[at] + "'"); O.showPosition ? xt = "Parse error on line " + (B + 1) + `: ` + O.showPosition() + ` Expecting ` + st.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : xt = "Parse error on line " + (B + 1) + ": Unexpected " + (z == rt ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(xt, { text: O.match, token: this.terminals_[z] || z, line: O.yylineno, loc: dt, expected: st }); } if (W[0] instanceof Array && W.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + Z + ", token: " + z); switch (W[0]) { case 1: E.push(z), _.push(O.yytext), h.push(O.yylloc), E.push(W[1]), z = null, ft ? (z = ft, ft = null) : (j = O.yyleng, p = O.yytext, B = O.yylineno, dt = O.yylloc, X > 0 && X--); break; case 2: if (V = this.productions_[W[1]][1], q.$ = _[_.length - V], q._$ = { first_line: h[h.length - (V || 1)].first_line, last_line: h[h.length - 1].last_line, first_column: h[h.length - (V || 1)].first_column, last_column: h[h.length - 1].last_column }, ue && (q._$.range = [h[h.length - (V || 1)].range[0], h[h.length - 1].range[1]]), pt = this.performAction.apply(q, [ p, j, B, G.yy, W[1], _, h ].concat(gt)), typeof pt < "u") return pt; V && (E = E.slice(0, -1 * V * 2), _ = _.slice(0, -1 * V), h = h.slice(0, -1 * V)), E.push(this.productions_[W[1]][0]), _.push(q.$), h.push(q._$), Ot = P[E[E.length - 2]][E[E.length - 1]], E.push(Ot); break; case 3: return !0; } } return !0; }, "parse") }; S.lexer = /* @__PURE__ */ (function() { return { EOF: 1, parseError: /* @__PURE__ */ u(function(f, b) { if (this.yy.parser) this.yy.parser.parseError(f, b); else throw new Error(f); }, "parseError"), setInput: /* @__PURE__ */ u(function(w, f) { return this.yy = f || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), input: /* @__PURE__ */ u(function() { var w = this._input[0]; return this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w, w.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w; }, "input"), unput: /* @__PURE__ */ u(function(w) { var f = w.length, b = w.split(/(?:\r\n?|\n)/g); this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - f), this.offset -= f; var E = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), b.length - 1 && (this.yylineno -= b.length - 1); var k = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: b ? (b.length === E.length ? this.yylloc.first_column : 0) + E[E.length - b.length].length - b[0].length : this.yylloc.first_column - f }, this.options.ranges && (this.yylloc.range = [k[0], k[0] + this.yyleng - f]), this.yyleng = this.yytext.length, this; }, "unput"), more: /* @__PURE__ */ u(function() { return this._more = !0, this; }, "more"), reject: /* @__PURE__ */ u(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else 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). ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), less: /* @__PURE__ */ u(function(w) { this.unput(this.match.slice(w)); }, "less"), pastInput: /* @__PURE__ */ u(function() { var w = this.matched.substr(0, this.matched.length - this.match.length); return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, ""); }, "pastInput"), upcomingInput: /* @__PURE__ */ u(function() { var w = this.match; return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), showPosition: /* @__PURE__ */ u(function() { var w = this.pastInput(), f = new Array(w.length + 1).join("-"); return w + this.upcomingInput() + ` ` + f + "^"; }, "showPosition"), test_match: /* @__PURE__ */ u(function(w, f) { var b, E, k; if (this.options.backtrack_lexer && (k = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (k.yylloc.range = this.yylloc.range.slice(0))), E = w[0].match(/(?:\r\n?|\n).*/g), E && (this.yylineno += E.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: E ? E[E.length - 1].length - E[E.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length }, this.yytext += w[0], this.match += w[0], this.matches = w, 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(w[0].length), this.matched += w[0], b = this.performAction.call(this, this.yy, this, f, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), b) return b; if (this._backtrack) { for (var _ in k) this[_] = k[_]; return !1; } return !1; }, "test_match"), next: /* @__PURE__ */ u(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var w, f, b, E; this._more || (this.yytext = "", this.match = ""); for (var k = this._currentRules(), _ = 0; _ < k.length; _++) if (b = this._input.match(this.rules[k[_]]), b && (!f || b[0].length > f[0].length)) { if (f = b, E = _, this.options.backtrack_lexer) { if (w = this.test_match(b, k[_]), w !== !1) return w; if (this._backtrack) { f = !1; continue; } else return !1; } else if (!this.options.flex) break; } return f ? (w = this.test_match(f, k[E]), w !== !1 ? w : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), lex: /* @__PURE__ */ u(function() { var f = this.next(); return f || this.lex(); }, "lex"), begin: /* @__PURE__ */ u(function(f) { this.conditionStack.push(f); }, "begin"), popState: /* @__PURE__ */ u(function() { return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), _currentRules: /* @__PURE__ */ u(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), topState: /* @__PURE__ */ u(function(f) { return f = this.conditionStack.length - 1 - Math.abs(f || 0), f >= 0 ? this.conditionStack[f] : "INITIAL"; }, "topState"), pushState: /* @__PURE__ */ u(function(f) { this.begin(f); }, "pushState"), stateStackSize: /* @__PURE__ */ u(function() { return this.conditionStack.length; }, "stateStackSize"), options: {}, performAction: /* @__PURE__ */ u(function(f, b, E, k) { switch (E) { case 0: return f.getLogger().debug("Found block-beta"), 10; case 1: return f.getLogger().debug("Found id-block"), 29; case 2: return f.getLogger().debug("Found block"), 10; case 3: f.getLogger().debug(".", b.yytext); break; case 4: f.getLogger().debug("_", b.yytext); break; case 5: return 5; case 6: return b.yytext = -1, 28; case 7: return b.yytext = b.yytext.replace(/columns\s+/, ""), f.getLogger().debug("COLUMNS (LEX)", b.yytext), 28; case 8: this.pushState("md_string"); break; case 9: return "MD_STR"; case 10: this.popState(); break; case 11: this.pushState("string"); break; case 12: f.getLogger().debug("LEX: POPPING STR:", b.yytext), this.popState(); break; case 13: return f.getLogger().debug("LEX: STR end:", b.yytext), "STR"; case 14: return b.yytext = b.yytext.replace(/space\:/, ""), f.getLogger().debug("SPACE NUM (LEX)", b.yytext), 21; case 15: return b.yytext = "1", f.getLogger().debug("COLUMNS (LEX)", b.yytext), 21; case 16: return 42; case 17: return "LINKSTYLE"; case 18: return "INTERPOLATE"; case 19: return this.pushState("CLASSDEF"), 39; case 20: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID"; case 21: return this.popState(), this.pushState("CLASSDEFID"), 40; case 22: return this.popState(), 41; case 23: return this.pushState("CLASS"), 43; case 24: return this.popState(), this.pushState("CLASS_STYLE"), 44; case 25: return this.popState(), 45; case 26: return this.pushState("STYLE_STMNT"), 46; case 27: return this.popState(), this.pushState("STYLE_DEFINITION"), 47; case 28: return this.popState(), 48; case 29: return this.pushState("acc_title"), "acc_title"; case 30: return this.popState(), "acc_title_value"; case 31: return this.pushState("acc_descr"), "acc_descr"; case 32: return this.popState(), "acc_descr_value"; case 33: this.pushState("acc_descr_multiline"); break; case 34: this.popState(); break; case 35: return "acc_descr_multiline_value"; case 36: return 30; case 37: return this.popState(), f.getLogger().debug("Lex: (("), "NODE_DEND"; case 38: return this.popState(), f.getLogger().debug("Lex: (("), "NODE_DEND"; case 39: return this.popState(), f.getLogger().debug("Lex: ))"), "NODE_DEND"; case 40: return this.popState(), f.getLogger().debug("Lex: (("), "NODE_DEND"; case 41: return this.popState(), f.getLogger().debug("Lex: (("), "NODE_DEND"; case 42: return this.popState(), f.getLogger().debug("Lex: (-"), "NODE_DEND"; case 43: return this.popState(), f.getLogger().debug("Lex: -)"), "NODE_DEND"; case 44: return this.popState(), f.getLogger().debug("Lex: (("), "NODE_DEND"; case 45: return this.popState(), f.getLogger().debug("Lex: ]]"), "NODE_DEND"; case 46: return this.popState(), f.getLogger().debug("Lex: ("), "NODE_DEND"; case 47: return this.popState(), f.getLogger().debug("Lex: ])"), "NODE_DEND"; case 48: return this.popState(), f.getLogger().debug("Lex: /]"), "NODE_DEND"; case 49: return this.popState(), f.getLogger().debug("Lex: /]"), "NODE_DEND"; case 50: return this.popState(), f.getLogger().debug("Lex: )]"), "NODE_DEND"; case 51: return this.popState(), f.getLogger().debug("Lex: )"), "NODE_DEND"; case 52: return this.popState(), f.getLogger().debug("Lex: ]>"), "NODE_DEND"; case 53: return this.popState(), f.getLogger().debug("Lex: ]"), "NODE_DEND"; case 54: return f.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35; case 55: return f.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35; case 56: return f.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35; case 57: return f.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35; case 58: return f.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35; case 59: return f.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35; case 60: return f.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35; case 61: return f.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35; case 62: return f.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35; case 63: return f.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35; case 64: return f.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35; case 65: return this.pushState("NODE"), 35; case 66: return this.pushState("NODE"), 35; case 67: return this.pushState("NODE"), 35; case 68: return this.pushState("NODE"), 35; case 69: return this.pushState("NODE"), 35; case 70: return this.pushState("NODE"), 35; case 71: return this.pushState("NODE"), 35; case 72: return f.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35; case 73: return this.pushState("BLOCK_ARROW"), f.getLogger().debug("LEX ARR START"), 37; case 74: return f.getLogger().debug("Lex: NODE_ID", b.yytext), 31; case 75: return f.getLogger().debug("Lex: EOF", b.yytext), 8; case 76: this.pushState("md_string"); break; case 77: this.pushState("md_string"); break; case 78: return "NODE_DESCR"; case 79: this.popState(); break; case 80: f.getLogger().debug("Lex: Starting string"), this.pushState("string"); break; case 81: f.getLogger().debug("LEX ARR: Starting string"), this.pushState("string"); break; case 82: return f.getLogger().debug("LEX: NODE_DESCR:", b.yytext), "NODE_DESCR"; case 83: f.getLogger().debug("LEX POPPING"), this.popState(); break; case 84: f.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR"); break; case 85: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (right): dir:", b.yytext), "DIR"; case 86: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (left):", b.yytext), "DIR"; case 87: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (x):", b.yytext), "DIR"; case 88: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (y):", b.yytext), "DIR"; case 89: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (up):", b.yytext), "DIR"; case 90: return b.yytext = b.yytext.replace(/^,\s*/, ""), f.getLogger().debug("Lex (down):", b.yytext), "DIR"; case 91: return b.yytext = "]>", f.getLogger().debug("Lex (ARROW_DIR end):", b.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END"; case 92: return f.getLogger().debug("Lex: LINK", "#" + b.yytext + "#"), 15; case 93: return f.getLogger().debug("Lex: LINK", b.yytext), 15; case 94: return f.getLogger().debug("Lex: LINK", b.yytext), 15; case 95: return f.getLogger().debug("Lex: LINK", b.yytext), 15; case 96: return f.getLogger().debug("Lex: START_LINK", b.yytext), this.pushState("LLABEL"), 16; case 97: return f.getLogger().debug("Lex: START_LINK", b.yytext), this.pushState("LLABEL"), 16; case 98: return f.getLogger().debug("Lex: START_LINK", b.yytext), this.pushState("LLABEL"), 16; case 99: this.pushState("md_string"); break; case 100: return f.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL"; case 101: return this.popState(), f.getLogger().debug("Lex: LINK", "#" + b.yytext + "#"), 15; case 102: return this.popState(), f.getLogger().debug("Lex: LINK", b.yytext), 15; case 103: return this.popState(), f.getLogger().debug("Lex: LINK", b.yytext), 15; case 104: return f.getLogger().debug("Lex: COLON", b.yytext), b.yytext = b.yytext.slice(1), 27; } }, "anonymous"), 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+)/ ], 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 } } }; })(); function N() { this.yy = {}; } return u(N, "Parser"), N.prototype = S, S.Parser = N, new N(); })(); mt.parser = mt; var sr = mt, H = /* @__PURE__ */ new Map(), Tt = [], wt = /* @__PURE__ */ new Map(), At = "color", zt = "fill", ir = "bgFill", Xt = ",", nt = /* @__PURE__ */ new Map(), St = "", nr = /* @__PURE__ */ u((e) => be.sanitizeText(e, C()), "sanitizeText"), cr = /* @__PURE__ */ u(function(e, t = "") { let r = nt.get(e); r || (r = { id: e, styles: [], textStyles: [] }, nt.set(e, r)), t?.split(Xt).forEach((n) => { const s = n.replace(/([^;]*);/, "$1").trim(); if (RegExp(At).exec(n)) { const i = s.replace(zt, ir).replace(At, zt); r.textStyles.push(i); } r.styles.push(s); }); }, "addStyleClass"), lr = /* @__PURE__ */ u(function(e, t = "") { const r = H.get(e); t != null && (r.styles = t.split(Xt)); }, "addStyle2Node"), or = /* @__PURE__ */ u(function(e, t) { e.split(",").forEach(function(r) { let n = H.get(r); if (n === void 0) { const s = r.trim(); n = { id: s, type: "na", children: [] }, H.set(s, n); } n.classes || (n.classes = []), n.classes.push(t); }); }, "setCssClass"), Vt = /* @__PURE__ */ u((e, t) => { const r = e.flat(), n = [], s = r.find((i) => i?.type === "column-setting")?.columns ?? -1; for (const i of r) { if (typeof s == "number" && s > 0 && i.type !== "column-setting" && typeof i.widthInColumns == "number" && i.widthInColumns > s && L.warn(`Block ${i.id} width ${i.widthInColumns} exceeds configured column width ${s}`), i.label && (i.label = nr(i.label)), i.type === "classDef") { cr(i.id, i.css); continue; } if (i.type === "applyClass") { or(i.id, i?.styleClass ?? ""); continue; } if (i.type === "applyStyles") { i?.stylesStr && lr(i.id, i?.stylesStr); continue; } if (i.type === "column-setting") t.columns = i.columns ?? -1; else if (i.type === "edge") { const a = (wt.get(i.id) ?? 0) + 1; wt.set(i.id, a), i.id = a + "-" + i.id, Tt.push(i); } else { i.label || (i.type === "composite" ? i.label = "" : i.label = i.id); const a = H.get(i.id); if (a === void 0 ? H.set(i.id, i) : (i.type !== "na" && (a.type = i.type), i.label !== i.id && (a.label = i.label)), i.children && Vt(i.children, i), i.type === "space") { const c = i.width ?? 1; for (let l = 0; l < c; l++) { const g = $e(i); g.id = g.id + "-" + l, H.set(g.id, g), n.push(g); } } else a === void 0 && n.push(i); } } t.children = n; }, "populateBlockDatabase"), Lt = [], tt = { id: "root", type: "composite", children: [], columns: -1 }, hr = /* @__PURE__ */ u(() => { L.debug("Clear called"), pe(), tt = { id: "root", type: "composite", children: [], columns: -1 }, H = /* @__PURE__ */ new Map([["root", tt]]), Lt = [], nt = /* @__PURE__ */ new Map(), Tt = [], wt = /* @__PURE__ */ new Map(), St = ""; }, "clear"); function jt(e) { switch (L.debug("typeStr2Type", e), e) { case "[]": return "square"; case "()": return L.debug("we have a round"), "round"; case "(())": return "circle"; case ">]": return "rect_left_inv_arrow"; case "{}": return "diamond"; case "{{}}": return "hexagon"; case "([])": return "stadium"; case "[[]]": return "subroutine"; case "[()]": return "cylinder"; case "((()))": return "doublecircle"; case "[//]": return "lean_right"; case "[\\\\]": return "lean_left"; case "[/\\]": return "trapezoid"; case "[\\/]": return "inv_trapezoid"; case "<[]>": return "block_arrow"; default: return "na"; } } u(jt, "typeStr2Type"); function Gt(e) { return L.debug("typeStr2Type", e), e === "==" ? "thick" : "normal"; } u(Gt, "edgeTypeStr2Type"); function Zt(e) { switch (e.trim().slice(-1)) { case "x": return "arrow_cross"; case "o": return "arrow_circle"; case ">": return "arrow_point"; default: return ""; } } u(Zt, "edgeStrToEdgeData"); function qt(e) { switch (e.trim().charAt(0)) { case "x": return "arrow_cross"; case "o": return "arrow_circle"; case "<": return "arrow_point"; default: return "arrow_open"; } } u(qt, "edgeStrToEdgeStartData"); function Jt(e) { return e.includes("==") ? "thick" : "normal"; } u(Jt, "edgeStrToThickness"); function Qt(e) { return e.includes(".-") ? "dotted" : "solid"; } u(Qt, "edgeStrToPattern"); var Mt = 0, gr = { getConfig: /* @__PURE__ */ u(() => et().block, "getConfig"), typeStr2Type: jt, edgeTypeStr2Type: Gt, edgeStrToEdgeData: Zt, edgeStrToEdgeStartData: qt, edgeStrToThickness: Jt, edgeStrToPattern: Qt, getLogger: /* @__PURE__ */ u(() => L, "getLogger"), getBlocksFlat: /* @__PURE__ */ u(() => [...H.values()], "getBlocksFlat"), getBlocks: /* @__PURE__ */ u(() => Lt || [], "getBlocks"), getEdges: /* @__PURE__ */ u(() => Tt, "getEdges"), setHierarchy: /* @__PURE__ */ u((e) => { tt.children = e, Vt(e, tt), Lt = tt.children; }, "setHierarchy"), getBlock: /* @__PURE__ */ u((e) => H.get(e), "getBlock"), setBlock: /* @__PURE__ */ u((e) => { H.set(e.id, e); }, "setBlock"), getColumns: /* @__PURE__ */ u((e) => { const t = H.get(e); return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1; }, "getColumns"), getClasses: /* @__PURE__ */ u(function() { return nt; }, "getClasses"), clear: hr, generateId: /* @__PURE__ */ u(() => (Mt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Mt), "generateId"), setDiagramId: /* @__PURE__ */ u((e) => { St = e; }, "setDiagramId"), getDiagramId: /* @__PURE__ */ u(() => St, "getDiagramId") }, bt = /* @__PURE__ */ u((e, t) => { const r = me, n = r(e, "r"), s = r(e, "g"), i = r(e, "b"); return ye(n, s, i, t); }, "fade"), ur = /* @__PURE__ */ u((e) => `.label { font-family: ${e.fontFamily}; color: ${e.nodeTextColor || e.textColor}; } .cluster-label text { fill: ${e.titleColor}; } .cluster-label span,p { color: ${e.titleColor}; } .label text,span,p { fill: ${e.nodeTextColor || e.textColor}; color: ${e.nodeTextColor || e.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: 1px; } .flowchart-label text { text-anchor: middle; } // .flowchart-label .text-outer-tspan { // text-anchor: middle; // } // .flowchart-label .text-inner-tspan { // text-anchor: start; // } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${e.arrowheadColor}; } .edgePath .path { stroke: ${e.lineColor}; stroke-width: 2.0px; } .flowchart-link { stroke: ${e.lineColor}; fill: none; } .edgeLabel { background-color: ${e.edgeLabelBackground}; /* * This is for backward compatibility with existing code that didn't * add a \`<p>\` around edge labels. * * TODO: We should probably remove this in a future release. */ p { margin: 0; padding: 0; display: inline; } rect { opacity: 0.5; background-color: ${e.edgeLabelBackground}; fill: ${e.edgeLabelBackground}; } text-align: center; } /* For html labels only */ .labelBkg { background-color: ${e.edgeLabelBackground}; } .node .cluster { // fill: ${bt(e.mainBkg, 0.5)}; fill: ${bt(e.clusterBkg, 0.5)}; stroke: ${bt(e.clusterBorder, 0.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } .cluster text { fill: ${e.titleColor}; } .cluster span,p { color: ${e.titleColor}; } /* .cluster div { color: ${e.titleColor}; } */ div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${e.fontFamily}; font-size: 12px; background: ${e.tertiaryColor}; border: 1px solid ${e.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${e.textColor}; } ${je()} `, "getStyles"), dr = /* @__PURE__ */ u((e,