mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,120 lines (1,099 loc) • 110 kB
JavaScript
import { g as we, D as _e, C as ke, c as st, s as $t, b as Pe, a as Le, E as Ie, l as X, d as Nt, e as te, f as _, Y as ee, a4 as at, r as se, _ as Bt, a5 as Ae, a6 as wt, h as Ne, j as It, k as ve, A as B } from "./mermaid-9f2aa176.js";
import { d as Se, a as Me, b as Re, c as Ce, e as zt, g as vt } from "./svgDrawCommon-ecc5f780.js";
var Yt = function() {
var t = function(ht, w, P, I) {
for (P = P || {}, I = ht.length; I--; P[ht[I]] = w)
;
return P;
}, e = [1, 2], c = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], o = [1, 11], l = [1, 13], u = [1, 14], n = [1, 16], x = [1, 17], T = [1, 18], p = [1, 24], g = [1, 25], m = [1, 26], k = [1, 27], A = [1, 28], V = [1, 29], S = [1, 30], O = [1, 31], R = [1, 32], q = [1, 33], z = [1, 34], J = [1, 35], $ = [1, 36], H = [1, 37], U = [1, 38], F = [1, 39], W = [1, 41], Z = [1, 42], K = [1, 43], Q = [1, 44], tt = [1, 45], v = [1, 46], y = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], L = [4, 5, 16, 50, 52, 53], j = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], nt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], N = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], Gt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], dt = [68, 69, 70], ot = [1, 120], Mt = {
trace: function() {
},
yy: {},
symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, DOTTED_ARROW: 74, SOLID_CROSS: 75, DOTTED_CROSS: 76, SOLID_POINT: 77, DOTTED_POINT: 78, TXT: 79, $accept: 0, $end: 1 },
terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "TXT" },
productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
performAction: function(w, P, I, b, M, d, Et) {
var h = d.length - 1;
switch (M) {
case 3:
return b.apply(d[h]), d[h];
case 4:
case 9:
this.$ = [];
break;
case 5:
case 10:
d[h - 1].push(d[h]), this.$ = d[h - 1];
break;
case 6:
case 7:
case 11:
case 12:
this.$ = d[h];
break;
case 8:
case 13:
this.$ = [];
break;
case 15:
d[h].type = "createParticipant", this.$ = d[h];
break;
case 16:
d[h - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(d[h - 2]) }), d[h - 1].push({ type: "boxEnd", boxText: d[h - 2] }), this.$ = d[h - 1];
break;
case 18:
this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[h - 2]), sequenceIndexStep: Number(d[h - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
break;
case 19:
this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[h - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
break;
case 20:
this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: b.LINETYPE.AUTONUMBER };
break;
case 21:
this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
break;
case 22:
this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[h - 1] };
break;
case 23:
this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[h - 1] };
break;
case 29:
b.setDiagramTitle(d[h].substring(6)), this.$ = d[h].substring(6);
break;
case 30:
b.setDiagramTitle(d[h].substring(7)), this.$ = d[h].substring(7);
break;
case 31:
this.$ = d[h].trim(), b.setAccTitle(this.$);
break;
case 32:
case 33:
this.$ = d[h].trim(), b.setAccDescription(this.$);
break;
case 34:
d[h - 1].unshift({ type: "loopStart", loopText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.LOOP_START }), d[h - 1].push({ type: "loopEnd", loopText: d[h - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = d[h - 1];
break;
case 35:
d[h - 1].unshift({ type: "rectStart", color: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.RECT_START }), d[h - 1].push({ type: "rectEnd", color: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = d[h - 1];
break;
case 36:
d[h - 1].unshift({ type: "optStart", optText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.OPT_START }), d[h - 1].push({ type: "optEnd", optText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = d[h - 1];
break;
case 37:
d[h - 1].unshift({ type: "altStart", altText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.ALT_START }), d[h - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = d[h - 1];
break;
case 38:
d[h - 1].unshift({ type: "parStart", parText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.PAR_START }), d[h - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[h - 1];
break;
case 39:
d[h - 1].unshift({ type: "parStart", parText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.PAR_OVER_START }), d[h - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[h - 1];
break;
case 40:
d[h - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.CRITICAL_START }), d[h - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = d[h - 1];
break;
case 41:
d[h - 1].unshift({ type: "breakStart", breakText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.BREAK_START }), d[h - 1].push({ type: "breakEnd", optText: b.parseMessage(d[h - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = d[h - 1];
break;
case 43:
this.$ = d[h - 3].concat([{ type: "option", optionText: b.parseMessage(d[h - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, d[h]]);
break;
case 45:
this.$ = d[h - 3].concat([{ type: "and", parText: b.parseMessage(d[h - 1]), signalType: b.LINETYPE.PAR_AND }, d[h]]);
break;
case 47:
this.$ = d[h - 3].concat([{ type: "else", altText: b.parseMessage(d[h - 1]), signalType: b.LINETYPE.ALT_ELSE }, d[h]]);
break;
case 48:
d[h - 3].draw = "participant", d[h - 3].type = "addParticipant", d[h - 3].description = b.parseMessage(d[h - 1]), this.$ = d[h - 3];
break;
case 49:
d[h - 1].draw = "participant", d[h - 1].type = "addParticipant", this.$ = d[h - 1];
break;
case 50:
d[h - 3].draw = "actor", d[h - 3].type = "addParticipant", d[h - 3].description = b.parseMessage(d[h - 1]), this.$ = d[h - 3];
break;
case 51:
d[h - 1].draw = "actor", d[h - 1].type = "addParticipant", this.$ = d[h - 1];
break;
case 52:
d[h - 1].type = "destroyParticipant", this.$ = d[h - 1];
break;
case 53:
this.$ = [d[h - 1], { type: "addNote", placement: d[h - 2], actor: d[h - 1].actor, text: d[h] }];
break;
case 54:
d[h - 2] = [].concat(d[h - 1], d[h - 1]).slice(0, 2), d[h - 2][0] = d[h - 2][0].actor, d[h - 2][1] = d[h - 2][1].actor, this.$ = [d[h - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: d[h - 2].slice(0, 2), text: d[h] }];
break;
case 55:
this.$ = [d[h - 1], { type: "addLinks", actor: d[h - 1].actor, text: d[h] }];
break;
case 56:
this.$ = [d[h - 1], { type: "addALink", actor: d[h - 1].actor, text: d[h] }];
break;
case 57:
this.$ = [d[h - 1], { type: "addProperties", actor: d[h - 1].actor, text: d[h] }];
break;
case 58:
this.$ = [d[h - 1], { type: "addDetails", actor: d[h - 1].actor, text: d[h] }];
break;
case 61:
this.$ = [d[h - 2], d[h]];
break;
case 62:
this.$ = d[h];
break;
case 63:
this.$ = b.PLACEMENT.LEFTOF;
break;
case 64:
this.$ = b.PLACEMENT.RIGHTOF;
break;
case 65:
this.$ = [
d[h - 4],
d[h - 1],
{ type: "addMessage", from: d[h - 4].actor, to: d[h - 1].actor, signalType: d[h - 3], msg: d[h], activate: !0 },
{ type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[h - 1] }
];
break;
case 66:
this.$ = [
d[h - 4],
d[h - 1],
{ type: "addMessage", from: d[h - 4].actor, to: d[h - 1].actor, signalType: d[h - 3], msg: d[h] },
{ type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[h - 4] }
];
break;
case 67:
this.$ = [d[h - 3], d[h - 1], { type: "addMessage", from: d[h - 3].actor, to: d[h - 1].actor, signalType: d[h - 2], msg: d[h] }];
break;
case 68:
this.$ = { type: "addParticipant", actor: d[h] };
break;
case 69:
this.$ = b.LINETYPE.SOLID_OPEN;
break;
case 70:
this.$ = b.LINETYPE.DOTTED_OPEN;
break;
case 71:
this.$ = b.LINETYPE.SOLID;
break;
case 72:
this.$ = b.LINETYPE.DOTTED;
break;
case 73:
this.$ = b.LINETYPE.SOLID_CROSS;
break;
case 74:
this.$ = b.LINETYPE.DOTTED_CROSS;
break;
case 75:
this.$ = b.LINETYPE.SOLID_POINT;
break;
case 76:
this.$ = b.LINETYPE.DOTTED_POINT;
break;
case 77:
this.$ = b.parseMessage(d[h].trim().substring(1));
break;
}
},
table: [{ 3: 1, 4: e, 5: c, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: c, 6: s }, { 3: 6, 4: e, 5: c, 6: s }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, t(y, [2, 5]), { 9: 47, 12: 12, 13: l, 14: u, 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 14]), { 12: 48, 50: H, 52: U, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: v }, { 22: 55, 70: v }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(y, [2, 29]), t(y, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(y, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: v }, { 22: 72, 70: v }, { 22: 73, 70: v }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: v }, { 22: 88, 70: v }, { 22: 89, 70: v }, { 22: 90, 70: v }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), t(y, [2, 6]), t(y, [2, 15]), t(L, [2, 9], { 10: 91 }), t(y, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, t(y, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, t(y, [2, 24]), t(y, [2, 25]), t(y, [2, 26]), t(y, [2, 27]), t(y, [2, 28]), t(y, [2, 31]), t(y, [2, 32]), t(j, r, { 7: 97 }), t(j, r, { 7: 98 }), t(j, r, { 7: 99 }), t(nt, r, { 40: 100, 7: 101 }), t(N, r, { 42: 102, 7: 103 }), t(N, r, { 7: 103, 42: 104 }), t(Gt, r, { 45: 105, 7: 106 }), t(j, r, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: v }, t(dt, [2, 69]), t(dt, [2, 70]), t(dt, [2, 71]), t(dt, [2, 72]), t(dt, [2, 73]), t(dt, [2, 74]), t(dt, [2, 75]), t(dt, [2, 76]), { 22: 116, 70: v }, { 22: 118, 58: 117, 70: v }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: ot }, { 56: 121, 79: ot }, { 56: 122, 79: ot }, { 56: 123, 79: ot }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: H, 52: U, 53: F }, { 5: [1, 129] }, t(y, [2, 19]), t(y, [2, 20]), t(y, [2, 22]), t(y, [2, 23]), { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [1, 130], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [1, 131], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [1, 132], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 16: [1, 133] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [2, 46], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 49: [1, 134], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 16: [1, 135] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [2, 44], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 48: [1, 136], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [2, 42], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 47: [1, 139], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: l, 14: u, 16: [1, 140], 17: 15, 18: n, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: m, 33: k, 35: A, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: v }, { 15: [1, 141] }, t(y, [2, 49]), { 15: [1, 142] }, t(y, [2, 51]), t(y, [2, 52]), { 22: 143, 70: v }, { 22: 144, 70: v }, { 56: 145, 79: ot }, { 56: 146, 79: ot }, { 56: 147, 79: ot }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(y, [2, 16]), t(L, [2, 10]), { 12: 149, 50: H, 52: U, 53: F }, t(L, [2, 12]), t(L, [2, 13]), t(y, [2, 18]), t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), { 15: [1, 150] }, t(y, [2, 38]), { 15: [1, 151] }, t(y, [2, 39]), t(y, [2, 40]), { 15: [1, 152] }, t(y, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: ot }, { 56: 156, 79: ot }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: v }, t(L, [2, 11]), t(nt, r, { 7: 101, 40: 158 }), t(N, r, { 7: 103, 42: 159 }), t(Gt, r, { 7: 106, 45: 160 }), t(y, [2, 48]), t(y, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] },
parseError: function(w, P) {
if (P.recoverable)
this.trace(w);
else {
var I = new Error(w);
throw I.hash = P, I;
}
},
parse: function(w) {
var P = this, I = [0], b = [], M = [null], d = [], Et = this.table, h = "", kt = 0, Xt = 0, Te = 2, Jt = 1, be = d.slice.call(arguments, 1), Y = Object.create(this.lexer), ut = { yy: {} };
for (var Ct in this.yy)
Object.prototype.hasOwnProperty.call(this.yy, Ct) && (ut.yy[Ct] = this.yy[Ct]);
Y.setInput(w, ut.yy), ut.yy.lexer = Y, ut.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
var Dt = Y.yylloc;
d.push(Dt);
var Ee = Y.options && Y.options.ranges;
typeof ut.yy.parseError == "function" ? this.parseError = ut.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
function me() {
var lt;
return lt = b.pop() || Y.lex() || Jt, typeof lt != "number" && (lt instanceof Array && (b = lt, lt = b.pop()), lt = P.symbols_[lt] || lt), lt;
}
for (var G, pt, et, Vt, yt = {}, Pt, ct, Zt, Lt; ; ) {
if (pt = I[I.length - 1], this.defaultActions[pt] ? et = this.defaultActions[pt] : ((G === null || typeof G > "u") && (G = me()), et = Et[pt] && Et[pt][G]), typeof et > "u" || !et.length || !et[0]) {
var Ot = "";
Lt = [];
for (Pt in Et[pt])
this.terminals_[Pt] && Pt > Te && Lt.push("'" + this.terminals_[Pt] + "'");
Y.showPosition ? Ot = "Parse error on line " + (kt + 1) + `:
` + Y.showPosition() + `
Expecting ` + Lt.join(", ") + ", got '" + (this.terminals_[G] || G) + "'" : Ot = "Parse error on line " + (kt + 1) + ": Unexpected " + (G == Jt ? "end of input" : "'" + (this.terminals_[G] || G) + "'"), this.parseError(Ot, {
text: Y.match,
token: this.terminals_[G] || G,
line: Y.yylineno,
loc: Dt,
expected: Lt
});
}
if (et[0] instanceof Array && et.length > 1)
throw new Error("Parse Error: multiple actions possible at state: " + pt + ", token: " + G);
switch (et[0]) {
case 1:
I.push(G), M.push(Y.yytext), d.push(Y.yylloc), I.push(et[1]), G = null, Xt = Y.yyleng, h = Y.yytext, kt = Y.yylineno, Dt = Y.yylloc;
break;
case 2:
if (ct = this.productions_[et[1]][1], yt.$ = M[M.length - ct], yt._$ = {
first_line: d[d.length - (ct || 1)].first_line,
last_line: d[d.length - 1].last_line,
first_column: d[d.length - (ct || 1)].first_column,
last_column: d[d.length - 1].last_column
}, Ee && (yt._$.range = [
d[d.length - (ct || 1)].range[0],
d[d.length - 1].range[1]
]), Vt = this.performAction.apply(yt, [
h,
Xt,
kt,
ut.yy,
et[1],
M,
d
].concat(be)), typeof Vt < "u")
return Vt;
ct && (I = I.slice(0, -1 * ct * 2), M = M.slice(0, -1 * ct), d = d.slice(0, -1 * ct)), I.push(this.productions_[et[1]][0]), M.push(yt.$), d.push(yt._$), Zt = Et[I[I.length - 2]][I[I.length - 1]], I.push(Zt);
break;
case 3:
return !0;
}
}
return !0;
}
}, ye = function() {
var ht = {
EOF: 1,
parseError: function(P, I) {
if (this.yy.parser)
this.yy.parser.parseError(P, I);
else
throw new Error(P);
},
// resets the lexer, sets new input
setInput: function(w, P) {
return this.yy = P || 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;
},
// consumes and returns one char from the input
input: function() {
var w = this._input[0];
this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
var P = w.match(/(?:\r\n?|\n).*/g);
return P ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
},
// unshifts one char (or a string) into the input
unput: function(w) {
var P = w.length, I = w.split(/(?:\r\n?|\n)/g);
this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - P), this.offset -= P;
var b = 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), I.length - 1 && (this.yylineno -= I.length - 1);
var M = 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: I ? (I.length === b.length ? this.yylloc.first_column : 0) + b[b.length - I.length].length - I[0].length : this.yylloc.first_column - P
}, this.options.ranges && (this.yylloc.range = [M[0], M[0] + this.yyleng - P]), this.yyleng = this.yytext.length, this;
},
// When called from action, caches matched text and appends it on next action
more: function() {
return this._more = !0, this;
},
// 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.
reject: 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;
},
// retain first n characters of the match
less: function(w) {
this.unput(this.match.slice(w));
},
// displays already matched input, i.e. for error messages
pastInput: function() {
var w = this.matched.substr(0, this.matched.length - this.match.length);
return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
},
// displays upcoming input, i.e. for error messages
upcomingInput: 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, "");
},
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition: function() {
var w = this.pastInput(), P = new Array(w.length + 1).join("-");
return w + this.upcomingInput() + `
` + P + "^";
},
// test the lexed token: return FALSE when not a match, otherwise return token
test_match: function(w, P) {
var I, b, M;
if (this.options.backtrack_lexer && (M = {
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 && (M.yylloc.range = this.yylloc.range.slice(0))), b = w[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: b ? b[b.length - 1].length - b[b.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], I = this.performAction.call(this, this.yy, this, P, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), I)
return I;
if (this._backtrack) {
for (var d in M)
this[d] = M[d];
return !1;
}
return !1;
},
// return next match in input
next: function() {
if (this.done)
return this.EOF;
this._input || (this.done = !0);
var w, P, I, b;
this._more || (this.yytext = "", this.match = "");
for (var M = this._currentRules(), d = 0; d < M.length; d++)
if (I = this._input.match(this.rules[M[d]]), I && (!P || I[0].length > P[0].length)) {
if (P = I, b = d, this.options.backtrack_lexer) {
if (w = this.test_match(I, M[d]), w !== !1)
return w;
if (this._backtrack) {
P = !1;
continue;
} else
return !1;
} else if (!this.options.flex)
break;
}
return P ? (w = this.test_match(P, M[b]), 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
});
},
// return next match that has a token
lex: function() {
var P = this.next();
return P || this.lex();
},
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin: function(P) {
this.conditionStack.push(P);
},
// pop the previously active lexer condition state off the condition stack
popState: function() {
var P = this.conditionStack.length - 1;
return P > 0 ? this.conditionStack.pop() : this.conditionStack[0];
},
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules: function() {
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
},
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState: function(P) {
return P = this.conditionStack.length - 1 - Math.abs(P || 0), P >= 0 ? this.conditionStack[P] : "INITIAL";
},
// alias for begin(condition)
pushState: function(P) {
this.begin(P);
},
// return the number of states currently on the stack
stateStackSize: function() {
return this.conditionStack.length;
},
options: { "case-insensitive": !0 },
performAction: function(P, I, b, M) {
switch (b) {
case 0:
return 5;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
return 19;
case 7:
return this.begin("LINE"), 14;
case 8:
return this.begin("ID"), 50;
case 9:
return this.begin("ID"), 52;
case 10:
return 13;
case 11:
return this.begin("ID"), 53;
case 12:
return I.yytext = I.yytext.trim(), this.begin("ALIAS"), 70;
case 13:
return this.popState(), this.popState(), this.begin("LINE"), 51;
case 14:
return this.popState(), this.popState(), 5;
case 15:
return this.begin("LINE"), 36;
case 16:
return this.begin("LINE"), 37;
case 17:
return this.begin("LINE"), 38;
case 18:
return this.begin("LINE"), 39;
case 19:
return this.begin("LINE"), 49;
case 20:
return this.begin("LINE"), 41;
case 21:
return this.begin("LINE"), 43;
case 22:
return this.begin("LINE"), 48;
case 23:
return this.begin("LINE"), 44;
case 24:
return this.begin("LINE"), 47;
case 25:
return this.begin("LINE"), 46;
case 26:
return this.popState(), 15;
case 27:
return 16;
case 28:
return 65;
case 29:
return 66;
case 30:
return 59;
case 31:
return 60;
case 32:
return 61;
case 33:
return 62;
case 34:
return 57;
case 35:
return 54;
case 36:
return this.begin("ID"), 21;
case 37:
return this.begin("ID"), 23;
case 38:
return 29;
case 39:
return 30;
case 40:
return this.begin("acc_title"), 31;
case 41:
return this.popState(), "acc_title_value";
case 42:
return this.begin("acc_descr"), 33;
case 43:
return this.popState(), "acc_descr_value";
case 44:
this.begin("acc_descr_multiline");
break;
case 45:
this.popState();
break;
case 46:
return "acc_descr_multiline_value";
case 47:
return 6;
case 48:
return 18;
case 49:
return 20;
case 50:
return 64;
case 51:
return 5;
case 52:
return I.yytext = I.yytext.trim(), 70;
case 53:
return 73;
case 54:
return 74;
case 55:
return 71;
case 56:
return 72;
case 57:
return 75;
case 58:
return 76;
case 59:
return 77;
case 60:
return 78;
case 61:
return 79;
case 62:
return 68;
case 63:
return 69;
case 64:
return 5;
case 65:
return "INVALID";
}
},
rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], inclusive: !0 } }
};
return ht;
}();
Mt.lexer = ye;
function Rt() {
this.yy = {};
}
return Rt.prototype = Mt, Mt.Parser = Rt, new Rt();
}();
Yt.parser = Yt;
const De = Yt;
class Ve {
/**
* @param init - Function that creates the default state.
*/
constructor(e) {
this.init = e, this.records = this.init();
}
reset() {
this.records = this.init();
}
}
const E = new Ve(() => ({
prevActor: void 0,
actors: {},
createdActors: {},
destroyedActors: {},
boxes: [],
messages: [],
notes: [],
sequenceNumbersEnabled: !1,
wrapEnabled: void 0,
currentBox: void 0,
lastCreated: void 0,
lastDestroyed: void 0
})), Oe = function(t) {
E.records.boxes.push({
name: t.text,
wrap: t.wrap === void 0 && gt() || !!t.wrap,
fill: t.color,
actorKeys: []
}), E.records.currentBox = E.records.boxes.slice(-1)[0];
}, Ft = function(t, e, c, s) {
let r = E.records.currentBox;
const i = E.records.actors[t];
if (i) {
if (E.records.currentBox && i.box && E.records.currentBox !== i.box)
throw new Error(
"A same participant should only be defined in one Box: " + i.name + " can't be in '" + i.box.name + "' and in '" + E.records.currentBox.name + "' at the same time."
);
if (r = i.box ? i.box : E.records.currentBox, i.box = r, i && e === i.name && c == null)
return;
}
(c == null || c.text == null) && (c = { text: e, wrap: null, type: s }), (s == null || c.text == null) && (c = { text: e, wrap: null, type: s }), E.records.actors[t] = {
box: r,
name: e,
description: c.text,
wrap: c.wrap === void 0 && gt() || !!c.wrap,
prevActor: E.records.prevActor,
links: {},
properties: {},
actorCnt: null,
rectData: null,
type: s || "participant"
}, E.records.prevActor && E.records.actors[E.records.prevActor] && (E.records.actors[E.records.prevActor].nextActor = t), E.records.currentBox && E.records.currentBox.actorKeys.push(t), E.records.prevActor = t;
}, Be = (t) => {
let e, c = 0;
for (e = 0; e < E.records.messages.length; e++)
E.records.messages[e].type === mt.ACTIVE_START && E.records.messages[e].from.actor === t && c++, E.records.messages[e].type === mt.ACTIVE_END && E.records.messages[e].from.actor === t && c--;
return c;
}, Ye = function(t, e, c, s) {
E.records.messages.push({
from: t,
to: e,
message: c.text,
wrap: c.wrap === void 0 && gt() || !!c.wrap,
answer: s
});
}, C = function(t, e, c = { text: void 0, wrap: void 0 }, s, r = !1) {
if (s === mt.ACTIVE_END && Be(t.actor) < 1) {
let o = new Error("Trying to inactivate an inactive participant (" + t.actor + ")");
throw o.hash = {
text: "->>-",
token: "->>-",
line: "1",
loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
expected: ["'ACTIVE_PARTICIPANT'"]
}, o;
}
return E.records.messages.push({
from: t,
to: e,
message: c.text,
wrap: c.wrap === void 0 && gt() || !!c.wrap,
type: s,
activate: r
}), !0;
}, Fe = function() {
return E.records.boxes.length > 0;
}, We = function() {
return E.records.boxes.some((t) => t.name);
}, qe = function() {
return E.records.messages;
}, ze = function() {
return E.records.boxes;
}, He = function() {
return E.records.actors;
}, Ue = function() {
return E.records.createdActors;
}, Ke = function() {
return E.records.destroyedActors;
}, _t = function(t) {
return E.records.actors[t];
}, Ge = function() {
return Object.keys(E.records.actors);
}, Xe = function() {
E.records.sequenceNumbersEnabled = !0;
}, Je = function() {
E.records.sequenceNumbersEnabled = !1;
}, Ze = () => E.records.sequenceNumbersEnabled, Qe = function(t) {
E.records.wrapEnabled = t;
}, gt = () => E.records.wrapEnabled !== void 0 ? E.records.wrapEnabled : st().sequence.wrap, je = function() {
E.reset(), Ie();
}, $e = function(t) {
const e = t.trim(), c = {
text: e.replace(/^:?(?:no)?wrap:/, "").trim(),
wrap: e.match(/^:?wrap:/) !== null ? !0 : e.match(/^:?nowrap:/) !== null ? !1 : void 0
};
return X.debug("parseMessage:", c), c;
}, t0 = function(t) {
const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
let c = e != null && e[1] ? e[1].trim() : "transparent", s = e != null && e[2] ? e[2].trim() : void 0;
if (window && window.CSS)
window.CSS.supports("color", c) || (c = "transparent", s = t.trim());
else {
const r = new Option().style;
r.color = c, r.color !== c && (c = "transparent", s = t.trim());
}
return {
color: c,
text: s !== void 0 ? Nt(s.replace(/^:?(?:no)?wrap:/, ""), st()) : void 0,
wrap: s !== void 0 ? s.match(/^:?wrap:/) !== null ? !0 : s.match(/^:?nowrap:/) !== null ? !1 : void 0 : void 0
};
}, mt = {
SOLID: 0,
DOTTED: 1,
NOTE: 2,
SOLID_CROSS: 3,
DOTTED_CROSS: 4,
SOLID_OPEN: 5,
DOTTED_OPEN: 6,
LOOP_START: 10,
LOOP_END: 11,
ALT_START: 12,
ALT_ELSE: 13,
ALT_END: 14,
OPT_START: 15,
OPT_END: 16,
ACTIVE_START: 17,
ACTIVE_END: 18,
PAR_START: 19,
PAR_AND: 20,
PAR_END: 21,
RECT_START: 22,
RECT_END: 23,
SOLID_POINT: 24,
DOTTED_POINT: 25,
AUTONUMBER: 26,
CRITICAL_START: 27,
CRITICAL_OPTION: 28,
CRITICAL_END: 29,
BREAK_START: 30,
BREAK_END: 31,
PAR_OVER_START: 32
}, e0 = {
FILLED: 0,
OPEN: 1
}, s0 = {
LEFTOF: 0,
RIGHTOF: 1,
OVER: 2
}, ne = function(t, e, c) {
const s = {
actor: t,
placement: e,
message: c.text,
wrap: c.wrap === void 0 && gt() || !!c.wrap
}, r = [].concat(t, t);
E.records.notes.push(s), E.records.messages.push({
from: r[0],
to: r[1],
message: c.text,
wrap: c.wrap === void 0 && gt() || !!c.wrap,
type: mt.NOTE,
placement: e
});
}, re = function(t, e) {
const c = _t(t);
try {
let s = Nt(e.text, st());
s = s.replace(/&/g, "&"), s = s.replace(/=/g, "=");
const r = JSON.parse(s);
Ht(c, r);
} catch (s) {
X.error("error while parsing actor link text", s);
}
}, n0 = function(t, e) {
const c = _t(t);
try {
const o = {};
let l = Nt(e.text, st());
var s = l.indexOf("@");
l = l.replace(/&/g, "&"), l = l.replace(/=/g, "=");
var r = l.slice(0, s - 1).trim(), i = l.slice(s + 1).trim();
o[r] = i, Ht(c, o);
} catch (o) {
X.error("error while parsing actor link text", o);
}
};
function Ht(t, e) {
if (t.links == null)
t.links = e;
else
for (let c in e)
t.links[c] = e[c];
}
const ie = function(t, e) {
const c = _t(t);
try {
let s = Nt(e.text, st());
const r = JSON.parse(s);
ae(c, r);
} catch (s) {
X.error("error while parsing actor properties text", s);
}
};
function ae(t, e) {
if (t.properties == null)
t.properties = e;
else
for (let c in e)
t.properties[c] = e[c];
}
function r0() {
E.records.currentBox = void 0;
}
const oe = function(t, e) {
const c = _t(t), s = document.getElementById(e.text);
try {
const r = s.innerHTML, i = JSON.parse(r);
i.properties && ae(c, i.properties), i.links && Ht(c, i.links);
} catch (r) {
X.error("error while parsing actor details text", r);
}
}, i0 = function(t, e) {
if (t !== void 0 && t.properties !== void 0)
return t.properties[e];
}, ce = function(t) {
if (Array.isArray(t))
t.forEach(function(e) {
ce(e);
});
else
switch (t.type) {
case "sequenceIndex":
E.records.messages.push({
from: void 0,
to: void 0,
message: {
start: t.sequenceIndex,
step: t.sequenceIndexStep,
visible: t.sequenceVisible
},
wrap: !1,
type: t.signalType
});
break;
case "addParticipant":
Ft(t.actor, t.actor, t.description, t.draw);
break;
case "createParticipant":
if (E.records.actors[t.actor])
throw new Error(
"It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
);
E.records.lastCreated = t.actor, Ft(t.actor, t.actor, t.description, t.draw), E.records.createdActors[t.actor] = E.records.messages.length;
break;
case "destroyParticipant":
E.records.lastDestroyed = t.actor, E.records.destroyedActors[t.actor] = E.records.messages.length;
break;
case "activeStart":
C(t.actor, void 0, void 0, t.signalType);
break;
case "activeEnd":
C(t.actor, void 0, void 0, t.signalType);
break;
case "addNote":
ne(t.actor, t.placement, t.text);
break;
case "addLinks":
re(t.actor, t.text);
break;
case "addALink":
n0(t.actor, t.text);
break;
case "addProperties":
ie(t.actor, t.text);
break;
case "addDetails":
oe(t.actor, t.text);
break;
case "addMessage":
if (E.records.lastCreated) {
if (t.to !== E.records.lastCreated)
throw new Error(
"The created participant " + E.records.lastCreated + " does not have an associated creating message after its declaration. Please check the sequence diagram."
);
E.records.lastCreated = void 0;
} else if (E.records.lastDestroyed) {
if (t.to !== E.records.lastDestroyed && t.from !== E.records.lastDestroyed)
throw new Error(
"The destroyed participant " + E.records.lastDestroyed + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
);
E.records.lastDestroyed = void 0;
}
C(t.from, t.to, t.msg, t.signalType, t.activate);
break;
case "boxStart":
Oe(t.boxData);
break;
case "boxEnd":
r0();
break;
case "loopStart":
C(void 0, void 0, t.loopText, t.signalType);
break;
case "loopEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "rectStart":
C(void 0, void 0, t.color, t.signalType);
break;
case "rectEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "optStart":
C(void 0, void 0, t.optText, t.signalType);
break;
case "optEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "altStart":
C(void 0, void 0, t.altText, t.signalType);
break;
case "else":
C(void 0, void 0, t.altText, t.signalType);
break;
case "altEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "setAccTitle":
$t(t.text);
break;
case "parStart":
C(void 0, void 0, t.parText, t.signalType);
break;
case "and":
C(void 0, void 0, t.parText, t.signalType);
break;
case "parEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "criticalStart":
C(void 0, void 0, t.criticalText, t.signalType);
break;
case "option":
C(void 0, void 0, t.optionText, t.signalType);
break;
case "criticalEnd":
C(void 0, void 0, void 0, t.signalType);
break;
case "breakStart":
C(void 0, void 0, t.breakText, t.signalType);
break;
case "breakEnd":
C(void 0, void 0, void 0, t.signalType);
break;
}
}, Qt = {
addActor: Ft,
addMessage: Ye,
addSignal: C,
addLinks: re,
addDetails: oe,
addProperties: ie,
autoWrap: gt,
setWrap: Qe,
enableSequenceNumbers: Xe,
disableSequenceNumbers: Je,
showSequenceNumbers: Ze,
getMessages: qe,
getActors: He,
getCreatedActors: Ue,
getDestroyedActors: Ke,
getActor: _t,
getActorKeys: Ge,
getActorProperty: i0,
getAccTitle: we,
getBoxes: ze,
getDiagramTitle: _e,
setDiagramTitle: ke,
getConfig: () => st().sequence,
clear: je,
parseMessage: $e,
parseBoxData: t0,
LINETYPE: mt,
ARROWTYPE: e0,
PLACEMENT: s0,
addNote: ne,
setAccTitle: $t,
apply: ce,
setAccDescription: Pe,
getAccDescription: Le,
hasAtLeastOneBox: Fe,
hasAtLeastOneBoxWithTitle: We
}, a0 = (t) => `.actor {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
text.actor > tspan {
fill: ${t.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${t.actorLineColor};
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${t.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${t.signalColor};
}
#arrowhead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.sequenceNumber {
fill: ${t.sequenceNumberColor};
}
#sequencenumber {
fill: ${t.signalColor};
}
#crosshead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.messageText {
fill: ${t.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBkgColor};
}
.labelText, .labelText > tspan {
fill: ${t.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBorderColor};
}
.note {
//stroke: #decc93;
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
}
.noteText, .noteText > tspan {
fill: ${t.noteTextColor};
stroke: none;
}
.activation0 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation1 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation2 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.actorPopupMenu {
position: absolute;
}
.actorPopupMenuPanel {
position: absolute;
fill: ${t.actorBkg};
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.actor-man line {
stroke: ${t.actorBorder};