@elmethis/core 1.0.0-alpha.134 → 1.0.0-alpha.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{Bash-CH5FqaYP.js → Bash-BGUPOZp7.js} +1 -1
  2. package/dist/{Css-CIfznlc_.js → Css-BCZOJ9TO.js} +1 -1
  3. package/dist/{Rust-CZSAfuWF.js → Rust-BwvKtYCc.js} +1 -1
  4. package/dist/_basePickBy-BjVOtBbf.js +152 -0
  5. package/dist/_baseUniq-DBXEmOed.js +583 -0
  6. package/dist/arc-CpOtc53l.js +83 -0
  7. package/dist/architecture-I3QFYML2-B3piHlUx.js +5 -0
  8. package/dist/architectureDiagram-UYN6MBPD-CIvqBNYd.js +4595 -0
  9. package/dist/blockDiagram-ZHA2E4KO-BJHIBwi6.js +2247 -0
  10. package/dist/c4Diagram-6F5ED5ID-DxXqw6e0.js +1581 -0
  11. package/dist/channel-BgZSmjvA.js +5 -0
  12. package/dist/chunk-5HRBRIJM-CvhBPtHu.js +24 -0
  13. package/dist/chunk-7U56Z5CX-CaWvnXle.js +1215 -0
  14. package/dist/chunk-ASOPGD6M-CQjrO8hd.js +64 -0
  15. package/dist/chunk-KFBOBJHC-DWru5GNu.js +15 -0
  16. package/dist/chunk-T2TOU4HS-DqpYO7rW.js +1303 -0
  17. package/dist/chunk-TMUBEWPD-LmMMNIqt.js +9 -0
  18. package/dist/classDiagram-LNE6IOMH-D5GoOZTJ.js +14 -0
  19. package/dist/classDiagram-v2-MQ7JQ4JX-D5GoOZTJ.js +14 -0
  20. package/dist/clone-DMQ2a__4.js +8 -0
  21. package/dist/{cobol-DZ3yq6J9.js → cobol-DMssKNmC.js} +1 -1
  22. package/dist/components/code/ElmMermaid.stories.d.ts +7 -0
  23. package/dist/components/code/ElmMermaid.vue.d.ts +8 -0
  24. package/dist/cytoscape.esm-CsRvAgYT.js +17639 -0
  25. package/dist/dagre-4EVJKHTY-C7YsHY3S.js +447 -0
  26. package/dist/diagram-QW4FP2JN-iDbrW_yI.js +126 -0
  27. package/dist/elmethis.js +36 -35
  28. package/dist/elmethis.umd.cjs +2272 -41
  29. package/dist/erDiagram-6RL3IURR-LYq0WEw3.js +937 -0
  30. package/dist/flowDiagram-7ASYPVHJ-DRPtjs2_.js +1484 -0
  31. package/dist/ganttDiagram-NTVNEXSI-C-hO_7Lp.js +2494 -0
  32. package/dist/gitGraph-YCYPL57B-BaVhg8eu.js +5 -0
  33. package/dist/gitGraphDiagram-NRZ2UAAF-u52k9qsq.js +712 -0
  34. package/dist/graph-CKV5wesZ.js +247 -0
  35. package/dist/{index-B_eGv85A.js → index-DQdUr-_f.js} +4349 -4241
  36. package/dist/index.d.ts +3 -2
  37. package/dist/info-46DW6VJ7-D5JUpHK_.js +5 -0
  38. package/dist/infoDiagram-A4XQUW5V-D5IcjWQu.js +22 -0
  39. package/dist/init-DjUOC4st.js +16 -0
  40. package/dist/journeyDiagram-G5WM74LC-XHcEaxXL.js +810 -0
  41. package/dist/kanban-definition-QRCXZQQD-BFgu8zXi.js +718 -0
  42. package/dist/layout-Cycesmdu.js +1324 -0
  43. package/dist/linear-CjRkwbhR.js +423 -0
  44. package/dist/mermaid-parser.core-CL_REaxY.js +12479 -0
  45. package/dist/mermaid.core-gtllNrzr.js +14852 -0
  46. package/dist/mindmap-definition-GWI6TPTV-yPOhYeCo.js +3220 -0
  47. package/dist/ordinal-DfAQgscy.js +61 -0
  48. package/dist/packet-W2GHVCYJ-D1drjM5q.js +5 -0
  49. package/dist/pie-BEWT4RHE-B2xFs62T.js +5 -0
  50. package/dist/pieDiagram-YF2LJOPJ-Cnvx0DvF.js +162 -0
  51. package/dist/quadrantDiagram-OS5C2QUG-DBWy6UVd.js +1024 -0
  52. package/dist/{razor-Dl6rcHmj.js → razor-CeqqNtyB.js} +1 -1
  53. package/dist/requirementDiagram-MIRIMTAZ-CfHcsBsO.js +768 -0
  54. package/dist/sankeyDiagram-Y46BX6SQ-C_60tCtv.js +805 -0
  55. package/dist/sass-eCUyDs9S.js +6 -0
  56. package/dist/scala-Cly-fENF.js +6 -0
  57. package/dist/sequenceDiagram-G6AWOVSC-XvgYpHvJ.js +2274 -0
  58. package/dist/stateDiagram-MAYHULR4-Bx48BKG3.js +268 -0
  59. package/dist/stateDiagram-v2-4JROLMXI-pDuBzVSZ.js +14 -0
  60. package/dist/swift-BAWqNR8A.js +6 -0
  61. package/dist/timeline-definition-U7ZMHBDA-EGhtku4S.js +804 -0
  62. package/dist/xychartDiagram-6QU3TZC5-B_OmutYz.js +1304 -0
  63. package/package.json +13 -12
  64. package/dist/sass-iCyS6eP9.js +0 -6
  65. package/dist/scala-BQHTnvwx.js +0 -6
  66. package/dist/swift-OL4r9IGP.js +0 -6
