lowcoder-comps 0.0.29 → 0.0.31

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