@zjlab-frontier/markdown 1.0.4
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.
- package/README.md +148 -0
- package/dist/Tableau10-D7jGxypv.mjs +8 -0
- package/dist/arc-BkFOiLi7.mjs +84 -0
- package/dist/array-CqVTtuYm.mjs +6 -0
- package/dist/blockDiagram-c4efeb88-CngVNufX.mjs +1221 -0
- package/dist/c4Diagram-c83219d4-CvSWXhSV.mjs +1579 -0
- package/dist/channel-BCTzeqLo.mjs +5 -0
- package/dist/classDiagram-beda092f-8UkpWDgI.mjs +218 -0
- package/dist/classDiagram-v2-2358418a-D3LsBhTm.mjs +200 -0
- package/dist/clone-DZgGXtyK.mjs +8 -0
- package/dist/createText-1719965b-DMv-Bu7A.mjs +155 -0
- package/dist/edges-96097737-BeVwLt3S.mjs +1088 -0
- package/dist/erDiagram-0228fc6a-GXXkRZ8r.mjs +929 -0
- package/dist/flowDb-c6c81e3f-CrOg5i55.mjs +1126 -0
- package/dist/flowDiagram-50d868cf-sXe_oFAW.mjs +788 -0
- package/dist/flowDiagram-v2-4f6560a1-CoKYvZkH.mjs +17 -0
- package/dist/flowchart-elk-definition-6af322e1-SuvGsuBl.mjs +48146 -0
- package/dist/ganttDiagram-a2739b55-BbWq9bqY.mjs +2477 -0
- package/dist/gitGraphDiagram-82fe8481-C6-e4UmK.mjs +1264 -0
- package/dist/graph-CoIGCRFf.mjs +847 -0
- package/dist/index-5325376f-BENBY8aO.mjs +373 -0
- package/dist/index-5_ujiRGo.mjs +46276 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +8 -0
- package/dist/index.umd.js +2421 -0
- package/dist/infoDiagram-8eee0895-BEAb2pCD.mjs +319 -0
- package/dist/init-DjUOC4st.mjs +16 -0
- package/dist/journeyDiagram-c64418c1-CERjyYnA.mjs +801 -0
- package/dist/layout-aCAVHR2T.mjs +1472 -0
- package/dist/line-BGunMwE-.mjs +33 -0
- package/dist/linear-DciWi0hE.mjs +423 -0
- package/dist/markdown.d.ts +25 -0
- package/dist/mindmap-definition-8da855dc-Cc8_U7zD.mjs +21936 -0
- package/dist/ordinal-C0oynhte.mjs +61 -0
- package/dist/path-DLwuMfdd.mjs +84 -0
- package/dist/pieDiagram-a8764435-B00hy7Ez.mjs +500 -0
- package/dist/quadrantDiagram-1e28029f-DR7IGAoM.mjs +903 -0
- package/dist/requirementDiagram-08caed73-o6N3X3-m.mjs +767 -0
- package/dist/sankeyDiagram-a04cb91d-CYF9Ro1W.mjs +802 -0
- package/dist/sequenceDiagram-c5b8d532-vz_R7xBU.mjs +2234 -0
- package/dist/stateDiagram-1ecb1508-B0YUHnuE.mjs +266 -0
- package/dist/stateDiagram-v2-c2b004d7-CDTm1Jfb.mjs +184 -0
- package/dist/styles/highlight.scss +115 -0
- package/dist/styles/markdown.scss +1163 -0
- package/dist/styles-b4e223ce-C_-huVuQ.mjs +1089 -0
- package/dist/styles-ca3715f6-soe07Bnw.mjs +960 -0
- package/dist/styles-d45a18b0-0ZXwJp5P.mjs +436 -0
- package/dist/svgDrawCommon-b86b1483-UCLksviB.mjs +64 -0
- package/dist/timeline-definition-faaaa080-Dt5unv7p.mjs +792 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/xychartDiagram-f5964ef8-BZWS0E_9.mjs +1282 -0
- package/package.json +66 -0
|
@@ -0,0 +1,2234 @@
|
|
|
1
|
+
import { a as we, s as ve, c as $t, g as st, D as _e, C as ke, b as Pe, d as Lt, l as X, j as te, e as Le, f as Ie, k as v, i as At, E as Ae, B, a3 as nt, a4 as wt, W as ee, a5 as Ne, t as se, Z as Bt } from "./index-5_ujiRGo.mjs";
|
|
2
|
+
import { a as Se, b as zt, d as Me, g as Nt, c as Re, e as Ce } from "./svgDrawCommon-b86b1483-UCLksviB.mjs";
|
|
3
|
+
var Yt = (function() {
|
|
4
|
+
var t = function(dt, w, k, L) {
|
|
5
|
+
for (k = k || {}, L = dt.length; L--; k[dt[L]] = w)
|
|
6
|
+
;
|
|
7
|
+
return k;
|
|
8
|
+
}, e = [1, 2], o = [1, 3], s = [1, 4], i = [2, 4], a = [1, 9], c = [1, 11], l = [1, 13], p = [1, 14], r = [1, 16], x = [1, 17], T = [1, 18], u = [1, 24], g = [1, 25], m = [1, 26], _ = [1, 27], I = [1, 28], V = [1, 29], S = [1, 30], O = [1, 31], R = [1, 32], q = [1, 33], z = [1, 34], J = [1, 35], $ = [1, 36], H = [1, 37], U = [1, 38], F = [1, 39], W = [1, 41], Z = [1, 42], K = [1, 43], Q = [1, 44], tt = [1, 45], N = [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], P = [4, 5, 16, 50, 52, 53], j = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], rt = [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], A = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], Gt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], ht = [68, 69, 70], ot = [1, 120], Mt = {
|
|
9
|
+
trace: function() {
|
|
10
|
+
},
|
|
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, DOTTED_ARROW: 74, SOLID_CROSS: 75, DOTTED_CROSS: 76, SOLID_POINT: 77, DOTTED_POINT: 78, TXT: 79, $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: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "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], [56, 1]],
|
|
15
|
+
performAction: function(w, k, L, b, M, h, Et) {
|
|
16
|
+
var d = h.length - 1;
|
|
17
|
+
switch (M) {
|
|
18
|
+
case 3:
|
|
19
|
+
return b.apply(h[d]), h[d];
|
|
20
|
+
case 4:
|
|
21
|
+
case 9:
|
|
22
|
+
this.$ = [];
|
|
23
|
+
break;
|
|
24
|
+
case 5:
|
|
25
|
+
case 10:
|
|
26
|
+
h[d - 1].push(h[d]), this.$ = h[d - 1];
|
|
27
|
+
break;
|
|
28
|
+
case 6:
|
|
29
|
+
case 7:
|
|
30
|
+
case 11:
|
|
31
|
+
case 12:
|
|
32
|
+
this.$ = h[d];
|
|
33
|
+
break;
|
|
34
|
+
case 8:
|
|
35
|
+
case 13:
|
|
36
|
+
this.$ = [];
|
|
37
|
+
break;
|
|
38
|
+
case 15:
|
|
39
|
+
h[d].type = "createParticipant", this.$ = h[d];
|
|
40
|
+
break;
|
|
41
|
+
case 16:
|
|
42
|
+
h[d - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(h[d - 2]) }), h[d - 1].push({ type: "boxEnd", boxText: h[d - 2] }), this.$ = h[d - 1];
|
|
43
|
+
break;
|
|
44
|
+
case 18:
|
|
45
|
+
this.$ = { type: "sequenceIndex", sequenceIndex: Number(h[d - 2]), sequenceIndexStep: Number(h[d - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
|
|
46
|
+
break;
|
|
47
|
+
case 19:
|
|
48
|
+
this.$ = { type: "sequenceIndex", sequenceIndex: Number(h[d - 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: h[d - 1] };
|
|
58
|
+
break;
|
|
59
|
+
case 23:
|
|
60
|
+
this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: h[d - 1] };
|
|
61
|
+
break;
|
|
62
|
+
case 29:
|
|
63
|
+
b.setDiagramTitle(h[d].substring(6)), this.$ = h[d].substring(6);
|
|
64
|
+
break;
|
|
65
|
+
case 30:
|
|
66
|
+
b.setDiagramTitle(h[d].substring(7)), this.$ = h[d].substring(7);
|
|
67
|
+
break;
|
|
68
|
+
case 31:
|
|
69
|
+
this.$ = h[d].trim(), b.setAccTitle(this.$);
|
|
70
|
+
break;
|
|
71
|
+
case 32:
|
|
72
|
+
case 33:
|
|
73
|
+
this.$ = h[d].trim(), b.setAccDescription(this.$);
|
|
74
|
+
break;
|
|
75
|
+
case 34:
|
|
76
|
+
h[d - 1].unshift({ type: "loopStart", loopText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.LOOP_START }), h[d - 1].push({ type: "loopEnd", loopText: h[d - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = h[d - 1];
|
|
77
|
+
break;
|
|
78
|
+
case 35:
|
|
79
|
+
h[d - 1].unshift({ type: "rectStart", color: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.RECT_START }), h[d - 1].push({ type: "rectEnd", color: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = h[d - 1];
|
|
80
|
+
break;
|
|
81
|
+
case 36:
|
|
82
|
+
h[d - 1].unshift({ type: "optStart", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.OPT_START }), h[d - 1].push({ type: "optEnd", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = h[d - 1];
|
|
83
|
+
break;
|
|
84
|
+
case 37:
|
|
85
|
+
h[d - 1].unshift({ type: "altStart", altText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.ALT_START }), h[d - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = h[d - 1];
|
|
86
|
+
break;
|
|
87
|
+
case 38:
|
|
88
|
+
h[d - 1].unshift({ type: "parStart", parText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.PAR_START }), h[d - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = h[d - 1];
|
|
89
|
+
break;
|
|
90
|
+
case 39:
|
|
91
|
+
h[d - 1].unshift({ type: "parStart", parText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.PAR_OVER_START }), h[d - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = h[d - 1];
|
|
92
|
+
break;
|
|
93
|
+
case 40:
|
|
94
|
+
h[d - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.CRITICAL_START }), h[d - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = h[d - 1];
|
|
95
|
+
break;
|
|
96
|
+
case 41:
|
|
97
|
+
h[d - 1].unshift({ type: "breakStart", breakText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.BREAK_START }), h[d - 1].push({ type: "breakEnd", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = h[d - 1];
|
|
98
|
+
break;
|
|
99
|
+
case 43:
|
|
100
|
+
this.$ = h[d - 3].concat([{ type: "option", optionText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, h[d]]);
|
|
101
|
+
break;
|
|
102
|
+
case 45:
|
|
103
|
+
this.$ = h[d - 3].concat([{ type: "and", parText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.PAR_AND }, h[d]]);
|
|
104
|
+
break;
|
|
105
|
+
case 47:
|
|
106
|
+
this.$ = h[d - 3].concat([{ type: "else", altText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.ALT_ELSE }, h[d]]);
|
|
107
|
+
break;
|
|
108
|
+
case 48:
|
|
109
|
+
h[d - 3].draw = "participant", h[d - 3].type = "addParticipant", h[d - 3].description = b.parseMessage(h[d - 1]), this.$ = h[d - 3];
|
|
110
|
+
break;
|
|
111
|
+
case 49:
|
|
112
|
+
h[d - 1].draw = "participant", h[d - 1].type = "addParticipant", this.$ = h[d - 1];
|
|
113
|
+
break;
|
|
114
|
+
case 50:
|
|
115
|
+
h[d - 3].draw = "actor", h[d - 3].type = "addParticipant", h[d - 3].description = b.parseMessage(h[d - 1]), this.$ = h[d - 3];
|
|
116
|
+
break;
|
|
117
|
+
case 51:
|
|
118
|
+
h[d - 1].draw = "actor", h[d - 1].type = "addParticipant", this.$ = h[d - 1];
|
|
119
|
+
break;
|
|
120
|
+
case 52:
|
|
121
|
+
h[d - 1].type = "destroyParticipant", this.$ = h[d - 1];
|
|
122
|
+
break;
|
|
123
|
+
case 53:
|
|
124
|
+
this.$ = [h[d - 1], { type: "addNote", placement: h[d - 2], actor: h[d - 1].actor, text: h[d] }];
|
|
125
|
+
break;
|
|
126
|
+
case 54:
|
|
127
|
+
h[d - 2] = [].concat(h[d - 1], h[d - 1]).slice(0, 2), h[d - 2][0] = h[d - 2][0].actor, h[d - 2][1] = h[d - 2][1].actor, this.$ = [h[d - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: h[d - 2].slice(0, 2), text: h[d] }];
|
|
128
|
+
break;
|
|
129
|
+
case 55:
|
|
130
|
+
this.$ = [h[d - 1], { type: "addLinks", actor: h[d - 1].actor, text: h[d] }];
|
|
131
|
+
break;
|
|
132
|
+
case 56:
|
|
133
|
+
this.$ = [h[d - 1], { type: "addALink", actor: h[d - 1].actor, text: h[d] }];
|
|
134
|
+
break;
|
|
135
|
+
case 57:
|
|
136
|
+
this.$ = [h[d - 1], { type: "addProperties", actor: h[d - 1].actor, text: h[d] }];
|
|
137
|
+
break;
|
|
138
|
+
case 58:
|
|
139
|
+
this.$ = [h[d - 1], { type: "addDetails", actor: h[d - 1].actor, text: h[d] }];
|
|
140
|
+
break;
|
|
141
|
+
case 61:
|
|
142
|
+
this.$ = [h[d - 2], h[d]];
|
|
143
|
+
break;
|
|
144
|
+
case 62:
|
|
145
|
+
this.$ = h[d];
|
|
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
|
+
h[d - 4],
|
|
156
|
+
h[d - 1],
|
|
157
|
+
{ type: "addMessage", from: h[d - 4].actor, to: h[d - 1].actor, signalType: h[d - 3], msg: h[d], activate: !0 },
|
|
158
|
+
{ type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: h[d - 1] }
|
|
159
|
+
];
|
|
160
|
+
break;
|
|
161
|
+
case 66:
|
|
162
|
+
this.$ = [
|
|
163
|
+
h[d - 4],
|
|
164
|
+
h[d - 1],
|
|
165
|
+
{ type: "addMessage", from: h[d - 4].actor, to: h[d - 1].actor, signalType: h[d - 3], msg: h[d] },
|
|
166
|
+
{ type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: h[d - 4] }
|
|
167
|
+
];
|
|
168
|
+
break;
|
|
169
|
+
case 67:
|
|
170
|
+
this.$ = [h[d - 3], h[d - 1], { type: "addMessage", from: h[d - 3].actor, to: h[d - 1].actor, signalType: h[d - 2], msg: h[d] }];
|
|
171
|
+
break;
|
|
172
|
+
case 68:
|
|
173
|
+
this.$ = { type: "addParticipant", actor: h[d] };
|
|
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.DOTTED;
|
|
186
|
+
break;
|
|
187
|
+
case 73:
|
|
188
|
+
this.$ = b.LINETYPE.SOLID_CROSS;
|
|
189
|
+
break;
|
|
190
|
+
case 74:
|
|
191
|
+
this.$ = b.LINETYPE.DOTTED_CROSS;
|
|
192
|
+
break;
|
|
193
|
+
case 75:
|
|
194
|
+
this.$ = b.LINETYPE.SOLID_POINT;
|
|
195
|
+
break;
|
|
196
|
+
case 76:
|
|
197
|
+
this.$ = b.LINETYPE.DOTTED_POINT;
|
|
198
|
+
break;
|
|
199
|
+
case 77:
|
|
200
|
+
this.$ = b.parseMessage(h[d].trim().substring(1));
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
table: [{ 3: 1, 4: e, 5: o, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: o, 6: s }, { 3: 6, 4: e, 5: o, 6: s }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, t(y, [2, 5]), { 9: 47, 12: 12, 13: l, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 14]), { 12: 48, 50: H, 52: U, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: N }, { 22: 55, 70: N }, { 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: N }, { 22: 72, 70: N }, { 22: 73, 70: N }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: N }, { 22: 88, 70: N }, { 22: 89, 70: N }, { 22: 90, 70: N }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), t(y, [2, 6]), t(y, [2, 15]), t(P, [2, 9], { 10: 91 }), t(y, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, t(y, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, t(y, [2, 24]), t(y, [2, 25]), t(y, [2, 26]), t(y, [2, 27]), t(y, [2, 28]), t(y, [2, 31]), t(y, [2, 32]), t(j, i, { 7: 97 }), t(j, i, { 7: 98 }), t(j, i, { 7: 99 }), t(rt, i, { 40: 100, 7: 101 }), t(A, i, { 42: 102, 7: 103 }), t(A, i, { 7: 103, 42: 104 }), t(Gt, i, { 45: 105, 7: 106 }), t(j, i, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: N }, t(ht, [2, 69]), t(ht, [2, 70]), t(ht, [2, 71]), t(ht, [2, 72]), t(ht, [2, 73]), t(ht, [2, 74]), t(ht, [2, 75]), t(ht, [2, 76]), { 22: 116, 70: N }, { 22: 118, 58: 117, 70: N }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: ot }, { 56: 121, 79: ot }, { 56: 122, 79: ot }, { 56: 123, 79: ot }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: H, 52: U, 53: F }, { 5: [1, 129] }, t(y, [2, 19]), t(y, [2, 20]), t(y, [2, 22]), t(y, [2, 23]), { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 130], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 131], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 132], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 16: [1, 133] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 46], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 49: [1, 134], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 16: [1, 135] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 44], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 48: [1, 136], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 42], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 47: [1, 139], 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 140], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: U, 53: F, 54: W, 59: Z, 60: K, 61: Q, 62: tt, 70: N }, { 15: [1, 141] }, t(y, [2, 49]), { 15: [1, 142] }, t(y, [2, 51]), t(y, [2, 52]), { 22: 143, 70: N }, { 22: 144, 70: N }, { 56: 145, 79: ot }, { 56: 146, 79: ot }, { 56: 147, 79: ot }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(y, [2, 16]), t(P, [2, 10]), { 12: 149, 50: H, 52: U, 53: F }, t(P, [2, 12]), t(P, [2, 13]), t(y, [2, 18]), t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), { 15: [1, 150] }, t(y, [2, 38]), { 15: [1, 151] }, t(y, [2, 39]), t(y, [2, 40]), { 15: [1, 152] }, t(y, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: ot }, { 56: 156, 79: ot }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: N }, t(P, [2, 11]), t(rt, i, { 7: 101, 40: 158 }), t(A, i, { 7: 103, 42: 159 }), t(Gt, i, { 7: 106, 45: 160 }), t(y, [2, 48]), t(y, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
|
|
205
|
+
defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] },
|
|
206
|
+
parseError: function(w, k) {
|
|
207
|
+
if (k.recoverable)
|
|
208
|
+
this.trace(w);
|
|
209
|
+
else {
|
|
210
|
+
var L = new Error(w);
|
|
211
|
+
throw L.hash = k, L;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
parse: function(w) {
|
|
215
|
+
var k = this, L = [0], b = [], M = [null], h = [], Et = this.table, d = "", _t = 0, Xt = 0, Te = 2, Jt = 1, be = h.slice.call(arguments, 1), Y = Object.create(this.lexer), pt = { yy: {} };
|
|
216
|
+
for (var Ct in this.yy)
|
|
217
|
+
Object.prototype.hasOwnProperty.call(this.yy, Ct) && (pt.yy[Ct] = this.yy[Ct]);
|
|
218
|
+
Y.setInput(w, pt.yy), pt.yy.lexer = Y, pt.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
|
|
219
|
+
var Dt = Y.yylloc;
|
|
220
|
+
h.push(Dt);
|
|
221
|
+
var Ee = Y.options && Y.options.ranges;
|
|
222
|
+
typeof pt.yy.parseError == "function" ? this.parseError = pt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
223
|
+
function me() {
|
|
224
|
+
var lt;
|
|
225
|
+
return lt = b.pop() || Y.lex() || Jt, typeof lt != "number" && (lt instanceof Array && (b = lt, lt = b.pop()), lt = k.symbols_[lt] || lt), lt;
|
|
226
|
+
}
|
|
227
|
+
for (var G, ut, et, Vt, yt = {}, kt, ct, Zt, Pt; ; ) {
|
|
228
|
+
if (ut = L[L.length - 1], this.defaultActions[ut] ? et = this.defaultActions[ut] : ((G === null || typeof G > "u") && (G = me()), et = Et[ut] && Et[ut][G]), typeof et > "u" || !et.length || !et[0]) {
|
|
229
|
+
var Ot = "";
|
|
230
|
+
Pt = [];
|
|
231
|
+
for (kt in Et[ut])
|
|
232
|
+
this.terminals_[kt] && kt > Te && Pt.push("'" + this.terminals_[kt] + "'");
|
|
233
|
+
Y.showPosition ? Ot = "Parse error on line " + (_t + 1) + `:
|
|
234
|
+
` + Y.showPosition() + `
|
|
235
|
+
Expecting ` + Pt.join(", ") + ", got '" + (this.terminals_[G] || G) + "'" : Ot = "Parse error on line " + (_t + 1) + ": Unexpected " + (G == Jt ? "end of input" : "'" + (this.terminals_[G] || G) + "'"), this.parseError(Ot, {
|
|
236
|
+
text: Y.match,
|
|
237
|
+
token: this.terminals_[G] || G,
|
|
238
|
+
line: Y.yylineno,
|
|
239
|
+
loc: Dt,
|
|
240
|
+
expected: Pt
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (et[0] instanceof Array && et.length > 1)
|
|
244
|
+
throw new Error("Parse Error: multiple actions possible at state: " + ut + ", token: " + G);
|
|
245
|
+
switch (et[0]) {
|
|
246
|
+
case 1:
|
|
247
|
+
L.push(G), M.push(Y.yytext), h.push(Y.yylloc), L.push(et[1]), G = null, Xt = Y.yyleng, d = Y.yytext, _t = Y.yylineno, Dt = Y.yylloc;
|
|
248
|
+
break;
|
|
249
|
+
case 2:
|
|
250
|
+
if (ct = this.productions_[et[1]][1], yt.$ = M[M.length - ct], yt._$ = {
|
|
251
|
+
first_line: h[h.length - (ct || 1)].first_line,
|
|
252
|
+
last_line: h[h.length - 1].last_line,
|
|
253
|
+
first_column: h[h.length - (ct || 1)].first_column,
|
|
254
|
+
last_column: h[h.length - 1].last_column
|
|
255
|
+
}, Ee && (yt._$.range = [
|
|
256
|
+
h[h.length - (ct || 1)].range[0],
|
|
257
|
+
h[h.length - 1].range[1]
|
|
258
|
+
]), Vt = this.performAction.apply(yt, [
|
|
259
|
+
d,
|
|
260
|
+
Xt,
|
|
261
|
+
_t,
|
|
262
|
+
pt.yy,
|
|
263
|
+
et[1],
|
|
264
|
+
M,
|
|
265
|
+
h
|
|
266
|
+
].concat(be)), typeof Vt < "u")
|
|
267
|
+
return Vt;
|
|
268
|
+
ct && (L = L.slice(0, -1 * ct * 2), M = M.slice(0, -1 * ct), h = h.slice(0, -1 * ct)), L.push(this.productions_[et[1]][0]), M.push(yt.$), h.push(yt._$), Zt = Et[L[L.length - 2]][L[L.length - 1]], L.push(Zt);
|
|
269
|
+
break;
|
|
270
|
+
case 3:
|
|
271
|
+
return !0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return !0;
|
|
275
|
+
}
|
|
276
|
+
}, ye = /* @__PURE__ */ (function() {
|
|
277
|
+
var dt = {
|
|
278
|
+
EOF: 1,
|
|
279
|
+
parseError: function(k, L) {
|
|
280
|
+
if (this.yy.parser)
|
|
281
|
+
this.yy.parser.parseError(k, L);
|
|
282
|
+
else
|
|
283
|
+
throw new Error(k);
|
|
284
|
+
},
|
|
285
|
+
// resets the lexer, sets new input
|
|
286
|
+
setInput: function(w, k) {
|
|
287
|
+
return this.yy = k || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
288
|
+
first_line: 1,
|
|
289
|
+
first_column: 0,
|
|
290
|
+
last_line: 1,
|
|
291
|
+
last_column: 0
|
|
292
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
293
|
+
},
|
|
294
|
+
// consumes and returns one char from the input
|
|
295
|
+
input: function() {
|
|
296
|
+
var w = this._input[0];
|
|
297
|
+
this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
|
|
298
|
+
var k = w.match(/(?:\r\n?|\n).*/g);
|
|
299
|
+
return k ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
|
|
300
|
+
},
|
|
301
|
+
// unshifts one char (or a string) into the input
|
|
302
|
+
unput: function(w) {
|
|
303
|
+
var k = w.length, L = w.split(/(?:\r\n?|\n)/g);
|
|
304
|
+
this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - k), this.offset -= k;
|
|
305
|
+
var b = this.match.split(/(?:\r\n?|\n)/g);
|
|
306
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
|
|
307
|
+
var M = this.yylloc.range;
|
|
308
|
+
return this.yylloc = {
|
|
309
|
+
first_line: this.yylloc.first_line,
|
|
310
|
+
last_line: this.yylineno + 1,
|
|
311
|
+
first_column: this.yylloc.first_column,
|
|
312
|
+
last_column: L ? (L.length === b.length ? this.yylloc.first_column : 0) + b[b.length - L.length].length - L[0].length : this.yylloc.first_column - k
|
|
313
|
+
}, this.options.ranges && (this.yylloc.range = [M[0], M[0] + this.yyleng - k]), this.yyleng = this.yytext.length, this;
|
|
314
|
+
},
|
|
315
|
+
// When called from action, caches matched text and appends it on next action
|
|
316
|
+
more: function() {
|
|
317
|
+
return this._more = !0, this;
|
|
318
|
+
},
|
|
319
|
+
// 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.
|
|
320
|
+
reject: function() {
|
|
321
|
+
if (this.options.backtrack_lexer)
|
|
322
|
+
this._backtrack = !0;
|
|
323
|
+
else
|
|
324
|
+
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).
|
|
325
|
+
` + this.showPosition(), {
|
|
326
|
+
text: "",
|
|
327
|
+
token: null,
|
|
328
|
+
line: this.yylineno
|
|
329
|
+
});
|
|
330
|
+
return this;
|
|
331
|
+
},
|
|
332
|
+
// retain first n characters of the match
|
|
333
|
+
less: function(w) {
|
|
334
|
+
this.unput(this.match.slice(w));
|
|
335
|
+
},
|
|
336
|
+
// displays already matched input, i.e. for error messages
|
|
337
|
+
pastInput: function() {
|
|
338
|
+
var w = this.matched.substr(0, this.matched.length - this.match.length);
|
|
339
|
+
return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
|
|
340
|
+
},
|
|
341
|
+
// displays upcoming input, i.e. for error messages
|
|
342
|
+
upcomingInput: function() {
|
|
343
|
+
var w = this.match;
|
|
344
|
+
return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
345
|
+
},
|
|
346
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
347
|
+
showPosition: function() {
|
|
348
|
+
var w = this.pastInput(), k = new Array(w.length + 1).join("-");
|
|
349
|
+
return w + this.upcomingInput() + `
|
|
350
|
+
` + k + "^";
|
|
351
|
+
},
|
|
352
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
353
|
+
test_match: function(w, k) {
|
|
354
|
+
var L, b, M;
|
|
355
|
+
if (this.options.backtrack_lexer && (M = {
|
|
356
|
+
yylineno: this.yylineno,
|
|
357
|
+
yylloc: {
|
|
358
|
+
first_line: this.yylloc.first_line,
|
|
359
|
+
last_line: this.last_line,
|
|
360
|
+
first_column: this.yylloc.first_column,
|
|
361
|
+
last_column: this.yylloc.last_column
|
|
362
|
+
},
|
|
363
|
+
yytext: this.yytext,
|
|
364
|
+
match: this.match,
|
|
365
|
+
matches: this.matches,
|
|
366
|
+
matched: this.matched,
|
|
367
|
+
yyleng: this.yyleng,
|
|
368
|
+
offset: this.offset,
|
|
369
|
+
_more: this._more,
|
|
370
|
+
_input: this._input,
|
|
371
|
+
yy: this.yy,
|
|
372
|
+
conditionStack: this.conditionStack.slice(0),
|
|
373
|
+
done: this.done
|
|
374
|
+
}, this.options.ranges && (M.yylloc.range = this.yylloc.range.slice(0))), b = w[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
|
|
375
|
+
first_line: this.yylloc.last_line,
|
|
376
|
+
last_line: this.yylineno + 1,
|
|
377
|
+
first_column: this.yylloc.last_column,
|
|
378
|
+
last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length
|
|
379
|
+
}, this.yytext += w[0], this.match += w[0], this.matches = w, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(w[0].length), this.matched += w[0], L = this.performAction.call(this, this.yy, this, k, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L)
|
|
380
|
+
return L;
|
|
381
|
+
if (this._backtrack) {
|
|
382
|
+
for (var h in M)
|
|
383
|
+
this[h] = M[h];
|
|
384
|
+
return !1;
|
|
385
|
+
}
|
|
386
|
+
return !1;
|
|
387
|
+
},
|
|
388
|
+
// return next match in input
|
|
389
|
+
next: function() {
|
|
390
|
+
if (this.done)
|
|
391
|
+
return this.EOF;
|
|
392
|
+
this._input || (this.done = !0);
|
|
393
|
+
var w, k, L, b;
|
|
394
|
+
this._more || (this.yytext = "", this.match = "");
|
|
395
|
+
for (var M = this._currentRules(), h = 0; h < M.length; h++)
|
|
396
|
+
if (L = this._input.match(this.rules[M[h]]), L && (!k || L[0].length > k[0].length)) {
|
|
397
|
+
if (k = L, b = h, this.options.backtrack_lexer) {
|
|
398
|
+
if (w = this.test_match(L, M[h]), w !== !1)
|
|
399
|
+
return w;
|
|
400
|
+
if (this._backtrack) {
|
|
401
|
+
k = !1;
|
|
402
|
+
continue;
|
|
403
|
+
} else
|
|
404
|
+
return !1;
|
|
405
|
+
} else if (!this.options.flex)
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
return k ? (w = this.test_match(k, M[b]), w !== !1 ? w : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
409
|
+
` + this.showPosition(), {
|
|
410
|
+
text: "",
|
|
411
|
+
token: null,
|
|
412
|
+
line: this.yylineno
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
// return next match that has a token
|
|
416
|
+
lex: function() {
|
|
417
|
+
var k = this.next();
|
|
418
|
+
return k || this.lex();
|
|
419
|
+
},
|
|
420
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
421
|
+
begin: function(k) {
|
|
422
|
+
this.conditionStack.push(k);
|
|
423
|
+
},
|
|
424
|
+
// pop the previously active lexer condition state off the condition stack
|
|
425
|
+
popState: function() {
|
|
426
|
+
var k = this.conditionStack.length - 1;
|
|
427
|
+
return k > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
428
|
+
},
|
|
429
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
430
|
+
_currentRules: function() {
|
|
431
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
432
|
+
},
|
|
433
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
434
|
+
topState: function(k) {
|
|
435
|
+
return k = this.conditionStack.length - 1 - Math.abs(k || 0), k >= 0 ? this.conditionStack[k] : "INITIAL";
|
|
436
|
+
},
|
|
437
|
+
// alias for begin(condition)
|
|
438
|
+
pushState: function(k) {
|
|
439
|
+
this.begin(k);
|
|
440
|
+
},
|
|
441
|
+
// return the number of states currently on the stack
|
|
442
|
+
stateStackSize: function() {
|
|
443
|
+
return this.conditionStack.length;
|
|
444
|
+
},
|
|
445
|
+
options: { "case-insensitive": !0 },
|
|
446
|
+
performAction: function(k, L, b, M) {
|
|
447
|
+
switch (b) {
|
|
448
|
+
case 0:
|
|
449
|
+
return 5;
|
|
450
|
+
case 1:
|
|
451
|
+
break;
|
|
452
|
+
case 2:
|
|
453
|
+
break;
|
|
454
|
+
case 3:
|
|
455
|
+
break;
|
|
456
|
+
case 4:
|
|
457
|
+
break;
|
|
458
|
+
case 5:
|
|
459
|
+
break;
|
|
460
|
+
case 6:
|
|
461
|
+
return 19;
|
|
462
|
+
case 7:
|
|
463
|
+
return this.begin("LINE"), 14;
|
|
464
|
+
case 8:
|
|
465
|
+
return this.begin("ID"), 50;
|
|
466
|
+
case 9:
|
|
467
|
+
return this.begin("ID"), 52;
|
|
468
|
+
case 10:
|
|
469
|
+
return 13;
|
|
470
|
+
case 11:
|
|
471
|
+
return this.begin("ID"), 53;
|
|
472
|
+
case 12:
|
|
473
|
+
return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 70;
|
|
474
|
+
case 13:
|
|
475
|
+
return this.popState(), this.popState(), this.begin("LINE"), 51;
|
|
476
|
+
case 14:
|
|
477
|
+
return this.popState(), this.popState(), 5;
|
|
478
|
+
case 15:
|
|
479
|
+
return this.begin("LINE"), 36;
|
|
480
|
+
case 16:
|
|
481
|
+
return this.begin("LINE"), 37;
|
|
482
|
+
case 17:
|
|
483
|
+
return this.begin("LINE"), 38;
|
|
484
|
+
case 18:
|
|
485
|
+
return this.begin("LINE"), 39;
|
|
486
|
+
case 19:
|
|
487
|
+
return this.begin("LINE"), 49;
|
|
488
|
+
case 20:
|
|
489
|
+
return this.begin("LINE"), 41;
|
|
490
|
+
case 21:
|
|
491
|
+
return this.begin("LINE"), 43;
|
|
492
|
+
case 22:
|
|
493
|
+
return this.begin("LINE"), 48;
|
|
494
|
+
case 23:
|
|
495
|
+
return this.begin("LINE"), 44;
|
|
496
|
+
case 24:
|
|
497
|
+
return this.begin("LINE"), 47;
|
|
498
|
+
case 25:
|
|
499
|
+
return this.begin("LINE"), 46;
|
|
500
|
+
case 26:
|
|
501
|
+
return this.popState(), 15;
|
|
502
|
+
case 27:
|
|
503
|
+
return 16;
|
|
504
|
+
case 28:
|
|
505
|
+
return 65;
|
|
506
|
+
case 29:
|
|
507
|
+
return 66;
|
|
508
|
+
case 30:
|
|
509
|
+
return 59;
|
|
510
|
+
case 31:
|
|
511
|
+
return 60;
|
|
512
|
+
case 32:
|
|
513
|
+
return 61;
|
|
514
|
+
case 33:
|
|
515
|
+
return 62;
|
|
516
|
+
case 34:
|
|
517
|
+
return 57;
|
|
518
|
+
case 35:
|
|
519
|
+
return 54;
|
|
520
|
+
case 36:
|
|
521
|
+
return this.begin("ID"), 21;
|
|
522
|
+
case 37:
|
|
523
|
+
return this.begin("ID"), 23;
|
|
524
|
+
case 38:
|
|
525
|
+
return 29;
|
|
526
|
+
case 39:
|
|
527
|
+
return 30;
|
|
528
|
+
case 40:
|
|
529
|
+
return this.begin("acc_title"), 31;
|
|
530
|
+
case 41:
|
|
531
|
+
return this.popState(), "acc_title_value";
|
|
532
|
+
case 42:
|
|
533
|
+
return this.begin("acc_descr"), 33;
|
|
534
|
+
case 43:
|
|
535
|
+
return this.popState(), "acc_descr_value";
|
|
536
|
+
case 44:
|
|
537
|
+
this.begin("acc_descr_multiline");
|
|
538
|
+
break;
|
|
539
|
+
case 45:
|
|
540
|
+
this.popState();
|
|
541
|
+
break;
|
|
542
|
+
case 46:
|
|
543
|
+
return "acc_descr_multiline_value";
|
|
544
|
+
case 47:
|
|
545
|
+
return 6;
|
|
546
|
+
case 48:
|
|
547
|
+
return 18;
|
|
548
|
+
case 49:
|
|
549
|
+
return 20;
|
|
550
|
+
case 50:
|
|
551
|
+
return 64;
|
|
552
|
+
case 51:
|
|
553
|
+
return 5;
|
|
554
|
+
case 52:
|
|
555
|
+
return L.yytext = L.yytext.trim(), 70;
|
|
556
|
+
case 53:
|
|
557
|
+
return 73;
|
|
558
|
+
case 54:
|
|
559
|
+
return 74;
|
|
560
|
+
case 55:
|
|
561
|
+
return 71;
|
|
562
|
+
case 56:
|
|
563
|
+
return 72;
|
|
564
|
+
case 57:
|
|
565
|
+
return 75;
|
|
566
|
+
case 58:
|
|
567
|
+
return 76;
|
|
568
|
+
case 59:
|
|
569
|
+
return 77;
|
|
570
|
+
case 60:
|
|
571
|
+
return 78;
|
|
572
|
+
case 61:
|
|
573
|
+
return 79;
|
|
574
|
+
case 62:
|
|
575
|
+
return 68;
|
|
576
|
+
case 63:
|
|
577
|
+
return 69;
|
|
578
|
+
case 64:
|
|
579
|
+
return 5;
|
|
580
|
+
case 65:
|
|
581
|
+
return "INVALID";
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
|
|
585
|
+
conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], inclusive: !0 } }
|
|
586
|
+
};
|
|
587
|
+
return dt;
|
|
588
|
+
})();
|
|
589
|
+
Mt.lexer = ye;
|
|
590
|
+
function Rt() {
|
|
591
|
+
this.yy = {};
|
|
592
|
+
}
|
|
593
|
+
return Rt.prototype = Mt, Mt.Parser = Rt, new Rt();
|
|
594
|
+
})();
|
|
595
|
+
Yt.parser = Yt;
|
|
596
|
+
const De = Yt;
|
|
597
|
+
class Ve {
|
|
598
|
+
/**
|
|
599
|
+
* @param init - Function that creates the default state.
|
|
600
|
+
*/
|
|
601
|
+
constructor(e) {
|
|
602
|
+
this.init = e, this.records = this.init();
|
|
603
|
+
}
|
|
604
|
+
reset() {
|
|
605
|
+
this.records = this.init();
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
const E = new Ve(() => ({
|
|
609
|
+
prevActor: void 0,
|
|
610
|
+
actors: {},
|
|
611
|
+
createdActors: {},
|
|
612
|
+
destroyedActors: {},
|
|
613
|
+
boxes: [],
|
|
614
|
+
messages: [],
|
|
615
|
+
notes: [],
|
|
616
|
+
sequenceNumbersEnabled: !1,
|
|
617
|
+
wrapEnabled: void 0,
|
|
618
|
+
currentBox: void 0,
|
|
619
|
+
lastCreated: void 0,
|
|
620
|
+
lastDestroyed: void 0
|
|
621
|
+
})), Oe = function(t) {
|
|
622
|
+
E.records.boxes.push({
|
|
623
|
+
name: t.text,
|
|
624
|
+
wrap: t.wrap === void 0 && gt() || !!t.wrap,
|
|
625
|
+
fill: t.color,
|
|
626
|
+
actorKeys: []
|
|
627
|
+
}), E.records.currentBox = E.records.boxes.slice(-1)[0];
|
|
628
|
+
}, Ft = function(t, e, o, s) {
|
|
629
|
+
let i = E.records.currentBox;
|
|
630
|
+
const a = E.records.actors[t];
|
|
631
|
+
if (a) {
|
|
632
|
+
if (E.records.currentBox && a.box && E.records.currentBox !== a.box)
|
|
633
|
+
throw new Error(
|
|
634
|
+
"A same participant should only be defined in one Box: " + a.name + " can't be in '" + a.box.name + "' and in '" + E.records.currentBox.name + "' at the same time."
|
|
635
|
+
);
|
|
636
|
+
if (i = a.box ? a.box : E.records.currentBox, a.box = i, a && e === a.name && o == null)
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
(o == null || o.text == null) && (o = { text: e, wrap: null, type: s }), (s == null || o.text == null) && (o = { text: e, wrap: null, type: s }), E.records.actors[t] = {
|
|
640
|
+
box: i,
|
|
641
|
+
name: e,
|
|
642
|
+
description: o.text,
|
|
643
|
+
wrap: o.wrap === void 0 && gt() || !!o.wrap,
|
|
644
|
+
prevActor: E.records.prevActor,
|
|
645
|
+
links: {},
|
|
646
|
+
properties: {},
|
|
647
|
+
actorCnt: null,
|
|
648
|
+
rectData: null,
|
|
649
|
+
type: s || "participant"
|
|
650
|
+
}, E.records.prevActor && E.records.actors[E.records.prevActor] && (E.records.actors[E.records.prevActor].nextActor = t), E.records.currentBox && E.records.currentBox.actorKeys.push(t), E.records.prevActor = t;
|
|
651
|
+
}, Be = (t) => {
|
|
652
|
+
let e, o = 0;
|
|
653
|
+
for (e = 0; e < E.records.messages.length; e++)
|
|
654
|
+
E.records.messages[e].type === mt.ACTIVE_START && E.records.messages[e].from.actor === t && o++, E.records.messages[e].type === mt.ACTIVE_END && E.records.messages[e].from.actor === t && o--;
|
|
655
|
+
return o;
|
|
656
|
+
}, Ye = function(t, e, o, s) {
|
|
657
|
+
E.records.messages.push({
|
|
658
|
+
from: t,
|
|
659
|
+
to: e,
|
|
660
|
+
message: o.text,
|
|
661
|
+
wrap: o.wrap === void 0 && gt() || !!o.wrap,
|
|
662
|
+
answer: s
|
|
663
|
+
});
|
|
664
|
+
}, C = function(t, e, o = { text: void 0, wrap: void 0 }, s, i = !1) {
|
|
665
|
+
if (s === mt.ACTIVE_END && Be(t.actor) < 1) {
|
|
666
|
+
let c = new Error("Trying to inactivate an inactive participant (" + t.actor + ")");
|
|
667
|
+
throw c.hash = {
|
|
668
|
+
text: "->>-",
|
|
669
|
+
token: "->>-",
|
|
670
|
+
line: "1",
|
|
671
|
+
loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
|
|
672
|
+
expected: ["'ACTIVE_PARTICIPANT'"]
|
|
673
|
+
}, c;
|
|
674
|
+
}
|
|
675
|
+
return E.records.messages.push({
|
|
676
|
+
from: t,
|
|
677
|
+
to: e,
|
|
678
|
+
message: o.text,
|
|
679
|
+
wrap: o.wrap === void 0 && gt() || !!o.wrap,
|
|
680
|
+
type: s,
|
|
681
|
+
activate: i
|
|
682
|
+
}), !0;
|
|
683
|
+
}, Fe = function() {
|
|
684
|
+
return E.records.boxes.length > 0;
|
|
685
|
+
}, We = function() {
|
|
686
|
+
return E.records.boxes.some((t) => t.name);
|
|
687
|
+
}, qe = function() {
|
|
688
|
+
return E.records.messages;
|
|
689
|
+
}, ze = function() {
|
|
690
|
+
return E.records.boxes;
|
|
691
|
+
}, He = function() {
|
|
692
|
+
return E.records.actors;
|
|
693
|
+
}, Ue = function() {
|
|
694
|
+
return E.records.createdActors;
|
|
695
|
+
}, Ke = function() {
|
|
696
|
+
return E.records.destroyedActors;
|
|
697
|
+
}, vt = function(t) {
|
|
698
|
+
return E.records.actors[t];
|
|
699
|
+
}, Ge = function() {
|
|
700
|
+
return Object.keys(E.records.actors);
|
|
701
|
+
}, Xe = function() {
|
|
702
|
+
E.records.sequenceNumbersEnabled = !0;
|
|
703
|
+
}, Je = function() {
|
|
704
|
+
E.records.sequenceNumbersEnabled = !1;
|
|
705
|
+
}, Ze = () => E.records.sequenceNumbersEnabled, Qe = function(t) {
|
|
706
|
+
E.records.wrapEnabled = t;
|
|
707
|
+
}, gt = () => E.records.wrapEnabled !== void 0 ? E.records.wrapEnabled : st().sequence.wrap, je = function() {
|
|
708
|
+
E.reset(), Ae();
|
|
709
|
+
}, $e = function(t) {
|
|
710
|
+
const e = t.trim(), o = {
|
|
711
|
+
text: e.replace(/^:?(?:no)?wrap:/, "").trim(),
|
|
712
|
+
wrap: e.match(/^:?wrap:/) !== null ? !0 : e.match(/^:?nowrap:/) !== null ? !1 : void 0
|
|
713
|
+
};
|
|
714
|
+
return X.debug("parseMessage:", o), o;
|
|
715
|
+
}, t0 = function(t) {
|
|
716
|
+
const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
|
|
717
|
+
let o = e != null && e[1] ? e[1].trim() : "transparent", s = e != null && e[2] ? e[2].trim() : void 0;
|
|
718
|
+
if (window && window.CSS)
|
|
719
|
+
window.CSS.supports("color", o) || (o = "transparent", s = t.trim());
|
|
720
|
+
else {
|
|
721
|
+
const i = new Option().style;
|
|
722
|
+
i.color = o, i.color !== o && (o = "transparent", s = t.trim());
|
|
723
|
+
}
|
|
724
|
+
return {
|
|
725
|
+
color: o,
|
|
726
|
+
text: s !== void 0 ? At(s.replace(/^:?(?:no)?wrap:/, ""), st()) : void 0,
|
|
727
|
+
wrap: s !== void 0 ? s.match(/^:?wrap:/) !== null ? !0 : s.match(/^:?nowrap:/) !== null ? !1 : void 0 : void 0
|
|
728
|
+
};
|
|
729
|
+
}, mt = {
|
|
730
|
+
SOLID: 0,
|
|
731
|
+
DOTTED: 1,
|
|
732
|
+
NOTE: 2,
|
|
733
|
+
SOLID_CROSS: 3,
|
|
734
|
+
DOTTED_CROSS: 4,
|
|
735
|
+
SOLID_OPEN: 5,
|
|
736
|
+
DOTTED_OPEN: 6,
|
|
737
|
+
LOOP_START: 10,
|
|
738
|
+
LOOP_END: 11,
|
|
739
|
+
ALT_START: 12,
|
|
740
|
+
ALT_ELSE: 13,
|
|
741
|
+
ALT_END: 14,
|
|
742
|
+
OPT_START: 15,
|
|
743
|
+
OPT_END: 16,
|
|
744
|
+
ACTIVE_START: 17,
|
|
745
|
+
ACTIVE_END: 18,
|
|
746
|
+
PAR_START: 19,
|
|
747
|
+
PAR_AND: 20,
|
|
748
|
+
PAR_END: 21,
|
|
749
|
+
RECT_START: 22,
|
|
750
|
+
RECT_END: 23,
|
|
751
|
+
SOLID_POINT: 24,
|
|
752
|
+
DOTTED_POINT: 25,
|
|
753
|
+
AUTONUMBER: 26,
|
|
754
|
+
CRITICAL_START: 27,
|
|
755
|
+
CRITICAL_OPTION: 28,
|
|
756
|
+
CRITICAL_END: 29,
|
|
757
|
+
BREAK_START: 30,
|
|
758
|
+
BREAK_END: 31,
|
|
759
|
+
PAR_OVER_START: 32
|
|
760
|
+
}, e0 = {
|
|
761
|
+
FILLED: 0,
|
|
762
|
+
OPEN: 1
|
|
763
|
+
}, s0 = {
|
|
764
|
+
LEFTOF: 0,
|
|
765
|
+
RIGHTOF: 1,
|
|
766
|
+
OVER: 2
|
|
767
|
+
}, re = function(t, e, o) {
|
|
768
|
+
const s = {
|
|
769
|
+
actor: t,
|
|
770
|
+
placement: e,
|
|
771
|
+
message: o.text,
|
|
772
|
+
wrap: o.wrap === void 0 && gt() || !!o.wrap
|
|
773
|
+
}, i = [].concat(t, t);
|
|
774
|
+
E.records.notes.push(s), E.records.messages.push({
|
|
775
|
+
from: i[0],
|
|
776
|
+
to: i[1],
|
|
777
|
+
message: o.text,
|
|
778
|
+
wrap: o.wrap === void 0 && gt() || !!o.wrap,
|
|
779
|
+
type: mt.NOTE,
|
|
780
|
+
placement: e
|
|
781
|
+
});
|
|
782
|
+
}, ie = function(t, e) {
|
|
783
|
+
const o = vt(t);
|
|
784
|
+
try {
|
|
785
|
+
let s = At(e.text, st());
|
|
786
|
+
s = s.replace(/&/g, "&"), s = s.replace(/=/g, "=");
|
|
787
|
+
const i = JSON.parse(s);
|
|
788
|
+
Ht(o, i);
|
|
789
|
+
} catch (s) {
|
|
790
|
+
X.error("error while parsing actor link text", s);
|
|
791
|
+
}
|
|
792
|
+
}, r0 = function(t, e) {
|
|
793
|
+
const o = vt(t);
|
|
794
|
+
try {
|
|
795
|
+
const c = {};
|
|
796
|
+
let l = At(e.text, st());
|
|
797
|
+
var s = l.indexOf("@");
|
|
798
|
+
l = l.replace(/&/g, "&"), l = l.replace(/=/g, "=");
|
|
799
|
+
var i = l.slice(0, s - 1).trim(), a = l.slice(s + 1).trim();
|
|
800
|
+
c[i] = a, Ht(o, c);
|
|
801
|
+
} catch (c) {
|
|
802
|
+
X.error("error while parsing actor link text", c);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
function Ht(t, e) {
|
|
806
|
+
if (t.links == null)
|
|
807
|
+
t.links = e;
|
|
808
|
+
else
|
|
809
|
+
for (let o in e)
|
|
810
|
+
t.links[o] = e[o];
|
|
811
|
+
}
|
|
812
|
+
const ae = function(t, e) {
|
|
813
|
+
const o = vt(t);
|
|
814
|
+
try {
|
|
815
|
+
let s = At(e.text, st());
|
|
816
|
+
const i = JSON.parse(s);
|
|
817
|
+
ne(o, i);
|
|
818
|
+
} catch (s) {
|
|
819
|
+
X.error("error while parsing actor properties text", s);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
function ne(t, e) {
|
|
823
|
+
if (t.properties == null)
|
|
824
|
+
t.properties = e;
|
|
825
|
+
else
|
|
826
|
+
for (let o in e)
|
|
827
|
+
t.properties[o] = e[o];
|
|
828
|
+
}
|
|
829
|
+
function i0() {
|
|
830
|
+
E.records.currentBox = void 0;
|
|
831
|
+
}
|
|
832
|
+
const oe = function(t, e) {
|
|
833
|
+
const o = vt(t), s = document.getElementById(e.text);
|
|
834
|
+
try {
|
|
835
|
+
const i = s.innerHTML, a = JSON.parse(i);
|
|
836
|
+
a.properties && ne(o, a.properties), a.links && Ht(o, a.links);
|
|
837
|
+
} catch (i) {
|
|
838
|
+
X.error("error while parsing actor details text", i);
|
|
839
|
+
}
|
|
840
|
+
}, a0 = function(t, e) {
|
|
841
|
+
if (t !== void 0 && t.properties !== void 0)
|
|
842
|
+
return t.properties[e];
|
|
843
|
+
}, ce = function(t) {
|
|
844
|
+
if (Array.isArray(t))
|
|
845
|
+
t.forEach(function(e) {
|
|
846
|
+
ce(e);
|
|
847
|
+
});
|
|
848
|
+
else
|
|
849
|
+
switch (t.type) {
|
|
850
|
+
case "sequenceIndex":
|
|
851
|
+
E.records.messages.push({
|
|
852
|
+
from: void 0,
|
|
853
|
+
to: void 0,
|
|
854
|
+
message: {
|
|
855
|
+
start: t.sequenceIndex,
|
|
856
|
+
step: t.sequenceIndexStep,
|
|
857
|
+
visible: t.sequenceVisible
|
|
858
|
+
},
|
|
859
|
+
wrap: !1,
|
|
860
|
+
type: t.signalType
|
|
861
|
+
});
|
|
862
|
+
break;
|
|
863
|
+
case "addParticipant":
|
|
864
|
+
Ft(t.actor, t.actor, t.description, t.draw);
|
|
865
|
+
break;
|
|
866
|
+
case "createParticipant":
|
|
867
|
+
if (E.records.actors[t.actor])
|
|
868
|
+
throw new Error(
|
|
869
|
+
"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"
|
|
870
|
+
);
|
|
871
|
+
E.records.lastCreated = t.actor, Ft(t.actor, t.actor, t.description, t.draw), E.records.createdActors[t.actor] = E.records.messages.length;
|
|
872
|
+
break;
|
|
873
|
+
case "destroyParticipant":
|
|
874
|
+
E.records.lastDestroyed = t.actor, E.records.destroyedActors[t.actor] = E.records.messages.length;
|
|
875
|
+
break;
|
|
876
|
+
case "activeStart":
|
|
877
|
+
C(t.actor, void 0, void 0, t.signalType);
|
|
878
|
+
break;
|
|
879
|
+
case "activeEnd":
|
|
880
|
+
C(t.actor, void 0, void 0, t.signalType);
|
|
881
|
+
break;
|
|
882
|
+
case "addNote":
|
|
883
|
+
re(t.actor, t.placement, t.text);
|
|
884
|
+
break;
|
|
885
|
+
case "addLinks":
|
|
886
|
+
ie(t.actor, t.text);
|
|
887
|
+
break;
|
|
888
|
+
case "addALink":
|
|
889
|
+
r0(t.actor, t.text);
|
|
890
|
+
break;
|
|
891
|
+
case "addProperties":
|
|
892
|
+
ae(t.actor, t.text);
|
|
893
|
+
break;
|
|
894
|
+
case "addDetails":
|
|
895
|
+
oe(t.actor, t.text);
|
|
896
|
+
break;
|
|
897
|
+
case "addMessage":
|
|
898
|
+
if (E.records.lastCreated) {
|
|
899
|
+
if (t.to !== E.records.lastCreated)
|
|
900
|
+
throw new Error(
|
|
901
|
+
"The created participant " + E.records.lastCreated + " does not have an associated creating message after its declaration. Please check the sequence diagram."
|
|
902
|
+
);
|
|
903
|
+
E.records.lastCreated = void 0;
|
|
904
|
+
} else if (E.records.lastDestroyed) {
|
|
905
|
+
if (t.to !== E.records.lastDestroyed && t.from !== E.records.lastDestroyed)
|
|
906
|
+
throw new Error(
|
|
907
|
+
"The destroyed participant " + E.records.lastDestroyed + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
|
|
908
|
+
);
|
|
909
|
+
E.records.lastDestroyed = void 0;
|
|
910
|
+
}
|
|
911
|
+
C(t.from, t.to, t.msg, t.signalType, t.activate);
|
|
912
|
+
break;
|
|
913
|
+
case "boxStart":
|
|
914
|
+
Oe(t.boxData);
|
|
915
|
+
break;
|
|
916
|
+
case "boxEnd":
|
|
917
|
+
i0();
|
|
918
|
+
break;
|
|
919
|
+
case "loopStart":
|
|
920
|
+
C(void 0, void 0, t.loopText, t.signalType);
|
|
921
|
+
break;
|
|
922
|
+
case "loopEnd":
|
|
923
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
924
|
+
break;
|
|
925
|
+
case "rectStart":
|
|
926
|
+
C(void 0, void 0, t.color, t.signalType);
|
|
927
|
+
break;
|
|
928
|
+
case "rectEnd":
|
|
929
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
930
|
+
break;
|
|
931
|
+
case "optStart":
|
|
932
|
+
C(void 0, void 0, t.optText, t.signalType);
|
|
933
|
+
break;
|
|
934
|
+
case "optEnd":
|
|
935
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
936
|
+
break;
|
|
937
|
+
case "altStart":
|
|
938
|
+
C(void 0, void 0, t.altText, t.signalType);
|
|
939
|
+
break;
|
|
940
|
+
case "else":
|
|
941
|
+
C(void 0, void 0, t.altText, t.signalType);
|
|
942
|
+
break;
|
|
943
|
+
case "altEnd":
|
|
944
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
945
|
+
break;
|
|
946
|
+
case "setAccTitle":
|
|
947
|
+
$t(t.text);
|
|
948
|
+
break;
|
|
949
|
+
case "parStart":
|
|
950
|
+
C(void 0, void 0, t.parText, t.signalType);
|
|
951
|
+
break;
|
|
952
|
+
case "and":
|
|
953
|
+
C(void 0, void 0, t.parText, t.signalType);
|
|
954
|
+
break;
|
|
955
|
+
case "parEnd":
|
|
956
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
957
|
+
break;
|
|
958
|
+
case "criticalStart":
|
|
959
|
+
C(void 0, void 0, t.criticalText, t.signalType);
|
|
960
|
+
break;
|
|
961
|
+
case "option":
|
|
962
|
+
C(void 0, void 0, t.optionText, t.signalType);
|
|
963
|
+
break;
|
|
964
|
+
case "criticalEnd":
|
|
965
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
966
|
+
break;
|
|
967
|
+
case "breakStart":
|
|
968
|
+
C(void 0, void 0, t.breakText, t.signalType);
|
|
969
|
+
break;
|
|
970
|
+
case "breakEnd":
|
|
971
|
+
C(void 0, void 0, void 0, t.signalType);
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
}, Qt = {
|
|
975
|
+
addActor: Ft,
|
|
976
|
+
addMessage: Ye,
|
|
977
|
+
addSignal: C,
|
|
978
|
+
addLinks: ie,
|
|
979
|
+
addDetails: oe,
|
|
980
|
+
addProperties: ae,
|
|
981
|
+
autoWrap: gt,
|
|
982
|
+
setWrap: Qe,
|
|
983
|
+
enableSequenceNumbers: Xe,
|
|
984
|
+
disableSequenceNumbers: Je,
|
|
985
|
+
showSequenceNumbers: Ze,
|
|
986
|
+
getMessages: qe,
|
|
987
|
+
getActors: He,
|
|
988
|
+
getCreatedActors: Ue,
|
|
989
|
+
getDestroyedActors: Ke,
|
|
990
|
+
getActor: vt,
|
|
991
|
+
getActorKeys: Ge,
|
|
992
|
+
getActorProperty: a0,
|
|
993
|
+
getAccTitle: Pe,
|
|
994
|
+
getBoxes: ze,
|
|
995
|
+
getDiagramTitle: ke,
|
|
996
|
+
setDiagramTitle: _e,
|
|
997
|
+
getConfig: () => st().sequence,
|
|
998
|
+
clear: je,
|
|
999
|
+
parseMessage: $e,
|
|
1000
|
+
parseBoxData: t0,
|
|
1001
|
+
LINETYPE: mt,
|
|
1002
|
+
ARROWTYPE: e0,
|
|
1003
|
+
PLACEMENT: s0,
|
|
1004
|
+
addNote: re,
|
|
1005
|
+
setAccTitle: $t,
|
|
1006
|
+
apply: ce,
|
|
1007
|
+
setAccDescription: ve,
|
|
1008
|
+
getAccDescription: we,
|
|
1009
|
+
hasAtLeastOneBox: Fe,
|
|
1010
|
+
hasAtLeastOneBoxWithTitle: We
|
|
1011
|
+
}, n0 = (t) => `.actor {
|
|
1012
|
+
stroke: ${t.actorBorder};
|
|
1013
|
+
fill: ${t.actorBkg};
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
text.actor > tspan {
|
|
1017
|
+
fill: ${t.actorTextColor};
|
|
1018
|
+
stroke: none;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.actor-line {
|
|
1022
|
+
stroke: ${t.actorLineColor};
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.messageLine0 {
|
|
1026
|
+
stroke-width: 1.5;
|
|
1027
|
+
stroke-dasharray: none;
|
|
1028
|
+
stroke: ${t.signalColor};
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.messageLine1 {
|
|
1032
|
+
stroke-width: 1.5;
|
|
1033
|
+
stroke-dasharray: 2, 2;
|
|
1034
|
+
stroke: ${t.signalColor};
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
#arrowhead path {
|
|
1038
|
+
fill: ${t.signalColor};
|
|
1039
|
+
stroke: ${t.signalColor};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.sequenceNumber {
|
|
1043
|
+
fill: ${t.sequenceNumberColor};
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
#sequencenumber {
|
|
1047
|
+
fill: ${t.signalColor};
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
#crosshead path {
|
|
1051
|
+
fill: ${t.signalColor};
|
|
1052
|
+
stroke: ${t.signalColor};
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.messageText {
|
|
1056
|
+
fill: ${t.signalTextColor};
|
|
1057
|
+
stroke: none;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.labelBox {
|
|
1061
|
+
stroke: ${t.labelBoxBorderColor};
|
|
1062
|
+
fill: ${t.labelBoxBkgColor};
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.labelText, .labelText > tspan {
|
|
1066
|
+
fill: ${t.labelTextColor};
|
|
1067
|
+
stroke: none;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
.loopText, .loopText > tspan {
|
|
1071
|
+
fill: ${t.loopTextColor};
|
|
1072
|
+
stroke: none;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.loopLine {
|
|
1076
|
+
stroke-width: 2px;
|
|
1077
|
+
stroke-dasharray: 2, 2;
|
|
1078
|
+
stroke: ${t.labelBoxBorderColor};
|
|
1079
|
+
fill: ${t.labelBoxBorderColor};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.note {
|
|
1083
|
+
//stroke: #decc93;
|
|
1084
|
+
stroke: ${t.noteBorderColor};
|
|
1085
|
+
fill: ${t.noteBkgColor};
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.noteText, .noteText > tspan {
|
|
1089
|
+
fill: ${t.noteTextColor};
|
|
1090
|
+
stroke: none;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.activation0 {
|
|
1094
|
+
fill: ${t.activationBkgColor};
|
|
1095
|
+
stroke: ${t.activationBorderColor};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.activation1 {
|
|
1099
|
+
fill: ${t.activationBkgColor};
|
|
1100
|
+
stroke: ${t.activationBorderColor};
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.activation2 {
|
|
1104
|
+
fill: ${t.activationBkgColor};
|
|
1105
|
+
stroke: ${t.activationBorderColor};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
.actorPopupMenu {
|
|
1109
|
+
position: absolute;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.actorPopupMenuPanel {
|
|
1113
|
+
position: absolute;
|
|
1114
|
+
fill: ${t.actorBkg};
|
|
1115
|
+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
|
1116
|
+
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
|
|
1117
|
+
}
|
|
1118
|
+
.actor-man line {
|
|
1119
|
+
stroke: ${t.actorBorder};
|
|
1120
|
+
fill: ${t.actorBkg};
|
|
1121
|
+
}
|
|
1122
|
+
.actor-man circle, line {
|
|
1123
|
+
stroke: ${t.actorBorder};
|
|
1124
|
+
fill: ${t.actorBkg};
|
|
1125
|
+
stroke-width: 2px;
|
|
1126
|
+
}
|
|
1127
|
+
`, o0 = n0, ft = 36, le = "actor-top", he = "actor-bottom", Ut = function(t, e) {
|
|
1128
|
+
return Me(t, e);
|
|
1129
|
+
}, c0 = function(t, e, o, s, i) {
|
|
1130
|
+
if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
|
|
1131
|
+
return { height: 0, width: 0 };
|
|
1132
|
+
const a = e.links, c = e.actorCnt, l = e.rectData;
|
|
1133
|
+
var p = "none";
|
|
1134
|
+
i && (p = "block !important");
|
|
1135
|
+
const r = t.append("g");
|
|
1136
|
+
r.attr("id", "actor" + c + "_popup"), r.attr("class", "actorPopupMenu"), r.attr("display", p);
|
|
1137
|
+
var x = "";
|
|
1138
|
+
l.class !== void 0 && (x = " " + l.class);
|
|
1139
|
+
let T = l.width > o ? l.width : o;
|
|
1140
|
+
const u = r.append("rect");
|
|
1141
|
+
if (u.attr("class", "actorPopupMenuPanel" + x), u.attr("x", l.x), u.attr("y", l.height), u.attr("fill", l.fill), u.attr("stroke", l.stroke), u.attr("width", T), u.attr("height", l.height), u.attr("rx", l.rx), u.attr("ry", l.ry), a != null) {
|
|
1142
|
+
var g = 20;
|
|
1143
|
+
for (let I in a) {
|
|
1144
|
+
var m = r.append("a"), _ = te.sanitizeUrl(a[I]);
|
|
1145
|
+
m.attr("xlink:href", _), m.attr("target", "_blank"), k0(s)(
|
|
1146
|
+
I,
|
|
1147
|
+
m,
|
|
1148
|
+
l.x + 10,
|
|
1149
|
+
l.height + g,
|
|
1150
|
+
T,
|
|
1151
|
+
20,
|
|
1152
|
+
{ class: "actor" },
|
|
1153
|
+
s
|
|
1154
|
+
), g += 30;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return u.attr("height", g), { height: l.height + g, width: T };
|
|
1158
|
+
}, l0 = function(t) {
|
|
1159
|
+
return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
|
|
1160
|
+
}, It = async function(t, e, o = null) {
|
|
1161
|
+
let s = t.append("foreignObject");
|
|
1162
|
+
const i = await se(e.text, Bt()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
|
|
1163
|
+
if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), e.class === "noteText") {
|
|
1164
|
+
const l = t.node().firstChild;
|
|
1165
|
+
l.setAttribute("height", c.height + 2 * e.textMargin);
|
|
1166
|
+
const p = l.getBBox();
|
|
1167
|
+
s.attr("x", Math.round(p.x + p.width / 2 - c.width / 2)).attr("y", Math.round(p.y + p.height / 2 - c.height / 2));
|
|
1168
|
+
} else if (o) {
|
|
1169
|
+
let { startx: l, stopx: p, starty: r } = o;
|
|
1170
|
+
if (l > p) {
|
|
1171
|
+
const x = l;
|
|
1172
|
+
l = p, p = x;
|
|
1173
|
+
}
|
|
1174
|
+
s.attr("x", Math.round(l + Math.abs(l - p) / 2 - c.width / 2)), e.class === "loopText" ? s.attr("y", Math.round(r)) : s.attr("y", Math.round(r - c.height));
|
|
1175
|
+
}
|
|
1176
|
+
return [s];
|
|
1177
|
+
}, bt = function(t, e) {
|
|
1178
|
+
let o = 0, s = 0;
|
|
1179
|
+
const i = e.text.split(v.lineBreakRegex), [a, c] = ee(e.fontSize);
|
|
1180
|
+
let l = [], p = 0, r = () => e.y;
|
|
1181
|
+
if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
|
|
1182
|
+
switch (e.valign) {
|
|
1183
|
+
case "top":
|
|
1184
|
+
case "start":
|
|
1185
|
+
r = () => Math.round(e.y + e.textMargin);
|
|
1186
|
+
break;
|
|
1187
|
+
case "middle":
|
|
1188
|
+
case "center":
|
|
1189
|
+
r = () => Math.round(e.y + (o + s + e.textMargin) / 2);
|
|
1190
|
+
break;
|
|
1191
|
+
case "bottom":
|
|
1192
|
+
case "end":
|
|
1193
|
+
r = () => Math.round(
|
|
1194
|
+
e.y + (o + s + 2 * e.textMargin) - e.textMargin
|
|
1195
|
+
);
|
|
1196
|
+
break;
|
|
1197
|
+
}
|
|
1198
|
+
if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
|
|
1199
|
+
switch (e.anchor) {
|
|
1200
|
+
case "left":
|
|
1201
|
+
case "start":
|
|
1202
|
+
e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1203
|
+
break;
|
|
1204
|
+
case "middle":
|
|
1205
|
+
case "center":
|
|
1206
|
+
e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1207
|
+
break;
|
|
1208
|
+
case "right":
|
|
1209
|
+
case "end":
|
|
1210
|
+
e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
for (let [x, T] of i.entries()) {
|
|
1214
|
+
e.textMargin !== void 0 && e.textMargin === 0 && a !== void 0 && (p = x * a);
|
|
1215
|
+
const u = t.append("text");
|
|
1216
|
+
u.attr("x", e.x), u.attr("y", r()), e.anchor !== void 0 && u.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && u.style("font-family", e.fontFamily), c !== void 0 && u.style("font-size", c), e.fontWeight !== void 0 && u.style("font-weight", e.fontWeight), e.fill !== void 0 && u.attr("fill", e.fill), e.class !== void 0 && u.attr("class", e.class), e.dy !== void 0 ? u.attr("dy", e.dy) : p !== 0 && u.attr("dy", p);
|
|
1217
|
+
const g = T || Ne;
|
|
1218
|
+
if (e.tspan) {
|
|
1219
|
+
const m = u.append("tspan");
|
|
1220
|
+
m.attr("x", e.x), e.fill !== void 0 && m.attr("fill", e.fill), m.text(g);
|
|
1221
|
+
} else
|
|
1222
|
+
u.text(g);
|
|
1223
|
+
e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (s += (u._groups || u)[0][0].getBBox().height, o = s), l.push(u);
|
|
1224
|
+
}
|
|
1225
|
+
return l;
|
|
1226
|
+
}, de = function(t, e) {
|
|
1227
|
+
function o(i, a, c, l, p) {
|
|
1228
|
+
return i + "," + a + " " + (i + c) + "," + a + " " + (i + c) + "," + (a + l - p) + " " + (i + c - p * 1.2) + "," + (a + l) + " " + i + "," + (a + l);
|
|
1229
|
+
}
|
|
1230
|
+
const s = t.append("polygon");
|
|
1231
|
+
return s.attr("points", o(e.x, e.y, e.width, e.height, 7)), s.attr("class", "labelBox"), e.y = e.y + e.height / 2, bt(t, e), s;
|
|
1232
|
+
};
|
|
1233
|
+
let at = -1;
|
|
1234
|
+
const pe = (t, e, o, s) => {
|
|
1235
|
+
t.select && o.forEach((i) => {
|
|
1236
|
+
const a = e[i], c = t.select("#actor" + a.actorCnt);
|
|
1237
|
+
!s.mirrorActors && a.stopy ? c.attr("y2", a.stopy + a.height / 2) : s.mirrorActors && c.attr("y2", a.stopy);
|
|
1238
|
+
});
|
|
1239
|
+
}, h0 = async function(t, e, o, s) {
|
|
1240
|
+
const i = s ? e.stopy : e.starty, a = e.x + e.width / 2, c = i + 5, l = t.append("g").lower();
|
|
1241
|
+
var p = l;
|
|
1242
|
+
s || (at++, Object.keys(e.links || {}).length && !o.forceMenus && p.attr("onclick", l0(`actor${at}_popup`)).attr("cursor", "pointer"), p.append("line").attr("id", "actor" + at).attr("x1", a).attr("y1", c).attr("x2", a).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), p = l.append("g"), e.actorCnt = at, e.links != null && p.attr("id", "root-" + at));
|
|
1243
|
+
const r = Nt();
|
|
1244
|
+
var x = "actor";
|
|
1245
|
+
e.properties != null && e.properties.class ? x = e.properties.class : r.fill = "#eaeaea", s ? x += ` ${he}` : x += ` ${le}`, r.x = e.x, r.y = i, r.width = e.width, r.height = e.height, r.class = x, r.rx = 3, r.ry = 3, r.name = e.name;
|
|
1246
|
+
const T = Ut(p, r);
|
|
1247
|
+
if (e.rectData = r, e.properties != null && e.properties.icon) {
|
|
1248
|
+
const g = e.properties.icon.trim();
|
|
1249
|
+
g.charAt(0) === "@" ? Re(p, r.x + r.width - 20, r.y + 10, g.substr(1)) : Ce(p, r.x + r.width - 20, r.y + 10, g);
|
|
1250
|
+
}
|
|
1251
|
+
await Kt(o, nt(e.description))(
|
|
1252
|
+
e.description,
|
|
1253
|
+
p,
|
|
1254
|
+
r.x,
|
|
1255
|
+
r.y,
|
|
1256
|
+
r.width,
|
|
1257
|
+
r.height,
|
|
1258
|
+
{ class: "actor" },
|
|
1259
|
+
o
|
|
1260
|
+
);
|
|
1261
|
+
let u = e.height;
|
|
1262
|
+
if (T.node) {
|
|
1263
|
+
const g = T.node().getBBox();
|
|
1264
|
+
e.height = g.height, u = g.height;
|
|
1265
|
+
}
|
|
1266
|
+
return u;
|
|
1267
|
+
}, d0 = async function(t, e, o, s) {
|
|
1268
|
+
const i = s ? e.stopy : e.starty, a = e.x + e.width / 2, c = i + 80;
|
|
1269
|
+
t.lower(), s || (at++, t.append("line").attr("id", "actor" + at).attr("x1", a).attr("y1", c).attr("x2", a).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), e.actorCnt = at);
|
|
1270
|
+
const l = t.append("g");
|
|
1271
|
+
let p = "actor-man";
|
|
1272
|
+
s ? p += ` ${he}` : p += ` ${le}`, l.attr("class", p), l.attr("name", e.name);
|
|
1273
|
+
const r = Nt();
|
|
1274
|
+
r.x = e.x, r.y = i, r.fill = "#eaeaea", r.width = e.width, r.height = e.height, r.class = "actor", r.rx = 3, r.ry = 3, l.append("line").attr("id", "actor-man-torso" + at).attr("x1", a).attr("y1", i + 25).attr("x2", a).attr("y2", i + 45), l.append("line").attr("id", "actor-man-arms" + at).attr("x1", a - ft / 2).attr("y1", i + 33).attr("x2", a + ft / 2).attr("y2", i + 33), l.append("line").attr("x1", a - ft / 2).attr("y1", i + 60).attr("x2", a).attr("y2", i + 45), l.append("line").attr("x1", a).attr("y1", i + 45).attr("x2", a + ft / 2 - 2).attr("y2", i + 60);
|
|
1275
|
+
const x = l.append("circle");
|
|
1276
|
+
x.attr("cx", e.x + e.width / 2), x.attr("cy", i + 10), x.attr("r", 15), x.attr("width", e.width), x.attr("height", e.height);
|
|
1277
|
+
const T = l.node().getBBox();
|
|
1278
|
+
return e.height = T.height, await Kt(o, nt(e.description))(
|
|
1279
|
+
e.description,
|
|
1280
|
+
l,
|
|
1281
|
+
r.x,
|
|
1282
|
+
r.y + 35,
|
|
1283
|
+
r.width,
|
|
1284
|
+
r.height,
|
|
1285
|
+
{ class: "actor" },
|
|
1286
|
+
o
|
|
1287
|
+
), e.height;
|
|
1288
|
+
}, p0 = async function(t, e, o, s) {
|
|
1289
|
+
switch (e.type) {
|
|
1290
|
+
case "actor":
|
|
1291
|
+
return await d0(t, e, o, s);
|
|
1292
|
+
case "participant":
|
|
1293
|
+
return await h0(t, e, o, s);
|
|
1294
|
+
}
|
|
1295
|
+
}, u0 = async function(t, e, o) {
|
|
1296
|
+
const i = t.append("g");
|
|
1297
|
+
ue(i, e), e.name && await Kt(o)(
|
|
1298
|
+
e.name,
|
|
1299
|
+
i,
|
|
1300
|
+
e.x,
|
|
1301
|
+
e.y + (e.textMaxHeight || 0) / 2,
|
|
1302
|
+
e.width,
|
|
1303
|
+
0,
|
|
1304
|
+
{ class: "text" },
|
|
1305
|
+
o
|
|
1306
|
+
), i.lower();
|
|
1307
|
+
}, f0 = function(t) {
|
|
1308
|
+
return t.append("g");
|
|
1309
|
+
}, g0 = function(t, e, o, s, i) {
|
|
1310
|
+
const a = Nt(), c = e.anchored;
|
|
1311
|
+
a.x = e.startx, a.y = e.starty, a.class = "activation" + i % 3, a.width = e.stopx - e.startx, a.height = o - e.starty, Ut(c, a);
|
|
1312
|
+
}, x0 = async function(t, e, o, s) {
|
|
1313
|
+
const {
|
|
1314
|
+
boxMargin: i,
|
|
1315
|
+
boxTextMargin: a,
|
|
1316
|
+
labelBoxHeight: c,
|
|
1317
|
+
labelBoxWidth: l,
|
|
1318
|
+
messageFontFamily: p,
|
|
1319
|
+
messageFontSize: r,
|
|
1320
|
+
messageFontWeight: x
|
|
1321
|
+
} = s, T = t.append("g"), u = function(_, I, V, S) {
|
|
1322
|
+
return T.append("line").attr("x1", _).attr("y1", I).attr("x2", V).attr("y2", S).attr("class", "loopLine");
|
|
1323
|
+
};
|
|
1324
|
+
u(e.startx, e.starty, e.stopx, e.starty), u(e.stopx, e.starty, e.stopx, e.stopy), u(e.startx, e.stopy, e.stopx, e.stopy), u(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(_) {
|
|
1325
|
+
u(e.startx, _.y, e.stopx, _.y).style(
|
|
1326
|
+
"stroke-dasharray",
|
|
1327
|
+
"3, 3"
|
|
1328
|
+
);
|
|
1329
|
+
});
|
|
1330
|
+
let g = zt();
|
|
1331
|
+
g.text = o, g.x = e.startx, g.y = e.starty, g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = l || 50, g.height = c || 20, g.textMargin = a, g.class = "labelText", de(T, g), g = fe(), g.text = e.title, g.x = e.startx + l / 2 + (e.stopx - e.startx) / 2, g.y = e.starty + i + a, g.anchor = "middle", g.valign = "middle", g.textMargin = a, g.class = "loopText", g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.wrap = !0;
|
|
1332
|
+
let m = nt(g.text) ? await It(T, g, e) : bt(T, g);
|
|
1333
|
+
if (e.sectionTitles !== void 0) {
|
|
1334
|
+
for (const [_, I] of Object.entries(e.sectionTitles))
|
|
1335
|
+
if (I.message) {
|
|
1336
|
+
g.text = I.message, g.x = e.startx + (e.stopx - e.startx) / 2, g.y = e.sections[_].y + i + a, g.class = "loopText", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.wrap = e.wrap, nt(g.text) ? (e.starty = e.sections[_].y, await It(T, g, e)) : bt(T, g);
|
|
1337
|
+
let V = Math.round(
|
|
1338
|
+
m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, O) => S + O)
|
|
1339
|
+
);
|
|
1340
|
+
e.sections[_].height += V - (i + a);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
return e.height = Math.round(e.stopy - e.starty), T;
|
|
1344
|
+
}, ue = function(t, e) {
|
|
1345
|
+
Se(t, e);
|
|
1346
|
+
}, y0 = function(t) {
|
|
1347
|
+
t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
|
|
1348
|
+
"d",
|
|
1349
|
+
"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"
|
|
1350
|
+
);
|
|
1351
|
+
}, T0 = function(t) {
|
|
1352
|
+
t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
|
|
1353
|
+
"d",
|
|
1354
|
+
"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"
|
|
1355
|
+
);
|
|
1356
|
+
}, b0 = function(t) {
|
|
1357
|
+
t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
|
|
1358
|
+
"d",
|
|
1359
|
+
"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"
|
|
1360
|
+
);
|
|
1361
|
+
}, E0 = function(t) {
|
|
1362
|
+
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").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
|
|
1363
|
+
}, m0 = function(t) {
|
|
1364
|
+
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");
|
|
1365
|
+
}, w0 = function(t) {
|
|
1366
|
+
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);
|
|
1367
|
+
}, v0 = function(t) {
|
|
1368
|
+
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");
|
|
1369
|
+
}, fe = function() {
|
|
1370
|
+
return {
|
|
1371
|
+
x: 0,
|
|
1372
|
+
y: 0,
|
|
1373
|
+
fill: void 0,
|
|
1374
|
+
anchor: void 0,
|
|
1375
|
+
style: "#666",
|
|
1376
|
+
width: void 0,
|
|
1377
|
+
height: void 0,
|
|
1378
|
+
textMargin: 0,
|
|
1379
|
+
rx: 0,
|
|
1380
|
+
ry: 0,
|
|
1381
|
+
tspan: !0,
|
|
1382
|
+
valign: void 0
|
|
1383
|
+
};
|
|
1384
|
+
}, _0 = function() {
|
|
1385
|
+
return {
|
|
1386
|
+
x: 0,
|
|
1387
|
+
y: 0,
|
|
1388
|
+
fill: "#EDF2AE",
|
|
1389
|
+
stroke: "#666",
|
|
1390
|
+
width: 100,
|
|
1391
|
+
anchor: "start",
|
|
1392
|
+
height: 100,
|
|
1393
|
+
rx: 0,
|
|
1394
|
+
ry: 0
|
|
1395
|
+
};
|
|
1396
|
+
}, Kt = /* @__PURE__ */ (function() {
|
|
1397
|
+
function t(a, c, l, p, r, x, T) {
|
|
1398
|
+
const u = c.append("text").attr("x", l + r / 2).attr("y", p + x / 2 + 5).style("text-anchor", "middle").text(a);
|
|
1399
|
+
i(u, T);
|
|
1400
|
+
}
|
|
1401
|
+
function e(a, c, l, p, r, x, T, u) {
|
|
1402
|
+
const { actorFontSize: g, actorFontFamily: m, actorFontWeight: _ } = u, [I, V] = ee(g), S = a.split(v.lineBreakRegex);
|
|
1403
|
+
for (let O = 0; O < S.length; O++) {
|
|
1404
|
+
const R = O * I - I * (S.length - 1) / 2, q = c.append("text").attr("x", l + r / 2).attr("y", p).style("text-anchor", "middle").style("font-size", V).style("font-weight", _).style("font-family", m);
|
|
1405
|
+
q.append("tspan").attr("x", l + r / 2).attr("dy", R).text(S[O]), q.attr("y", p + x / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(q, T);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
function o(a, c, l, p, r, x, T, u) {
|
|
1409
|
+
const g = c.append("switch"), _ = g.append("foreignObject").attr("x", l).attr("y", p).attr("width", r).attr("height", x).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
1410
|
+
_.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(a), e(a, g, l, p, r, x, T, u), i(_, T);
|
|
1411
|
+
}
|
|
1412
|
+
async function s(a, c, l, p, r, x, T, u) {
|
|
1413
|
+
const g = await wt(a, Bt()), m = c.append("switch"), I = m.append("foreignObject").attr("x", l + r / 2 - g.width / 2).attr("y", p + x / 2 - g.height / 2).attr("width", g.width).attr("height", g.height).append("xhtml:div").style("height", "100%").style("width", "100%");
|
|
1414
|
+
I.append("div").style("text-align", "center").style("vertical-align", "middle").html(await se(a, Bt())), e(a, m, l, p, r, x, T, u), i(I, T);
|
|
1415
|
+
}
|
|
1416
|
+
function i(a, c) {
|
|
1417
|
+
for (const l in c)
|
|
1418
|
+
c.hasOwnProperty(l) && a.attr(l, c[l]);
|
|
1419
|
+
}
|
|
1420
|
+
return function(a, c = !1) {
|
|
1421
|
+
return c ? s : a.textPlacement === "fo" ? o : a.textPlacement === "old" ? t : e;
|
|
1422
|
+
};
|
|
1423
|
+
})(), k0 = /* @__PURE__ */ (function() {
|
|
1424
|
+
function t(i, a, c, l, p, r, x) {
|
|
1425
|
+
const T = a.append("text").attr("x", c).attr("y", l).style("text-anchor", "start").text(i);
|
|
1426
|
+
s(T, x);
|
|
1427
|
+
}
|
|
1428
|
+
function e(i, a, c, l, p, r, x, T) {
|
|
1429
|
+
const { actorFontSize: u, actorFontFamily: g, actorFontWeight: m } = T, _ = i.split(v.lineBreakRegex);
|
|
1430
|
+
for (let I = 0; I < _.length; I++) {
|
|
1431
|
+
const V = I * u - u * (_.length - 1) / 2, S = a.append("text").attr("x", c).attr("y", l).style("text-anchor", "start").style("font-size", u).style("font-weight", m).style("font-family", g);
|
|
1432
|
+
S.append("tspan").attr("x", c).attr("dy", V).text(_[I]), S.attr("y", l + r / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, x);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
function o(i, a, c, l, p, r, x, T) {
|
|
1436
|
+
const u = a.append("switch"), m = u.append("foreignObject").attr("x", c).attr("y", l).attr("width", p).attr("height", r).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
1437
|
+
m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, u, c, l, p, r, x, T), s(m, x);
|
|
1438
|
+
}
|
|
1439
|
+
function s(i, a) {
|
|
1440
|
+
for (const c in a)
|
|
1441
|
+
a.hasOwnProperty(c) && i.attr(c, a[c]);
|
|
1442
|
+
}
|
|
1443
|
+
return function(i) {
|
|
1444
|
+
return i.textPlacement === "fo" ? o : i.textPlacement === "old" ? t : e;
|
|
1445
|
+
};
|
|
1446
|
+
})(), D = {
|
|
1447
|
+
drawRect: Ut,
|
|
1448
|
+
drawText: bt,
|
|
1449
|
+
drawLabel: de,
|
|
1450
|
+
drawActor: p0,
|
|
1451
|
+
drawBox: u0,
|
|
1452
|
+
drawPopup: c0,
|
|
1453
|
+
anchorElement: f0,
|
|
1454
|
+
drawActivation: g0,
|
|
1455
|
+
drawLoop: x0,
|
|
1456
|
+
drawBackgroundRect: ue,
|
|
1457
|
+
insertArrowHead: E0,
|
|
1458
|
+
insertArrowFilledHead: m0,
|
|
1459
|
+
insertSequenceNumber: w0,
|
|
1460
|
+
insertArrowCrossHead: v0,
|
|
1461
|
+
insertDatabaseIcon: y0,
|
|
1462
|
+
insertComputerIcon: T0,
|
|
1463
|
+
insertClockIcon: b0,
|
|
1464
|
+
getTextObj: fe,
|
|
1465
|
+
getNoteRect: _0,
|
|
1466
|
+
fixLifeLineHeights: pe,
|
|
1467
|
+
sanitizeUrl: te.sanitizeUrl
|
|
1468
|
+
};
|
|
1469
|
+
let n = {};
|
|
1470
|
+
const f = {
|
|
1471
|
+
data: {
|
|
1472
|
+
startx: void 0,
|
|
1473
|
+
stopx: void 0,
|
|
1474
|
+
starty: void 0,
|
|
1475
|
+
stopy: void 0
|
|
1476
|
+
},
|
|
1477
|
+
verticalPos: 0,
|
|
1478
|
+
sequenceItems: [],
|
|
1479
|
+
activations: [],
|
|
1480
|
+
models: {
|
|
1481
|
+
getHeight: function() {
|
|
1482
|
+
return Math.max.apply(
|
|
1483
|
+
null,
|
|
1484
|
+
this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
|
|
1485
|
+
) + (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));
|
|
1486
|
+
},
|
|
1487
|
+
clear: function() {
|
|
1488
|
+
this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
|
|
1489
|
+
},
|
|
1490
|
+
addBox: function(t) {
|
|
1491
|
+
this.boxes.push(t);
|
|
1492
|
+
},
|
|
1493
|
+
addActor: function(t) {
|
|
1494
|
+
this.actors.push(t);
|
|
1495
|
+
},
|
|
1496
|
+
addLoop: function(t) {
|
|
1497
|
+
this.loops.push(t);
|
|
1498
|
+
},
|
|
1499
|
+
addMessage: function(t) {
|
|
1500
|
+
this.messages.push(t);
|
|
1501
|
+
},
|
|
1502
|
+
addNote: function(t) {
|
|
1503
|
+
this.notes.push(t);
|
|
1504
|
+
},
|
|
1505
|
+
lastActor: function() {
|
|
1506
|
+
return this.actors[this.actors.length - 1];
|
|
1507
|
+
},
|
|
1508
|
+
lastLoop: function() {
|
|
1509
|
+
return this.loops[this.loops.length - 1];
|
|
1510
|
+
},
|
|
1511
|
+
lastMessage: function() {
|
|
1512
|
+
return this.messages[this.messages.length - 1];
|
|
1513
|
+
},
|
|
1514
|
+
lastNote: function() {
|
|
1515
|
+
return this.notes[this.notes.length - 1];
|
|
1516
|
+
},
|
|
1517
|
+
actors: [],
|
|
1518
|
+
boxes: [],
|
|
1519
|
+
loops: [],
|
|
1520
|
+
messages: [],
|
|
1521
|
+
notes: []
|
|
1522
|
+
},
|
|
1523
|
+
init: function() {
|
|
1524
|
+
this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
|
|
1525
|
+
startx: void 0,
|
|
1526
|
+
stopx: void 0,
|
|
1527
|
+
starty: void 0,
|
|
1528
|
+
stopy: void 0
|
|
1529
|
+
}, this.verticalPos = 0, xe(st());
|
|
1530
|
+
},
|
|
1531
|
+
updateVal: function(t, e, o, s) {
|
|
1532
|
+
t[e] === void 0 ? t[e] = o : t[e] = s(o, t[e]);
|
|
1533
|
+
},
|
|
1534
|
+
updateBounds: function(t, e, o, s) {
|
|
1535
|
+
const i = this;
|
|
1536
|
+
let a = 0;
|
|
1537
|
+
function c(l) {
|
|
1538
|
+
return function(r) {
|
|
1539
|
+
a++;
|
|
1540
|
+
const x = i.sequenceItems.length - a + 1;
|
|
1541
|
+
i.updateVal(r, "starty", e - x * n.boxMargin, Math.min), i.updateVal(r, "stopy", s + x * n.boxMargin, Math.max), i.updateVal(f.data, "startx", t - x * n.boxMargin, Math.min), i.updateVal(f.data, "stopx", o + x * n.boxMargin, Math.max), l !== "activation" && (i.updateVal(r, "startx", t - x * n.boxMargin, Math.min), i.updateVal(r, "stopx", o + x * n.boxMargin, Math.max), i.updateVal(f.data, "starty", e - x * n.boxMargin, Math.min), i.updateVal(f.data, "stopy", s + x * n.boxMargin, Math.max));
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
|
|
1545
|
+
},
|
|
1546
|
+
insert: function(t, e, o, s) {
|
|
1547
|
+
const i = v.getMin(t, o), a = v.getMax(t, o), c = v.getMin(e, s), l = v.getMax(e, s);
|
|
1548
|
+
this.updateVal(f.data, "startx", i, Math.min), this.updateVal(f.data, "starty", c, Math.min), this.updateVal(f.data, "stopx", a, Math.max), this.updateVal(f.data, "stopy", l, Math.max), this.updateBounds(i, c, a, l);
|
|
1549
|
+
},
|
|
1550
|
+
newActivation: function(t, e, o) {
|
|
1551
|
+
const s = o[t.from.actor], i = St(t.from.actor).length || 0, a = s.x + s.width / 2 + (i - 1) * n.activationWidth / 2;
|
|
1552
|
+
this.activations.push({
|
|
1553
|
+
startx: a,
|
|
1554
|
+
starty: this.verticalPos + 2,
|
|
1555
|
+
stopx: a + n.activationWidth,
|
|
1556
|
+
stopy: void 0,
|
|
1557
|
+
actor: t.from.actor,
|
|
1558
|
+
anchored: D.anchorElement(e)
|
|
1559
|
+
});
|
|
1560
|
+
},
|
|
1561
|
+
endActivation: function(t) {
|
|
1562
|
+
const e = this.activations.map(function(o) {
|
|
1563
|
+
return o.actor;
|
|
1564
|
+
}).lastIndexOf(t.from.actor);
|
|
1565
|
+
return this.activations.splice(e, 1)[0];
|
|
1566
|
+
},
|
|
1567
|
+
createLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
|
|
1568
|
+
return {
|
|
1569
|
+
startx: void 0,
|
|
1570
|
+
starty: this.verticalPos,
|
|
1571
|
+
stopx: void 0,
|
|
1572
|
+
stopy: void 0,
|
|
1573
|
+
title: t.message,
|
|
1574
|
+
wrap: t.wrap,
|
|
1575
|
+
width: t.width,
|
|
1576
|
+
height: 0,
|
|
1577
|
+
fill: e
|
|
1578
|
+
};
|
|
1579
|
+
},
|
|
1580
|
+
newLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
|
|
1581
|
+
this.sequenceItems.push(this.createLoop(t, e));
|
|
1582
|
+
},
|
|
1583
|
+
endLoop: function() {
|
|
1584
|
+
return this.sequenceItems.pop();
|
|
1585
|
+
},
|
|
1586
|
+
isLoopOverlap: function() {
|
|
1587
|
+
return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
|
|
1588
|
+
},
|
|
1589
|
+
addSectionToLoop: function(t) {
|
|
1590
|
+
const e = this.sequenceItems.pop();
|
|
1591
|
+
e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: f.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
|
|
1592
|
+
},
|
|
1593
|
+
saveVerticalPos: function() {
|
|
1594
|
+
this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
|
|
1595
|
+
},
|
|
1596
|
+
resetVerticalPos: function() {
|
|
1597
|
+
this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
|
|
1598
|
+
},
|
|
1599
|
+
bumpVerticalPos: function(t) {
|
|
1600
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = v.getMax(this.data.stopy, this.verticalPos);
|
|
1601
|
+
},
|
|
1602
|
+
getVerticalPos: function() {
|
|
1603
|
+
return this.verticalPos;
|
|
1604
|
+
},
|
|
1605
|
+
getBounds: function() {
|
|
1606
|
+
return { bounds: this.data, models: this.models };
|
|
1607
|
+
}
|
|
1608
|
+
}, P0 = async function(t, e) {
|
|
1609
|
+
f.bumpVerticalPos(n.boxMargin), e.height = n.boxMargin, e.starty = f.getVerticalPos();
|
|
1610
|
+
const o = Nt();
|
|
1611
|
+
o.x = e.startx, o.y = e.starty, o.width = e.width || n.width, o.class = "note";
|
|
1612
|
+
const s = t.append("g"), i = D.drawRect(s, o), a = zt();
|
|
1613
|
+
a.x = e.startx, a.y = e.starty, a.width = o.width, a.dy = "1em", a.text = e.message, a.class = "noteText", a.fontFamily = n.noteFontFamily, a.fontSize = n.noteFontSize, a.fontWeight = n.noteFontWeight, a.anchor = n.noteAlign, a.textMargin = n.noteMargin, a.valign = "center";
|
|
1614
|
+
const c = nt(a.text) ? await It(s, a) : bt(s, a), l = Math.round(
|
|
1615
|
+
c.map((p) => (p._groups || p)[0][0].getBBox().height).reduce((p, r) => p + r)
|
|
1616
|
+
);
|
|
1617
|
+
i.attr("height", l + 2 * n.noteMargin), e.height += l + 2 * n.noteMargin, f.bumpVerticalPos(l + 2 * n.noteMargin), e.stopy = e.starty + l + 2 * n.noteMargin, e.stopx = e.startx + o.width, f.insert(e.startx, e.starty, e.stopx, e.stopy), f.models.addNote(e);
|
|
1618
|
+
}, xt = (t) => ({
|
|
1619
|
+
fontFamily: t.messageFontFamily,
|
|
1620
|
+
fontSize: t.messageFontSize,
|
|
1621
|
+
fontWeight: t.messageFontWeight
|
|
1622
|
+
}), Tt = (t) => ({
|
|
1623
|
+
fontFamily: t.noteFontFamily,
|
|
1624
|
+
fontSize: t.noteFontSize,
|
|
1625
|
+
fontWeight: t.noteFontWeight
|
|
1626
|
+
}), Wt = (t) => ({
|
|
1627
|
+
fontFamily: t.actorFontFamily,
|
|
1628
|
+
fontSize: t.actorFontSize,
|
|
1629
|
+
fontWeight: t.actorFontWeight
|
|
1630
|
+
});
|
|
1631
|
+
async function L0(t, e) {
|
|
1632
|
+
f.bumpVerticalPos(10);
|
|
1633
|
+
const { startx: o, stopx: s, message: i } = e, a = v.splitBreaks(i).length, c = nt(i), l = c ? await wt(i, st()) : B.calculateTextDimensions(i, xt(n));
|
|
1634
|
+
if (!c) {
|
|
1635
|
+
const T = l.height / a;
|
|
1636
|
+
e.height += T, f.bumpVerticalPos(T);
|
|
1637
|
+
}
|
|
1638
|
+
let p, r = l.height - 10;
|
|
1639
|
+
const x = l.width;
|
|
1640
|
+
if (o === s) {
|
|
1641
|
+
p = f.getVerticalPos() + r, n.rightAngles || (r += n.boxMargin, p = f.getVerticalPos() + r), r += 30;
|
|
1642
|
+
const T = v.getMax(x / 2, n.width / 2);
|
|
1643
|
+
f.insert(
|
|
1644
|
+
o - T,
|
|
1645
|
+
f.getVerticalPos() - 10 + r,
|
|
1646
|
+
s + T,
|
|
1647
|
+
f.getVerticalPos() + 30 + r
|
|
1648
|
+
);
|
|
1649
|
+
} else
|
|
1650
|
+
r += n.boxMargin, p = f.getVerticalPos() + r, f.insert(o, p - 10, s, p);
|
|
1651
|
+
return f.bumpVerticalPos(r), e.height += r, e.stopy = e.starty + e.height, f.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), p;
|
|
1652
|
+
}
|
|
1653
|
+
const I0 = async function(t, e, o, s) {
|
|
1654
|
+
const { startx: i, stopx: a, starty: c, message: l, type: p, sequenceIndex: r, sequenceVisible: x } = e, T = B.calculateTextDimensions(l, xt(n)), u = zt();
|
|
1655
|
+
u.x = i, u.y = c + 10, u.width = a - i, u.class = "messageText", u.dy = "1em", u.text = l, u.fontFamily = n.messageFontFamily, u.fontSize = n.messageFontSize, u.fontWeight = n.messageFontWeight, u.anchor = n.messageAlign, u.valign = "center", u.textMargin = n.wrapPadding, u.tspan = !1, nt(u.text) ? await It(t, u, { startx: i, stopx: a, starty: o }) : bt(t, u);
|
|
1656
|
+
const g = T.width;
|
|
1657
|
+
let m;
|
|
1658
|
+
i === a ? n.rightAngles ? m = t.append("path").attr(
|
|
1659
|
+
"d",
|
|
1660
|
+
`M ${i},${o} H ${i + v.getMax(n.width / 2, g / 2)} V ${o + 25} H ${i}`
|
|
1661
|
+
) : m = t.append("path").attr(
|
|
1662
|
+
"d",
|
|
1663
|
+
"M " + i + "," + o + " C " + (i + 60) + "," + (o - 10) + " " + (i + 60) + "," + (o + 30) + " " + i + "," + (o + 20)
|
|
1664
|
+
) : (m = t.append("line"), m.attr("x1", i), m.attr("y1", o), m.attr("x2", a), m.attr("y2", o)), p === s.db.LINETYPE.DOTTED || p === s.db.LINETYPE.DOTTED_CROSS || p === s.db.LINETYPE.DOTTED_POINT || p === s.db.LINETYPE.DOTTED_OPEN ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
|
|
1665
|
+
let _ = "";
|
|
1666
|
+
n.arrowMarkerAbsolute && (_ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, _ = _.replace(/\(/g, "\\("), _ = _.replace(/\)/g, "\\)")), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (p === s.db.LINETYPE.SOLID || p === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + _ + "#arrowhead)"), (p === s.db.LINETYPE.SOLID_POINT || p === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + _ + "#filled-head)"), (p === s.db.LINETYPE.SOLID_CROSS || p === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + _ + "#crosshead)"), (x || n.showSequenceNumbers) && (m.attr("marker-start", "url(" + _ + "#sequencenumber)"), t.append("text").attr("x", i).attr("y", o + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(r));
|
|
1667
|
+
}, A0 = async function(t, e, o, s, i, a, c) {
|
|
1668
|
+
let l = 0, p = 0, r, x = 0;
|
|
1669
|
+
for (const T of s) {
|
|
1670
|
+
const u = e[T], g = u.box;
|
|
1671
|
+
r && r != g && (f.models.addBox(r), p += n.boxMargin + r.margin), g && g != r && (g.x = l + p, g.y = i, p += g.margin), u.width = u.width || n.width, u.height = v.getMax(u.height || n.height, n.height), u.margin = u.margin || n.actorMargin, x = v.getMax(x, u.height), o[u.name] && (p += u.width / 2), u.x = l + p, u.starty = f.getVerticalPos(), f.insert(u.x, i, u.x + u.width, u.height), l += u.width + p, u.box && (u.box.width = l + g.margin - u.box.x), p = u.margin, r = u.box, f.models.addActor(u);
|
|
1672
|
+
}
|
|
1673
|
+
r && f.models.addBox(r), f.bumpVerticalPos(x);
|
|
1674
|
+
}, qt = async function(t, e, o, s) {
|
|
1675
|
+
if (s) {
|
|
1676
|
+
let i = 0;
|
|
1677
|
+
f.bumpVerticalPos(n.boxMargin * 2);
|
|
1678
|
+
for (const a of o) {
|
|
1679
|
+
const c = e[a];
|
|
1680
|
+
c.stopy || (c.stopy = f.getVerticalPos());
|
|
1681
|
+
const l = await D.drawActor(t, c, n, !0);
|
|
1682
|
+
i = v.getMax(i, l);
|
|
1683
|
+
}
|
|
1684
|
+
f.bumpVerticalPos(i + n.boxMargin);
|
|
1685
|
+
} else
|
|
1686
|
+
for (const i of o) {
|
|
1687
|
+
const a = e[i];
|
|
1688
|
+
await D.drawActor(t, a, n, !1);
|
|
1689
|
+
}
|
|
1690
|
+
}, ge = function(t, e, o, s) {
|
|
1691
|
+
let i = 0, a = 0;
|
|
1692
|
+
for (const c of o) {
|
|
1693
|
+
const l = e[c], p = R0(l), r = D.drawPopup(
|
|
1694
|
+
t,
|
|
1695
|
+
l,
|
|
1696
|
+
p,
|
|
1697
|
+
n,
|
|
1698
|
+
n.forceMenus,
|
|
1699
|
+
s
|
|
1700
|
+
);
|
|
1701
|
+
r.height > i && (i = r.height), r.width + l.x > a && (a = r.width + l.x);
|
|
1702
|
+
}
|
|
1703
|
+
return { maxHeight: i, maxWidth: a };
|
|
1704
|
+
}, xe = function(t) {
|
|
1705
|
+
Ie(n, t), t.fontFamily && (n.actorFontFamily = n.noteFontFamily = n.messageFontFamily = t.fontFamily), t.fontSize && (n.actorFontSize = n.noteFontSize = n.messageFontSize = t.fontSize), t.fontWeight && (n.actorFontWeight = n.noteFontWeight = n.messageFontWeight = t.fontWeight);
|
|
1706
|
+
}, St = function(t) {
|
|
1707
|
+
return f.activations.filter(function(e) {
|
|
1708
|
+
return e.actor === t;
|
|
1709
|
+
});
|
|
1710
|
+
}, jt = function(t, e) {
|
|
1711
|
+
const o = e[t], s = St(t), i = s.reduce(function(c, l) {
|
|
1712
|
+
return v.getMin(c, l.startx);
|
|
1713
|
+
}, o.x + o.width / 2 - 1), a = s.reduce(function(c, l) {
|
|
1714
|
+
return v.getMax(c, l.stopx);
|
|
1715
|
+
}, o.x + o.width / 2 + 1);
|
|
1716
|
+
return [i, a];
|
|
1717
|
+
};
|
|
1718
|
+
function it(t, e, o, s, i) {
|
|
1719
|
+
f.bumpVerticalPos(o);
|
|
1720
|
+
let a = s;
|
|
1721
|
+
if (e.id && e.message && t[e.id]) {
|
|
1722
|
+
const c = t[e.id].width, l = xt(n);
|
|
1723
|
+
e.message = B.wrapLabel(`[${e.message}]`, c - 2 * n.wrapPadding, l), e.width = c, e.wrap = !0;
|
|
1724
|
+
const p = B.calculateTextDimensions(e.message, l), r = v.getMax(p.height, n.labelBoxHeight);
|
|
1725
|
+
a = s + r, X.debug(`${r} - ${e.message}`);
|
|
1726
|
+
}
|
|
1727
|
+
i(e), f.bumpVerticalPos(a);
|
|
1728
|
+
}
|
|
1729
|
+
function N0(t, e, o, s, i, a, c) {
|
|
1730
|
+
function l(r, x) {
|
|
1731
|
+
r.x < i[t.from].x ? (f.insert(
|
|
1732
|
+
e.stopx - x,
|
|
1733
|
+
e.starty,
|
|
1734
|
+
e.startx,
|
|
1735
|
+
e.stopy + r.height / 2 + n.noteMargin
|
|
1736
|
+
), e.stopx = e.stopx + x) : (f.insert(
|
|
1737
|
+
e.startx,
|
|
1738
|
+
e.starty,
|
|
1739
|
+
e.stopx + x,
|
|
1740
|
+
e.stopy + r.height / 2 + n.noteMargin
|
|
1741
|
+
), e.stopx = e.stopx - x);
|
|
1742
|
+
}
|
|
1743
|
+
function p(r, x) {
|
|
1744
|
+
r.x < i[t.to].x ? (f.insert(
|
|
1745
|
+
e.startx - x,
|
|
1746
|
+
e.starty,
|
|
1747
|
+
e.stopx,
|
|
1748
|
+
e.stopy + r.height / 2 + n.noteMargin
|
|
1749
|
+
), e.startx = e.startx + x) : (f.insert(
|
|
1750
|
+
e.stopx,
|
|
1751
|
+
e.starty,
|
|
1752
|
+
e.startx + x,
|
|
1753
|
+
e.stopy + r.height / 2 + n.noteMargin
|
|
1754
|
+
), e.startx = e.startx - x);
|
|
1755
|
+
}
|
|
1756
|
+
if (a[t.to] == s) {
|
|
1757
|
+
const r = i[t.to], x = r.type == "actor" ? ft / 2 + 3 : r.width / 2 + 3;
|
|
1758
|
+
l(r, x), r.starty = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
|
|
1759
|
+
} else if (c[t.from] == s) {
|
|
1760
|
+
const r = i[t.from];
|
|
1761
|
+
if (n.mirrorActors) {
|
|
1762
|
+
const x = r.type == "actor" ? ft / 2 : r.width / 2;
|
|
1763
|
+
p(r, x);
|
|
1764
|
+
}
|
|
1765
|
+
r.stopy = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
|
|
1766
|
+
} else if (c[t.to] == s) {
|
|
1767
|
+
const r = i[t.to];
|
|
1768
|
+
if (n.mirrorActors) {
|
|
1769
|
+
const x = r.type == "actor" ? ft / 2 + 3 : r.width / 2 + 3;
|
|
1770
|
+
l(r, x);
|
|
1771
|
+
}
|
|
1772
|
+
r.stopy = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
const S0 = async function(t, e, o, s) {
|
|
1776
|
+
const { securityLevel: i, sequence: a } = st();
|
|
1777
|
+
n = a;
|
|
1778
|
+
let c;
|
|
1779
|
+
i === "sandbox" && (c = Lt("#i" + e));
|
|
1780
|
+
const l = i === "sandbox" ? Lt(c.nodes()[0].contentDocument.body) : Lt("body"), p = i === "sandbox" ? c.nodes()[0].contentDocument : document;
|
|
1781
|
+
f.init(), X.debug(s.db);
|
|
1782
|
+
const r = i === "sandbox" ? l.select(`[id="${e}"]`) : Lt(`[id="${e}"]`), x = s.db.getActors(), T = s.db.getCreatedActors(), u = s.db.getDestroyedActors(), g = s.db.getBoxes();
|
|
1783
|
+
let m = s.db.getActorKeys();
|
|
1784
|
+
const _ = s.db.getMessages(), I = s.db.getDiagramTitle(), V = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), O = await M0(x, _, s);
|
|
1785
|
+
if (n.height = await C0(x, O, g), D.insertComputerIcon(r), D.insertDatabaseIcon(r), D.insertClockIcon(r), V && (f.bumpVerticalPos(n.boxMargin), S && f.bumpVerticalPos(g[0].textMaxHeight)), n.hideUnusedParticipants === !0) {
|
|
1786
|
+
const y = /* @__PURE__ */ new Set();
|
|
1787
|
+
_.forEach((P) => {
|
|
1788
|
+
y.add(P.from), y.add(P.to);
|
|
1789
|
+
}), m = m.filter((P) => y.has(P));
|
|
1790
|
+
}
|
|
1791
|
+
await A0(r, x, T, m, 0);
|
|
1792
|
+
const R = await O0(_, x, O, s);
|
|
1793
|
+
D.insertArrowHead(r), D.insertArrowCrossHead(r), D.insertArrowFilledHead(r), D.insertSequenceNumber(r);
|
|
1794
|
+
function q(y, P) {
|
|
1795
|
+
const j = f.endActivation(y);
|
|
1796
|
+
j.starty + 18 > P && (j.starty = P - 6, P += 12), D.drawActivation(
|
|
1797
|
+
r,
|
|
1798
|
+
j,
|
|
1799
|
+
P,
|
|
1800
|
+
n,
|
|
1801
|
+
St(y.from.actor).length
|
|
1802
|
+
), f.insert(j.startx, P - 10, j.stopx, P);
|
|
1803
|
+
}
|
|
1804
|
+
let z = 1, J = 1;
|
|
1805
|
+
const $ = [], H = [];
|
|
1806
|
+
let U = 0;
|
|
1807
|
+
for (const y of _) {
|
|
1808
|
+
let P, j, rt;
|
|
1809
|
+
switch (y.type) {
|
|
1810
|
+
case s.db.LINETYPE.NOTE:
|
|
1811
|
+
f.resetVerticalPos(), j = y.noteModel, await P0(r, j);
|
|
1812
|
+
break;
|
|
1813
|
+
case s.db.LINETYPE.ACTIVE_START:
|
|
1814
|
+
f.newActivation(y, r, x);
|
|
1815
|
+
break;
|
|
1816
|
+
case s.db.LINETYPE.ACTIVE_END:
|
|
1817
|
+
q(y, f.getVerticalPos());
|
|
1818
|
+
break;
|
|
1819
|
+
case s.db.LINETYPE.LOOP_START:
|
|
1820
|
+
it(
|
|
1821
|
+
R,
|
|
1822
|
+
y,
|
|
1823
|
+
n.boxMargin,
|
|
1824
|
+
n.boxMargin + n.boxTextMargin,
|
|
1825
|
+
(A) => f.newLoop(A)
|
|
1826
|
+
);
|
|
1827
|
+
break;
|
|
1828
|
+
case s.db.LINETYPE.LOOP_END:
|
|
1829
|
+
P = f.endLoop(), await D.drawLoop(r, P, "loop", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1830
|
+
break;
|
|
1831
|
+
case s.db.LINETYPE.RECT_START:
|
|
1832
|
+
it(
|
|
1833
|
+
R,
|
|
1834
|
+
y,
|
|
1835
|
+
n.boxMargin,
|
|
1836
|
+
n.boxMargin,
|
|
1837
|
+
(A) => f.newLoop(void 0, A.message)
|
|
1838
|
+
);
|
|
1839
|
+
break;
|
|
1840
|
+
case s.db.LINETYPE.RECT_END:
|
|
1841
|
+
P = f.endLoop(), H.push(P), f.models.addLoop(P), f.bumpVerticalPos(P.stopy - f.getVerticalPos());
|
|
1842
|
+
break;
|
|
1843
|
+
case s.db.LINETYPE.OPT_START:
|
|
1844
|
+
it(
|
|
1845
|
+
R,
|
|
1846
|
+
y,
|
|
1847
|
+
n.boxMargin,
|
|
1848
|
+
n.boxMargin + n.boxTextMargin,
|
|
1849
|
+
(A) => f.newLoop(A)
|
|
1850
|
+
);
|
|
1851
|
+
break;
|
|
1852
|
+
case s.db.LINETYPE.OPT_END:
|
|
1853
|
+
P = f.endLoop(), await D.drawLoop(r, P, "opt", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1854
|
+
break;
|
|
1855
|
+
case s.db.LINETYPE.ALT_START:
|
|
1856
|
+
it(
|
|
1857
|
+
R,
|
|
1858
|
+
y,
|
|
1859
|
+
n.boxMargin,
|
|
1860
|
+
n.boxMargin + n.boxTextMargin,
|
|
1861
|
+
(A) => f.newLoop(A)
|
|
1862
|
+
);
|
|
1863
|
+
break;
|
|
1864
|
+
case s.db.LINETYPE.ALT_ELSE:
|
|
1865
|
+
it(
|
|
1866
|
+
R,
|
|
1867
|
+
y,
|
|
1868
|
+
n.boxMargin + n.boxTextMargin,
|
|
1869
|
+
n.boxMargin,
|
|
1870
|
+
(A) => f.addSectionToLoop(A)
|
|
1871
|
+
);
|
|
1872
|
+
break;
|
|
1873
|
+
case s.db.LINETYPE.ALT_END:
|
|
1874
|
+
P = f.endLoop(), await D.drawLoop(r, P, "alt", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1875
|
+
break;
|
|
1876
|
+
case s.db.LINETYPE.PAR_START:
|
|
1877
|
+
case s.db.LINETYPE.PAR_OVER_START:
|
|
1878
|
+
it(
|
|
1879
|
+
R,
|
|
1880
|
+
y,
|
|
1881
|
+
n.boxMargin,
|
|
1882
|
+
n.boxMargin + n.boxTextMargin,
|
|
1883
|
+
(A) => f.newLoop(A)
|
|
1884
|
+
), f.saveVerticalPos();
|
|
1885
|
+
break;
|
|
1886
|
+
case s.db.LINETYPE.PAR_AND:
|
|
1887
|
+
it(
|
|
1888
|
+
R,
|
|
1889
|
+
y,
|
|
1890
|
+
n.boxMargin + n.boxTextMargin,
|
|
1891
|
+
n.boxMargin,
|
|
1892
|
+
(A) => f.addSectionToLoop(A)
|
|
1893
|
+
);
|
|
1894
|
+
break;
|
|
1895
|
+
case s.db.LINETYPE.PAR_END:
|
|
1896
|
+
P = f.endLoop(), await D.drawLoop(r, P, "par", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1897
|
+
break;
|
|
1898
|
+
case s.db.LINETYPE.AUTONUMBER:
|
|
1899
|
+
z = y.message.start || z, J = y.message.step || J, y.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
|
|
1900
|
+
break;
|
|
1901
|
+
case s.db.LINETYPE.CRITICAL_START:
|
|
1902
|
+
it(
|
|
1903
|
+
R,
|
|
1904
|
+
y,
|
|
1905
|
+
n.boxMargin,
|
|
1906
|
+
n.boxMargin + n.boxTextMargin,
|
|
1907
|
+
(A) => f.newLoop(A)
|
|
1908
|
+
);
|
|
1909
|
+
break;
|
|
1910
|
+
case s.db.LINETYPE.CRITICAL_OPTION:
|
|
1911
|
+
it(
|
|
1912
|
+
R,
|
|
1913
|
+
y,
|
|
1914
|
+
n.boxMargin + n.boxTextMargin,
|
|
1915
|
+
n.boxMargin,
|
|
1916
|
+
(A) => f.addSectionToLoop(A)
|
|
1917
|
+
);
|
|
1918
|
+
break;
|
|
1919
|
+
case s.db.LINETYPE.CRITICAL_END:
|
|
1920
|
+
P = f.endLoop(), await D.drawLoop(r, P, "critical", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1921
|
+
break;
|
|
1922
|
+
case s.db.LINETYPE.BREAK_START:
|
|
1923
|
+
it(
|
|
1924
|
+
R,
|
|
1925
|
+
y,
|
|
1926
|
+
n.boxMargin,
|
|
1927
|
+
n.boxMargin + n.boxTextMargin,
|
|
1928
|
+
(A) => f.newLoop(A)
|
|
1929
|
+
);
|
|
1930
|
+
break;
|
|
1931
|
+
case s.db.LINETYPE.BREAK_END:
|
|
1932
|
+
P = f.endLoop(), await D.drawLoop(r, P, "break", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
|
|
1933
|
+
break;
|
|
1934
|
+
default:
|
|
1935
|
+
try {
|
|
1936
|
+
rt = y.msgModel, rt.starty = f.getVerticalPos(), rt.sequenceIndex = z, rt.sequenceVisible = s.db.showSequenceNumbers();
|
|
1937
|
+
const A = await L0(r, rt);
|
|
1938
|
+
N0(
|
|
1939
|
+
y,
|
|
1940
|
+
rt,
|
|
1941
|
+
A,
|
|
1942
|
+
U,
|
|
1943
|
+
x,
|
|
1944
|
+
T,
|
|
1945
|
+
u
|
|
1946
|
+
), $.push({ messageModel: rt, lineStartY: A }), f.models.addMessage(rt);
|
|
1947
|
+
} catch (A) {
|
|
1948
|
+
X.error("error while drawing message", A);
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
[
|
|
1952
|
+
s.db.LINETYPE.SOLID_OPEN,
|
|
1953
|
+
s.db.LINETYPE.DOTTED_OPEN,
|
|
1954
|
+
s.db.LINETYPE.SOLID,
|
|
1955
|
+
s.db.LINETYPE.DOTTED,
|
|
1956
|
+
s.db.LINETYPE.SOLID_CROSS,
|
|
1957
|
+
s.db.LINETYPE.DOTTED_CROSS,
|
|
1958
|
+
s.db.LINETYPE.SOLID_POINT,
|
|
1959
|
+
s.db.LINETYPE.DOTTED_POINT
|
|
1960
|
+
].includes(y.type) && (z = z + J), U++;
|
|
1961
|
+
}
|
|
1962
|
+
X.debug("createdActors", T), X.debug("destroyedActors", u), await qt(r, x, m, !1);
|
|
1963
|
+
for (const y of $)
|
|
1964
|
+
await I0(r, y.messageModel, y.lineStartY, s);
|
|
1965
|
+
n.mirrorActors && await qt(r, x, m, !0), H.forEach((y) => D.drawBackgroundRect(r, y)), pe(r, x, m, n);
|
|
1966
|
+
for (const y of f.models.boxes)
|
|
1967
|
+
y.height = f.getVerticalPos() - y.y, f.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)", await D.drawBox(r, y, n);
|
|
1968
|
+
V && f.bumpVerticalPos(n.boxMargin);
|
|
1969
|
+
const F = ge(r, x, m, p), { bounds: W } = f.getBounds();
|
|
1970
|
+
let Z = W.stopy - W.starty;
|
|
1971
|
+
Z < F.maxHeight && (Z = F.maxHeight);
|
|
1972
|
+
let K = Z + 2 * n.diagramMarginY;
|
|
1973
|
+
n.mirrorActors && (K = K - n.boxMargin + n.bottomMarginAdj);
|
|
1974
|
+
let Q = W.stopx - W.startx;
|
|
1975
|
+
Q < F.maxWidth && (Q = F.maxWidth);
|
|
1976
|
+
const tt = Q + 2 * n.diagramMarginX;
|
|
1977
|
+
I && r.append("text").text(I).attr("x", (W.stopx - W.startx) / 2 - 2 * n.diagramMarginX).attr("y", -25), Le(r, K, tt, n.useMaxWidth);
|
|
1978
|
+
const N = I ? 40 : 0;
|
|
1979
|
+
r.attr(
|
|
1980
|
+
"viewBox",
|
|
1981
|
+
W.startx - n.diagramMarginX + " -" + (n.diagramMarginY + N) + " " + tt + " " + (K + N)
|
|
1982
|
+
), X.debug("models:", f.models);
|
|
1983
|
+
};
|
|
1984
|
+
async function M0(t, e, o) {
|
|
1985
|
+
const s = {};
|
|
1986
|
+
for (const i of e)
|
|
1987
|
+
if (t[i.to] && t[i.from]) {
|
|
1988
|
+
const a = t[i.to];
|
|
1989
|
+
if (i.placement === o.db.PLACEMENT.LEFTOF && !a.prevActor || i.placement === o.db.PLACEMENT.RIGHTOF && !a.nextActor)
|
|
1990
|
+
continue;
|
|
1991
|
+
const c = i.placement !== void 0, l = !c, p = c ? Tt(n) : xt(n), r = i.wrap ? B.wrapLabel(i.message, n.width - 2 * n.wrapPadding, p) : i.message, T = (nt(r) ? await wt(i.message, st()) : B.calculateTextDimensions(r, p)).width + 2 * n.wrapPadding;
|
|
1992
|
+
l && i.from === a.nextActor ? s[i.to] = v.getMax(
|
|
1993
|
+
s[i.to] || 0,
|
|
1994
|
+
T
|
|
1995
|
+
) : l && i.from === a.prevActor ? s[i.from] = v.getMax(
|
|
1996
|
+
s[i.from] || 0,
|
|
1997
|
+
T
|
|
1998
|
+
) : l && i.from === i.to ? (s[i.from] = v.getMax(
|
|
1999
|
+
s[i.from] || 0,
|
|
2000
|
+
T / 2
|
|
2001
|
+
), s[i.to] = v.getMax(
|
|
2002
|
+
s[i.to] || 0,
|
|
2003
|
+
T / 2
|
|
2004
|
+
)) : i.placement === o.db.PLACEMENT.RIGHTOF ? s[i.from] = v.getMax(
|
|
2005
|
+
s[i.from] || 0,
|
|
2006
|
+
T
|
|
2007
|
+
) : i.placement === o.db.PLACEMENT.LEFTOF ? s[a.prevActor] = v.getMax(
|
|
2008
|
+
s[a.prevActor] || 0,
|
|
2009
|
+
T
|
|
2010
|
+
) : i.placement === o.db.PLACEMENT.OVER && (a.prevActor && (s[a.prevActor] = v.getMax(
|
|
2011
|
+
s[a.prevActor] || 0,
|
|
2012
|
+
T / 2
|
|
2013
|
+
)), a.nextActor && (s[i.from] = v.getMax(
|
|
2014
|
+
s[i.from] || 0,
|
|
2015
|
+
T / 2
|
|
2016
|
+
)));
|
|
2017
|
+
}
|
|
2018
|
+
return X.debug("maxMessageWidthPerActor:", s), s;
|
|
2019
|
+
}
|
|
2020
|
+
const R0 = function(t) {
|
|
2021
|
+
let e = 0;
|
|
2022
|
+
const o = Wt(n);
|
|
2023
|
+
for (const s in t.links) {
|
|
2024
|
+
const a = B.calculateTextDimensions(s, o).width + 2 * n.wrapPadding + 2 * n.boxMargin;
|
|
2025
|
+
e < a && (e = a);
|
|
2026
|
+
}
|
|
2027
|
+
return e;
|
|
2028
|
+
};
|
|
2029
|
+
async function C0(t, e, o) {
|
|
2030
|
+
let s = 0;
|
|
2031
|
+
for (const a of Object.keys(t)) {
|
|
2032
|
+
const c = t[a];
|
|
2033
|
+
c.wrap && (c.description = B.wrapLabel(
|
|
2034
|
+
c.description,
|
|
2035
|
+
n.width - 2 * n.wrapPadding,
|
|
2036
|
+
Wt(n)
|
|
2037
|
+
));
|
|
2038
|
+
const l = nt(c.description) ? await wt(c.description, st()) : B.calculateTextDimensions(c.description, Wt(n));
|
|
2039
|
+
c.width = c.wrap ? n.width : v.getMax(n.width, l.width + 2 * n.wrapPadding), c.height = c.wrap ? v.getMax(l.height, n.height) : n.height, s = v.getMax(s, c.height);
|
|
2040
|
+
}
|
|
2041
|
+
for (const a in e) {
|
|
2042
|
+
const c = t[a];
|
|
2043
|
+
if (!c)
|
|
2044
|
+
continue;
|
|
2045
|
+
const l = t[c.nextActor];
|
|
2046
|
+
if (!l) {
|
|
2047
|
+
const T = e[a] + n.actorMargin - c.width / 2;
|
|
2048
|
+
c.margin = v.getMax(T, n.actorMargin);
|
|
2049
|
+
continue;
|
|
2050
|
+
}
|
|
2051
|
+
const r = e[a] + n.actorMargin - c.width / 2 - l.width / 2;
|
|
2052
|
+
c.margin = v.getMax(r, n.actorMargin);
|
|
2053
|
+
}
|
|
2054
|
+
let i = 0;
|
|
2055
|
+
return o.forEach((a) => {
|
|
2056
|
+
const c = xt(n);
|
|
2057
|
+
let l = a.actorKeys.reduce((x, T) => x += t[T].width + (t[T].margin || 0), 0);
|
|
2058
|
+
l -= 2 * n.boxTextMargin, a.wrap && (a.name = B.wrapLabel(a.name, l - 2 * n.wrapPadding, c));
|
|
2059
|
+
const p = B.calculateTextDimensions(a.name, c);
|
|
2060
|
+
i = v.getMax(p.height, i);
|
|
2061
|
+
const r = v.getMax(l, p.width + 2 * n.wrapPadding);
|
|
2062
|
+
if (a.margin = n.boxTextMargin, l < r) {
|
|
2063
|
+
const x = (r - l) / 2;
|
|
2064
|
+
a.margin += x;
|
|
2065
|
+
}
|
|
2066
|
+
}), o.forEach((a) => a.textMaxHeight = i), v.getMax(s, n.height);
|
|
2067
|
+
}
|
|
2068
|
+
const D0 = async function(t, e, o) {
|
|
2069
|
+
const s = e[t.from].x, i = e[t.to].x, a = t.wrap && t.message;
|
|
2070
|
+
let c = nt(t.message) ? await wt(t.message, st()) : B.calculateTextDimensions(
|
|
2071
|
+
a ? B.wrapLabel(t.message, n.width, Tt(n)) : t.message,
|
|
2072
|
+
Tt(n)
|
|
2073
|
+
);
|
|
2074
|
+
const l = {
|
|
2075
|
+
width: a ? n.width : v.getMax(n.width, c.width + 2 * n.noteMargin),
|
|
2076
|
+
height: 0,
|
|
2077
|
+
startx: e[t.from].x,
|
|
2078
|
+
stopx: 0,
|
|
2079
|
+
starty: 0,
|
|
2080
|
+
stopy: 0,
|
|
2081
|
+
message: t.message
|
|
2082
|
+
};
|
|
2083
|
+
return t.placement === o.db.PLACEMENT.RIGHTOF ? (l.width = a ? v.getMax(n.width, c.width) : v.getMax(
|
|
2084
|
+
e[t.from].width / 2 + e[t.to].width / 2,
|
|
2085
|
+
c.width + 2 * n.noteMargin
|
|
2086
|
+
), l.startx = s + (e[t.from].width + n.actorMargin) / 2) : t.placement === o.db.PLACEMENT.LEFTOF ? (l.width = a ? v.getMax(n.width, c.width + 2 * n.noteMargin) : v.getMax(
|
|
2087
|
+
e[t.from].width / 2 + e[t.to].width / 2,
|
|
2088
|
+
c.width + 2 * n.noteMargin
|
|
2089
|
+
), l.startx = s - l.width + (e[t.from].width - n.actorMargin) / 2) : t.to === t.from ? (c = B.calculateTextDimensions(
|
|
2090
|
+
a ? B.wrapLabel(
|
|
2091
|
+
t.message,
|
|
2092
|
+
v.getMax(n.width, e[t.from].width),
|
|
2093
|
+
Tt(n)
|
|
2094
|
+
) : t.message,
|
|
2095
|
+
Tt(n)
|
|
2096
|
+
), l.width = a ? v.getMax(n.width, e[t.from].width) : v.getMax(
|
|
2097
|
+
e[t.from].width,
|
|
2098
|
+
n.width,
|
|
2099
|
+
c.width + 2 * n.noteMargin
|
|
2100
|
+
), l.startx = s + (e[t.from].width - l.width) / 2) : (l.width = Math.abs(s + e[t.from].width / 2 - (i + e[t.to].width / 2)) + n.actorMargin, l.startx = s < i ? s + e[t.from].width / 2 - n.actorMargin / 2 : i + e[t.to].width / 2 - n.actorMargin / 2), a && (l.message = B.wrapLabel(
|
|
2101
|
+
t.message,
|
|
2102
|
+
l.width - 2 * n.wrapPadding,
|
|
2103
|
+
Tt(n)
|
|
2104
|
+
)), X.debug(
|
|
2105
|
+
`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`
|
|
2106
|
+
), l;
|
|
2107
|
+
}, V0 = function(t, e, o) {
|
|
2108
|
+
if (![
|
|
2109
|
+
o.db.LINETYPE.SOLID_OPEN,
|
|
2110
|
+
o.db.LINETYPE.DOTTED_OPEN,
|
|
2111
|
+
o.db.LINETYPE.SOLID,
|
|
2112
|
+
o.db.LINETYPE.DOTTED,
|
|
2113
|
+
o.db.LINETYPE.SOLID_CROSS,
|
|
2114
|
+
o.db.LINETYPE.DOTTED_CROSS,
|
|
2115
|
+
o.db.LINETYPE.SOLID_POINT,
|
|
2116
|
+
o.db.LINETYPE.DOTTED_POINT
|
|
2117
|
+
].includes(t.type))
|
|
2118
|
+
return {};
|
|
2119
|
+
const [s, i] = jt(t.from, e), [a, c] = jt(t.to, e), l = s <= a, p = l ? i : s;
|
|
2120
|
+
let r = l ? a : c;
|
|
2121
|
+
const x = Math.abs(a - c) > 2, T = (_) => l ? -_ : _;
|
|
2122
|
+
t.from === t.to ? r = p : (t.activate && !x && (r += T(n.activationWidth / 2 - 1)), [o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (r += T(3)));
|
|
2123
|
+
const u = [s, i, a, c], g = Math.abs(p - r);
|
|
2124
|
+
t.wrap && t.message && (t.message = B.wrapLabel(
|
|
2125
|
+
t.message,
|
|
2126
|
+
v.getMax(g + 2 * n.wrapPadding, n.width),
|
|
2127
|
+
xt(n)
|
|
2128
|
+
));
|
|
2129
|
+
const m = B.calculateTextDimensions(t.message, xt(n));
|
|
2130
|
+
return {
|
|
2131
|
+
width: v.getMax(
|
|
2132
|
+
t.wrap ? 0 : m.width + 2 * n.wrapPadding,
|
|
2133
|
+
g + 2 * n.wrapPadding,
|
|
2134
|
+
n.width
|
|
2135
|
+
),
|
|
2136
|
+
height: 0,
|
|
2137
|
+
startx: p,
|
|
2138
|
+
stopx: r,
|
|
2139
|
+
starty: 0,
|
|
2140
|
+
stopy: 0,
|
|
2141
|
+
message: t.message,
|
|
2142
|
+
type: t.type,
|
|
2143
|
+
wrap: t.wrap,
|
|
2144
|
+
fromBounds: Math.min.apply(null, u),
|
|
2145
|
+
toBounds: Math.max.apply(null, u)
|
|
2146
|
+
};
|
|
2147
|
+
}, O0 = async function(t, e, o, s) {
|
|
2148
|
+
const i = {}, a = [];
|
|
2149
|
+
let c, l, p;
|
|
2150
|
+
for (const r of t) {
|
|
2151
|
+
switch (r.id = B.random({ length: 10 }), r.type) {
|
|
2152
|
+
case s.db.LINETYPE.LOOP_START:
|
|
2153
|
+
case s.db.LINETYPE.ALT_START:
|
|
2154
|
+
case s.db.LINETYPE.OPT_START:
|
|
2155
|
+
case s.db.LINETYPE.PAR_START:
|
|
2156
|
+
case s.db.LINETYPE.PAR_OVER_START:
|
|
2157
|
+
case s.db.LINETYPE.CRITICAL_START:
|
|
2158
|
+
case s.db.LINETYPE.BREAK_START:
|
|
2159
|
+
a.push({
|
|
2160
|
+
id: r.id,
|
|
2161
|
+
msg: r.message,
|
|
2162
|
+
from: Number.MAX_SAFE_INTEGER,
|
|
2163
|
+
to: Number.MIN_SAFE_INTEGER,
|
|
2164
|
+
width: 0
|
|
2165
|
+
});
|
|
2166
|
+
break;
|
|
2167
|
+
case s.db.LINETYPE.ALT_ELSE:
|
|
2168
|
+
case s.db.LINETYPE.PAR_AND:
|
|
2169
|
+
case s.db.LINETYPE.CRITICAL_OPTION:
|
|
2170
|
+
r.message && (c = a.pop(), i[c.id] = c, i[r.id] = c, a.push(c));
|
|
2171
|
+
break;
|
|
2172
|
+
case s.db.LINETYPE.LOOP_END:
|
|
2173
|
+
case s.db.LINETYPE.ALT_END:
|
|
2174
|
+
case s.db.LINETYPE.OPT_END:
|
|
2175
|
+
case s.db.LINETYPE.PAR_END:
|
|
2176
|
+
case s.db.LINETYPE.CRITICAL_END:
|
|
2177
|
+
case s.db.LINETYPE.BREAK_END:
|
|
2178
|
+
c = a.pop(), i[c.id] = c;
|
|
2179
|
+
break;
|
|
2180
|
+
case s.db.LINETYPE.ACTIVE_START:
|
|
2181
|
+
{
|
|
2182
|
+
const T = e[r.from ? r.from.actor : r.to.actor], u = St(r.from ? r.from.actor : r.to.actor).length, g = T.x + T.width / 2 + (u - 1) * n.activationWidth / 2, m = {
|
|
2183
|
+
startx: g,
|
|
2184
|
+
stopx: g + n.activationWidth,
|
|
2185
|
+
actor: r.from.actor,
|
|
2186
|
+
enabled: !0
|
|
2187
|
+
};
|
|
2188
|
+
f.activations.push(m);
|
|
2189
|
+
}
|
|
2190
|
+
break;
|
|
2191
|
+
case s.db.LINETYPE.ACTIVE_END:
|
|
2192
|
+
{
|
|
2193
|
+
const T = f.activations.map((u) => u.actor).lastIndexOf(r.from.actor);
|
|
2194
|
+
delete f.activations.splice(T, 1)[0];
|
|
2195
|
+
}
|
|
2196
|
+
break;
|
|
2197
|
+
}
|
|
2198
|
+
r.placement !== void 0 ? (l = await D0(r, e, s), r.noteModel = l, a.forEach((T) => {
|
|
2199
|
+
c = T, c.from = v.getMin(c.from, l.startx), c.to = v.getMax(c.to, l.startx + l.width), c.width = v.getMax(c.width, Math.abs(c.from - c.to)) - n.labelBoxWidth;
|
|
2200
|
+
})) : (p = V0(r, e, s), r.msgModel = p, p.startx && p.stopx && a.length > 0 && a.forEach((T) => {
|
|
2201
|
+
if (c = T, p.startx === p.stopx) {
|
|
2202
|
+
const u = e[r.from], g = e[r.to];
|
|
2203
|
+
c.from = v.getMin(
|
|
2204
|
+
u.x - p.width / 2,
|
|
2205
|
+
u.x - u.width / 2,
|
|
2206
|
+
c.from
|
|
2207
|
+
), c.to = v.getMax(
|
|
2208
|
+
g.x + p.width / 2,
|
|
2209
|
+
g.x + u.width / 2,
|
|
2210
|
+
c.to
|
|
2211
|
+
), c.width = v.getMax(c.width, Math.abs(c.to - c.from)) - n.labelBoxWidth;
|
|
2212
|
+
} else
|
|
2213
|
+
c.from = v.getMin(p.startx, c.from), c.to = v.getMax(p.stopx, c.to), c.width = v.getMax(c.width, p.width) - n.labelBoxWidth;
|
|
2214
|
+
}));
|
|
2215
|
+
}
|
|
2216
|
+
return f.activations = [], X.debug("Loop type widths:", i), i;
|
|
2217
|
+
}, B0 = {
|
|
2218
|
+
bounds: f,
|
|
2219
|
+
drawActors: qt,
|
|
2220
|
+
drawActorsPopup: ge,
|
|
2221
|
+
setConf: xe,
|
|
2222
|
+
draw: S0
|
|
2223
|
+
}, W0 = {
|
|
2224
|
+
parser: De,
|
|
2225
|
+
db: Qt,
|
|
2226
|
+
renderer: B0,
|
|
2227
|
+
styles: o0,
|
|
2228
|
+
init: ({ wrap: t }) => {
|
|
2229
|
+
Qt.setWrap(t);
|
|
2230
|
+
}
|
|
2231
|
+
};
|
|
2232
|
+
export {
|
|
2233
|
+
W0 as diagram
|
|
2234
|
+
};
|