@@ -0,0 +1,2274 @@
1
+ import { g as St, a as Kt, d as Se, b as Me, c as Re, e as De } from "./chunk-ASOPGD6M-CQjrO8hd.js";
2
+ import { I as Ce } from "./chunk-KFBOBJHC-DWru5GNu.js";
3
+ import { _ as d, g as Oe, r as Be, q as Ve, d as at, s as se, c as Ye, b as Fe, e as L, a2 as lt, a3 as It, v as F, l as J, x as We, i as Mt, a as qe, j as vt, k as ze, m as ae, a4 as ne, F as Ft, a5 as ie, a6 as He } from "./mermaid.core-gtllNrzr.js";
4
+ var Wt = function() {
5
+ var t = /* @__PURE__ */ d(function(ut, _, P, k) {
6
+ for (P = P || {}, k = ut.length; k--; P[ut[k]] = _) ;
7
+ return P;
8
+ }, "o"), e = [1, 2], o = [1, 3], r = [1, 4], a = [2, 4], n = [1, 9], c = [1, 11], h = [1, 13], u = [1, 14], s = [1, 16], g = [1, 17], E = [1, 18], f = [1, 24], T = [1, 25], m = [1, 26], I = [1, 27], v = [1, 28], V = [1, 29], M = [1, 30], Y = [1, 31], C = [1, 32], z = [1, 33], H = [1, 34], Z = [1, 35], et = [1, 36], K = [1, 37], U = [1, 38], q = [1, 39], R = [1, 41], Q = [1, 42], G = [1, 43], j = [1, 44], rt = [1, 45], S = [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], A = [4, 5, 16, 50, 52, 53], $ = [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], Jt = [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], ot = [68, 69, 70], dt = [1, 122], Ct = {
9
+ trace: /* @__PURE__ */ d(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ 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, BIDIRECTIONAL_SOLID_ARROW: 74, DOTTED_ARROW: 75, BIDIRECTIONAL_DOTTED_ARROW: 76, SOLID_CROSS: 77, DOTTED_CROSS: 78, SOLID_POINT: 79, DOTTED_POINT: 80, TXT: 81, $accept: 0, $end: 1 },
13
+ 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: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" },
14
+ 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], [67, 1], [67, 1], [56, 1]],
15
+ performAction: /* @__PURE__ */ d(function(_, P, k, b, D, l, mt) {
16
+ var p = l.length - 1;
17
+ switch (D) {
18
+ case 3:
19
+ return b.apply(l[p]), l[p];
20
+ case 4:
21
+ case 9:
22
+ this.$ = [];
23
+ break;
24
+ case 5:
25
+ case 10:
26
+ l[p - 1].push(l[p]), this.$ = l[p - 1];
27
+ break;
28
+ case 6:
29
+ case 7:
30
+ case 11:
31
+ case 12:
32
+ this.$ = l[p];
33
+ break;
34
+ case 8:
35
+ case 13:
36
+ this.$ = [];
37
+ break;
38
+ case 15:
39
+ l[p].type = "createParticipant", this.$ = l[p];
40
+ break;
41
+ case 16:
42
+ l[p - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(l[p - 2]) }), l[p - 1].push({ type: "boxEnd", boxText: l[p - 2] }), this.$ = l[p - 1];
43
+ break;
44
+ case 18:
45
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[p - 2]), sequenceIndexStep: Number(l[p - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
46
+ break;
47
+ case 19:
48
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[p - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
49
+ break;
50
+ case 20:
51
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: b.LINETYPE.AUTONUMBER };
52
+ break;
53
+ case 21:
54
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
55
+ break;
56
+ case 22:
57
+ this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: l[p - 1].actor };
58
+ break;
59
+ case 23:
60
+ this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: l[p - 1].actor };
61
+ break;
62
+ case 29:
63
+ b.setDiagramTitle(l[p].substring(6)), this.$ = l[p].substring(6);
64
+ break;
65
+ case 30:
66
+ b.setDiagramTitle(l[p].substring(7)), this.$ = l[p].substring(7);
67
+ break;
68
+ case 31:
69
+ this.$ = l[p].trim(), b.setAccTitle(this.$);
70
+ break;
71
+ case 32:
72
+ case 33:
73
+ this.$ = l[p].trim(), b.setAccDescription(this.$);
74
+ break;
75
+ case 34:
76
+ l[p - 1].unshift({ type: "loopStart", loopText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.LOOP_START }), l[p - 1].push({ type: "loopEnd", loopText: l[p - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = l[p - 1];
77
+ break;
78
+ case 35:
79
+ l[p - 1].unshift({ type: "rectStart", color: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.RECT_START }), l[p - 1].push({ type: "rectEnd", color: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = l[p - 1];
80
+ break;
81
+ case 36:
82
+ l[p - 1].unshift({ type: "optStart", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.OPT_START }), l[p - 1].push({ type: "optEnd", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = l[p - 1];
83
+ break;
84
+ case 37:
85
+ l[p - 1].unshift({ type: "altStart", altText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.ALT_START }), l[p - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = l[p - 1];
86
+ break;
87
+ case 38:
88
+ l[p - 1].unshift({ type: "parStart", parText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.PAR_START }), l[p - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = l[p - 1];
89
+ break;
90
+ case 39:
91
+ l[p - 1].unshift({ type: "parStart", parText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.PAR_OVER_START }), l[p - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = l[p - 1];
92
+ break;
93
+ case 40:
94
+ l[p - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.CRITICAL_START }), l[p - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = l[p - 1];
95
+ break;
96
+ case 41:
97
+ l[p - 1].unshift({ type: "breakStart", breakText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.BREAK_START }), l[p - 1].push({ type: "breakEnd", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = l[p - 1];
98
+ break;
99
+ case 43:
100
+ this.$ = l[p - 3].concat([{ type: "option", optionText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, l[p]]);
101
+ break;
102
+ case 45:
103
+ this.$ = l[p - 3].concat([{ type: "and", parText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.PAR_AND }, l[p]]);
104
+ break;
105
+ case 47:
106
+ this.$ = l[p - 3].concat([{ type: "else", altText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.ALT_ELSE }, l[p]]);
107
+ break;
108
+ case 48:
109
+ l[p - 3].draw = "participant", l[p - 3].type = "addParticipant", l[p - 3].description = b.parseMessage(l[p - 1]), this.$ = l[p - 3];
110
+ break;
111
+ case 49:
112
+ l[p - 1].draw = "participant", l[p - 1].type = "addParticipant", this.$ = l[p - 1];
113
+ break;
114
+ case 50:
115
+ l[p - 3].draw = "actor", l[p - 3].type = "addParticipant", l[p - 3].description = b.parseMessage(l[p - 1]), this.$ = l[p - 3];
116
+ break;
117
+ case 51:
118
+ l[p - 1].draw = "actor", l[p - 1].type = "addParticipant", this.$ = l[p - 1];
119
+ break;
120
+ case 52:
121
+ l[p - 1].type = "destroyParticipant", this.$ = l[p - 1];
122
+ break;
123
+ case 53:
124
+ this.$ = [l[p - 1], { type: "addNote", placement: l[p - 2], actor: l[p - 1].actor, text: l[p] }];
125
+ break;
126
+ case 54:
127
+ l[p - 2] = [].concat(l[p - 1], l[p - 1]).slice(0, 2), l[p - 2][0] = l[p - 2][0].actor, l[p - 2][1] = l[p - 2][1].actor, this.$ = [l[p - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: l[p - 2].slice(0, 2), text: l[p] }];
128
+ break;
129
+ case 55:
130
+ this.$ = [l[p - 1], { type: "addLinks", actor: l[p - 1].actor, text: l[p] }];
131
+ break;
132
+ case 56:
133
+ this.$ = [l[p - 1], { type: "addALink", actor: l[p - 1].actor, text: l[p] }];
134
+ break;
135
+ case 57:
136
+ this.$ = [l[p - 1], { type: "addProperties", actor: l[p - 1].actor, text: l[p] }];
137
+ break;
138
+ case 58:
139
+ this.$ = [l[p - 1], { type: "addDetails", actor: l[p - 1].actor, text: l[p] }];
140
+ break;
141
+ case 61:
142
+ this.$ = [l[p - 2], l[p]];
143
+ break;
144
+ case 62:
145
+ this.$ = l[p];
146
+ break;
147
+ case 63:
148
+ this.$ = b.PLACEMENT.LEFTOF;
149
+ break;
150
+ case 64:
151
+ this.$ = b.PLACEMENT.RIGHTOF;
152
+ break;
153
+ case 65:
154
+ this.$ = [
155
+ l[p - 4],
156
+ l[p - 1],
157
+ { type: "addMessage", from: l[p - 4].actor, to: l[p - 1].actor, signalType: l[p - 3], msg: l[p], activate: !0 },
158
+ { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: l[p - 1].actor }
159
+ ];
160
+ break;
161
+ case 66:
162
+ this.$ = [
163
+ l[p - 4],
164
+ l[p - 1],
165
+ { type: "addMessage", from: l[p - 4].actor, to: l[p - 1].actor, signalType: l[p - 3], msg: l[p] },
166
+ { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: l[p - 4].actor }
167
+ ];
168
+ break;
169
+ case 67:
170
+ this.$ = [l[p - 3], l[p - 1], { type: "addMessage", from: l[p - 3].actor, to: l[p - 1].actor, signalType: l[p - 2], msg: l[p] }];
171
+ break;
172
+ case 68:
173
+ this.$ = { type: "addParticipant", actor: l[p] };
174
+ break;
175
+ case 69:
176
+ this.$ = b.LINETYPE.SOLID_OPEN;
177
+ break;
178
+ case 70:
179
+ this.$ = b.LINETYPE.DOTTED_OPEN;
180
+ break;
181
+ case 71:
182
+ this.$ = b.LINETYPE.SOLID;
183
+ break;
184
+ case 72:
185
+ this.$ = b.LINETYPE.BIDIRECTIONAL_SOLID;
186
+ break;
187
+ case 73:
188
+ this.$ = b.LINETYPE.DOTTED;
189
+ break;
190
+ case 74:
191
+ this.$ = b.LINETYPE.BIDIRECTIONAL_DOTTED;
192
+ break;
193
+ case 75:
194
+ this.$ = b.LINETYPE.SOLID_CROSS;
195
+ break;
196
+ case 76:
197
+ this.$ = b.LINETYPE.DOTTED_CROSS;
198
+ break;
199
+ case 77:
200
+ this.$ = b.LINETYPE.SOLID_POINT;
201
+ break;
202
+ case 78:
203
+ this.$ = b.LINETYPE.DOTTED_POINT;
204
+ break;
205
+ case 79:
206
+ this.$ = b.parseMessage(l[p].trim().substring(1));
207
+ break;
208
+ }
209
+ }, "anonymous"),
210
+ table: [{ 3: 1, 4: e, 5: o, 6: r }, { 1: [3] }, { 3: 5, 4: e, 5: o, 6: r }, { 3: 6, 4: e, 5: o, 6: r }, 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], a, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, t(y, [2, 5]), { 9: 47, 12: 12, 13: h, 14: u, 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 14]), { 12: 48, 50: K, 52: U, 53: q }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: S }, { 22: 55, 70: S }, { 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: S }, { 22: 72, 70: S }, { 22: 73, 70: S }, { 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], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: S }, { 22: 90, 70: S }, { 22: 91, 70: S }, { 22: 92, 70: S }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), t(y, [2, 6]), t(y, [2, 15]), t(A, [2, 9], { 10: 93 }), t(y, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, t(y, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, 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($, a, { 7: 99 }), t($, a, { 7: 100 }), t($, a, { 7: 101 }), t(nt, a, { 40: 102, 7: 103 }), t(N, a, { 42: 104, 7: 105 }), t(N, a, { 7: 105, 42: 106 }), t(Jt, a, { 45: 107, 7: 108 }), t($, a, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: S }, t(ot, [2, 69]), t(ot, [2, 70]), t(ot, [2, 71]), t(ot, [2, 72]), t(ot, [2, 73]), t(ot, [2, 74]), t(ot, [2, 75]), t(ot, [2, 76]), t(ot, [2, 77]), t(ot, [2, 78]), { 22: 118, 70: S }, { 22: 120, 58: 119, 70: S }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: dt }, { 56: 123, 81: dt }, { 56: 124, 81: dt }, { 56: 125, 81: dt }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: K, 52: U, 53: q }, { 5: [1, 131] }, t(y, [2, 19]), t(y, [2, 20]), t(y, [2, 22]), t(y, [2, 23]), { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 132], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 133], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 134], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 16: [1, 135] }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 46], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 49: [1, 136], 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 16: [1, 137] }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 44], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 48: [1, 138], 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 42], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 47: [1, 141], 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 4: n, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 142], 17: 15, 18: s, 21: g, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: f, 30: T, 31: m, 33: I, 35: v, 36: V, 37: M, 38: Y, 39: C, 41: z, 43: H, 44: Z, 46: et, 50: K, 52: U, 53: q, 54: R, 59: Q, 60: G, 61: j, 62: rt, 70: S }, { 15: [1, 143] }, t(y, [2, 49]), { 15: [1, 144] }, t(y, [2, 51]), t(y, [2, 52]), { 22: 145, 70: S }, { 22: 146, 70: S }, { 56: 147, 81: dt }, { 56: 148, 81: dt }, { 56: 149, 81: dt }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(y, [2, 16]), t(A, [2, 10]), { 12: 151, 50: K, 52: U, 53: q }, t(A, [2, 12]), t(A, [2, 13]), t(y, [2, 18]), t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), { 15: [1, 152] }, t(y, [2, 38]), { 15: [1, 153] }, t(y, [2, 39]), t(y, [2, 40]), { 15: [1, 154] }, t(y, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: dt }, { 56: 158, 81: dt }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: S }, t(A, [2, 11]), t(nt, a, { 7: 103, 40: 160 }), t(N, a, { 7: 105, 42: 161 }), t(Jt, a, { 7: 108, 45: 162 }), t(y, [2, 48]), t(y, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
211
+ defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] },
212
+ parseError: /* @__PURE__ */ d(function(_, P) {
213
+ if (P.recoverable)
214
+ this.trace(_);
215
+ else {
216
+ var k = new Error(_);
217
+ throw k.hash = P, k;
218
+ }
219
+ }, "parseError"),
220
+ parse: /* @__PURE__ */ d(function(_) {
221
+ var P = this, k = [0], b = [], D = [null], l = [], mt = this.table, p = "", Pt = 0, Zt = 0, Ae = 2, Qt = 1, ke = l.slice.call(arguments, 1), W = Object.create(this.lexer), pt = { yy: {} };
222
+ for (var Ot in this.yy)
223
+ Object.prototype.hasOwnProperty.call(this.yy, Ot) && (pt.yy[Ot] = this.yy[Ot]);
224
+ W.setInput(_, pt.yy), pt.yy.lexer = W, pt.yy.parser = this, typeof W.yylloc > "u" && (W.yylloc = {});
225
+ var Bt = W.yylloc;
226
+ l.push(Bt);
227
+ var ve = W.options && W.options.ranges;
228
+ typeof pt.yy.parseError == "function" ? this.parseError = pt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
229
+ function Ne(tt) {
230
+ k.length = k.length - 2 * tt, D.length = D.length - tt, l.length = l.length - tt;
231
+ }
232
+ d(Ne, "popStack");
233
+ function jt() {
234
+ var tt;
235
+ return tt = b.pop() || W.lex() || Qt, typeof tt != "number" && (tt instanceof Array && (b = tt, tt = b.pop()), tt = P.symbols_[tt] || tt), tt;
236
+ }
237
+ d(jt, "lex");
238
+ for (var X, ft, st, Vt, yt = {}, At, ht, $t, kt; ; ) {
239
+ if (ft = k[k.length - 1], this.defaultActions[ft] ? st = this.defaultActions[ft] : ((X === null || typeof X > "u") && (X = jt()), st = mt[ft] && mt[ft][X]), typeof st > "u" || !st.length || !st[0]) {
240
+ var Yt = "";
241
+ kt = [];
242
+ for (At in mt[ft])
243
+ this.terminals_[At] && At > Ae && kt.push("'" + this.terminals_[At] + "'");
244
+ W.showPosition ? Yt = "Parse error on line " + (Pt + 1) + `:
245
+ ` + W.showPosition() + `
246
+ Expecting ` + kt.join(", ") + ", got '" + (this.terminals_[X] || X) + "'" : Yt = "Parse error on line " + (Pt + 1) + ": Unexpected " + (X == Qt ? "end of input" : "'" + (this.terminals_[X] || X) + "'"), this.parseError(Yt, {
247
+ text: W.match,
248
+ token: this.terminals_[X] || X,
249
+ line: W.yylineno,
250
+ loc: Bt,
251
+ expected: kt
252
+ });
253
+ }
254
+ if (st[0] instanceof Array && st.length > 1)
255
+ throw new Error("Parse Error: multiple actions possible at state: " + ft + ", token: " + X);
256
+ switch (st[0]) {
257
+ case 1:
258
+ k.push(X), D.push(W.yytext), l.push(W.yylloc), k.push(st[1]), X = null, Zt = W.yyleng, p = W.yytext, Pt = W.yylineno, Bt = W.yylloc;
259
+ break;
260
+ case 2:
261
+ if (ht = this.productions_[st[1]][1], yt.$ = D[D.length - ht], yt._$ = {
262
+ first_line: l[l.length - (ht || 1)].first_line,
263
+ last_line: l[l.length - 1].last_line,
264
+ first_column: l[l.length - (ht || 1)].first_column,
265
+ last_column: l[l.length - 1].last_column
266
+ }, ve && (yt._$.range = [
267
+ l[l.length - (ht || 1)].range[0],
268
+ l[l.length - 1].range[1]
269
+ ]), Vt = this.performAction.apply(yt, [
270
+ p,
271
+ Zt,
272
+ Pt,
273
+ pt.yy,
274
+ st[1],
275
+ D,
276
+ l
277
+ ].concat(ke)), typeof Vt < "u")
278
+ return Vt;
279
+ ht && (k = k.slice(0, -1 * ht * 2), D = D.slice(0, -1 * ht), l = l.slice(0, -1 * ht)), k.push(this.productions_[st[1]][0]), D.push(yt.$), l.push(yt._$), $t = mt[k[k.length - 2]][k[k.length - 1]], k.push($t);
280
+ break;
281
+ case 3:
282
+ return !0;
283
+ }
284
+ }
285
+ return !0;
286
+ }, "parse")
287
+ }, Pe = /* @__PURE__ */ function() {
288
+ var ut = {
289
+ EOF: 1,
290
+ parseError: /* @__PURE__ */ d(function(P, k) {
291
+ if (this.yy.parser)
292
+ this.yy.parser.parseError(P, k);
293
+ else
294
+ throw new Error(P);
295
+ }, "parseError"),
296
+ // resets the lexer, sets new input
297
+ setInput: /* @__PURE__ */ d(function(_, P) {
298
+ return this.yy = P || this.yy || {}, this._input = _, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
299
+ first_line: 1,
300
+ first_column: 0,
301
+ last_line: 1,
302
+ last_column: 0
303
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
304
+ }, "setInput"),
305
+ // consumes and returns one char from the input
306
+ input: /* @__PURE__ */ d(function() {
307
+ var _ = this._input[0];
308
+ this.yytext += _, this.yyleng++, this.offset++, this.match += _, this.matched += _;
309
+ var P = _.match(/(?:\r\n?|\n).*/g);
310
+ 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), _;
311
+ }, "input"),
312
+ // unshifts one char (or a string) into the input
313
+ unput: /* @__PURE__ */ d(function(_) {
314
+ var P = _.length, k = _.split(/(?:\r\n?|\n)/g);
315
+ this._input = _ + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - P), this.offset -= P;
316
+ var b = this.match.split(/(?:\r\n?|\n)/g);
317
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), k.length - 1 && (this.yylineno -= k.length - 1);
318
+ var D = this.yylloc.range;
319
+ return this.yylloc = {
320
+ first_line: this.yylloc.first_line,
321
+ last_line: this.yylineno + 1,
322
+ first_column: this.yylloc.first_column,
323
+ last_column: k ? (k.length === b.length ? this.yylloc.first_column : 0) + b[b.length - k.length].length - k[0].length : this.yylloc.first_column - P
324
+ }, this.options.ranges && (this.yylloc.range = [D[0], D[0] + this.yyleng - P]), this.yyleng = this.yytext.length, this;
325
+ }, "unput"),
326
+ // When called from action, caches matched text and appends it on next action
327
+ more: /* @__PURE__ */ d(function() {
328
+ return this._more = !0, this;
329
+ }, "more"),
330
+ // 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.
331
+ reject: /* @__PURE__ */ d(function() {
332
+ if (this.options.backtrack_lexer)
333
+ this._backtrack = !0;
334
+ else
335
+ 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).
336
+ ` + this.showPosition(), {
337
+ text: "",
338
+ token: null,
339
+ line: this.yylineno
340
+ });
341
+ return this;
342
+ }, "reject"),
343
+ // retain first n characters of the match
344
+ less: /* @__PURE__ */ d(function(_) {
345
+ this.unput(this.match.slice(_));
346
+ }, "less"),
347
+ // displays already matched input, i.e. for error messages
348
+ pastInput: /* @__PURE__ */ d(function() {
349
+ var _ = this.matched.substr(0, this.matched.length - this.match.length);
350
+ return (_.length > 20 ? "..." : "") + _.substr(-20).replace(/\n/g, "");
351
+ }, "pastInput"),
352
+ // displays upcoming input, i.e. for error messages
353
+ upcomingInput: /* @__PURE__ */ d(function() {
354
+ var _ = this.match;
355
+ return _.length < 20 && (_ += this._input.substr(0, 20 - _.length)), (_.substr(0, 20) + (_.length > 20 ? "..." : "")).replace(/\n/g, "");
356
+ }, "upcomingInput"),
357
+ // displays the character position where the lexing error occurred, i.e. for error messages
358
+ showPosition: /* @__PURE__ */ d(function() {
359
+ var _ = this.pastInput(), P = new Array(_.length + 1).join("-");
360
+ return _ + this.upcomingInput() + `
361
+ ` + P + "^";
362
+ }, "showPosition"),
363
+ // test the lexed token: return FALSE when not a match, otherwise return token
364
+ test_match: /* @__PURE__ */ d(function(_, P) {
365
+ var k, b, D;
366
+ if (this.options.backtrack_lexer && (D = {
367
+ yylineno: this.yylineno,
368
+ yylloc: {
369
+ first_line: this.yylloc.first_line,
370
+ last_line: this.last_line,
371
+ first_column: this.yylloc.first_column,
372
+ last_column: this.yylloc.last_column
373
+ },
374
+ yytext: this.yytext,
375
+ match: this.match,
376
+ matches: this.matches,
377
+ matched: this.matched,
378
+ yyleng: this.yyleng,
379
+ offset: this.offset,
380
+ _more: this._more,
381
+ _input: this._input,
382
+ yy: this.yy,
383
+ conditionStack: this.conditionStack.slice(0),
384
+ done: this.done
385
+ }, this.options.ranges && (D.yylloc.range = this.yylloc.range.slice(0))), b = _[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
386
+ first_line: this.yylloc.last_line,
387
+ last_line: this.yylineno + 1,
388
+ first_column: this.yylloc.last_column,
389
+ last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + _[0].length
390
+ }, this.yytext += _[0], this.match += _[0], this.matches = _, 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(_[0].length), this.matched += _[0], k = this.performAction.call(this, this.yy, this, P, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), k)
391
+ return k;
392
+ if (this._backtrack) {
393
+ for (var l in D)
394
+ this[l] = D[l];
395
+ return !1;
396
+ }
397
+ return !1;
398
+ }, "test_match"),
399
+ // return next match in input
400
+ next: /* @__PURE__ */ d(function() {
401
+ if (this.done)
402
+ return this.EOF;
403
+ this._input || (this.done = !0);
404
+ var _, P, k, b;
405
+ this._more || (this.yytext = "", this.match = "");
406
+ for (var D = this._currentRules(), l = 0; l < D.length; l++)
407
+ if (k = this._input.match(this.rules[D[l]]), k && (!P || k[0].length > P[0].length)) {
408
+ if (P = k, b = l, this.options.backtrack_lexer) {
409
+ if (_ = this.test_match(k, D[l]), _ !== !1)
410
+ return _;
411
+ if (this._backtrack) {
412
+ P = !1;
413
+ continue;
414
+ } else
415
+ return !1;
416
+ } else if (!this.options.flex)
417
+ break;
418
+ }
419
+ return P ? (_ = this.test_match(P, D[b]), _ !== !1 ? _ : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
420
+ ` + this.showPosition(), {
421
+ text: "",
422
+ token: null,
423
+ line: this.yylineno
424
+ });
425
+ }, "next"),
426
+ // return next match that has a token
427
+ lex: /* @__PURE__ */ d(function() {
428
+ var P = this.next();
429
+ return P || this.lex();
430
+ }, "lex"),
431
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
432
+ begin: /* @__PURE__ */ d(function(P) {
433
+ this.conditionStack.push(P);
434
+ }, "begin"),
435
+ // pop the previously active lexer condition state off the condition stack
436
+ popState: /* @__PURE__ */ d(function() {
437
+ var P = this.conditionStack.length - 1;
438
+ return P > 0 ? this.conditionStack.pop() : this.conditionStack[0];
439
+ }, "popState"),
440
+ // produce the lexer rule set which is active for the currently active lexer condition state
441
+ _currentRules: /* @__PURE__ */ d(function() {
442
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
443
+ }, "_currentRules"),
444
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
445
+ topState: /* @__PURE__ */ d(function(P) {
446
+ return P = this.conditionStack.length - 1 - Math.abs(P || 0), P >= 0 ? this.conditionStack[P] : "INITIAL";
447
+ }, "topState"),
448
+ // alias for begin(condition)
449
+ pushState: /* @__PURE__ */ d(function(P) {
450
+ this.begin(P);
451
+ }, "pushState"),
452
+ // return the number of states currently on the stack
453
+ stateStackSize: /* @__PURE__ */ d(function() {
454
+ return this.conditionStack.length;
455
+ }, "stateStackSize"),
456
+ options: { "case-insensitive": !0 },
457
+ performAction: /* @__PURE__ */ d(function(P, k, b, D) {
458
+ switch (b) {
459
+ case 0:
460
+ return 5;
461
+ case 1:
462
+ break;
463
+ case 2:
464
+ break;
465
+ case 3:
466
+ break;
467
+ case 4:
468
+ break;
469
+ case 5:
470
+ break;
471
+ case 6:
472
+ return 19;
473
+ case 7:
474
+ return this.begin("LINE"), 14;
475
+ case 8:
476
+ return this.begin("ID"), 50;
477
+ case 9:
478
+ return this.begin("ID"), 52;
479
+ case 10:
480
+ return 13;
481
+ case 11:
482
+ return this.begin("ID"), 53;
483
+ case 12:
484
+ return k.yytext = k.yytext.trim(), this.begin("ALIAS"), 70;
485
+ case 13:
486
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
487
+ case 14:
488
+ return this.popState(), this.popState(), 5;
489
+ case 15:
490
+ return this.begin("LINE"), 36;
491
+ case 16:
492
+ return this.begin("LINE"), 37;
493
+ case 17:
494
+ return this.begin("LINE"), 38;
495
+ case 18:
496
+ return this.begin("LINE"), 39;
497
+ case 19:
498
+ return this.begin("LINE"), 49;
499
+ case 20:
500
+ return this.begin("LINE"), 41;
501
+ case 21:
502
+ return this.begin("LINE"), 43;
503
+ case 22:
504
+ return this.begin("LINE"), 48;
505
+ case 23:
506
+ return this.begin("LINE"), 44;
507
+ case 24:
508
+ return this.begin("LINE"), 47;
509
+ case 25:
510
+ return this.begin("LINE"), 46;
511
+ case 26:
512
+ return this.popState(), 15;
513
+ case 27:
514
+ return 16;
515
+ case 28:
516
+ return 65;
517
+ case 29:
518
+ return 66;
519
+ case 30:
520
+ return 59;
521
+ case 31:
522
+ return 60;
523
+ case 32:
524
+ return 61;
525
+ case 33:
526
+ return 62;
527
+ case 34:
528
+ return 57;
529
+ case 35:
530
+ return 54;
531
+ case 36:
532
+ return this.begin("ID"), 21;
533
+ case 37:
534
+ return this.begin("ID"), 23;
535
+ case 38:
536
+ return 29;
537
+ case 39:
538
+ return 30;
539
+ case 40:
540
+ return this.begin("acc_title"), 31;
541
+ case 41:
542
+ return this.popState(), "acc_title_value";
543
+ case 42:
544
+ return this.begin("acc_descr"), 33;
545
+ case 43:
546
+ return this.popState(), "acc_descr_value";
547
+ case 44:
548
+ this.begin("acc_descr_multiline");
549
+ break;
550
+ case 45:
551
+ this.popState();
552
+ break;
553
+ case 46:
554
+ return "acc_descr_multiline_value";
555
+ case 47:
556
+ return 6;
557
+ case 48:
558
+ return 18;
559
+ case 49:
560
+ return 20;
561
+ case 50:
562
+ return 64;
563
+ case 51:
564
+ return 5;
565
+ case 52:
566
+ return k.yytext = k.yytext.trim(), 70;
567
+ case 53:
568
+ return 73;
569
+ case 54:
570
+ return 74;
571
+ case 55:
572
+ return 75;
573
+ case 56:
574
+ return 76;
575
+ case 57:
576
+ return 71;
577
+ case 58:
578
+ return 72;
579
+ case 59:
580
+ return 77;
581
+ case 60:
582
+ return 78;
583
+ case 61:
584
+ return 79;
585
+ case 62:
586
+ return 80;
587
+ case 63:
588
+ return 81;
589
+ case 64:
590
+ return 68;
591
+ case 65:
592
+ return 69;
593
+ case 66:
594
+ return 5;
595
+ case 67:
596
+ return "INVALID";
597
+ }
598
+ }, "anonymous"),
599
+ 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, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
600
+ 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, 66, 67], inclusive: !0 } }
601
+ };
602
+ return ut;
603
+ }();
604
+ Ct.lexer = Pe;
605
+ function Lt() {
606
+ this.yy = {};
607
+ }
608
+ return d(Lt, "Parser"), Lt.prototype = Ct, Ct.Parser = Lt, new Lt();
609
+ }();
610
+ Wt.parser = Wt;
611
+ var Ke = Wt, w = new Ce(() => ({
612
+ prevActor: void 0,
613
+ actors: /* @__PURE__ */ new Map(),
614
+ createdActors: /* @__PURE__ */ new Map(),
615
+ destroyedActors: /* @__PURE__ */ new Map(),
616
+ boxes: [],
617
+ messages: [],
618
+ notes: [],
619
+ sequenceNumbersEnabled: !1,
620
+ wrapEnabled: void 0,
621
+ currentBox: void 0,
622
+ lastCreated: void 0,
623
+ lastDestroyed: void 0
624
+ })), Ue = /* @__PURE__ */ d(function(t) {
625
+ w.records.boxes.push({
626
+ name: t.text,
627
+ wrap: t.wrap ?? xt(),
628
+ fill: t.color,
629
+ actorKeys: []
630
+ }), w.records.currentBox = w.records.boxes.slice(-1)[0];
631
+ }, "addBox"), qt = /* @__PURE__ */ d(function(t, e, o, r) {
632
+ let a = w.records.currentBox;
633
+ const n = w.records.actors.get(t);
634
+ if (n) {
635
+ if (w.records.currentBox && n.box && w.records.currentBox !== n.box)
636
+ throw new Error(
637
+ `A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${w.records.currentBox.name}' at the same time.`
638
+ );
639
+ if (a = n.box ? n.box : w.records.currentBox, n.box = a, n && e === n.name && o == null)
640
+ return;
641
+ }
642
+ if ((o == null ? void 0 : o.text) == null && (o = { text: e, type: r }), (r == null || o.text == null) && (o = { text: e, type: r }), w.records.actors.set(t, {
643
+ box: a,
644
+ name: e,
645
+ description: o.text,
646
+ wrap: o.wrap ?? xt(),
647
+ prevActor: w.records.prevActor,
648
+ links: {},
649
+ properties: {},
650
+ actorCnt: null,
651
+ rectData: null,
652
+ type: r ?? "participant"
653
+ }), w.records.prevActor) {
654
+ const c = w.records.actors.get(w.records.prevActor);
655
+ c && (c.nextActor = t);
656
+ }
657
+ w.records.currentBox && w.records.currentBox.actorKeys.push(t), w.records.prevActor = t;
658
+ }, "addActor"), Ge = /* @__PURE__ */ d((t) => {
659
+ let e, o = 0;
660
+ if (!t)
661
+ return 0;
662
+ for (e = 0; e < w.records.messages.length; e++)
663
+ w.records.messages[e].type === wt.ACTIVE_START && w.records.messages[e].from === t && o++, w.records.messages[e].type === wt.ACTIVE_END && w.records.messages[e].from === t && o--;
664
+ return o;
665
+ }, "activationCount"), Xe = /* @__PURE__ */ d(function(t, e, o, r) {
666
+ w.records.messages.push({
667
+ from: t,
668
+ to: e,
669
+ message: o.text,
670
+ wrap: o.wrap ?? xt(),
671
+ answer: r
672
+ });
673
+ }, "addMessage"), O = /* @__PURE__ */ d(function(t, e, o, r, a = !1) {
674
+ if (r === wt.ACTIVE_END && Ge(t ?? "") < 1) {
675
+ const c = new Error("Trying to inactivate an inactive participant (" + t + ")");
676
+ throw c.hash = {
677
+ text: "->>-",
678
+ token: "->>-",
679
+ line: "1",
680
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
681
+ expected: ["'ACTIVE_PARTICIPANT'"]
682
+ }, c;
683
+ }
684
+ return w.records.messages.push({
685
+ from: t,
686
+ to: e,
687
+ message: (o == null ? void 0 : o.text) ?? "",
688
+ wrap: (o == null ? void 0 : o.wrap) ?? xt(),
689
+ type: r,
690
+ activate: a
691
+ }), !0;
692
+ }, "addSignal"), Je = /* @__PURE__ */ d(function() {
693
+ return w.records.boxes.length > 0;
694
+ }, "hasAtLeastOneBox"), Ze = /* @__PURE__ */ d(function() {
695
+ return w.records.boxes.some((t) => t.name);
696
+ }, "hasAtLeastOneBoxWithTitle"), Qe = /* @__PURE__ */ d(function() {
697
+ return w.records.messages;
698
+ }, "getMessages"), je = /* @__PURE__ */ d(function() {
699
+ return w.records.boxes;
700
+ }, "getBoxes"), $e = /* @__PURE__ */ d(function() {
701
+ return w.records.actors;
702
+ }, "getActors"), t0 = /* @__PURE__ */ d(function() {
703
+ return w.records.createdActors;
704
+ }, "getCreatedActors"), e0 = /* @__PURE__ */ d(function() {
705
+ return w.records.destroyedActors;
706
+ }, "getDestroyedActors"), _t = /* @__PURE__ */ d(function(t) {
707
+ return w.records.actors.get(t);
708
+ }, "getActor"), r0 = /* @__PURE__ */ d(function() {
709
+ return [...w.records.actors.keys()];
710
+ }, "getActorKeys"), s0 = /* @__PURE__ */ d(function() {
711
+ w.records.sequenceNumbersEnabled = !0;
712
+ }, "enableSequenceNumbers"), a0 = /* @__PURE__ */ d(function() {
713
+ w.records.sequenceNumbersEnabled = !1;
714
+ }, "disableSequenceNumbers"), n0 = /* @__PURE__ */ d(() => w.records.sequenceNumbersEnabled, "showSequenceNumbers"), i0 = /* @__PURE__ */ d(function(t) {
715
+ w.records.wrapEnabled = t;
716
+ }, "setWrap"), oe = /* @__PURE__ */ d((t) => {
717
+ if (t === void 0)
718
+ return {};
719
+ t = t.trim();
720
+ const e = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
721
+ return { cleanedText: (e === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: e };
722
+ }, "extractWrap"), xt = /* @__PURE__ */ d(() => {
723
+ var t;
724
+ return w.records.wrapEnabled !== void 0 ? w.records.wrapEnabled : ((t = at().sequence) == null ? void 0 : t.wrap) ?? !1;
725
+ }, "autoWrap"), o0 = /* @__PURE__ */ d(function() {
726
+ w.reset(), We();
727
+ }, "clear"), c0 = /* @__PURE__ */ d(function(t) {
728
+ const e = t.trim(), { wrap: o, cleanedText: r } = oe(e), a = {
729
+ text: r,
730
+ wrap: o
731
+ };
732
+ return J.debug(`parseMessage: ${JSON.stringify(a)}`), a;
733
+ }, "parseMessage"), l0 = /* @__PURE__ */ d(function(t) {
734
+ const e = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
735
+ let o = e != null && e[1] ? e[1].trim() : "transparent", r = e != null && e[2] ? e[2].trim() : void 0;
736
+ if (window != null && window.CSS)
737
+ window.CSS.supports("color", o) || (o = "transparent", r = t.trim());
738
+ else {
739
+ const c = new Option().style;
740
+ c.color = o, c.color !== o && (o = "transparent", r = t.trim());
741
+ }
742
+ const { wrap: a, cleanedText: n } = oe(r);
743
+ return {
744
+ text: n ? Mt(n, at()) : void 0,
745
+ color: o,
746
+ wrap: a
747
+ };
748
+ }, "parseBoxData"), wt = {
749
+ SOLID: 0,
750
+ DOTTED: 1,
751
+ NOTE: 2,
752
+ SOLID_CROSS: 3,
753
+ DOTTED_CROSS: 4,
754
+ SOLID_OPEN: 5,
755
+ DOTTED_OPEN: 6,
756
+ LOOP_START: 10,
757
+ LOOP_END: 11,
758
+ ALT_START: 12,
759
+ ALT_ELSE: 13,
760
+ ALT_END: 14,
761
+ OPT_START: 15,
762
+ OPT_END: 16,
763
+ ACTIVE_START: 17,
764
+ ACTIVE_END: 18,
765
+ PAR_START: 19,
766
+ PAR_AND: 20,
767
+ PAR_END: 21,
768
+ RECT_START: 22,
769
+ RECT_END: 23,
770
+ SOLID_POINT: 24,
771
+ DOTTED_POINT: 25,
772
+ AUTONUMBER: 26,
773
+ CRITICAL_START: 27,
774
+ CRITICAL_OPTION: 28,
775
+ CRITICAL_END: 29,
776
+ BREAK_START: 30,
777
+ BREAK_END: 31,
778
+ PAR_OVER_START: 32,
779
+ BIDIRECTIONAL_SOLID: 33,
780
+ BIDIRECTIONAL_DOTTED: 34
781
+ }, d0 = {
782
+ FILLED: 0,
783
+ OPEN: 1
784
+ }, h0 = {
785
+ LEFTOF: 0,
786
+ RIGHTOF: 1,
787
+ OVER: 2
788
+ }, ce = /* @__PURE__ */ d(function(t, e, o) {
789
+ const r = {
790
+ actor: t,
791
+ placement: e,
792
+ message: o.text,
793
+ wrap: o.wrap ?? xt()
794
+ }, a = [].concat(t, t);
795
+ w.records.notes.push(r), w.records.messages.push({
796
+ from: a[0],
797
+ to: a[1],
798
+ message: o.text,
799
+ wrap: o.wrap ?? xt(),
800
+ type: wt.NOTE,
801
+ placement: e
802
+ });
803
+ }, "addNote"), le = /* @__PURE__ */ d(function(t, e) {
804
+ const o = _t(t);
805
+ try {
806
+ let r = Mt(e.text, at());
807
+ r = r.replace(/&amp;/g, "&"), r = r.replace(/&equals;/g, "=");
808
+ const a = JSON.parse(r);
809
+ Rt(o, a);
810
+ } catch (r) {
811
+ J.error("error while parsing actor link text", r);
812
+ }
813
+ }, "addLinks"), u0 = /* @__PURE__ */ d(function(t, e) {
814
+ const o = _t(t);
815
+ try {
816
+ const r = {};
817
+ let a = Mt(e.text, at());
818
+ const n = a.indexOf("@");
819
+ a = a.replace(/&amp;/g, "&"), a = a.replace(/&equals;/g, "=");
820
+ const c = a.slice(0, n - 1).trim(), h = a.slice(n + 1).trim();
821
+ r[c] = h, Rt(o, r);
822
+ } catch (r) {
823
+ J.error("error while parsing actor link text", r);
824
+ }
825
+ }, "addALink");
826
+ function Rt(t, e) {
827
+ if (t.links == null)
828
+ t.links = e;
829
+ else
830
+ for (const o in e)
831
+ t.links[o] = e[o];
832
+ }
833
+ d(Rt, "insertLinks");
834
+ var de = /* @__PURE__ */ d(function(t, e) {
835
+ const o = _t(t);
836
+ try {
837
+ const r = Mt(e.text, at()), a = JSON.parse(r);
838
+ Ut(o, a);
839
+ } catch (r) {
840
+ J.error("error while parsing actor properties text", r);
841
+ }
842
+ }, "addProperties");
843
+ function Ut(t, e) {
844
+ if (t.properties == null)
845
+ t.properties = e;
846
+ else
847
+ for (const o in e)
848
+ t.properties[o] = e[o];
849
+ }
850
+ d(Ut, "insertProperties");
851
+ function he() {
852
+ w.records.currentBox = void 0;
853
+ }
854
+ d(he, "boxEnd");
855
+ var ue = /* @__PURE__ */ d(function(t, e) {
856
+ const o = _t(t), r = document.getElementById(e.text);
857
+ try {
858
+ const a = r.innerHTML, n = JSON.parse(a);
859
+ n.properties && Ut(o, n.properties), n.links && Rt(o, n.links);
860
+ } catch (a) {
861
+ J.error("error while parsing actor details text", a);
862
+ }
863
+ }, "addDetails"), p0 = /* @__PURE__ */ d(function(t, e) {
864
+ if ((t == null ? void 0 : t.properties) !== void 0)
865
+ return t.properties[e];
866
+ }, "getActorProperty"), pe = /* @__PURE__ */ d(function(t) {
867
+ if (Array.isArray(t))
868
+ t.forEach(function(e) {
869
+ pe(e);
870
+ });
871
+ else
872
+ switch (t.type) {
873
+ case "sequenceIndex":
874
+ w.records.messages.push({
875
+ from: void 0,
876
+ to: void 0,
877
+ message: {
878
+ start: t.sequenceIndex,
879
+ step: t.sequenceIndexStep,
880
+ visible: t.sequenceVisible
881
+ },
882
+ wrap: !1,
883
+ type: t.signalType
884
+ });
885
+ break;
886
+ case "addParticipant":
887
+ qt(t.actor, t.actor, t.description, t.draw);
888
+ break;
889
+ case "createParticipant":
890
+ if (w.records.actors.has(t.actor))
891
+ throw new Error(
892
+ "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"
893
+ );
894
+ w.records.lastCreated = t.actor, qt(t.actor, t.actor, t.description, t.draw), w.records.createdActors.set(t.actor, w.records.messages.length);
895
+ break;
896
+ case "destroyParticipant":
897
+ w.records.lastDestroyed = t.actor, w.records.destroyedActors.set(t.actor, w.records.messages.length);
898
+ break;
899
+ case "activeStart":
900
+ O(t.actor, void 0, void 0, t.signalType);
901
+ break;
902
+ case "activeEnd":
903
+ O(t.actor, void 0, void 0, t.signalType);
904
+ break;
905
+ case "addNote":
906
+ ce(t.actor, t.placement, t.text);
907
+ break;
908
+ case "addLinks":
909
+ le(t.actor, t.text);
910
+ break;
911
+ case "addALink":
912
+ u0(t.actor, t.text);
913
+ break;
914
+ case "addProperties":
915
+ de(t.actor, t.text);
916
+ break;
917
+ case "addDetails":
918
+ ue(t.actor, t.text);
919
+ break;
920
+ case "addMessage":
921
+ if (w.records.lastCreated) {
922
+ if (t.to !== w.records.lastCreated)
923
+ throw new Error(
924
+ "The created participant " + w.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
925
+ );
926
+ w.records.lastCreated = void 0;
927
+ } else if (w.records.lastDestroyed) {
928
+ if (t.to !== w.records.lastDestroyed && t.from !== w.records.lastDestroyed)
929
+ throw new Error(
930
+ "The destroyed participant " + w.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
931
+ );
932
+ w.records.lastDestroyed = void 0;
933
+ }
934
+ O(t.from, t.to, t.msg, t.signalType, t.activate);
935
+ break;
936
+ case "boxStart":
937
+ Ue(t.boxData);
938
+ break;
939
+ case "boxEnd":
940
+ he();
941
+ break;
942
+ case "loopStart":
943
+ O(void 0, void 0, t.loopText, t.signalType);
944
+ break;
945
+ case "loopEnd":
946
+ O(void 0, void 0, void 0, t.signalType);
947
+ break;
948
+ case "rectStart":
949
+ O(void 0, void 0, t.color, t.signalType);
950
+ break;
951
+ case "rectEnd":
952
+ O(void 0, void 0, void 0, t.signalType);
953
+ break;
954
+ case "optStart":
955
+ O(void 0, void 0, t.optText, t.signalType);
956
+ break;
957
+ case "optEnd":
958
+ O(void 0, void 0, void 0, t.signalType);
959
+ break;
960
+ case "altStart":
961
+ O(void 0, void 0, t.altText, t.signalType);
962
+ break;
963
+ case "else":
964
+ O(void 0, void 0, t.altText, t.signalType);
965
+ break;
966
+ case "altEnd":
967
+ O(void 0, void 0, void 0, t.signalType);
968
+ break;
969
+ case "setAccTitle":
970
+ se(t.text);
971
+ break;
972
+ case "parStart":
973
+ O(void 0, void 0, t.parText, t.signalType);
974
+ break;
975
+ case "and":
976
+ O(void 0, void 0, t.parText, t.signalType);
977
+ break;
978
+ case "parEnd":
979
+ O(void 0, void 0, void 0, t.signalType);
980
+ break;
981
+ case "criticalStart":
982
+ O(void 0, void 0, t.criticalText, t.signalType);
983
+ break;
984
+ case "option":
985
+ O(void 0, void 0, t.optionText, t.signalType);
986
+ break;
987
+ case "criticalEnd":
988
+ O(void 0, void 0, void 0, t.signalType);
989
+ break;
990
+ case "breakStart":
991
+ O(void 0, void 0, t.breakText, t.signalType);
992
+ break;
993
+ case "breakEnd":
994
+ O(void 0, void 0, void 0, t.signalType);
995
+ break;
996
+ }
997
+ }, "apply"), te = {
998
+ addActor: qt,
999
+ addMessage: Xe,
1000
+ addSignal: O,
1001
+ addLinks: le,
1002
+ addDetails: ue,
1003
+ addProperties: de,
1004
+ autoWrap: xt,
1005
+ setWrap: i0,
1006
+ enableSequenceNumbers: s0,
1007
+ disableSequenceNumbers: a0,
1008
+ showSequenceNumbers: n0,
1009
+ getMessages: Qe,
1010
+ getActors: $e,
1011
+ getCreatedActors: t0,
1012
+ getDestroyedActors: e0,
1013
+ getActor: _t,
1014
+ getActorKeys: r0,
1015
+ getActorProperty: p0,
1016
+ getAccTitle: Oe,
1017
+ getBoxes: je,
1018
+ getDiagramTitle: Be,
1019
+ setDiagramTitle: Ve,
1020
+ getConfig: /* @__PURE__ */ d(() => at().sequence, "getConfig"),
1021
+ clear: o0,
1022
+ parseMessage: c0,
1023
+ parseBoxData: l0,
1024
+ LINETYPE: wt,
1025
+ ARROWTYPE: d0,
1026
+ PLACEMENT: h0,
1027
+ addNote: ce,
1028
+ setAccTitle: se,
1029
+ apply: pe,
1030
+ setAccDescription: Ye,
1031
+ getAccDescription: Fe,
1032
+ hasAtLeastOneBox: Je,
1033
+ hasAtLeastOneBoxWithTitle: Ze
1034
+ }, f0 = /* @__PURE__ */ d((t) => `.actor {
1035
+ stroke: ${t.actorBorder};
1036
+ fill: ${t.actorBkg};
1037
+ }
1038
+
1039
+ text.actor > tspan {
1040
+ fill: ${t.actorTextColor};
1041
+ stroke: none;
1042
+ }
1043
+
1044
+ .actor-line {
1045
+ stroke: ${t.actorLineColor};
1046
+ }
1047
+
1048
+ .messageLine0 {
1049
+ stroke-width: 1.5;
1050
+ stroke-dasharray: none;
1051
+ stroke: ${t.signalColor};
1052
+ }
1053
+
1054
+ .messageLine1 {
1055
+ stroke-width: 1.5;
1056
+ stroke-dasharray: 2, 2;
1057
+ stroke: ${t.signalColor};
1058
+ }
1059
+
1060
+ #arrowhead path {
1061
+ fill: ${t.signalColor};
1062
+ stroke: ${t.signalColor};
1063
+ }
1064
+
1065
+ .sequenceNumber {
1066
+ fill: ${t.sequenceNumberColor};
1067
+ }
1068
+
1069
+ #sequencenumber {
1070
+ fill: ${t.signalColor};
1071
+ }
1072
+
1073
+ #crosshead path {
1074
+ fill: ${t.signalColor};
1075
+ stroke: ${t.signalColor};
1076
+ }
1077
+
1078
+ .messageText {
1079
+ fill: ${t.signalTextColor};
1080
+ stroke: none;
1081
+ }
1082
+
1083
+ .labelBox {
1084
+ stroke: ${t.labelBoxBorderColor};
1085
+ fill: ${t.labelBoxBkgColor};
1086
+ }
1087
+
1088
+ .labelText, .labelText > tspan {
1089
+ fill: ${t.labelTextColor};
1090
+ stroke: none;
1091
+ }
1092
+
1093
+ .loopText, .loopText > tspan {
1094
+ fill: ${t.loopTextColor};
1095
+ stroke: none;
1096
+ }
1097
+
1098
+ .loopLine {
1099
+ stroke-width: 2px;
1100
+ stroke-dasharray: 2, 2;
1101
+ stroke: ${t.labelBoxBorderColor};
1102
+ fill: ${t.labelBoxBorderColor};
1103
+ }
1104
+
1105
+ .note {
1106
+ //stroke: #decc93;
1107
+ stroke: ${t.noteBorderColor};
1108
+ fill: ${t.noteBkgColor};
1109
+ }
1110
+
1111
+ .noteText, .noteText > tspan {
1112
+ fill: ${t.noteTextColor};
1113
+ stroke: none;
1114
+ }
1115
+
1116
+ .activation0 {
1117
+ fill: ${t.activationBkgColor};
1118
+ stroke: ${t.activationBorderColor};
1119
+ }
1120
+
1121
+ .activation1 {
1122
+ fill: ${t.activationBkgColor};
1123
+ stroke: ${t.activationBorderColor};
1124
+ }
1125
+
1126
+ .activation2 {
1127
+ fill: ${t.activationBkgColor};
1128
+ stroke: ${t.activationBorderColor};
1129
+ }
1130
+
1131
+ .actorPopupMenu {
1132
+ position: absolute;
1133
+ }
1134
+
1135
+ .actorPopupMenuPanel {
1136
+ position: absolute;
1137
+ fill: ${t.actorBkg};
1138
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1139
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1140
+ }
1141
+ .actor-man line {
1142
+ stroke: ${t.actorBorder};
1143
+ fill: ${t.actorBkg};
1144
+ }
1145
+ .actor-man circle, line {
1146
+ stroke: ${t.actorBorder};
1147
+ fill: ${t.actorBkg};
1148
+ stroke-width: 2px;
1149
+ }
1150
+ `, "getStyles"), g0 = f0, gt = 18 * 2, fe = "actor-top", ge = "actor-bottom", x0 = "actor-box", ee = "actor-man", Gt = /* @__PURE__ */ d(function(t, e) {
1151
+ return Se(t, e);
1152
+ }, "drawRect"), T0 = /* @__PURE__ */ d(function(t, e, o, r, a) {
1153
+ if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
1154
+ return { height: 0, width: 0 };
1155
+ const n = e.links, c = e.actorCnt, h = e.rectData;
1156
+ var u = "none";
1157
+ a && (u = "block !important");
1158
+ const s = t.append("g");
1159
+ s.attr("id", "actor" + c + "_popup"), s.attr("class", "actorPopupMenu"), s.attr("display", u);
1160
+ var g = "";
1161
+ h.class !== void 0 && (g = " " + h.class);
1162
+ let E = h.width > o ? h.width : o;
1163
+ const f = s.append("rect");
1164
+ if (f.attr("class", "actorPopupMenuPanel" + g), f.attr("x", h.x), f.attr("y", h.height), f.attr("fill", h.fill), f.attr("stroke", h.stroke), f.attr("width", E), f.attr("height", h.height), f.attr("rx", h.rx), f.attr("ry", h.ry), n != null) {
1165
+ var T = 20;
1166
+ for (let v in n) {
1167
+ var m = s.append("a"), I = ae.sanitizeUrl(n[v]);
1168
+ m.attr("xlink:href", I), m.attr("target", "_blank"), D0(r)(
1169
+ v,
1170
+ m,
1171
+ h.x + 10,
1172
+ h.height + T,
1173
+ E,
1174
+ 20,
1175
+ { class: "actor" },
1176
+ r
1177
+ ), T += 30;
1178
+ }
1179
+ }
1180
+ return f.attr("height", T), { height: h.height + T, width: E };
1181
+ }, "drawPopup"), y0 = /* @__PURE__ */ d(function(t) {
1182
+ return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1183
+ }, "popupMenuToggle"), Nt = /* @__PURE__ */ d(async function(t, e, o = null) {
1184
+ let r = t.append("foreignObject");
1185
+ const a = await ne(e.text, Ft()), c = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();
1186
+ if (r.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), e.class === "noteText") {
1187
+ const h = t.node().firstChild;
1188
+ h.setAttribute("height", c.height + 2 * e.textMargin);
1189
+ const u = h.getBBox();
1190
+ r.attr("x", Math.round(u.x + u.width / 2 - c.width / 2)).attr("y", Math.round(u.y + u.height / 2 - c.height / 2));
1191
+ } else if (o) {
1192
+ let { startx: h, stopx: u, starty: s } = o;
1193
+ if (h > u) {
1194
+ const g = h;
1195
+ h = u, u = g;
1196
+ }
1197
+ r.attr("x", Math.round(h + Math.abs(h - u) / 2 - c.width / 2)), e.class === "loopText" ? r.attr("y", Math.round(s)) : r.attr("y", Math.round(s - c.height));
1198
+ }
1199
+ return [r];
1200
+ }, "drawKatex"), bt = /* @__PURE__ */ d(function(t, e) {
1201
+ let o = 0, r = 0;
1202
+ const a = e.text.split(L.lineBreakRegex), [n, c] = ie(e.fontSize);
1203
+ let h = [], u = 0, s = /* @__PURE__ */ d(() => e.y, "yfunc");
1204
+ if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
1205
+ switch (e.valign) {
1206
+ case "top":
1207
+ case "start":
1208
+ s = /* @__PURE__ */ d(() => Math.round(e.y + e.textMargin), "yfunc");
1209
+ break;
1210
+ case "middle":
1211
+ case "center":
1212
+ s = /* @__PURE__ */ d(() => Math.round(e.y + (o + r + e.textMargin) / 2), "yfunc");
1213
+ break;
1214
+ case "bottom":
1215
+ case "end":
1216
+ s = /* @__PURE__ */ d(() => Math.round(
1217
+ e.y + (o + r + 2 * e.textMargin) - e.textMargin
1218
+ ), "yfunc");
1219
+ break;
1220
+ }
1221
+ if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
1222
+ switch (e.anchor) {
1223
+ case "left":
1224
+ case "start":
1225
+ e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1226
+ break;
1227
+ case "middle":
1228
+ case "center":
1229
+ e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1230
+ break;
1231
+ case "right":
1232
+ case "end":
1233
+ e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1234
+ break;
1235
+ }
1236
+ for (let [g, E] of a.entries()) {
1237
+ e.textMargin !== void 0 && e.textMargin === 0 && n !== void 0 && (u = g * n);
1238
+ const f = t.append("text");
1239
+ f.attr("x", e.x), f.attr("y", s()), e.anchor !== void 0 && f.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && f.style("font-family", e.fontFamily), c !== void 0 && f.style("font-size", c), e.fontWeight !== void 0 && f.style("font-weight", e.fontWeight), e.fill !== void 0 && f.attr("fill", e.fill), e.class !== void 0 && f.attr("class", e.class), e.dy !== void 0 ? f.attr("dy", e.dy) : u !== 0 && f.attr("dy", u);
1240
+ const T = E || He;
1241
+ if (e.tspan) {
1242
+ const m = f.append("tspan");
1243
+ m.attr("x", e.x), e.fill !== void 0 && m.attr("fill", e.fill), m.text(T);
1244
+ } else
1245
+ f.text(T);
1246
+ e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (r += (f._groups || f)[0][0].getBBox().height, o = r), h.push(f);
1247
+ }
1248
+ return h;
1249
+ }, "drawText"), xe = /* @__PURE__ */ d(function(t, e) {
1250
+ function o(a, n, c, h, u) {
1251
+ return a + "," + n + " " + (a + c) + "," + n + " " + (a + c) + "," + (n + h - u) + " " + (a + c - u * 1.2) + "," + (n + h) + " " + a + "," + (n + h);
1252
+ }
1253
+ d(o, "genPoints");
1254
+ const r = t.append("polygon");
1255
+ return r.attr("points", o(e.x, e.y, e.width, e.height, 7)), r.attr("class", "labelBox"), e.y = e.y + e.height / 2, bt(t, e), r;
1256
+ }, "drawLabel"), ct = -1, Te = /* @__PURE__ */ d((t, e, o, r) => {
1257
+ t.select && o.forEach((a) => {
1258
+ const n = e.get(a), c = t.select("#actor" + n.actorCnt);
1259
+ !r.mirrorActors && n.stopy ? c.attr("y2", n.stopy + n.height / 2) : r.mirrorActors && c.attr("y2", n.stopy);
1260
+ });
1261
+ }, "fixLifeLineHeights"), E0 = /* @__PURE__ */ d(function(t, e, o, r) {
1262
+ var T, m;
1263
+ const a = r ? e.stopy : e.starty, n = e.x + e.width / 2, c = a + e.height, h = t.append("g").lower();
1264
+ var u = h;
1265
+ r || (ct++, Object.keys(e.links || {}).length && !o.forceMenus && u.attr("onclick", y0(`actor${ct}_popup`)).attr("cursor", "pointer"), u.append("line").attr("id", "actor" + ct).attr("x1", n).attr("y1", c).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), u = h.append("g"), e.actorCnt = ct, e.links != null && u.attr("id", "root-" + ct));
1266
+ const s = St();
1267
+ var g = "actor";
1268
+ (T = e.properties) != null && T.class ? g = e.properties.class : s.fill = "#eaeaea", r ? g += ` ${ge}` : g += ` ${fe}`, s.x = e.x, s.y = a, s.width = e.width, s.height = e.height, s.class = g, s.rx = 3, s.ry = 3, s.name = e.name;
1269
+ const E = Gt(u, s);
1270
+ if (e.rectData = s, (m = e.properties) != null && m.icon) {
1271
+ const I = e.properties.icon.trim();
1272
+ I.charAt(0) === "@" ? Re(u, s.x + s.width - 20, s.y + 10, I.substr(1)) : De(u, s.x + s.width - 20, s.y + 10, I);
1273
+ }
1274
+ Xt(o, lt(e.description))(
1275
+ e.description,
1276
+ u,
1277
+ s.x,
1278
+ s.y,
1279
+ s.width,
1280
+ s.height,
1281
+ { class: `actor ${x0}` },
1282
+ o
1283
+ );
1284
+ let f = e.height;
1285
+ if (E.node) {
1286
+ const I = E.node().getBBox();
1287
+ e.height = I.height, f = I.height;
1288
+ }
1289
+ return f;
1290
+ }, "drawActorTypeParticipant"), b0 = /* @__PURE__ */ d(function(t, e, o, r) {
1291
+ const a = r ? e.stopy : e.starty, n = e.x + e.width / 2, c = a + 80, h = t.append("g").lower();
1292
+ r || (ct++, h.append("line").attr("id", "actor" + ct).attr("x1", n).attr("y1", c).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), e.actorCnt = ct);
1293
+ const u = t.append("g");
1294
+ let s = ee;
1295
+ r ? s += ` ${ge}` : s += ` ${fe}`, u.attr("class", s), u.attr("name", e.name);
1296
+ const g = St();
1297
+ g.x = e.x, g.y = a, g.fill = "#eaeaea", g.width = e.width, g.height = e.height, g.class = "actor", g.rx = 3, g.ry = 3, u.append("line").attr("id", "actor-man-torso" + ct).attr("x1", n).attr("y1", a + 25).attr("x2", n).attr("y2", a + 45), u.append("line").attr("id", "actor-man-arms" + ct).attr("x1", n - gt / 2).attr("y1", a + 33).attr("x2", n + gt / 2).attr("y2", a + 33), u.append("line").attr("x1", n - gt / 2).attr("y1", a + 60).attr("x2", n).attr("y2", a + 45), u.append("line").attr("x1", n).attr("y1", a + 45).attr("x2", n + gt / 2 - 2).attr("y2", a + 60);
1298
+ const E = u.append("circle");
1299
+ E.attr("cx", e.x + e.width / 2), E.attr("cy", a + 10), E.attr("r", 15), E.attr("width", e.width), E.attr("height", e.height);
1300
+ const f = u.node().getBBox();
1301
+ return e.height = f.height, Xt(o, lt(e.description))(
1302
+ e.description,
1303
+ u,
1304
+ g.x,
1305
+ g.y + 35,
1306
+ g.width,
1307
+ g.height,
1308
+ { class: `actor ${ee}` },
1309
+ o
1310
+ ), e.height;
1311
+ }, "drawActorTypeActor"), m0 = /* @__PURE__ */ d(async function(t, e, o, r) {
1312
+ switch (e.type) {
1313
+ case "actor":
1314
+ return await b0(t, e, o, r);
1315
+ case "participant":
1316
+ return await E0(t, e, o, r);
1317
+ }
1318
+ }, "drawActor"), w0 = /* @__PURE__ */ d(function(t, e, o) {
1319
+ const a = t.append("g");
1320
+ ye(a, e), e.name && Xt(o)(
1321
+ e.name,
1322
+ a,
1323
+ e.x,
1324
+ e.y + (e.textMaxHeight || 0) / 2,
1325
+ e.width,
1326
+ 0,
1327
+ { class: "text" },
1328
+ o
1329
+ ), a.lower();
1330
+ }, "drawBox"), I0 = /* @__PURE__ */ d(function(t) {
1331
+ return t.append("g");
1332
+ }, "anchorElement"), _0 = /* @__PURE__ */ d(function(t, e, o, r, a) {
1333
+ const n = St(), c = e.anchored;
1334
+ n.x = e.startx, n.y = e.starty, n.class = "activation" + a % 3, n.width = e.stopx - e.startx, n.height = o - e.starty, Gt(c, n);
1335
+ }, "drawActivation"), L0 = /* @__PURE__ */ d(async function(t, e, o, r) {
1336
+ const {
1337
+ boxMargin: a,
1338
+ boxTextMargin: n,
1339
+ labelBoxHeight: c,
1340
+ labelBoxWidth: h,
1341
+ messageFontFamily: u,
1342
+ messageFontSize: s,
1343
+ messageFontWeight: g
1344
+ } = r, E = t.append("g"), f = /* @__PURE__ */ d(function(I, v, V, M) {
1345
+ return E.append("line").attr("x1", I).attr("y1", v).attr("x2", V).attr("y2", M).attr("class", "loopLine");
1346
+ }, "drawLoopLine");
1347
+ f(e.startx, e.starty, e.stopx, e.starty), f(e.stopx, e.starty, e.stopx, e.stopy), f(e.startx, e.stopy, e.stopx, e.stopy), f(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(I) {
1348
+ f(e.startx, I.y, e.stopx, I.y).style(
1349
+ "stroke-dasharray",
1350
+ "3, 3"
1351
+ );
1352
+ });
1353
+ let T = Kt();
1354
+ T.text = o, T.x = e.startx, T.y = e.starty, T.fontFamily = u, T.fontSize = s, T.fontWeight = g, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = h || 50, T.height = c || 20, T.textMargin = n, T.class = "labelText", xe(E, T), T = Ee(), T.text = e.title, T.x = e.startx + h / 2 + (e.stopx - e.startx) / 2, T.y = e.starty + a + n, T.anchor = "middle", T.valign = "middle", T.textMargin = n, T.class = "loopText", T.fontFamily = u, T.fontSize = s, T.fontWeight = g, T.wrap = !0;
1355
+ let m = lt(T.text) ? await Nt(E, T, e) : bt(E, T);
1356
+ if (e.sectionTitles !== void 0) {
1357
+ for (const [I, v] of Object.entries(e.sectionTitles))
1358
+ if (v.message) {
1359
+ T.text = v.message, T.x = e.startx + (e.stopx - e.startx) / 2, T.y = e.sections[I].y + a + n, T.class = "loopText", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = u, T.fontSize = s, T.fontWeight = g, T.wrap = e.wrap, lt(T.text) ? (e.starty = e.sections[I].y, await Nt(E, T, e)) : bt(E, T);
1360
+ let V = Math.round(
1361
+ m.map((M) => (M._groups || M)[0][0].getBBox().height).reduce((M, Y) => M + Y)
1362
+ );
1363
+ e.sections[I].height += V - (a + n);
1364
+ }
1365
+ }
1366
+ return e.height = Math.round(e.stopy - e.starty), E;
1367
+ }, "drawLoop"), ye = /* @__PURE__ */ d(function(t, e) {
1368
+ Me(t, e);
1369
+ }, "drawBackgroundRect"), P0 = /* @__PURE__ */ d(function(t) {
1370
+ t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1371
+ "d",
1372
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1373
+ );
1374
+ }, "insertDatabaseIcon"), A0 = /* @__PURE__ */ d(function(t) {
1375
+ t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1376
+ "d",
1377
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1378
+ );
1379
+ }, "insertComputerIcon"), k0 = /* @__PURE__ */ d(function(t) {
1380
+ t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1381
+ "d",
1382
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1383
+ );
1384
+ }, "insertClockIcon"), v0 = /* @__PURE__ */ d(function(t) {
1385
+ t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1386
+ }, "insertArrowHead"), N0 = /* @__PURE__ */ d(function(t) {
1387
+ t.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1388
+ }, "insertArrowFilledHead"), S0 = /* @__PURE__ */ d(function(t) {
1389
+ t.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1390
+ }, "insertSequenceNumber"), M0 = /* @__PURE__ */ d(function(t) {
1391
+ t.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1392
+ }, "insertArrowCrossHead"), Ee = /* @__PURE__ */ d(function() {
1393
+ return {
1394
+ x: 0,
1395
+ y: 0,
1396
+ fill: void 0,
1397
+ anchor: void 0,
1398
+ style: "#666",
1399
+ width: void 0,
1400
+ height: void 0,
1401
+ textMargin: 0,
1402
+ rx: 0,
1403
+ ry: 0,
1404
+ tspan: !0,
1405
+ valign: void 0
1406
+ };
1407
+ }, "getTextObj"), R0 = /* @__PURE__ */ d(function() {
1408
+ return {
1409
+ x: 0,
1410
+ y: 0,
1411
+ fill: "#EDF2AE",
1412
+ stroke: "#666",
1413
+ width: 100,
1414
+ anchor: "start",
1415
+ height: 100,
1416
+ rx: 0,
1417
+ ry: 0
1418
+ };
1419
+ }, "getNoteRect"), Xt = /* @__PURE__ */ function() {
1420
+ function t(n, c, h, u, s, g, E) {
1421
+ const f = c.append("text").attr("x", h + s / 2).attr("y", u + g / 2 + 5).style("text-anchor", "middle").text(n);
1422
+ a(f, E);
1423
+ }
1424
+ d(t, "byText");
1425
+ function e(n, c, h, u, s, g, E, f) {
1426
+ const { actorFontSize: T, actorFontFamily: m, actorFontWeight: I } = f, [v, V] = ie(T), M = n.split(L.lineBreakRegex);
1427
+ for (let Y = 0; Y < M.length; Y++) {
1428
+ const C = Y * v - v * (M.length - 1) / 2, z = c.append("text").attr("x", h + s / 2).attr("y", u).style("text-anchor", "middle").style("font-size", V).style("font-weight", I).style("font-family", m);
1429
+ z.append("tspan").attr("x", h + s / 2).attr("dy", C).text(M[Y]), z.attr("y", u + g / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(z, E);
1430
+ }
1431
+ }
1432
+ d(e, "byTspan");
1433
+ function o(n, c, h, u, s, g, E, f) {
1434
+ const T = c.append("switch"), I = T.append("foreignObject").attr("x", h).attr("y", u).attr("width", s).attr("height", g).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1435
+ I.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), e(n, T, h, u, s, g, E, f), a(I, E);
1436
+ }
1437
+ d(o, "byFo");
1438
+ async function r(n, c, h, u, s, g, E, f) {
1439
+ const T = await It(n, Ft()), m = c.append("switch"), v = m.append("foreignObject").attr("x", h + s / 2 - T.width / 2).attr("y", u + g / 2 - T.height / 2).attr("width", T.width).attr("height", T.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1440
+ v.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ne(n, Ft())), e(n, m, h, u, s, g, E, f), a(v, E);
1441
+ }
1442
+ d(r, "byKatex");
1443
+ function a(n, c) {
1444
+ for (const h in c)
1445
+ c.hasOwnProperty(h) && n.attr(h, c[h]);
1446
+ }
1447
+ return d(a, "_setTextAttrs"), function(n, c = !1) {
1448
+ return c ? r : n.textPlacement === "fo" ? o : n.textPlacement === "old" ? t : e;
1449
+ };
1450
+ }(), D0 = /* @__PURE__ */ function() {
1451
+ function t(a, n, c, h, u, s, g) {
1452
+ const E = n.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(a);
1453
+ r(E, g);
1454
+ }
1455
+ d(t, "byText");
1456
+ function e(a, n, c, h, u, s, g, E) {
1457
+ const { actorFontSize: f, actorFontFamily: T, actorFontWeight: m } = E, I = a.split(L.lineBreakRegex);
1458
+ for (let v = 0; v < I.length; v++) {
1459
+ const V = v * f - f * (I.length - 1) / 2, M = n.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", f).style("font-weight", m).style("font-family", T);
1460
+ M.append("tspan").attr("x", c).attr("dy", V).text(I[v]), M.attr("y", h + s / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(M, g);
1461
+ }
1462
+ }
1463
+ d(e, "byTspan");
1464
+ function o(a, n, c, h, u, s, g, E) {
1465
+ const f = n.append("switch"), m = f.append("foreignObject").attr("x", c).attr("y", h).attr("width", u).attr("height", s).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1466
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(a), e(a, f, c, h, u, s, g, E), r(m, g);
1467
+ }
1468
+ d(o, "byFo");
1469
+ function r(a, n) {
1470
+ for (const c in n)
1471
+ n.hasOwnProperty(c) && a.attr(c, n[c]);
1472
+ }
1473
+ return d(r, "_setTextAttrs"), function(a) {
1474
+ return a.textPlacement === "fo" ? o : a.textPlacement === "old" ? t : e;
1475
+ };
1476
+ }(), B = {
1477
+ drawRect: Gt,
1478
+ drawText: bt,
1479
+ drawLabel: xe,
1480
+ drawActor: m0,
1481
+ drawBox: w0,
1482
+ drawPopup: T0,
1483
+ anchorElement: I0,
1484
+ drawActivation: _0,
1485
+ drawLoop: L0,
1486
+ drawBackgroundRect: ye,
1487
+ insertArrowHead: v0,
1488
+ insertArrowFilledHead: N0,
1489
+ insertSequenceNumber: S0,
1490
+ insertArrowCrossHead: M0,
1491
+ insertDatabaseIcon: P0,
1492
+ insertComputerIcon: A0,
1493
+ insertClockIcon: k0,
1494
+ getTextObj: Ee,
1495
+ getNoteRect: R0,
1496
+ fixLifeLineHeights: Te,
1497
+ sanitizeUrl: ae.sanitizeUrl
1498
+ }, i = {}, x = {
1499
+ data: {
1500
+ startx: void 0,
1501
+ stopx: void 0,
1502
+ starty: void 0,
1503
+ stopy: void 0
1504
+ },
1505
+ verticalPos: 0,
1506
+ sequenceItems: [],
1507
+ activations: [],
1508
+ models: {
1509
+ getHeight: /* @__PURE__ */ d(function() {
1510
+ return Math.max.apply(
1511
+ null,
1512
+ this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
1513
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e));
1514
+ }, "getHeight"),
1515
+ clear: /* @__PURE__ */ d(function() {
1516
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1517
+ }, "clear"),
1518
+ addBox: /* @__PURE__ */ d(function(t) {
1519
+ this.boxes.push(t);
1520
+ }, "addBox"),
1521
+ addActor: /* @__PURE__ */ d(function(t) {
1522
+ this.actors.push(t);
1523
+ }, "addActor"),
1524
+ addLoop: /* @__PURE__ */ d(function(t) {
1525
+ this.loops.push(t);
1526
+ }, "addLoop"),
1527
+ addMessage: /* @__PURE__ */ d(function(t) {
1528
+ this.messages.push(t);
1529
+ }, "addMessage"),
1530
+ addNote: /* @__PURE__ */ d(function(t) {
1531
+ this.notes.push(t);
1532
+ }, "addNote"),
1533
+ lastActor: /* @__PURE__ */ d(function() {
1534
+ return this.actors[this.actors.length - 1];
1535
+ }, "lastActor"),
1536
+ lastLoop: /* @__PURE__ */ d(function() {
1537
+ return this.loops[this.loops.length - 1];
1538
+ }, "lastLoop"),
1539
+ lastMessage: /* @__PURE__ */ d(function() {
1540
+ return this.messages[this.messages.length - 1];
1541
+ }, "lastMessage"),
1542
+ lastNote: /* @__PURE__ */ d(function() {
1543
+ return this.notes[this.notes.length - 1];
1544
+ }, "lastNote"),
1545
+ actors: [],
1546
+ boxes: [],
1547
+ loops: [],
1548
+ messages: [],
1549
+ notes: []
1550
+ },
1551
+ init: /* @__PURE__ */ d(function() {
1552
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1553
+ startx: void 0,
1554
+ stopx: void 0,
1555
+ starty: void 0,
1556
+ stopy: void 0
1557
+ }, this.verticalPos = 0, we(at());
1558
+ }, "init"),
1559
+ updateVal: /* @__PURE__ */ d(function(t, e, o, r) {
1560
+ t[e] === void 0 ? t[e] = o : t[e] = r(o, t[e]);
1561
+ }, "updateVal"),
1562
+ updateBounds: /* @__PURE__ */ d(function(t, e, o, r) {
1563
+ const a = this;
1564
+ let n = 0;
1565
+ function c(h) {
1566
+ return /* @__PURE__ */ d(function(s) {
1567
+ n++;
1568
+ const g = a.sequenceItems.length - n + 1;
1569
+ a.updateVal(s, "starty", e - g * i.boxMargin, Math.min), a.updateVal(s, "stopy", r + g * i.boxMargin, Math.max), a.updateVal(x.data, "startx", t - g * i.boxMargin, Math.min), a.updateVal(x.data, "stopx", o + g * i.boxMargin, Math.max), h !== "activation" && (a.updateVal(s, "startx", t - g * i.boxMargin, Math.min), a.updateVal(s, "stopx", o + g * i.boxMargin, Math.max), a.updateVal(x.data, "starty", e - g * i.boxMargin, Math.min), a.updateVal(x.data, "stopy", r + g * i.boxMargin, Math.max));
1570
+ }, "updateItemBounds");
1571
+ }
1572
+ d(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1573
+ }, "updateBounds"),
1574
+ insert: /* @__PURE__ */ d(function(t, e, o, r) {
1575
+ const a = L.getMin(t, o), n = L.getMax(t, o), c = L.getMin(e, r), h = L.getMax(e, r);
1576
+ this.updateVal(x.data, "startx", a, Math.min), this.updateVal(x.data, "starty", c, Math.min), this.updateVal(x.data, "stopx", n, Math.max), this.updateVal(x.data, "stopy", h, Math.max), this.updateBounds(a, c, n, h);
1577
+ }, "insert"),
1578
+ newActivation: /* @__PURE__ */ d(function(t, e, o) {
1579
+ const r = o.get(t.from), a = Dt(t.from).length || 0, n = r.x + r.width / 2 + (a - 1) * i.activationWidth / 2;
1580
+ this.activations.push({
1581
+ startx: n,
1582
+ starty: this.verticalPos + 2,
1583
+ stopx: n + i.activationWidth,
1584
+ stopy: void 0,
1585
+ actor: t.from,
1586
+ anchored: B.anchorElement(e)
1587
+ });
1588
+ }, "newActivation"),
1589
+ endActivation: /* @__PURE__ */ d(function(t) {
1590
+ const e = this.activations.map(function(o) {
1591
+ return o.actor;
1592
+ }).lastIndexOf(t.from);
1593
+ return this.activations.splice(e, 1)[0];
1594
+ }, "endActivation"),
1595
+ createLoop: /* @__PURE__ */ d(function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1596
+ return {
1597
+ startx: void 0,
1598
+ starty: this.verticalPos,
1599
+ stopx: void 0,
1600
+ stopy: void 0,
1601
+ title: t.message,
1602
+ wrap: t.wrap,
1603
+ width: t.width,
1604
+ height: 0,
1605
+ fill: e
1606
+ };
1607
+ }, "createLoop"),
1608
+ newLoop: /* @__PURE__ */ d(function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1609
+ this.sequenceItems.push(this.createLoop(t, e));
1610
+ }, "newLoop"),
1611
+ endLoop: /* @__PURE__ */ d(function() {
1612
+ return this.sequenceItems.pop();
1613
+ }, "endLoop"),
1614
+ isLoopOverlap: /* @__PURE__ */ d(function() {
1615
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1616
+ }, "isLoopOverlap"),
1617
+ addSectionToLoop: /* @__PURE__ */ d(function(t) {
1618
+ const e = this.sequenceItems.pop();
1619
+ e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: x.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
1620
+ }, "addSectionToLoop"),
1621
+ saveVerticalPos: /* @__PURE__ */ d(function() {
1622
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1623
+ }, "saveVerticalPos"),
1624
+ resetVerticalPos: /* @__PURE__ */ d(function() {
1625
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1626
+ }, "resetVerticalPos"),
1627
+ bumpVerticalPos: /* @__PURE__ */ d(function(t) {
1628
+ this.verticalPos = this.verticalPos + t, this.data.stopy = L.getMax(this.data.stopy, this.verticalPos);
1629
+ }, "bumpVerticalPos"),
1630
+ getVerticalPos: /* @__PURE__ */ d(function() {
1631
+ return this.verticalPos;
1632
+ }, "getVerticalPos"),
1633
+ getBounds: /* @__PURE__ */ d(function() {
1634
+ return { bounds: this.data, models: this.models };
1635
+ }, "getBounds")
1636
+ }, C0 = /* @__PURE__ */ d(async function(t, e) {
1637
+ x.bumpVerticalPos(i.boxMargin), e.height = i.boxMargin, e.starty = x.getVerticalPos();
1638
+ const o = St();
1639
+ o.x = e.startx, o.y = e.starty, o.width = e.width || i.width, o.class = "note";
1640
+ const r = t.append("g"), a = B.drawRect(r, o), n = Kt();
1641
+ n.x = e.startx, n.y = e.starty, n.width = o.width, n.dy = "1em", n.text = e.message, n.class = "noteText", n.fontFamily = i.noteFontFamily, n.fontSize = i.noteFontSize, n.fontWeight = i.noteFontWeight, n.anchor = i.noteAlign, n.textMargin = i.noteMargin, n.valign = "center";
1642
+ const c = lt(n.text) ? await Nt(r, n) : bt(r, n), h = Math.round(
1643
+ c.map((u) => (u._groups || u)[0][0].getBBox().height).reduce((u, s) => u + s)
1644
+ );
1645
+ a.attr("height", h + 2 * i.noteMargin), e.height += h + 2 * i.noteMargin, x.bumpVerticalPos(h + 2 * i.noteMargin), e.stopy = e.starty + h + 2 * i.noteMargin, e.stopx = e.startx + o.width, x.insert(e.startx, e.starty, e.stopx, e.stopy), x.models.addNote(e);
1646
+ }, "drawNote"), Tt = /* @__PURE__ */ d((t) => ({
1647
+ fontFamily: t.messageFontFamily,
1648
+ fontSize: t.messageFontSize,
1649
+ fontWeight: t.messageFontWeight
1650
+ }), "messageFont"), Et = /* @__PURE__ */ d((t) => ({
1651
+ fontFamily: t.noteFontFamily,
1652
+ fontSize: t.noteFontSize,
1653
+ fontWeight: t.noteFontWeight
1654
+ }), "noteFont"), zt = /* @__PURE__ */ d((t) => ({
1655
+ fontFamily: t.actorFontFamily,
1656
+ fontSize: t.actorFontSize,
1657
+ fontWeight: t.actorFontWeight
1658
+ }), "actorFont");
1659
+ async function be(t, e) {
1660
+ x.bumpVerticalPos(10);
1661
+ const { startx: o, stopx: r, message: a } = e, n = L.splitBreaks(a).length, c = lt(a), h = c ? await It(a, at()) : F.calculateTextDimensions(a, Tt(i));
1662
+ if (!c) {
1663
+ const E = h.height / n;
1664
+ e.height += E, x.bumpVerticalPos(E);
1665
+ }
1666
+ let u, s = h.height - 10;
1667
+ const g = h.width;
1668
+ if (o === r) {
1669
+ u = x.getVerticalPos() + s, i.rightAngles || (s += i.boxMargin, u = x.getVerticalPos() + s), s += 30;
1670
+ const E = L.getMax(g / 2, i.width / 2);
1671
+ x.insert(
1672
+ o - E,
1673
+ x.getVerticalPos() - 10 + s,
1674
+ r + E,
1675
+ x.getVerticalPos() + 30 + s
1676
+ );
1677
+ } else
1678
+ s += i.boxMargin, u = x.getVerticalPos() + s, x.insert(o, u - 10, r, u);
1679
+ return x.bumpVerticalPos(s), e.height += s, e.stopy = e.starty + e.height, x.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), u;
1680
+ }
1681
+ d(be, "boundMessage");
1682
+ var O0 = /* @__PURE__ */ d(async function(t, e, o, r) {
1683
+ const { startx: a, stopx: n, starty: c, message: h, type: u, sequenceIndex: s, sequenceVisible: g } = e, E = F.calculateTextDimensions(h, Tt(i)), f = Kt();
1684
+ f.x = a, f.y = c + 10, f.width = n - a, f.class = "messageText", f.dy = "1em", f.text = h, f.fontFamily = i.messageFontFamily, f.fontSize = i.messageFontSize, f.fontWeight = i.messageFontWeight, f.anchor = i.messageAlign, f.valign = "center", f.textMargin = i.wrapPadding, f.tspan = !1, lt(f.text) ? await Nt(t, f, { startx: a, stopx: n, starty: o }) : bt(t, f);
1685
+ const T = E.width;
1686
+ let m;
1687
+ a === n ? i.rightAngles ? m = t.append("path").attr(
1688
+ "d",
1689
+ `M ${a},${o} H ${a + L.getMax(i.width / 2, T / 2)} V ${o + 25} H ${a}`
1690
+ ) : m = t.append("path").attr(
1691
+ "d",
1692
+ "M " + a + "," + o + " C " + (a + 60) + "," + (o - 10) + " " + (a + 60) + "," + (o + 30) + " " + a + "," + (o + 20)
1693
+ ) : (m = t.append("line"), m.attr("x1", a), m.attr("y1", o), m.attr("x2", n), m.attr("y2", o)), u === r.db.LINETYPE.DOTTED || u === r.db.LINETYPE.DOTTED_CROSS || u === r.db.LINETYPE.DOTTED_POINT || u === r.db.LINETYPE.DOTTED_OPEN || u === r.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1694
+ let I = "";
1695
+ i.arrowMarkerAbsolute && (I = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, I = I.replace(/\(/g, "\\("), I = I.replace(/\)/g, "\\)")), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (u === r.db.LINETYPE.SOLID || u === r.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + I + "#arrowhead)"), (u === r.db.LINETYPE.BIDIRECTIONAL_SOLID || u === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + I + "#arrowhead)"), m.attr("marker-end", "url(" + I + "#arrowhead)")), (u === r.db.LINETYPE.SOLID_POINT || u === r.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + I + "#filled-head)"), (u === r.db.LINETYPE.SOLID_CROSS || u === r.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + I + "#crosshead)"), (g || i.showSequenceNumbers) && (m.attr("marker-start", "url(" + I + "#sequencenumber)"), t.append("text").attr("x", a).attr("y", o + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(s));
1696
+ }, "drawMessage"), B0 = /* @__PURE__ */ d(function(t, e, o, r, a, n, c) {
1697
+ let h = 0, u = 0, s, g = 0;
1698
+ for (const E of r) {
1699
+ const f = e.get(E), T = f.box;
1700
+ s && s != T && (c || x.models.addBox(s), u += i.boxMargin + s.margin), T && T != s && (c || (T.x = h + u, T.y = a), u += T.margin), f.width = f.width || i.width, f.height = L.getMax(f.height || i.height, i.height), f.margin = f.margin || i.actorMargin, g = L.getMax(g, f.height), o.get(f.name) && (u += f.width / 2), f.x = h + u, f.starty = x.getVerticalPos(), x.insert(f.x, a, f.x + f.width, f.height), h += f.width + u, f.box && (f.box.width = h + T.margin - f.box.x), u = f.margin, s = f.box, x.models.addActor(f);
1701
+ }
1702
+ s && !c && x.models.addBox(s), x.bumpVerticalPos(g);
1703
+ }, "addActorRenderingData"), Ht = /* @__PURE__ */ d(async function(t, e, o, r) {
1704
+ if (r) {
1705
+ let a = 0;
1706
+ x.bumpVerticalPos(i.boxMargin * 2);
1707
+ for (const n of o) {
1708
+ const c = e.get(n);
1709
+ c.stopy || (c.stopy = x.getVerticalPos());
1710
+ const h = await B.drawActor(t, c, i, !0);
1711
+ a = L.getMax(a, h);
1712
+ }
1713
+ x.bumpVerticalPos(a + i.boxMargin);
1714
+ } else
1715
+ for (const a of o) {
1716
+ const n = e.get(a);
1717
+ await B.drawActor(t, n, i, !1);
1718
+ }
1719
+ }, "drawActors"), me = /* @__PURE__ */ d(function(t, e, o, r) {
1720
+ let a = 0, n = 0;
1721
+ for (const c of o) {
1722
+ const h = e.get(c), u = Y0(h), s = B.drawPopup(
1723
+ t,
1724
+ h,
1725
+ u,
1726
+ i,
1727
+ i.forceMenus,
1728
+ r
1729
+ );
1730
+ s.height > a && (a = s.height), s.width + h.x > n && (n = s.width + h.x);
1731
+ }
1732
+ return { maxHeight: a, maxWidth: n };
1733
+ }, "drawActorsPopup"), we = /* @__PURE__ */ d(function(t) {
1734
+ qe(i, t), t.fontFamily && (i.actorFontFamily = i.noteFontFamily = i.messageFontFamily = t.fontFamily), t.fontSize && (i.actorFontSize = i.noteFontSize = i.messageFontSize = t.fontSize), t.fontWeight && (i.actorFontWeight = i.noteFontWeight = i.messageFontWeight = t.fontWeight);
1735
+ }, "setConf"), Dt = /* @__PURE__ */ d(function(t) {
1736
+ return x.activations.filter(function(e) {
1737
+ return e.actor === t;
1738
+ });
1739
+ }, "actorActivations"), re = /* @__PURE__ */ d(function(t, e) {
1740
+ const o = e.get(t), r = Dt(t), a = r.reduce(
1741
+ function(c, h) {
1742
+ return L.getMin(c, h.startx);
1743
+ },
1744
+ o.x + o.width / 2 - 1
1745
+ ), n = r.reduce(
1746
+ function(c, h) {
1747
+ return L.getMax(c, h.stopx);
1748
+ },
1749
+ o.x + o.width / 2 + 1
1750
+ );
1751
+ return [a, n];
1752
+ }, "activationBounds");
1753
+ function it(t, e, o, r, a) {
1754
+ x.bumpVerticalPos(o);
1755
+ let n = r;
1756
+ if (e.id && e.message && t[e.id]) {
1757
+ const c = t[e.id].width, h = Tt(i);
1758
+ e.message = F.wrapLabel(`[${e.message}]`, c - 2 * i.wrapPadding, h), e.width = c, e.wrap = !0;
1759
+ const u = F.calculateTextDimensions(e.message, h), s = L.getMax(u.height, i.labelBoxHeight);
1760
+ n = r + s, J.debug(`${s} - ${e.message}`);
1761
+ }
1762
+ a(e), x.bumpVerticalPos(n);
1763
+ }
1764
+ d(it, "adjustLoopHeightForWrap");
1765
+ function Ie(t, e, o, r, a, n, c) {
1766
+ function h(s, g) {
1767
+ s.x < a.get(t.from).x ? (x.insert(
1768
+ e.stopx - g,
1769
+ e.starty,
1770
+ e.startx,
1771
+ e.stopy + s.height / 2 + i.noteMargin
1772
+ ), e.stopx = e.stopx + g) : (x.insert(
1773
+ e.startx,
1774
+ e.starty,
1775
+ e.stopx + g,
1776
+ e.stopy + s.height / 2 + i.noteMargin
1777
+ ), e.stopx = e.stopx - g);
1778
+ }
1779
+ d(h, "receiverAdjustment");
1780
+ function u(s, g) {
1781
+ s.x < a.get(t.to).x ? (x.insert(
1782
+ e.startx - g,
1783
+ e.starty,
1784
+ e.stopx,
1785
+ e.stopy + s.height / 2 + i.noteMargin
1786
+ ), e.startx = e.startx + g) : (x.insert(
1787
+ e.stopx,
1788
+ e.starty,
1789
+ e.startx + g,
1790
+ e.stopy + s.height / 2 + i.noteMargin
1791
+ ), e.startx = e.startx - g);
1792
+ }
1793
+ if (d(u, "senderAdjustment"), n.get(t.to) == r) {
1794
+ const s = a.get(t.to), g = s.type == "actor" ? gt / 2 + 3 : s.width / 2 + 3;
1795
+ h(s, g), s.starty = o - s.height / 2, x.bumpVerticalPos(s.height / 2);
1796
+ } else if (c.get(t.from) == r) {
1797
+ const s = a.get(t.from);
1798
+ if (i.mirrorActors) {
1799
+ const g = s.type == "actor" ? gt / 2 : s.width / 2;
1800
+ u(s, g);
1801
+ }
1802
+ s.stopy = o - s.height / 2, x.bumpVerticalPos(s.height / 2);
1803
+ } else if (c.get(t.to) == r) {
1804
+ const s = a.get(t.to);
1805
+ if (i.mirrorActors) {
1806
+ const g = s.type == "actor" ? gt / 2 + 3 : s.width / 2 + 3;
1807
+ h(s, g);
1808
+ }
1809
+ s.stopy = o - s.height / 2, x.bumpVerticalPos(s.height / 2);
1810
+ }
1811
+ }
1812
+ d(Ie, "adjustCreatedDestroyedData");
1813
+ var V0 = /* @__PURE__ */ d(async function(t, e, o, r) {
1814
+ const { securityLevel: a, sequence: n } = at();
1815
+ i = n;
1816
+ let c;
1817
+ a === "sandbox" && (c = vt("#i" + e));
1818
+ const h = a === "sandbox" ? vt(c.nodes()[0].contentDocument.body) : vt("body"), u = a === "sandbox" ? c.nodes()[0].contentDocument : document;
1819
+ x.init(), J.debug(r.db);
1820
+ const s = a === "sandbox" ? h.select(`[id="${e}"]`) : vt(`[id="${e}"]`), g = r.db.getActors(), E = r.db.getCreatedActors(), f = r.db.getDestroyedActors(), T = r.db.getBoxes();
1821
+ let m = r.db.getActorKeys();
1822
+ const I = r.db.getMessages(), v = r.db.getDiagramTitle(), V = r.db.hasAtLeastOneBox(), M = r.db.hasAtLeastOneBoxWithTitle(), Y = await _e(g, I, r);
1823
+ if (i.height = await Le(g, Y, T), B.insertComputerIcon(s), B.insertDatabaseIcon(s), B.insertClockIcon(s), V && (x.bumpVerticalPos(i.boxMargin), M && x.bumpVerticalPos(T[0].textMaxHeight)), i.hideUnusedParticipants === !0) {
1824
+ const y = /* @__PURE__ */ new Set();
1825
+ I.forEach((A) => {
1826
+ y.add(A.from), y.add(A.to);
1827
+ }), m = m.filter((A) => y.has(A));
1828
+ }
1829
+ B0(s, g, E, m, 0, I, !1);
1830
+ const C = await q0(I, g, Y, r);
1831
+ B.insertArrowHead(s), B.insertArrowCrossHead(s), B.insertArrowFilledHead(s), B.insertSequenceNumber(s);
1832
+ function z(y, A) {
1833
+ const $ = x.endActivation(y);
1834
+ $.starty + 18 > A && ($.starty = A - 6, A += 12), B.drawActivation(
1835
+ s,
1836
+ $,
1837
+ A,
1838
+ i,
1839
+ Dt(y.from).length
1840
+ ), x.insert($.startx, A - 10, $.stopx, A);
1841
+ }
1842
+ d(z, "activeEnd");
1843
+ let H = 1, Z = 1;
1844
+ const et = [], K = [];
1845
+ let U = 0;
1846
+ for (const y of I) {
1847
+ let A, $, nt;
1848
+ switch (y.type) {
1849
+ case r.db.LINETYPE.NOTE:
1850
+ x.resetVerticalPos(), $ = y.noteModel, await C0(s, $);
1851
+ break;
1852
+ case r.db.LINETYPE.ACTIVE_START:
1853
+ x.newActivation(y, s, g);
1854
+ break;
1855
+ case r.db.LINETYPE.ACTIVE_END:
1856
+ z(y, x.getVerticalPos());
1857
+ break;
1858
+ case r.db.LINETYPE.LOOP_START:
1859
+ it(
1860
+ C,
1861
+ y,
1862
+ i.boxMargin,
1863
+ i.boxMargin + i.boxTextMargin,
1864
+ (N) => x.newLoop(N)
1865
+ );
1866
+ break;
1867
+ case r.db.LINETYPE.LOOP_END:
1868
+ A = x.endLoop(), await B.drawLoop(s, A, "loop", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1869
+ break;
1870
+ case r.db.LINETYPE.RECT_START:
1871
+ it(
1872
+ C,
1873
+ y,
1874
+ i.boxMargin,
1875
+ i.boxMargin,
1876
+ (N) => x.newLoop(void 0, N.message)
1877
+ );
1878
+ break;
1879
+ case r.db.LINETYPE.RECT_END:
1880
+ A = x.endLoop(), K.push(A), x.models.addLoop(A), x.bumpVerticalPos(A.stopy - x.getVerticalPos());
1881
+ break;
1882
+ case r.db.LINETYPE.OPT_START:
1883
+ it(
1884
+ C,
1885
+ y,
1886
+ i.boxMargin,
1887
+ i.boxMargin + i.boxTextMargin,
1888
+ (N) => x.newLoop(N)
1889
+ );
1890
+ break;
1891
+ case r.db.LINETYPE.OPT_END:
1892
+ A = x.endLoop(), await B.drawLoop(s, A, "opt", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1893
+ break;
1894
+ case r.db.LINETYPE.ALT_START:
1895
+ it(
1896
+ C,
1897
+ y,
1898
+ i.boxMargin,
1899
+ i.boxMargin + i.boxTextMargin,
1900
+ (N) => x.newLoop(N)
1901
+ );
1902
+ break;
1903
+ case r.db.LINETYPE.ALT_ELSE:
1904
+ it(
1905
+ C,
1906
+ y,
1907
+ i.boxMargin + i.boxTextMargin,
1908
+ i.boxMargin,
1909
+ (N) => x.addSectionToLoop(N)
1910
+ );
1911
+ break;
1912
+ case r.db.LINETYPE.ALT_END:
1913
+ A = x.endLoop(), await B.drawLoop(s, A, "alt", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1914
+ break;
1915
+ case r.db.LINETYPE.PAR_START:
1916
+ case r.db.LINETYPE.PAR_OVER_START:
1917
+ it(
1918
+ C,
1919
+ y,
1920
+ i.boxMargin,
1921
+ i.boxMargin + i.boxTextMargin,
1922
+ (N) => x.newLoop(N)
1923
+ ), x.saveVerticalPos();
1924
+ break;
1925
+ case r.db.LINETYPE.PAR_AND:
1926
+ it(
1927
+ C,
1928
+ y,
1929
+ i.boxMargin + i.boxTextMargin,
1930
+ i.boxMargin,
1931
+ (N) => x.addSectionToLoop(N)
1932
+ );
1933
+ break;
1934
+ case r.db.LINETYPE.PAR_END:
1935
+ A = x.endLoop(), await B.drawLoop(s, A, "par", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1936
+ break;
1937
+ case r.db.LINETYPE.AUTONUMBER:
1938
+ H = y.message.start || H, Z = y.message.step || Z, y.message.visible ? r.db.enableSequenceNumbers() : r.db.disableSequenceNumbers();
1939
+ break;
1940
+ case r.db.LINETYPE.CRITICAL_START:
1941
+ it(
1942
+ C,
1943
+ y,
1944
+ i.boxMargin,
1945
+ i.boxMargin + i.boxTextMargin,
1946
+ (N) => x.newLoop(N)
1947
+ );
1948
+ break;
1949
+ case r.db.LINETYPE.CRITICAL_OPTION:
1950
+ it(
1951
+ C,
1952
+ y,
1953
+ i.boxMargin + i.boxTextMargin,
1954
+ i.boxMargin,
1955
+ (N) => x.addSectionToLoop(N)
1956
+ );
1957
+ break;
1958
+ case r.db.LINETYPE.CRITICAL_END:
1959
+ A = x.endLoop(), await B.drawLoop(s, A, "critical", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1960
+ break;
1961
+ case r.db.LINETYPE.BREAK_START:
1962
+ it(
1963
+ C,
1964
+ y,
1965
+ i.boxMargin,
1966
+ i.boxMargin + i.boxTextMargin,
1967
+ (N) => x.newLoop(N)
1968
+ );
1969
+ break;
1970
+ case r.db.LINETYPE.BREAK_END:
1971
+ A = x.endLoop(), await B.drawLoop(s, A, "break", i), x.bumpVerticalPos(A.stopy - x.getVerticalPos()), x.models.addLoop(A);
1972
+ break;
1973
+ default:
1974
+ try {
1975
+ nt = y.msgModel, nt.starty = x.getVerticalPos(), nt.sequenceIndex = H, nt.sequenceVisible = r.db.showSequenceNumbers();
1976
+ const N = await be(s, nt);
1977
+ Ie(
1978
+ y,
1979
+ nt,
1980
+ N,
1981
+ U,
1982
+ g,
1983
+ E,
1984
+ f
1985
+ ), et.push({ messageModel: nt, lineStartY: N }), x.models.addMessage(nt);
1986
+ } catch (N) {
1987
+ J.error("error while drawing message", N);
1988
+ }
1989
+ }
1990
+ [
1991
+ r.db.LINETYPE.SOLID_OPEN,
1992
+ r.db.LINETYPE.DOTTED_OPEN,
1993
+ r.db.LINETYPE.SOLID,
1994
+ r.db.LINETYPE.DOTTED,
1995
+ r.db.LINETYPE.SOLID_CROSS,
1996
+ r.db.LINETYPE.DOTTED_CROSS,
1997
+ r.db.LINETYPE.SOLID_POINT,
1998
+ r.db.LINETYPE.DOTTED_POINT,
1999
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
2000
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED
2001
+ ].includes(y.type) && (H = H + Z), U++;
2002
+ }
2003
+ J.debug("createdActors", E), J.debug("destroyedActors", f), await Ht(s, g, m, !1);
2004
+ for (const y of et)
2005
+ await O0(s, y.messageModel, y.lineStartY, r);
2006
+ i.mirrorActors && await Ht(s, g, m, !0), K.forEach((y) => B.drawBackgroundRect(s, y)), Te(s, g, m, i);
2007
+ for (const y of x.models.boxes)
2008
+ y.height = x.getVerticalPos() - y.y, x.insert(y.x, y.y, y.x + y.width, y.height), y.startx = y.x, y.starty = y.y, y.stopx = y.startx + y.width, y.stopy = y.starty + y.height, y.stroke = "rgb(0,0,0, 0.5)", B.drawBox(s, y, i);
2009
+ V && x.bumpVerticalPos(i.boxMargin);
2010
+ const q = me(s, g, m, u), { bounds: R } = x.getBounds();
2011
+ R.startx === void 0 && (R.startx = 0), R.starty === void 0 && (R.starty = 0), R.stopx === void 0 && (R.stopx = 0), R.stopy === void 0 && (R.stopy = 0);
2012
+ let Q = R.stopy - R.starty;
2013
+ Q < q.maxHeight && (Q = q.maxHeight);
2014
+ let G = Q + 2 * i.diagramMarginY;
2015
+ i.mirrorActors && (G = G - i.boxMargin + i.bottomMarginAdj);
2016
+ let j = R.stopx - R.startx;
2017
+ j < q.maxWidth && (j = q.maxWidth);
2018
+ const rt = j + 2 * i.diagramMarginX;
2019
+ v && s.append("text").text(v).attr("x", (R.stopx - R.startx) / 2 - 2 * i.diagramMarginX).attr("y", -25), ze(s, G, rt, i.useMaxWidth);
2020
+ const S = v ? 40 : 0;
2021
+ s.attr(
2022
+ "viewBox",
2023
+ R.startx - i.diagramMarginX + " -" + (i.diagramMarginY + S) + " " + rt + " " + (G + S)
2024
+ ), J.debug("models:", x.models);
2025
+ }, "draw");
2026
+ async function _e(t, e, o) {
2027
+ const r = {};
2028
+ for (const a of e)
2029
+ if (t.get(a.to) && t.get(a.from)) {
2030
+ const n = t.get(a.to);
2031
+ if (a.placement === o.db.PLACEMENT.LEFTOF && !n.prevActor || a.placement === o.db.PLACEMENT.RIGHTOF && !n.nextActor)
2032
+ continue;
2033
+ const c = a.placement !== void 0, h = !c, u = c ? Et(i) : Tt(i), s = a.wrap ? F.wrapLabel(a.message, i.width - 2 * i.wrapPadding, u) : a.message, E = (lt(s) ? await It(a.message, at()) : F.calculateTextDimensions(s, u)).width + 2 * i.wrapPadding;
2034
+ h && a.from === n.nextActor ? r[a.to] = L.getMax(
2035
+ r[a.to] || 0,
2036
+ E
2037
+ ) : h && a.from === n.prevActor ? r[a.from] = L.getMax(
2038
+ r[a.from] || 0,
2039
+ E
2040
+ ) : h && a.from === a.to ? (r[a.from] = L.getMax(
2041
+ r[a.from] || 0,
2042
+ E / 2
2043
+ ), r[a.to] = L.getMax(
2044
+ r[a.to] || 0,
2045
+ E / 2
2046
+ )) : a.placement === o.db.PLACEMENT.RIGHTOF ? r[a.from] = L.getMax(
2047
+ r[a.from] || 0,
2048
+ E
2049
+ ) : a.placement === o.db.PLACEMENT.LEFTOF ? r[n.prevActor] = L.getMax(
2050
+ r[n.prevActor] || 0,
2051
+ E
2052
+ ) : a.placement === o.db.PLACEMENT.OVER && (n.prevActor && (r[n.prevActor] = L.getMax(
2053
+ r[n.prevActor] || 0,
2054
+ E / 2
2055
+ )), n.nextActor && (r[a.from] = L.getMax(
2056
+ r[a.from] || 0,
2057
+ E / 2
2058
+ )));
2059
+ }
2060
+ return J.debug("maxMessageWidthPerActor:", r), r;
2061
+ }
2062
+ d(_e, "getMaxMessageWidthPerActor");
2063
+ var Y0 = /* @__PURE__ */ d(function(t) {
2064
+ let e = 0;
2065
+ const o = zt(i);
2066
+ for (const r in t.links) {
2067
+ const n = F.calculateTextDimensions(r, o).width + 2 * i.wrapPadding + 2 * i.boxMargin;
2068
+ e < n && (e = n);
2069
+ }
2070
+ return e;
2071
+ }, "getRequiredPopupWidth");
2072
+ async function Le(t, e, o) {
2073
+ let r = 0;
2074
+ for (const n of t.keys()) {
2075
+ const c = t.get(n);
2076
+ c.wrap && (c.description = F.wrapLabel(
2077
+ c.description,
2078
+ i.width - 2 * i.wrapPadding,
2079
+ zt(i)
2080
+ ));
2081
+ const h = lt(c.description) ? await It(c.description, at()) : F.calculateTextDimensions(c.description, zt(i));
2082
+ c.width = c.wrap ? i.width : L.getMax(i.width, h.width + 2 * i.wrapPadding), c.height = c.wrap ? L.getMax(h.height, i.height) : i.height, r = L.getMax(r, c.height);
2083
+ }
2084
+ for (const n in e) {
2085
+ const c = t.get(n);
2086
+ if (!c)
2087
+ continue;
2088
+ const h = t.get(c.nextActor);
2089
+ if (!h) {
2090
+ const E = e[n] + i.actorMargin - c.width / 2;
2091
+ c.margin = L.getMax(E, i.actorMargin);
2092
+ continue;
2093
+ }
2094
+ const s = e[n] + i.actorMargin - c.width / 2 - h.width / 2;
2095
+ c.margin = L.getMax(s, i.actorMargin);
2096
+ }
2097
+ let a = 0;
2098
+ return o.forEach((n) => {
2099
+ const c = Tt(i);
2100
+ let h = n.actorKeys.reduce((g, E) => g += t.get(E).width + (t.get(E).margin || 0), 0);
2101
+ h -= 2 * i.boxTextMargin, n.wrap && (n.name = F.wrapLabel(n.name, h - 2 * i.wrapPadding, c));
2102
+ const u = F.calculateTextDimensions(n.name, c);
2103
+ a = L.getMax(u.height, a);
2104
+ const s = L.getMax(h, u.width + 2 * i.wrapPadding);
2105
+ if (n.margin = i.boxTextMargin, h < s) {
2106
+ const g = (s - h) / 2;
2107
+ n.margin += g;
2108
+ }
2109
+ }), o.forEach((n) => n.textMaxHeight = a), L.getMax(r, i.height);
2110
+ }
2111
+ d(Le, "calculateActorMargins");
2112
+ var F0 = /* @__PURE__ */ d(async function(t, e, o) {
2113
+ const r = e.get(t.from), a = e.get(t.to), n = r.x, c = a.x, h = t.wrap && t.message;
2114
+ let u = lt(t.message) ? await It(t.message, at()) : F.calculateTextDimensions(
2115
+ h ? F.wrapLabel(t.message, i.width, Et(i)) : t.message,
2116
+ Et(i)
2117
+ );
2118
+ const s = {
2119
+ width: h ? i.width : L.getMax(i.width, u.width + 2 * i.noteMargin),
2120
+ height: 0,
2121
+ startx: r.x,
2122
+ stopx: 0,
2123
+ starty: 0,
2124
+ stopy: 0,
2125
+ message: t.message
2126
+ };
2127
+ return t.placement === o.db.PLACEMENT.RIGHTOF ? (s.width = h ? L.getMax(i.width, u.width) : L.getMax(
2128
+ r.width / 2 + a.width / 2,
2129
+ u.width + 2 * i.noteMargin
2130
+ ), s.startx = n + (r.width + i.actorMargin) / 2) : t.placement === o.db.PLACEMENT.LEFTOF ? (s.width = h ? L.getMax(i.width, u.width + 2 * i.noteMargin) : L.getMax(
2131
+ r.width / 2 + a.width / 2,
2132
+ u.width + 2 * i.noteMargin
2133
+ ), s.startx = n - s.width + (r.width - i.actorMargin) / 2) : t.to === t.from ? (u = F.calculateTextDimensions(
2134
+ h ? F.wrapLabel(t.message, L.getMax(i.width, r.width), Et(i)) : t.message,
2135
+ Et(i)
2136
+ ), s.width = h ? L.getMax(i.width, r.width) : L.getMax(r.width, i.width, u.width + 2 * i.noteMargin), s.startx = n + (r.width - s.width) / 2) : (s.width = Math.abs(n + r.width / 2 - (c + a.width / 2)) + i.actorMargin, s.startx = n < c ? n + r.width / 2 - i.actorMargin / 2 : c + a.width / 2 - i.actorMargin / 2), h && (s.message = F.wrapLabel(
2137
+ t.message,
2138
+ s.width - 2 * i.wrapPadding,
2139
+ Et(i)
2140
+ )), J.debug(
2141
+ `NM:[${s.startx},${s.stopx},${s.starty},${s.stopy}:${s.width},${s.height}=${t.message}]`
2142
+ ), s;
2143
+ }, "buildNoteModel"), W0 = /* @__PURE__ */ d(function(t, e, o) {
2144
+ if (![
2145
+ o.db.LINETYPE.SOLID_OPEN,
2146
+ o.db.LINETYPE.DOTTED_OPEN,
2147
+ o.db.LINETYPE.SOLID,
2148
+ o.db.LINETYPE.DOTTED,
2149
+ o.db.LINETYPE.SOLID_CROSS,
2150
+ o.db.LINETYPE.DOTTED_CROSS,
2151
+ o.db.LINETYPE.SOLID_POINT,
2152
+ o.db.LINETYPE.DOTTED_POINT,
2153
+ o.db.LINETYPE.BIDIRECTIONAL_SOLID,
2154
+ o.db.LINETYPE.BIDIRECTIONAL_DOTTED
2155
+ ].includes(t.type))
2156
+ return {};
2157
+ const [r, a] = re(t.from, e), [n, c] = re(t.to, e), h = r <= n;
2158
+ let u = h ? a : r, s = h ? n : c;
2159
+ const g = Math.abs(n - c) > 2, E = /* @__PURE__ */ d((I) => h ? -I : I, "adjustValue");
2160
+ t.from === t.to ? s = u : (t.activate && !g && (s += E(i.activationWidth / 2 - 1)), [o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (s += E(3)), [o.db.LINETYPE.BIDIRECTIONAL_SOLID, o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2161
+ t.type
2162
+ ) && (u -= E(3)));
2163
+ const f = [r, a, n, c], T = Math.abs(u - s);
2164
+ t.wrap && t.message && (t.message = F.wrapLabel(
2165
+ t.message,
2166
+ L.getMax(T + 2 * i.wrapPadding, i.width),
2167
+ Tt(i)
2168
+ ));
2169
+ const m = F.calculateTextDimensions(t.message, Tt(i));
2170
+ return {
2171
+ width: L.getMax(
2172
+ t.wrap ? 0 : m.width + 2 * i.wrapPadding,
2173
+ T + 2 * i.wrapPadding,
2174
+ i.width
2175
+ ),
2176
+ height: 0,
2177
+ startx: u,
2178
+ stopx: s,
2179
+ starty: 0,
2180
+ stopy: 0,
2181
+ message: t.message,
2182
+ type: t.type,
2183
+ wrap: t.wrap,
2184
+ fromBounds: Math.min.apply(null, f),
2185
+ toBounds: Math.max.apply(null, f)
2186
+ };
2187
+ }, "buildMessageModel"), q0 = /* @__PURE__ */ d(async function(t, e, o, r) {
2188
+ const a = {}, n = [];
2189
+ let c, h, u;
2190
+ for (const s of t) {
2191
+ switch (s.id = F.random({ length: 10 }), s.type) {
2192
+ case r.db.LINETYPE.LOOP_START:
2193
+ case r.db.LINETYPE.ALT_START:
2194
+ case r.db.LINETYPE.OPT_START:
2195
+ case r.db.LINETYPE.PAR_START:
2196
+ case r.db.LINETYPE.PAR_OVER_START:
2197
+ case r.db.LINETYPE.CRITICAL_START:
2198
+ case r.db.LINETYPE.BREAK_START:
2199
+ n.push({
2200
+ id: s.id,
2201
+ msg: s.message,
2202
+ from: Number.MAX_SAFE_INTEGER,
2203
+ to: Number.MIN_SAFE_INTEGER,
2204
+ width: 0
2205
+ });
2206
+ break;
2207
+ case r.db.LINETYPE.ALT_ELSE:
2208
+ case r.db.LINETYPE.PAR_AND:
2209
+ case r.db.LINETYPE.CRITICAL_OPTION:
2210
+ s.message && (c = n.pop(), a[c.id] = c, a[s.id] = c, n.push(c));
2211
+ break;
2212
+ case r.db.LINETYPE.LOOP_END:
2213
+ case r.db.LINETYPE.ALT_END:
2214
+ case r.db.LINETYPE.OPT_END:
2215
+ case r.db.LINETYPE.PAR_END:
2216
+ case r.db.LINETYPE.CRITICAL_END:
2217
+ case r.db.LINETYPE.BREAK_END:
2218
+ c = n.pop(), a[c.id] = c;
2219
+ break;
2220
+ case r.db.LINETYPE.ACTIVE_START:
2221
+ {
2222
+ const E = e.get(s.from ? s.from : s.to.actor), f = Dt(s.from ? s.from : s.to.actor).length, T = E.x + E.width / 2 + (f - 1) * i.activationWidth / 2, m = {
2223
+ startx: T,
2224
+ stopx: T + i.activationWidth,
2225
+ actor: s.from,
2226
+ enabled: !0
2227
+ };
2228
+ x.activations.push(m);
2229
+ }
2230
+ break;
2231
+ case r.db.LINETYPE.ACTIVE_END:
2232
+ {
2233
+ const E = x.activations.map((f) => f.actor).lastIndexOf(s.from);
2234
+ x.activations.splice(E, 1).splice(0, 1);
2235
+ }
2236
+ break;
2237
+ }
2238
+ s.placement !== void 0 ? (h = await F0(s, e, r), s.noteModel = h, n.forEach((E) => {
2239
+ c = E, c.from = L.getMin(c.from, h.startx), c.to = L.getMax(c.to, h.startx + h.width), c.width = L.getMax(c.width, Math.abs(c.from - c.to)) - i.labelBoxWidth;
2240
+ })) : (u = W0(s, e, r), s.msgModel = u, u.startx && u.stopx && n.length > 0 && n.forEach((E) => {
2241
+ if (c = E, u.startx === u.stopx) {
2242
+ const f = e.get(s.from), T = e.get(s.to);
2243
+ c.from = L.getMin(
2244
+ f.x - u.width / 2,
2245
+ f.x - f.width / 2,
2246
+ c.from
2247
+ ), c.to = L.getMax(
2248
+ T.x + u.width / 2,
2249
+ T.x + f.width / 2,
2250
+ c.to
2251
+ ), c.width = L.getMax(c.width, Math.abs(c.to - c.from)) - i.labelBoxWidth;
2252
+ } else
2253
+ c.from = L.getMin(u.startx, c.from), c.to = L.getMax(u.stopx, c.to), c.width = L.getMax(c.width, u.width) - i.labelBoxWidth;
2254
+ }));
2255
+ }
2256
+ return x.activations = [], J.debug("Loop type widths:", a), a;
2257
+ }, "calculateLoopBounds"), z0 = {
2258
+ bounds: x,
2259
+ drawActors: Ht,
2260
+ drawActorsPopup: me,
2261
+ setConf: we,
2262
+ draw: V0
2263
+ }, G0 = {
2264
+ parser: Ke,
2265
+ db: te,
2266
+ renderer: z0,
2267
+ styles: g0,
2268
+ init: /* @__PURE__ */ d(({ wrap: t }) => {
2269
+ te.setWrap(t);
2270
+ }, "init")
2271
+ };
2272
+ export {
2273
+ G0 as diagram
2274
+ };