@schmitech/chatbot-widget 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tableau10-D7jGxypv-BNlEL2G_.js +9 -0
- package/dist/arc-D-ZI5fuh-CvDHBzlN.js +84 -0
- package/dist/blockDiagram-c4efeb88-DUnNxfIR-Bhh-x1q6.js +1221 -0
- package/dist/c4Diagram-c83219d4-cC4OxfBG-DRTO_jy5.js +1580 -0
- package/dist/channel-hcYozyrT-BSOc2Hp-.js +6 -0
- package/dist/chatbot-widget.bundle.js +3881 -1586
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +12 -63659
- package/dist/chatbot-widget.umd.js +3880 -1585
- package/dist/classDiagram-beda092f-BLYhf5Mr-vk4Ko58U.js +218 -0
- package/dist/classDiagram-v2-2358418a-VBkbF8mr-Ca0l1fEs.js +201 -0
- package/dist/clone-BZIkCMuw-B9owNq6E.js +9 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/createText-1719965b-UejsQ47k-B1DYw0WW.js +2955 -0
- package/dist/edges-96097737-1M5QvjOd-BpQVVoQN.js +1088 -0
- package/dist/erDiagram-0228fc6a-CjBNxHoC-DXDVlH55.js +929 -0
- package/dist/flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js +1127 -0
- package/dist/flowDiagram-50d868cf-zizL6ppE-BAH-_juu.js +788 -0
- package/dist/flowDiagram-v2-4f6560a1-DVx_vlO5-bkcRE0UW.js +18 -0
- package/dist/flowchart-elk-definition-6af322e1-Eyez36go-B_lk3oHt.js +48132 -0
- package/dist/ganttDiagram-a2739b55-C82Jv-TO-DoS-s1Yu.js +1743 -0
- package/dist/gitGraphDiagram-82fe8481-D9o_9-U8-DJF-ZeR8.js +1265 -0
- package/dist/graph-BjmGDpTe-DgbYS1Ie.js +848 -0
- package/dist/index-5325376f-CJL5w-Sw-BXp44Ej5.js +374 -0
- package/dist/index-s6Yb6o1D.js +116386 -0
- package/dist/infoDiagram-8eee0895-FpS-TLK_-BnvO_wUe.js +320 -0
- package/dist/journeyDiagram-c64418c1-CMj1efQ9-CshcRDhm.js +802 -0
- package/dist/layout-D_6hdlf3-B7guhEBN.js +1470 -0
- package/dist/mindmap-definition-8da855dc-D4SxHjUd-jFZFomnk.js +21924 -0
- package/dist/pieDiagram-a8764435-BF5ZqOjB-Mqzg2J4Q.js +498 -0
- package/dist/quadrantDiagram-1e28029f-GtQb80VU-DCy1QjzW.js +903 -0
- package/dist/requirementDiagram-08caed73-CHtPj3FO-AHEP0cIt.js +767 -0
- package/dist/sankeyDiagram-a04cb91d-CBlXzOgd-CWJTc5AX.js +802 -0
- package/dist/sequenceDiagram-c5b8d532-Cs1iyw97-oayOJE8v.js +2235 -0
- package/dist/shared/styles.d.ts +1 -1
- package/dist/stateDiagram-1ecb1508-CpRKICMQ-C5OFJeRZ.js +266 -0
- package/dist/stateDiagram-v2-c2b004d7-BtkhFyQ5-DxzE8Je5.js +185 -0
- package/dist/styles-b4e223ce-D0oeHeKH-BmNvk4NR.js +1090 -0
- package/dist/styles-ca3715f6-BouNgl-L-_qXsPDP3.js +961 -0
- package/dist/styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js +437 -0
- package/dist/svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js +65 -0
- package/dist/timeline-definition-faaaa080-3olbep_P-BqKpgsPZ.js +793 -0
- package/dist/ui/Message.d.ts +1 -5
- package/dist/ui/MessagesList.d.ts +1 -5
- package/dist/xychartDiagram-f5964ef8-BN6HXpmW-C-g_F1w2.js +1238 -0
- package/package.json +3 -3
- package/dist/ui/TypingEffect.d.ts +0 -18
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
import { v as ut, y as yt, b as pt, a as ft, w as dt, x as gt, g as I, P as z, W as mt, m as xt } from "./index-s6Yb6o1D.js";
|
|
2
|
+
import { x as kt, p as nt, d as _t, l as bt } from "./svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js";
|
|
3
|
+
import { h as J } from "./arc-D-ZI5fuh-CvDHBzlN.js";
|
|
4
|
+
typeof window < "u" && (window.global = window);
|
|
5
|
+
var X = function() {
|
|
6
|
+
var t = function(d, i, r, c) {
|
|
7
|
+
for (r = r || {}, c = d.length; c--; r[d[c]] = i)
|
|
8
|
+
;
|
|
9
|
+
return r;
|
|
10
|
+
}, e = [6, 8, 10, 11, 12, 14, 16, 17, 18], s = [1, 9], o = [1, 10], n = [1, 11], l = [1, 12], u = [1, 13], y = [1, 14], p = {
|
|
11
|
+
trace: function() {
|
|
12
|
+
},
|
|
13
|
+
yy: {},
|
|
14
|
+
symbols_: { error: 2, start: 3, journey: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, title: 11, acc_title: 12, acc_title_value: 13, acc_descr: 14, acc_descr_value: 15, acc_descr_multiline_value: 16, section: 17, taskName: 18, taskData: 19, $accept: 0, $end: 1 },
|
|
15
|
+
terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" },
|
|
16
|
+
productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]],
|
|
17
|
+
performAction: function(d, i, r, c, h, a, g) {
|
|
18
|
+
var x = a.length - 1;
|
|
19
|
+
switch (h) {
|
|
20
|
+
case 1:
|
|
21
|
+
return a[x - 1];
|
|
22
|
+
case 2:
|
|
23
|
+
this.$ = [];
|
|
24
|
+
break;
|
|
25
|
+
case 3:
|
|
26
|
+
a[x - 1].push(a[x]), this.$ = a[x - 1];
|
|
27
|
+
break;
|
|
28
|
+
case 4:
|
|
29
|
+
case 5:
|
|
30
|
+
this.$ = a[x];
|
|
31
|
+
break;
|
|
32
|
+
case 6:
|
|
33
|
+
case 7:
|
|
34
|
+
this.$ = [];
|
|
35
|
+
break;
|
|
36
|
+
case 8:
|
|
37
|
+
c.setDiagramTitle(a[x].substr(6)), this.$ = a[x].substr(6);
|
|
38
|
+
break;
|
|
39
|
+
case 9:
|
|
40
|
+
this.$ = a[x].trim(), c.setAccTitle(this.$);
|
|
41
|
+
break;
|
|
42
|
+
case 10:
|
|
43
|
+
case 11:
|
|
44
|
+
this.$ = a[x].trim(), c.setAccDescription(this.$);
|
|
45
|
+
break;
|
|
46
|
+
case 12:
|
|
47
|
+
c.addSection(a[x].substr(8)), this.$ = a[x].substr(8);
|
|
48
|
+
break;
|
|
49
|
+
case 13:
|
|
50
|
+
c.addTask(a[x - 1], a[x]), this.$ = "task";
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(e, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: s, 12: o, 14: n, 16: l, 17: u, 18: y }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: s, 12: o, 14: n, 16: l, 17: u, 18: y }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, t(e, [2, 11]), t(e, [2, 12]), { 19: [1, 18] }, t(e, [2, 4]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 13])],
|
|
55
|
+
defaultActions: {},
|
|
56
|
+
parseError: function(d, i) {
|
|
57
|
+
if (i.recoverable)
|
|
58
|
+
this.trace(d);
|
|
59
|
+
else {
|
|
60
|
+
var r = new Error(d);
|
|
61
|
+
throw r.hash = i, r;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
parse: function(d) {
|
|
65
|
+
var i = this, r = [0], c = [], h = [null], a = [], g = this.table, x = "", L = 0, U = 0, ot = 2, Z = 1, lt = a.slice.call(arguments, 1), k = Object.create(this.lexer), T = { yy: {} };
|
|
66
|
+
for (var N in this.yy)
|
|
67
|
+
Object.prototype.hasOwnProperty.call(this.yy, N) && (T.yy[N] = this.yy[N]);
|
|
68
|
+
k.setInput(d, T.yy), T.yy.lexer = k, T.yy.parser = this, typeof k.yylloc > "u" && (k.yylloc = {});
|
|
69
|
+
var R = k.yylloc;
|
|
70
|
+
a.push(R);
|
|
71
|
+
var ct = k.options && k.options.ranges;
|
|
72
|
+
typeof T.yy.parseError == "function" ? this.parseError = T.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
73
|
+
function ht() {
|
|
74
|
+
var $;
|
|
75
|
+
return $ = c.pop() || k.lex() || Z, typeof $ != "number" && ($ instanceof Array && (c = $, $ = c.pop()), $ = i.symbols_[$] || $), $;
|
|
76
|
+
}
|
|
77
|
+
for (var _, S, b, B, C = {}, D, w, H, F; ; ) {
|
|
78
|
+
if (S = r[r.length - 1], this.defaultActions[S] ? b = this.defaultActions[S] : ((_ === null || typeof _ > "u") && (_ = ht()), b = g[S] && g[S][_]), typeof b > "u" || !b.length || !b[0]) {
|
|
79
|
+
var Y = "";
|
|
80
|
+
F = [];
|
|
81
|
+
for (D in g[S])
|
|
82
|
+
this.terminals_[D] && D > ot && F.push("'" + this.terminals_[D] + "'");
|
|
83
|
+
k.showPosition ? Y = "Parse error on line " + (L + 1) + `:
|
|
84
|
+
` + k.showPosition() + `
|
|
85
|
+
Expecting ` + F.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : Y = "Parse error on line " + (L + 1) + ": Unexpected " + (_ == Z ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(Y, {
|
|
86
|
+
text: k.match,
|
|
87
|
+
token: this.terminals_[_] || _,
|
|
88
|
+
line: k.yylineno,
|
|
89
|
+
loc: R,
|
|
90
|
+
expected: F
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (b[0] instanceof Array && b.length > 1)
|
|
94
|
+
throw new Error("Parse Error: multiple actions possible at state: " + S + ", token: " + _);
|
|
95
|
+
switch (b[0]) {
|
|
96
|
+
case 1:
|
|
97
|
+
r.push(_), h.push(k.yytext), a.push(k.yylloc), r.push(b[1]), _ = null, U = k.yyleng, x = k.yytext, L = k.yylineno, R = k.yylloc;
|
|
98
|
+
break;
|
|
99
|
+
case 2:
|
|
100
|
+
if (w = this.productions_[b[1]][1], C.$ = h[h.length - w], C._$ = {
|
|
101
|
+
first_line: a[a.length - (w || 1)].first_line,
|
|
102
|
+
last_line: a[a.length - 1].last_line,
|
|
103
|
+
first_column: a[a.length - (w || 1)].first_column,
|
|
104
|
+
last_column: a[a.length - 1].last_column
|
|
105
|
+
}, ct && (C._$.range = [
|
|
106
|
+
a[a.length - (w || 1)].range[0],
|
|
107
|
+
a[a.length - 1].range[1]
|
|
108
|
+
]), B = this.performAction.apply(C, [
|
|
109
|
+
x,
|
|
110
|
+
U,
|
|
111
|
+
L,
|
|
112
|
+
T.yy,
|
|
113
|
+
b[1],
|
|
114
|
+
h,
|
|
115
|
+
a
|
|
116
|
+
].concat(lt)), typeof B < "u")
|
|
117
|
+
return B;
|
|
118
|
+
w && (r = r.slice(0, -1 * w * 2), h = h.slice(0, -1 * w), a = a.slice(0, -1 * w)), r.push(this.productions_[b[1]][0]), h.push(C.$), a.push(C._$), H = g[r[r.length - 2]][r[r.length - 1]], r.push(H);
|
|
119
|
+
break;
|
|
120
|
+
case 3:
|
|
121
|
+
return !0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return !0;
|
|
125
|
+
}
|
|
126
|
+
}, m = /* @__PURE__ */ function() {
|
|
127
|
+
var d = {
|
|
128
|
+
EOF: 1,
|
|
129
|
+
parseError: function(i, r) {
|
|
130
|
+
if (this.yy.parser)
|
|
131
|
+
this.yy.parser.parseError(i, r);
|
|
132
|
+
else
|
|
133
|
+
throw new Error(i);
|
|
134
|
+
},
|
|
135
|
+
// resets the lexer, sets new input
|
|
136
|
+
setInput: function(i, r) {
|
|
137
|
+
return this.yy = r || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
138
|
+
first_line: 1,
|
|
139
|
+
first_column: 0,
|
|
140
|
+
last_line: 1,
|
|
141
|
+
last_column: 0
|
|
142
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
143
|
+
},
|
|
144
|
+
// consumes and returns one char from the input
|
|
145
|
+
input: function() {
|
|
146
|
+
var i = this._input[0];
|
|
147
|
+
this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
|
|
148
|
+
var r = i.match(/(?:\r\n?|\n).*/g);
|
|
149
|
+
return r ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
|
|
150
|
+
},
|
|
151
|
+
// unshifts one char (or a string) into the input
|
|
152
|
+
unput: function(i) {
|
|
153
|
+
var r = i.length, c = i.split(/(?:\r\n?|\n)/g);
|
|
154
|
+
this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r;
|
|
155
|
+
var h = this.match.split(/(?:\r\n?|\n)/g);
|
|
156
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
|
|
157
|
+
var a = this.yylloc.range;
|
|
158
|
+
return this.yylloc = {
|
|
159
|
+
first_line: this.yylloc.first_line,
|
|
160
|
+
last_line: this.yylineno + 1,
|
|
161
|
+
first_column: this.yylloc.first_column,
|
|
162
|
+
last_column: c ? (c.length === h.length ? this.yylloc.first_column : 0) + h[h.length - c.length].length - c[0].length : this.yylloc.first_column - r
|
|
163
|
+
}, this.options.ranges && (this.yylloc.range = [a[0], a[0] + this.yyleng - r]), this.yyleng = this.yytext.length, this;
|
|
164
|
+
},
|
|
165
|
+
// When called from action, caches matched text and appends it on next action
|
|
166
|
+
more: function() {
|
|
167
|
+
return this._more = !0, this;
|
|
168
|
+
},
|
|
169
|
+
// 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.
|
|
170
|
+
reject: function() {
|
|
171
|
+
if (this.options.backtrack_lexer)
|
|
172
|
+
this._backtrack = !0;
|
|
173
|
+
else
|
|
174
|
+
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).
|
|
175
|
+
` + this.showPosition(), {
|
|
176
|
+
text: "",
|
|
177
|
+
token: null,
|
|
178
|
+
line: this.yylineno
|
|
179
|
+
});
|
|
180
|
+
return this;
|
|
181
|
+
},
|
|
182
|
+
// retain first n characters of the match
|
|
183
|
+
less: function(i) {
|
|
184
|
+
this.unput(this.match.slice(i));
|
|
185
|
+
},
|
|
186
|
+
// displays already matched input, i.e. for error messages
|
|
187
|
+
pastInput: function() {
|
|
188
|
+
var i = this.matched.substr(0, this.matched.length - this.match.length);
|
|
189
|
+
return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
|
|
190
|
+
},
|
|
191
|
+
// displays upcoming input, i.e. for error messages
|
|
192
|
+
upcomingInput: function() {
|
|
193
|
+
var i = this.match;
|
|
194
|
+
return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
195
|
+
},
|
|
196
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
197
|
+
showPosition: function() {
|
|
198
|
+
var i = this.pastInput(), r = new Array(i.length + 1).join("-");
|
|
199
|
+
return i + this.upcomingInput() + `
|
|
200
|
+
` + r + "^";
|
|
201
|
+
},
|
|
202
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
203
|
+
test_match: function(i, r) {
|
|
204
|
+
var c, h, a;
|
|
205
|
+
if (this.options.backtrack_lexer && (a = {
|
|
206
|
+
yylineno: this.yylineno,
|
|
207
|
+
yylloc: {
|
|
208
|
+
first_line: this.yylloc.first_line,
|
|
209
|
+
last_line: this.last_line,
|
|
210
|
+
first_column: this.yylloc.first_column,
|
|
211
|
+
last_column: this.yylloc.last_column
|
|
212
|
+
},
|
|
213
|
+
yytext: this.yytext,
|
|
214
|
+
match: this.match,
|
|
215
|
+
matches: this.matches,
|
|
216
|
+
matched: this.matched,
|
|
217
|
+
yyleng: this.yyleng,
|
|
218
|
+
offset: this.offset,
|
|
219
|
+
_more: this._more,
|
|
220
|
+
_input: this._input,
|
|
221
|
+
yy: this.yy,
|
|
222
|
+
conditionStack: this.conditionStack.slice(0),
|
|
223
|
+
done: this.done
|
|
224
|
+
}, this.options.ranges && (a.yylloc.range = this.yylloc.range.slice(0))), h = i[0].match(/(?:\r\n?|\n).*/g), h && (this.yylineno += h.length), this.yylloc = {
|
|
225
|
+
first_line: this.yylloc.last_line,
|
|
226
|
+
last_line: this.yylineno + 1,
|
|
227
|
+
first_column: this.yylloc.last_column,
|
|
228
|
+
last_column: h ? h[h.length - 1].length - h[h.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
|
|
229
|
+
}, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
|
|
230
|
+
return c;
|
|
231
|
+
if (this._backtrack) {
|
|
232
|
+
for (var g in a)
|
|
233
|
+
this[g] = a[g];
|
|
234
|
+
return !1;
|
|
235
|
+
}
|
|
236
|
+
return !1;
|
|
237
|
+
},
|
|
238
|
+
// return next match in input
|
|
239
|
+
next: function() {
|
|
240
|
+
if (this.done)
|
|
241
|
+
return this.EOF;
|
|
242
|
+
this._input || (this.done = !0);
|
|
243
|
+
var i, r, c, h;
|
|
244
|
+
this._more || (this.yytext = "", this.match = "");
|
|
245
|
+
for (var a = this._currentRules(), g = 0; g < a.length; g++)
|
|
246
|
+
if (c = this._input.match(this.rules[a[g]]), c && (!r || c[0].length > r[0].length)) {
|
|
247
|
+
if (r = c, h = g, this.options.backtrack_lexer) {
|
|
248
|
+
if (i = this.test_match(c, a[g]), i !== !1)
|
|
249
|
+
return i;
|
|
250
|
+
if (this._backtrack) {
|
|
251
|
+
r = !1;
|
|
252
|
+
continue;
|
|
253
|
+
} else
|
|
254
|
+
return !1;
|
|
255
|
+
} else if (!this.options.flex)
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
return r ? (i = this.test_match(r, a[h]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
259
|
+
` + this.showPosition(), {
|
|
260
|
+
text: "",
|
|
261
|
+
token: null,
|
|
262
|
+
line: this.yylineno
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
// return next match that has a token
|
|
266
|
+
lex: function() {
|
|
267
|
+
var i = this.next();
|
|
268
|
+
return i || this.lex();
|
|
269
|
+
},
|
|
270
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
271
|
+
begin: function(i) {
|
|
272
|
+
this.conditionStack.push(i);
|
|
273
|
+
},
|
|
274
|
+
// pop the previously active lexer condition state off the condition stack
|
|
275
|
+
popState: function() {
|
|
276
|
+
var i = this.conditionStack.length - 1;
|
|
277
|
+
return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
278
|
+
},
|
|
279
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
280
|
+
_currentRules: function() {
|
|
281
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
282
|
+
},
|
|
283
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
284
|
+
topState: function(i) {
|
|
285
|
+
return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
|
|
286
|
+
},
|
|
287
|
+
// alias for begin(condition)
|
|
288
|
+
pushState: function(i) {
|
|
289
|
+
this.begin(i);
|
|
290
|
+
},
|
|
291
|
+
// return the number of states currently on the stack
|
|
292
|
+
stateStackSize: function() {
|
|
293
|
+
return this.conditionStack.length;
|
|
294
|
+
},
|
|
295
|
+
options: { "case-insensitive": !0 },
|
|
296
|
+
performAction: function(i, r, c, h) {
|
|
297
|
+
switch (c) {
|
|
298
|
+
case 0:
|
|
299
|
+
break;
|
|
300
|
+
case 1:
|
|
301
|
+
break;
|
|
302
|
+
case 2:
|
|
303
|
+
return 10;
|
|
304
|
+
case 3:
|
|
305
|
+
break;
|
|
306
|
+
case 4:
|
|
307
|
+
break;
|
|
308
|
+
case 5:
|
|
309
|
+
return 4;
|
|
310
|
+
case 6:
|
|
311
|
+
return 11;
|
|
312
|
+
case 7:
|
|
313
|
+
return this.begin("acc_title"), 12;
|
|
314
|
+
case 8:
|
|
315
|
+
return this.popState(), "acc_title_value";
|
|
316
|
+
case 9:
|
|
317
|
+
return this.begin("acc_descr"), 14;
|
|
318
|
+
case 10:
|
|
319
|
+
return this.popState(), "acc_descr_value";
|
|
320
|
+
case 11:
|
|
321
|
+
this.begin("acc_descr_multiline");
|
|
322
|
+
break;
|
|
323
|
+
case 12:
|
|
324
|
+
this.popState();
|
|
325
|
+
break;
|
|
326
|
+
case 13:
|
|
327
|
+
return "acc_descr_multiline_value";
|
|
328
|
+
case 14:
|
|
329
|
+
return 17;
|
|
330
|
+
case 15:
|
|
331
|
+
return 18;
|
|
332
|
+
case 16:
|
|
333
|
+
return 19;
|
|
334
|
+
case 17:
|
|
335
|
+
return ":";
|
|
336
|
+
case 18:
|
|
337
|
+
return 6;
|
|
338
|
+
case 19:
|
|
339
|
+
return "INVALID";
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/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, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
|
|
343
|
+
conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], inclusive: !0 } }
|
|
344
|
+
};
|
|
345
|
+
return d;
|
|
346
|
+
}();
|
|
347
|
+
p.lexer = m;
|
|
348
|
+
function f() {
|
|
349
|
+
this.yy = {};
|
|
350
|
+
}
|
|
351
|
+
return f.prototype = p, p.Parser = f, new f();
|
|
352
|
+
}();
|
|
353
|
+
X.parser = X;
|
|
354
|
+
const vt = X;
|
|
355
|
+
let E = "";
|
|
356
|
+
const G = [], A = [], j = [], wt = function() {
|
|
357
|
+
G.length = 0, A.length = 0, E = "", j.length = 0, xt();
|
|
358
|
+
}, $t = function(t) {
|
|
359
|
+
E = t, G.push(t);
|
|
360
|
+
}, Mt = function() {
|
|
361
|
+
return G;
|
|
362
|
+
}, Tt = function() {
|
|
363
|
+
let t = Q();
|
|
364
|
+
const e = 100;
|
|
365
|
+
let s = 0;
|
|
366
|
+
for (; !t && s < e; )
|
|
367
|
+
t = Q(), s++;
|
|
368
|
+
return A.push(...j), A;
|
|
369
|
+
}, St = function() {
|
|
370
|
+
const t = [];
|
|
371
|
+
return A.forEach((e) => {
|
|
372
|
+
e.people && t.push(...e.people);
|
|
373
|
+
}), [...new Set(t)].sort();
|
|
374
|
+
}, Pt = function(t, e) {
|
|
375
|
+
const s = e.substr(1).split(":");
|
|
376
|
+
let o = 0, n = [];
|
|
377
|
+
s.length === 1 ? (o = Number(s[0]), n = []) : (o = Number(s[0]), n = s[1].split(","));
|
|
378
|
+
const l = n.map((y) => y.trim()), u = {
|
|
379
|
+
section: E,
|
|
380
|
+
type: E,
|
|
381
|
+
people: l,
|
|
382
|
+
task: t,
|
|
383
|
+
score: o
|
|
384
|
+
};
|
|
385
|
+
j.push(u);
|
|
386
|
+
}, It = function(t) {
|
|
387
|
+
const e = {
|
|
388
|
+
section: E,
|
|
389
|
+
type: E,
|
|
390
|
+
description: t,
|
|
391
|
+
task: t,
|
|
392
|
+
classes: []
|
|
393
|
+
};
|
|
394
|
+
A.push(e);
|
|
395
|
+
}, Q = function() {
|
|
396
|
+
const t = function(s) {
|
|
397
|
+
return j[s].processed;
|
|
398
|
+
};
|
|
399
|
+
let e = !0;
|
|
400
|
+
for (const [s, o] of j.entries())
|
|
401
|
+
t(s), e = e && o.processed;
|
|
402
|
+
return e;
|
|
403
|
+
}, Ct = function() {
|
|
404
|
+
return St();
|
|
405
|
+
}, K = {
|
|
406
|
+
getConfig: () => I().journey,
|
|
407
|
+
clear: wt,
|
|
408
|
+
setDiagramTitle: gt,
|
|
409
|
+
getDiagramTitle: dt,
|
|
410
|
+
setAccTitle: ft,
|
|
411
|
+
getAccTitle: pt,
|
|
412
|
+
setAccDescription: yt,
|
|
413
|
+
getAccDescription: ut,
|
|
414
|
+
addSection: $t,
|
|
415
|
+
getSections: Mt,
|
|
416
|
+
getTasks: Tt,
|
|
417
|
+
addTask: Pt,
|
|
418
|
+
addTaskOrg: It,
|
|
419
|
+
getActors: Ct
|
|
420
|
+
}, Et = (t) => `.label {
|
|
421
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
422
|
+
font-family: var(--mermaid-font-family);
|
|
423
|
+
color: ${t.textColor};
|
|
424
|
+
}
|
|
425
|
+
.mouth {
|
|
426
|
+
stroke: #666;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
line {
|
|
430
|
+
stroke: ${t.textColor}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.legend {
|
|
434
|
+
fill: ${t.textColor};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.label text {
|
|
438
|
+
fill: #333;
|
|
439
|
+
}
|
|
440
|
+
.label {
|
|
441
|
+
color: ${t.textColor}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.face {
|
|
445
|
+
${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
|
|
446
|
+
stroke: #999;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.node rect,
|
|
450
|
+
.node circle,
|
|
451
|
+
.node ellipse,
|
|
452
|
+
.node polygon,
|
|
453
|
+
.node path {
|
|
454
|
+
fill: ${t.mainBkg};
|
|
455
|
+
stroke: ${t.nodeBorder};
|
|
456
|
+
stroke-width: 1px;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.node .label {
|
|
460
|
+
text-align: center;
|
|
461
|
+
}
|
|
462
|
+
.node.clickable {
|
|
463
|
+
cursor: pointer;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.arrowheadPath {
|
|
467
|
+
fill: ${t.arrowheadColor};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.edgePath .path {
|
|
471
|
+
stroke: ${t.lineColor};
|
|
472
|
+
stroke-width: 1.5px;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.flowchart-link {
|
|
476
|
+
stroke: ${t.lineColor};
|
|
477
|
+
fill: none;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.edgeLabel {
|
|
481
|
+
background-color: ${t.edgeLabelBackground};
|
|
482
|
+
rect {
|
|
483
|
+
opacity: 0.5;
|
|
484
|
+
}
|
|
485
|
+
text-align: center;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.cluster rect {
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.cluster text {
|
|
492
|
+
fill: ${t.titleColor};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
div.mermaidTooltip {
|
|
496
|
+
position: absolute;
|
|
497
|
+
text-align: center;
|
|
498
|
+
max-width: 200px;
|
|
499
|
+
padding: 2px;
|
|
500
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
501
|
+
font-family: var(--mermaid-font-family);
|
|
502
|
+
font-size: 12px;
|
|
503
|
+
background: ${t.tertiaryColor};
|
|
504
|
+
border: 1px solid ${t.border2};
|
|
505
|
+
border-radius: 2px;
|
|
506
|
+
pointer-events: none;
|
|
507
|
+
z-index: 100;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.task-type-0, .section-type-0 {
|
|
511
|
+
${t.fillType0 ? `fill: ${t.fillType0}` : ""};
|
|
512
|
+
}
|
|
513
|
+
.task-type-1, .section-type-1 {
|
|
514
|
+
${t.fillType0 ? `fill: ${t.fillType1}` : ""};
|
|
515
|
+
}
|
|
516
|
+
.task-type-2, .section-type-2 {
|
|
517
|
+
${t.fillType0 ? `fill: ${t.fillType2}` : ""};
|
|
518
|
+
}
|
|
519
|
+
.task-type-3, .section-type-3 {
|
|
520
|
+
${t.fillType0 ? `fill: ${t.fillType3}` : ""};
|
|
521
|
+
}
|
|
522
|
+
.task-type-4, .section-type-4 {
|
|
523
|
+
${t.fillType0 ? `fill: ${t.fillType4}` : ""};
|
|
524
|
+
}
|
|
525
|
+
.task-type-5, .section-type-5 {
|
|
526
|
+
${t.fillType0 ? `fill: ${t.fillType5}` : ""};
|
|
527
|
+
}
|
|
528
|
+
.task-type-6, .section-type-6 {
|
|
529
|
+
${t.fillType0 ? `fill: ${t.fillType6}` : ""};
|
|
530
|
+
}
|
|
531
|
+
.task-type-7, .section-type-7 {
|
|
532
|
+
${t.fillType0 ? `fill: ${t.fillType7}` : ""};
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.actor-0 {
|
|
536
|
+
${t.actor0 ? `fill: ${t.actor0}` : ""};
|
|
537
|
+
}
|
|
538
|
+
.actor-1 {
|
|
539
|
+
${t.actor1 ? `fill: ${t.actor1}` : ""};
|
|
540
|
+
}
|
|
541
|
+
.actor-2 {
|
|
542
|
+
${t.actor2 ? `fill: ${t.actor2}` : ""};
|
|
543
|
+
}
|
|
544
|
+
.actor-3 {
|
|
545
|
+
${t.actor3 ? `fill: ${t.actor3}` : ""};
|
|
546
|
+
}
|
|
547
|
+
.actor-4 {
|
|
548
|
+
${t.actor4 ? `fill: ${t.actor4}` : ""};
|
|
549
|
+
}
|
|
550
|
+
.actor-5 {
|
|
551
|
+
${t.actor5 ? `fill: ${t.actor5}` : ""};
|
|
552
|
+
}
|
|
553
|
+
`, At = Et, q = function(t, e) {
|
|
554
|
+
return bt(t, e);
|
|
555
|
+
}, jt = function(t, e) {
|
|
556
|
+
const s = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), o = t.append("g");
|
|
557
|
+
o.append("circle").attr("cx", e.cx - 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), o.append("circle").attr("cx", e.cx + 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
|
|
558
|
+
function n(y) {
|
|
559
|
+
const p = J().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
560
|
+
y.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
|
|
561
|
+
}
|
|
562
|
+
function l(y) {
|
|
563
|
+
const p = J().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
564
|
+
y.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
|
|
565
|
+
}
|
|
566
|
+
function u(y) {
|
|
567
|
+
y.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", e.cx - 5).attr("y1", e.cy + 7).attr("x2", e.cx + 5).attr("y2", e.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
|
|
568
|
+
}
|
|
569
|
+
return e.score > 3 ? n(o) : e.score < 3 ? l(o) : u(o), s;
|
|
570
|
+
}, st = function(t, e) {
|
|
571
|
+
const s = t.append("circle");
|
|
572
|
+
return s.attr("cx", e.cx), s.attr("cy", e.cy), s.attr("class", "actor-" + e.pos), s.attr("fill", e.fill), s.attr("stroke", e.stroke), s.attr("r", e.r), s.class !== void 0 && s.attr("class", s.class), e.title !== void 0 && s.append("title").text(e.title), s;
|
|
573
|
+
}, rt = function(t, e) {
|
|
574
|
+
return _t(t, e);
|
|
575
|
+
}, Vt = function(t, e) {
|
|
576
|
+
function s(n, l, u, y, p) {
|
|
577
|
+
return n + "," + l + " " + (n + u) + "," + l + " " + (n + u) + "," + (l + y - p) + " " + (n + u - p * 1.2) + "," + (l + y) + " " + n + "," + (l + y);
|
|
578
|
+
}
|
|
579
|
+
const o = t.append("polygon");
|
|
580
|
+
o.attr("points", s(e.x, e.y, 50, 20, 7)), o.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, rt(t, e);
|
|
581
|
+
}, Lt = function(t, e, s) {
|
|
582
|
+
const o = t.append("g"), n = nt();
|
|
583
|
+
n.x = e.x, n.y = e.y, n.fill = e.fill, n.width = s.width * e.taskCount + // width of the tasks
|
|
584
|
+
s.diagramMarginX * (e.taskCount - 1), n.height = s.height, n.class = "journey-section section-type-" + e.num, n.rx = 3, n.ry = 3, q(o, n), at(s)(
|
|
585
|
+
e.text,
|
|
586
|
+
o,
|
|
587
|
+
n.x,
|
|
588
|
+
n.y,
|
|
589
|
+
n.width,
|
|
590
|
+
n.height,
|
|
591
|
+
{ class: "journey-section section-type-" + e.num },
|
|
592
|
+
s,
|
|
593
|
+
e.colour
|
|
594
|
+
);
|
|
595
|
+
};
|
|
596
|
+
let tt = -1;
|
|
597
|
+
const Dt = function(t, e, s) {
|
|
598
|
+
const o = e.x + s.width / 2, n = t.append("g");
|
|
599
|
+
tt++, n.append("line").attr("id", "task" + tt).attr("x1", o).attr("y1", e.y).attr("x2", o).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), jt(n, {
|
|
600
|
+
cx: o,
|
|
601
|
+
cy: 300 + (5 - e.score) * 30,
|
|
602
|
+
score: e.score
|
|
603
|
+
});
|
|
604
|
+
const l = nt();
|
|
605
|
+
l.x = e.x, l.y = e.y, l.fill = e.fill, l.width = s.width, l.height = s.height, l.class = "task task-type-" + e.num, l.rx = 3, l.ry = 3, q(n, l);
|
|
606
|
+
let u = e.x + 14;
|
|
607
|
+
e.people.forEach((y) => {
|
|
608
|
+
const p = e.actors[y].color, m = {
|
|
609
|
+
cx: u,
|
|
610
|
+
cy: e.y,
|
|
611
|
+
r: 7,
|
|
612
|
+
fill: p,
|
|
613
|
+
stroke: "#000",
|
|
614
|
+
title: y,
|
|
615
|
+
pos: e.actors[y].position
|
|
616
|
+
};
|
|
617
|
+
st(n, m), u += 10;
|
|
618
|
+
}), at(s)(
|
|
619
|
+
e.task,
|
|
620
|
+
n,
|
|
621
|
+
l.x,
|
|
622
|
+
l.y,
|
|
623
|
+
l.width,
|
|
624
|
+
l.height,
|
|
625
|
+
{ class: "task" },
|
|
626
|
+
s,
|
|
627
|
+
e.colour
|
|
628
|
+
);
|
|
629
|
+
}, Ft = function(t, e) {
|
|
630
|
+
kt(t, e);
|
|
631
|
+
}, at = /* @__PURE__ */ function() {
|
|
632
|
+
function t(n, l, u, y, p, m, f, d) {
|
|
633
|
+
const i = l.append("text").attr("x", u + p / 2).attr("y", y + m / 2 + 5).style("font-color", d).style("text-anchor", "middle").text(n);
|
|
634
|
+
o(i, f);
|
|
635
|
+
}
|
|
636
|
+
function e(n, l, u, y, p, m, f, d, i) {
|
|
637
|
+
const { taskFontSize: r, taskFontFamily: c } = d, h = n.split(/<br\s*\/?>/gi);
|
|
638
|
+
for (let a = 0; a < h.length; a++) {
|
|
639
|
+
const g = a * r - r * (h.length - 1) / 2, x = l.append("text").attr("x", u + p / 2).attr("y", y).attr("fill", i).style("text-anchor", "middle").style("font-size", r).style("font-family", c);
|
|
640
|
+
x.append("tspan").attr("x", u + p / 2).attr("dy", g).text(h[a]), x.attr("y", y + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), o(x, f);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function s(n, l, u, y, p, m, f, d) {
|
|
644
|
+
const i = l.append("switch"), r = i.append("foreignObject").attr("x", u).attr("y", y).attr("width", p).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
645
|
+
r.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), e(n, i, u, y, p, m, f, d), o(r, f);
|
|
646
|
+
}
|
|
647
|
+
function o(n, l) {
|
|
648
|
+
for (const u in l)
|
|
649
|
+
u in l && n.attr(u, l[u]);
|
|
650
|
+
}
|
|
651
|
+
return function(n) {
|
|
652
|
+
return n.textPlacement === "fo" ? s : n.textPlacement === "old" ? t : e;
|
|
653
|
+
};
|
|
654
|
+
}(), Ot = function(t) {
|
|
655
|
+
t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
|
|
656
|
+
}, V = {
|
|
657
|
+
drawRect: q,
|
|
658
|
+
drawCircle: st,
|
|
659
|
+
drawSection: Lt,
|
|
660
|
+
drawText: rt,
|
|
661
|
+
drawLabel: Vt,
|
|
662
|
+
drawTask: Dt,
|
|
663
|
+
drawBackgroundRect: Ft,
|
|
664
|
+
initGraphics: Ot
|
|
665
|
+
}, Nt = function(t) {
|
|
666
|
+
Object.keys(t).forEach(function(e) {
|
|
667
|
+
O[e] = t[e];
|
|
668
|
+
});
|
|
669
|
+
}, M = {};
|
|
670
|
+
function Rt(t) {
|
|
671
|
+
const e = I().journey;
|
|
672
|
+
let s = 60;
|
|
673
|
+
Object.keys(M).forEach((o) => {
|
|
674
|
+
const n = M[o].color, l = {
|
|
675
|
+
cx: 20,
|
|
676
|
+
cy: s,
|
|
677
|
+
r: 7,
|
|
678
|
+
fill: n,
|
|
679
|
+
stroke: "#000",
|
|
680
|
+
pos: M[o].position
|
|
681
|
+
};
|
|
682
|
+
V.drawCircle(t, l);
|
|
683
|
+
const u = {
|
|
684
|
+
x: 40,
|
|
685
|
+
y: s + 7,
|
|
686
|
+
fill: "#666",
|
|
687
|
+
text: o,
|
|
688
|
+
textMargin: e.boxTextMargin | 5
|
|
689
|
+
};
|
|
690
|
+
V.drawText(t, u), s += 20;
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
const O = I().journey, P = O.leftMargin, Bt = function(t, e, s, o) {
|
|
694
|
+
const n = I().journey, l = I().securityLevel;
|
|
695
|
+
let u;
|
|
696
|
+
l === "sandbox" && (u = z("#i" + e));
|
|
697
|
+
const y = l === "sandbox" ? z(u.nodes()[0].contentDocument.body) : z("body");
|
|
698
|
+
v.init();
|
|
699
|
+
const p = y.select("#" + e);
|
|
700
|
+
V.initGraphics(p);
|
|
701
|
+
const m = o.db.getTasks(), f = o.db.getDiagramTitle(), d = o.db.getActors();
|
|
702
|
+
for (const g in M)
|
|
703
|
+
delete M[g];
|
|
704
|
+
let i = 0;
|
|
705
|
+
d.forEach((g) => {
|
|
706
|
+
M[g] = {
|
|
707
|
+
color: n.actorColours[i % n.actorColours.length],
|
|
708
|
+
position: i
|
|
709
|
+
}, i++;
|
|
710
|
+
}), Rt(p), v.insert(0, 0, P, Object.keys(M).length * 50), Yt(p, m, 0);
|
|
711
|
+
const r = v.getBounds();
|
|
712
|
+
f && p.append("text").text(f).attr("x", P).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
|
|
713
|
+
const c = r.stopy - r.starty + 2 * n.diagramMarginY, h = P + r.stopx + 2 * n.diagramMarginX;
|
|
714
|
+
mt(p, c, h, n.useMaxWidth), p.append("line").attr("x1", P).attr("y1", n.height * 4).attr("x2", h - P - 4).attr("y2", n.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
|
|
715
|
+
const a = f ? 70 : 0;
|
|
716
|
+
p.attr("viewBox", `${r.startx} -25 ${h} ${c + a}`), p.attr("preserveAspectRatio", "xMinYMin meet"), p.attr("height", c + a + 25);
|
|
717
|
+
}, v = {
|
|
718
|
+
data: {
|
|
719
|
+
startx: void 0,
|
|
720
|
+
stopx: void 0,
|
|
721
|
+
starty: void 0,
|
|
722
|
+
stopy: void 0
|
|
723
|
+
},
|
|
724
|
+
verticalPos: 0,
|
|
725
|
+
sequenceItems: [],
|
|
726
|
+
init: function() {
|
|
727
|
+
this.sequenceItems = [], this.data = {
|
|
728
|
+
startx: void 0,
|
|
729
|
+
stopx: void 0,
|
|
730
|
+
starty: void 0,
|
|
731
|
+
stopy: void 0
|
|
732
|
+
}, this.verticalPos = 0;
|
|
733
|
+
},
|
|
734
|
+
updateVal: function(t, e, s, o) {
|
|
735
|
+
t[e] === void 0 ? t[e] = s : t[e] = o(s, t[e]);
|
|
736
|
+
},
|
|
737
|
+
updateBounds: function(t, e, s, o) {
|
|
738
|
+
const n = I().journey, l = this;
|
|
739
|
+
let u = 0;
|
|
740
|
+
function y(p) {
|
|
741
|
+
return function(m) {
|
|
742
|
+
u++;
|
|
743
|
+
const f = l.sequenceItems.length - u + 1;
|
|
744
|
+
l.updateVal(m, "starty", e - f * n.boxMargin, Math.min), l.updateVal(m, "stopy", o + f * n.boxMargin, Math.max), l.updateVal(v.data, "startx", t - f * n.boxMargin, Math.min), l.updateVal(v.data, "stopx", s + f * n.boxMargin, Math.max), l.updateVal(m, "startx", t - f * n.boxMargin, Math.min), l.updateVal(m, "stopx", s + f * n.boxMargin, Math.max), l.updateVal(v.data, "starty", e - f * n.boxMargin, Math.min), l.updateVal(v.data, "stopy", o + f * n.boxMargin, Math.max);
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
this.sequenceItems.forEach(y());
|
|
748
|
+
},
|
|
749
|
+
insert: function(t, e, s, o) {
|
|
750
|
+
const n = Math.min(t, s), l = Math.max(t, s), u = Math.min(e, o), y = Math.max(e, o);
|
|
751
|
+
this.updateVal(v.data, "startx", n, Math.min), this.updateVal(v.data, "starty", u, Math.min), this.updateVal(v.data, "stopx", l, Math.max), this.updateVal(v.data, "stopy", y, Math.max), this.updateBounds(n, u, l, y);
|
|
752
|
+
},
|
|
753
|
+
bumpVerticalPos: function(t) {
|
|
754
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
|
|
755
|
+
},
|
|
756
|
+
getVerticalPos: function() {
|
|
757
|
+
return this.verticalPos;
|
|
758
|
+
},
|
|
759
|
+
getBounds: function() {
|
|
760
|
+
return this.data;
|
|
761
|
+
}
|
|
762
|
+
}, W = O.sectionFills, et = O.sectionColours, Yt = function(t, e, s) {
|
|
763
|
+
const o = I().journey;
|
|
764
|
+
let n = "";
|
|
765
|
+
const l = o.height * 2 + o.diagramMarginY, u = s + l;
|
|
766
|
+
let y = 0, p = "#CCC", m = "black", f = 0;
|
|
767
|
+
for (const [d, i] of e.entries()) {
|
|
768
|
+
if (n !== i.section) {
|
|
769
|
+
p = W[y % W.length], f = y % W.length, m = et[y % et.length];
|
|
770
|
+
let c = 0;
|
|
771
|
+
const h = i.section;
|
|
772
|
+
for (let g = d; g < e.length && e[g].section == h; g++)
|
|
773
|
+
c = c + 1;
|
|
774
|
+
const a = {
|
|
775
|
+
x: d * o.taskMargin + d * o.width + P,
|
|
776
|
+
y: 50,
|
|
777
|
+
text: i.section,
|
|
778
|
+
fill: p,
|
|
779
|
+
num: f,
|
|
780
|
+
colour: m,
|
|
781
|
+
taskCount: c
|
|
782
|
+
};
|
|
783
|
+
V.drawSection(t, a, o), n = i.section, y++;
|
|
784
|
+
}
|
|
785
|
+
const r = i.people.reduce((c, h) => (M[h] && (c[h] = M[h]), c), {});
|
|
786
|
+
i.x = d * o.taskMargin + d * o.width + P, i.y = u, i.width = o.diagramMarginX, i.height = o.diagramMarginY, i.colour = m, i.fill = p, i.num = f, i.actors = r, V.drawTask(t, i, o), v.insert(i.x, i.y, i.x + i.width + o.taskMargin, 450);
|
|
787
|
+
}
|
|
788
|
+
}, it = {
|
|
789
|
+
setConf: Nt,
|
|
790
|
+
draw: Bt
|
|
791
|
+
}, Gt = {
|
|
792
|
+
parser: vt,
|
|
793
|
+
db: K,
|
|
794
|
+
renderer: it,
|
|
795
|
+
styles: At,
|
|
796
|
+
init: (t) => {
|
|
797
|
+
it.setConf(t.journey), K.clear();
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
export {
|
|
801
|
+
Gt as diagram
|
|
802
|
+
};
|