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