@aidapt/caity-chat 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/lib/_baseUniq-BVCT-t6P.js +477 -0
- package/dist/lib/arc-Kj6ZmwPS.js +83 -0
- package/dist/lib/architectureDiagram-Q4EWVU46-DA4kYaz_.js +4690 -0
- package/dist/lib/blockDiagram-DXYQGD6D-BWT5yya1.js +2295 -0
- package/dist/lib/c4Diagram-AHTNJAMY-BjY6DW3U.js +1577 -0
- package/dist/lib/caity-chat.tgz +0 -0
- package/dist/lib/channel-BjraetTo.js +5 -0
- package/dist/lib/chunk-4BX2VUAB-iSPZGgxQ.js +8 -0
- package/dist/lib/chunk-4TB4RGXK-DvnUcLoe.js +1465 -0
- package/dist/lib/chunk-55IACEB6-Mw25YX9j.js +8 -0
- package/dist/lib/chunk-EDXVE4YY-Dtbxz7df.js +19 -0
- package/dist/lib/chunk-FMBD7UC4-OCIy3top.js +19 -0
- package/dist/lib/chunk-OYMX7WX6-DFW9El2C.js +1383 -0
- package/dist/lib/chunk-QZHKN3VN-BYFTfk7k.js +15 -0
- package/dist/lib/chunk-YZCP3GAM-Cs-HTcyJ.js +68 -0
- package/dist/lib/classDiagram-6PBFFD2Q-CrDUlIYr.js +16 -0
- package/dist/lib/classDiagram-v2-HSJHXN6E-CrDUlIYr.js +16 -0
- package/dist/lib/clone-C0qEGPCz.js +8 -0
- package/dist/lib/cose-bilkent-S5V4N54A-H1-YbKvI.js +2609 -0
- package/dist/lib/cytoscape.esm-D_3MZVO6.js +18707 -0
- package/dist/lib/dagre-KV5264BT-DhEnTJ4D.js +443 -0
- package/dist/lib/defaultLocale-BgPVtth8.js +171 -0
- package/dist/lib/diagram-5BDNPKRD-CK6wgKxI.js +123 -0
- package/dist/lib/diagram-G4DWMVQ6-IhA_MJ0t.js +528 -0
- package/dist/lib/diagram-MMDJMWI5-DDuA1rYY.js +217 -0
- package/dist/lib/diagram-TYMM5635-_VI1en0S.js +142 -0
- package/dist/lib/erDiagram-SMLLAGMA-B1REwW7y.js +899 -0
- package/dist/lib/flowDiagram-DWJPFMVM-rWzOGDlg.js +1628 -0
- package/dist/lib/ganttDiagram-T4ZO3ILL-UhSvbAmM.js +2701 -0
- package/dist/lib/gitGraphDiagram-UUTBAWPF-DrsSMMoJ.js +815 -0
- package/dist/lib/graph-DMr8NrNW.js +738 -0
- package/dist/lib/index.d.ts +665 -0
- package/dist/lib/index.js +52 -0
- package/dist/lib/infoDiagram-42DDH7IO-CPF3XCNj.js +24 -0
- package/dist/lib/init-DjUOC4st.js +16 -0
- package/dist/lib/ishikawaDiagram-UXIWVN3A-B4Nt1TdW.js +621 -0
- package/dist/lib/journeyDiagram-VCZTEJTY-DW5yRsOM.js +834 -0
- package/dist/lib/kanban-definition-6JOO6SKY-5DmJRubo.js +724 -0
- package/dist/lib/layout-B00IQLgh.js +1441 -0
- package/dist/lib/linear-LLab47WO.js +259 -0
- package/dist/lib/main-C9dvh9CT.js +88771 -0
- package/dist/lib/mermaid.core-BrBkhL9h.js +15967 -0
- package/dist/lib/min-CJFyJhXg.js +38 -0
- package/dist/lib/mindmap-definition-QFDTVHPH-doqZCFNi.js +833 -0
- package/dist/lib/ordinal-B6-f3MAq.js +61 -0
- package/dist/lib/pieDiagram-DEJITSTG-DKi5GKup.js +163 -0
- package/dist/lib/quadrantDiagram-34T5L4WZ-COYWmEhy.js +1022 -0
- package/dist/lib/requirementDiagram-MS252O5E-D3odK6YH.js +882 -0
- package/dist/lib/sankeyDiagram-XADWPNL6-D36eaMCx.js +810 -0
- package/dist/lib/sequenceDiagram-FGHM5R23-NpESTwMk.js +2883 -0
- package/dist/lib/standalone.js +4 -0
- package/dist/lib/stateDiagram-FHFEXIEX-kXZ_Bn-a.js +263 -0
- package/dist/lib/stateDiagram-v2-QKLJ7IA2-B5xMdEuE.js +16 -0
- package/dist/lib/timeline-definition-GMOUNBTQ-DZDdcJwy.js +1055 -0
- package/dist/lib/vennDiagram-DHZGUBPP-Clhb6EGF.js +1557 -0
- package/dist/lib/wardley-RL74JXVD-CwSnyVu7.js +18396 -0
- package/dist/lib/wardleyDiagram-NUSXRM2D-DnXL4F04.js +594 -0
- package/dist/lib/xychartDiagram-5P7HB3ND-CweIkrg3.js +1342 -0
- package/package.json +95 -0
- package/src/types/caity-chat.d.ts +213 -0
- package/src/types/template-slots.d.ts +167 -0
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
import { g as gt } from "./chunk-FMBD7UC4-OCIy3top.js";
|
|
2
|
+
import { a as mt, g as lt, h as xt, d as kt } from "./chunk-YZCP3GAM-Cs-HTcyJ.js";
|
|
3
|
+
import { g as _t, s as vt, a as bt, b as wt, q as Tt, p as St, _ as s, c as R, d as X, e as $t, z as Mt } from "./mermaid.core-BrBkhL9h.js";
|
|
4
|
+
import { d as it } from "./arc-Kj6ZmwPS.js";
|
|
5
|
+
var U = (function() {
|
|
6
|
+
var t = /* @__PURE__ */ s(function(h, r, n, l) {
|
|
7
|
+
for (n = n || {}, l = h.length; l--; n[h[l]] = r) ;
|
|
8
|
+
return n;
|
|
9
|
+
}, "o"), e = [6, 8, 10, 11, 12, 14, 16, 17, 18], a = [1, 9], f = [1, 10], i = [1, 11], u = [1, 12], p = [1, 13], o = [1, 14], g = {
|
|
10
|
+
trace: /* @__PURE__ */ s(function() {
|
|
11
|
+
}, "trace"),
|
|
12
|
+
yy: {},
|
|
13
|
+
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 },
|
|
14
|
+
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" },
|
|
15
|
+
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]],
|
|
16
|
+
performAction: /* @__PURE__ */ s(function(r, n, l, y, d, c, v) {
|
|
17
|
+
var k = c.length - 1;
|
|
18
|
+
switch (d) {
|
|
19
|
+
case 1:
|
|
20
|
+
return c[k - 1];
|
|
21
|
+
case 2:
|
|
22
|
+
this.$ = [];
|
|
23
|
+
break;
|
|
24
|
+
case 3:
|
|
25
|
+
c[k - 1].push(c[k]), this.$ = c[k - 1];
|
|
26
|
+
break;
|
|
27
|
+
case 4:
|
|
28
|
+
case 5:
|
|
29
|
+
this.$ = c[k];
|
|
30
|
+
break;
|
|
31
|
+
case 6:
|
|
32
|
+
case 7:
|
|
33
|
+
this.$ = [];
|
|
34
|
+
break;
|
|
35
|
+
case 8:
|
|
36
|
+
y.setDiagramTitle(c[k].substr(6)), this.$ = c[k].substr(6);
|
|
37
|
+
break;
|
|
38
|
+
case 9:
|
|
39
|
+
this.$ = c[k].trim(), y.setAccTitle(this.$);
|
|
40
|
+
break;
|
|
41
|
+
case 10:
|
|
42
|
+
case 11:
|
|
43
|
+
this.$ = c[k].trim(), y.setAccDescription(this.$);
|
|
44
|
+
break;
|
|
45
|
+
case 12:
|
|
46
|
+
y.addSection(c[k].substr(8)), this.$ = c[k].substr(8);
|
|
47
|
+
break;
|
|
48
|
+
case 13:
|
|
49
|
+
y.addTask(c[k - 1], c[k]), this.$ = "task";
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}, "anonymous"),
|
|
53
|
+
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: a, 12: f, 14: i, 16: u, 17: p, 18: o }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: a, 12: f, 14: i, 16: u, 17: p, 18: o }, 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])],
|
|
54
|
+
defaultActions: {},
|
|
55
|
+
parseError: /* @__PURE__ */ s(function(r, n) {
|
|
56
|
+
if (n.recoverable)
|
|
57
|
+
this.trace(r);
|
|
58
|
+
else {
|
|
59
|
+
var l = new Error(r);
|
|
60
|
+
throw l.hash = n, l;
|
|
61
|
+
}
|
|
62
|
+
}, "parseError"),
|
|
63
|
+
parse: /* @__PURE__ */ s(function(r) {
|
|
64
|
+
var n = this, l = [0], y = [], d = [null], c = [], v = this.table, k = "", C = 0, Q = 0, yt = 2, D = 1, dt = c.slice.call(arguments, 1), _ = Object.create(this.lexer), I = { yy: {} };
|
|
65
|
+
for (var O in this.yy)
|
|
66
|
+
Object.prototype.hasOwnProperty.call(this.yy, O) && (I.yy[O] = this.yy[O]);
|
|
67
|
+
_.setInput(r, I.yy), I.yy.lexer = _, I.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {});
|
|
68
|
+
var Y = _.yylloc;
|
|
69
|
+
c.push(Y);
|
|
70
|
+
var ft = _.options && _.options.ranges;
|
|
71
|
+
typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
72
|
+
function pt(w) {
|
|
73
|
+
l.length = l.length - 2 * w, d.length = d.length - w, c.length = c.length - w;
|
|
74
|
+
}
|
|
75
|
+
s(pt, "popStack");
|
|
76
|
+
function tt() {
|
|
77
|
+
var w;
|
|
78
|
+
return w = y.pop() || _.lex() || D, typeof w != "number" && (w instanceof Array && (y = w, w = y.pop()), w = n.symbols_[w] || w), w;
|
|
79
|
+
}
|
|
80
|
+
s(tt, "lex");
|
|
81
|
+
for (var b, A, T, q, F = {}, N, M, et, z; ; ) {
|
|
82
|
+
if (A = l[l.length - 1], this.defaultActions[A] ? T = this.defaultActions[A] : ((b === null || typeof b > "u") && (b = tt()), T = v[A] && v[A][b]), typeof T > "u" || !T.length || !T[0]) {
|
|
83
|
+
var H = "";
|
|
84
|
+
z = [];
|
|
85
|
+
for (N in v[A])
|
|
86
|
+
this.terminals_[N] && N > yt && z.push("'" + this.terminals_[N] + "'");
|
|
87
|
+
_.showPosition ? H = "Parse error on line " + (C + 1) + `:
|
|
88
|
+
` + _.showPosition() + `
|
|
89
|
+
Expecting ` + z.join(", ") + ", got '" + (this.terminals_[b] || b) + "'" : H = "Parse error on line " + (C + 1) + ": Unexpected " + (b == D ? "end of input" : "'" + (this.terminals_[b] || b) + "'"), this.parseError(H, {
|
|
90
|
+
text: _.match,
|
|
91
|
+
token: this.terminals_[b] || b,
|
|
92
|
+
line: _.yylineno,
|
|
93
|
+
loc: Y,
|
|
94
|
+
expected: z
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (T[0] instanceof Array && T.length > 1)
|
|
98
|
+
throw new Error("Parse Error: multiple actions possible at state: " + A + ", token: " + b);
|
|
99
|
+
switch (T[0]) {
|
|
100
|
+
case 1:
|
|
101
|
+
l.push(b), d.push(_.yytext), c.push(_.yylloc), l.push(T[1]), b = null, Q = _.yyleng, k = _.yytext, C = _.yylineno, Y = _.yylloc;
|
|
102
|
+
break;
|
|
103
|
+
case 2:
|
|
104
|
+
if (M = this.productions_[T[1]][1], F.$ = d[d.length - M], F._$ = {
|
|
105
|
+
first_line: c[c.length - (M || 1)].first_line,
|
|
106
|
+
last_line: c[c.length - 1].last_line,
|
|
107
|
+
first_column: c[c.length - (M || 1)].first_column,
|
|
108
|
+
last_column: c[c.length - 1].last_column
|
|
109
|
+
}, ft && (F._$.range = [
|
|
110
|
+
c[c.length - (M || 1)].range[0],
|
|
111
|
+
c[c.length - 1].range[1]
|
|
112
|
+
]), q = this.performAction.apply(F, [
|
|
113
|
+
k,
|
|
114
|
+
Q,
|
|
115
|
+
C,
|
|
116
|
+
I.yy,
|
|
117
|
+
T[1],
|
|
118
|
+
d,
|
|
119
|
+
c
|
|
120
|
+
].concat(dt)), typeof q < "u")
|
|
121
|
+
return q;
|
|
122
|
+
M && (l = l.slice(0, -1 * M * 2), d = d.slice(0, -1 * M), c = c.slice(0, -1 * M)), l.push(this.productions_[T[1]][0]), d.push(F.$), c.push(F._$), et = v[l[l.length - 2]][l[l.length - 1]], l.push(et);
|
|
123
|
+
break;
|
|
124
|
+
case 3:
|
|
125
|
+
return !0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return !0;
|
|
129
|
+
}, "parse")
|
|
130
|
+
}, m = /* @__PURE__ */ (function() {
|
|
131
|
+
var h = {
|
|
132
|
+
EOF: 1,
|
|
133
|
+
parseError: /* @__PURE__ */ s(function(n, l) {
|
|
134
|
+
if (this.yy.parser)
|
|
135
|
+
this.yy.parser.parseError(n, l);
|
|
136
|
+
else
|
|
137
|
+
throw new Error(n);
|
|
138
|
+
}, "parseError"),
|
|
139
|
+
// resets the lexer, sets new input
|
|
140
|
+
setInput: /* @__PURE__ */ s(function(r, n) {
|
|
141
|
+
return this.yy = n || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
142
|
+
first_line: 1,
|
|
143
|
+
first_column: 0,
|
|
144
|
+
last_line: 1,
|
|
145
|
+
last_column: 0
|
|
146
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
147
|
+
}, "setInput"),
|
|
148
|
+
// consumes and returns one char from the input
|
|
149
|
+
input: /* @__PURE__ */ s(function() {
|
|
150
|
+
var r = this._input[0];
|
|
151
|
+
this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
|
|
152
|
+
var n = r.match(/(?:\r\n?|\n).*/g);
|
|
153
|
+
return n ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
|
|
154
|
+
}, "input"),
|
|
155
|
+
// unshifts one char (or a string) into the input
|
|
156
|
+
unput: /* @__PURE__ */ s(function(r) {
|
|
157
|
+
var n = r.length, l = r.split(/(?:\r\n?|\n)/g);
|
|
158
|
+
this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - n), this.offset -= n;
|
|
159
|
+
var y = this.match.split(/(?:\r\n?|\n)/g);
|
|
160
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
|
|
161
|
+
var d = this.yylloc.range;
|
|
162
|
+
return this.yylloc = {
|
|
163
|
+
first_line: this.yylloc.first_line,
|
|
164
|
+
last_line: this.yylineno + 1,
|
|
165
|
+
first_column: this.yylloc.first_column,
|
|
166
|
+
last_column: l ? (l.length === y.length ? this.yylloc.first_column : 0) + y[y.length - l.length].length - l[0].length : this.yylloc.first_column - n
|
|
167
|
+
}, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - n]), this.yyleng = this.yytext.length, this;
|
|
168
|
+
}, "unput"),
|
|
169
|
+
// When called from action, caches matched text and appends it on next action
|
|
170
|
+
more: /* @__PURE__ */ s(function() {
|
|
171
|
+
return this._more = !0, this;
|
|
172
|
+
}, "more"),
|
|
173
|
+
// 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.
|
|
174
|
+
reject: /* @__PURE__ */ s(function() {
|
|
175
|
+
if (this.options.backtrack_lexer)
|
|
176
|
+
this._backtrack = !0;
|
|
177
|
+
else
|
|
178
|
+
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).
|
|
179
|
+
` + this.showPosition(), {
|
|
180
|
+
text: "",
|
|
181
|
+
token: null,
|
|
182
|
+
line: this.yylineno
|
|
183
|
+
});
|
|
184
|
+
return this;
|
|
185
|
+
}, "reject"),
|
|
186
|
+
// retain first n characters of the match
|
|
187
|
+
less: /* @__PURE__ */ s(function(r) {
|
|
188
|
+
this.unput(this.match.slice(r));
|
|
189
|
+
}, "less"),
|
|
190
|
+
// displays already matched input, i.e. for error messages
|
|
191
|
+
pastInput: /* @__PURE__ */ s(function() {
|
|
192
|
+
var r = this.matched.substr(0, this.matched.length - this.match.length);
|
|
193
|
+
return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
|
|
194
|
+
}, "pastInput"),
|
|
195
|
+
// displays upcoming input, i.e. for error messages
|
|
196
|
+
upcomingInput: /* @__PURE__ */ s(function() {
|
|
197
|
+
var r = this.match;
|
|
198
|
+
return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
199
|
+
}, "upcomingInput"),
|
|
200
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
201
|
+
showPosition: /* @__PURE__ */ s(function() {
|
|
202
|
+
var r = this.pastInput(), n = new Array(r.length + 1).join("-");
|
|
203
|
+
return r + this.upcomingInput() + `
|
|
204
|
+
` + n + "^";
|
|
205
|
+
}, "showPosition"),
|
|
206
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
207
|
+
test_match: /* @__PURE__ */ s(function(r, n) {
|
|
208
|
+
var l, y, d;
|
|
209
|
+
if (this.options.backtrack_lexer && (d = {
|
|
210
|
+
yylineno: this.yylineno,
|
|
211
|
+
yylloc: {
|
|
212
|
+
first_line: this.yylloc.first_line,
|
|
213
|
+
last_line: this.last_line,
|
|
214
|
+
first_column: this.yylloc.first_column,
|
|
215
|
+
last_column: this.yylloc.last_column
|
|
216
|
+
},
|
|
217
|
+
yytext: this.yytext,
|
|
218
|
+
match: this.match,
|
|
219
|
+
matches: this.matches,
|
|
220
|
+
matched: this.matched,
|
|
221
|
+
yyleng: this.yyleng,
|
|
222
|
+
offset: this.offset,
|
|
223
|
+
_more: this._more,
|
|
224
|
+
_input: this._input,
|
|
225
|
+
yy: this.yy,
|
|
226
|
+
conditionStack: this.conditionStack.slice(0),
|
|
227
|
+
done: this.done
|
|
228
|
+
}, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), y = r[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
|
|
229
|
+
first_line: this.yylloc.last_line,
|
|
230
|
+
last_line: this.yylineno + 1,
|
|
231
|
+
first_column: this.yylloc.last_column,
|
|
232
|
+
last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
|
|
233
|
+
}, this.yytext += r[0], this.match += r[0], this.matches = r, 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(r[0].length), this.matched += r[0], l = this.performAction.call(this, this.yy, this, n, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
|
|
234
|
+
return l;
|
|
235
|
+
if (this._backtrack) {
|
|
236
|
+
for (var c in d)
|
|
237
|
+
this[c] = d[c];
|
|
238
|
+
return !1;
|
|
239
|
+
}
|
|
240
|
+
return !1;
|
|
241
|
+
}, "test_match"),
|
|
242
|
+
// return next match in input
|
|
243
|
+
next: /* @__PURE__ */ s(function() {
|
|
244
|
+
if (this.done)
|
|
245
|
+
return this.EOF;
|
|
246
|
+
this._input || (this.done = !0);
|
|
247
|
+
var r, n, l, y;
|
|
248
|
+
this._more || (this.yytext = "", this.match = "");
|
|
249
|
+
for (var d = this._currentRules(), c = 0; c < d.length; c++)
|
|
250
|
+
if (l = this._input.match(this.rules[d[c]]), l && (!n || l[0].length > n[0].length)) {
|
|
251
|
+
if (n = l, y = c, this.options.backtrack_lexer) {
|
|
252
|
+
if (r = this.test_match(l, d[c]), r !== !1)
|
|
253
|
+
return r;
|
|
254
|
+
if (this._backtrack) {
|
|
255
|
+
n = !1;
|
|
256
|
+
continue;
|
|
257
|
+
} else
|
|
258
|
+
return !1;
|
|
259
|
+
} else if (!this.options.flex)
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
return n ? (r = this.test_match(n, d[y]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
263
|
+
` + this.showPosition(), {
|
|
264
|
+
text: "",
|
|
265
|
+
token: null,
|
|
266
|
+
line: this.yylineno
|
|
267
|
+
});
|
|
268
|
+
}, "next"),
|
|
269
|
+
// return next match that has a token
|
|
270
|
+
lex: /* @__PURE__ */ s(function() {
|
|
271
|
+
var n = this.next();
|
|
272
|
+
return n || this.lex();
|
|
273
|
+
}, "lex"),
|
|
274
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
275
|
+
begin: /* @__PURE__ */ s(function(n) {
|
|
276
|
+
this.conditionStack.push(n);
|
|
277
|
+
}, "begin"),
|
|
278
|
+
// pop the previously active lexer condition state off the condition stack
|
|
279
|
+
popState: /* @__PURE__ */ s(function() {
|
|
280
|
+
var n = this.conditionStack.length - 1;
|
|
281
|
+
return n > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
282
|
+
}, "popState"),
|
|
283
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
284
|
+
_currentRules: /* @__PURE__ */ s(function() {
|
|
285
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
286
|
+
}, "_currentRules"),
|
|
287
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
288
|
+
topState: /* @__PURE__ */ s(function(n) {
|
|
289
|
+
return n = this.conditionStack.length - 1 - Math.abs(n || 0), n >= 0 ? this.conditionStack[n] : "INITIAL";
|
|
290
|
+
}, "topState"),
|
|
291
|
+
// alias for begin(condition)
|
|
292
|
+
pushState: /* @__PURE__ */ s(function(n) {
|
|
293
|
+
this.begin(n);
|
|
294
|
+
}, "pushState"),
|
|
295
|
+
// return the number of states currently on the stack
|
|
296
|
+
stateStackSize: /* @__PURE__ */ s(function() {
|
|
297
|
+
return this.conditionStack.length;
|
|
298
|
+
}, "stateStackSize"),
|
|
299
|
+
options: { "case-insensitive": !0 },
|
|
300
|
+
performAction: /* @__PURE__ */ s(function(n, l, y, d) {
|
|
301
|
+
switch (y) {
|
|
302
|
+
case 0:
|
|
303
|
+
break;
|
|
304
|
+
case 1:
|
|
305
|
+
break;
|
|
306
|
+
case 2:
|
|
307
|
+
return 10;
|
|
308
|
+
case 3:
|
|
309
|
+
break;
|
|
310
|
+
case 4:
|
|
311
|
+
break;
|
|
312
|
+
case 5:
|
|
313
|
+
return 4;
|
|
314
|
+
case 6:
|
|
315
|
+
return 11;
|
|
316
|
+
case 7:
|
|
317
|
+
return this.begin("acc_title"), 12;
|
|
318
|
+
case 8:
|
|
319
|
+
return this.popState(), "acc_title_value";
|
|
320
|
+
case 9:
|
|
321
|
+
return this.begin("acc_descr"), 14;
|
|
322
|
+
case 10:
|
|
323
|
+
return this.popState(), "acc_descr_value";
|
|
324
|
+
case 11:
|
|
325
|
+
this.begin("acc_descr_multiline");
|
|
326
|
+
break;
|
|
327
|
+
case 12:
|
|
328
|
+
this.popState();
|
|
329
|
+
break;
|
|
330
|
+
case 13:
|
|
331
|
+
return "acc_descr_multiline_value";
|
|
332
|
+
case 14:
|
|
333
|
+
return 17;
|
|
334
|
+
case 15:
|
|
335
|
+
return 18;
|
|
336
|
+
case 16:
|
|
337
|
+
return 19;
|
|
338
|
+
case 17:
|
|
339
|
+
return ":";
|
|
340
|
+
case 18:
|
|
341
|
+
return 6;
|
|
342
|
+
case 19:
|
|
343
|
+
return "INVALID";
|
|
344
|
+
}
|
|
345
|
+
}, "anonymous"),
|
|
346
|
+
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],
|
|
347
|
+
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 } }
|
|
348
|
+
};
|
|
349
|
+
return h;
|
|
350
|
+
})();
|
|
351
|
+
g.lexer = m;
|
|
352
|
+
function x() {
|
|
353
|
+
this.yy = {};
|
|
354
|
+
}
|
|
355
|
+
return s(x, "Parser"), x.prototype = g, g.Parser = x, new x();
|
|
356
|
+
})();
|
|
357
|
+
U.parser = U;
|
|
358
|
+
var Et = U, V = "", J = [], L = [], B = [], Ct = /* @__PURE__ */ s(function() {
|
|
359
|
+
J.length = 0, L.length = 0, V = "", B.length = 0, Mt();
|
|
360
|
+
}, "clear"), Pt = /* @__PURE__ */ s(function(t) {
|
|
361
|
+
V = t, J.push(t);
|
|
362
|
+
}, "addSection"), It = /* @__PURE__ */ s(function() {
|
|
363
|
+
return J;
|
|
364
|
+
}, "getSections"), At = /* @__PURE__ */ s(function() {
|
|
365
|
+
let t = rt();
|
|
366
|
+
const e = 100;
|
|
367
|
+
let a = 0;
|
|
368
|
+
for (; !t && a < e; )
|
|
369
|
+
t = rt(), a++;
|
|
370
|
+
return L.push(...B), L;
|
|
371
|
+
}, "getTasks"), Ft = /* @__PURE__ */ s(function() {
|
|
372
|
+
const t = [];
|
|
373
|
+
return L.forEach((a) => {
|
|
374
|
+
a.people && t.push(...a.people);
|
|
375
|
+
}), [...new Set(t)].sort();
|
|
376
|
+
}, "updateActors"), Vt = /* @__PURE__ */ s(function(t, e) {
|
|
377
|
+
const a = e.substr(1).split(":");
|
|
378
|
+
let f = 0, i = [];
|
|
379
|
+
a.length === 1 ? (f = Number(a[0]), i = []) : (f = Number(a[0]), i = a[1].split(","));
|
|
380
|
+
const u = i.map((o) => o.trim()), p = {
|
|
381
|
+
section: V,
|
|
382
|
+
type: V,
|
|
383
|
+
people: u,
|
|
384
|
+
task: t,
|
|
385
|
+
score: f
|
|
386
|
+
};
|
|
387
|
+
B.push(p);
|
|
388
|
+
}, "addTask"), Rt = /* @__PURE__ */ s(function(t) {
|
|
389
|
+
const e = {
|
|
390
|
+
section: V,
|
|
391
|
+
type: V,
|
|
392
|
+
description: t,
|
|
393
|
+
task: t,
|
|
394
|
+
classes: []
|
|
395
|
+
};
|
|
396
|
+
L.push(e);
|
|
397
|
+
}, "addTaskOrg"), rt = /* @__PURE__ */ s(function() {
|
|
398
|
+
const t = /* @__PURE__ */ s(function(a) {
|
|
399
|
+
return B[a].processed;
|
|
400
|
+
}, "compileTask");
|
|
401
|
+
let e = !0;
|
|
402
|
+
for (const [a, f] of B.entries())
|
|
403
|
+
t(a), e = e && f.processed;
|
|
404
|
+
return e;
|
|
405
|
+
}, "compileTasks"), Lt = /* @__PURE__ */ s(function() {
|
|
406
|
+
return Ft();
|
|
407
|
+
}, "getActors"), nt = {
|
|
408
|
+
getConfig: /* @__PURE__ */ s(() => R().journey, "getConfig"),
|
|
409
|
+
clear: Ct,
|
|
410
|
+
setDiagramTitle: St,
|
|
411
|
+
getDiagramTitle: Tt,
|
|
412
|
+
setAccTitle: wt,
|
|
413
|
+
getAccTitle: bt,
|
|
414
|
+
setAccDescription: vt,
|
|
415
|
+
getAccDescription: _t,
|
|
416
|
+
addSection: Pt,
|
|
417
|
+
getSections: It,
|
|
418
|
+
getTasks: At,
|
|
419
|
+
addTask: Vt,
|
|
420
|
+
addTaskOrg: Rt,
|
|
421
|
+
getActors: Lt
|
|
422
|
+
}, Bt = /* @__PURE__ */ s((t) => `.label {
|
|
423
|
+
font-family: ${t.fontFamily};
|
|
424
|
+
color: ${t.textColor};
|
|
425
|
+
}
|
|
426
|
+
.mouth {
|
|
427
|
+
stroke: #666;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
line {
|
|
431
|
+
stroke: ${t.textColor}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.legend {
|
|
435
|
+
fill: ${t.textColor};
|
|
436
|
+
font-family: ${t.fontFamily};
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.label text {
|
|
440
|
+
fill: #333;
|
|
441
|
+
}
|
|
442
|
+
.label {
|
|
443
|
+
color: ${t.textColor}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.face {
|
|
447
|
+
${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
|
|
448
|
+
stroke: #999;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.node rect,
|
|
452
|
+
.node circle,
|
|
453
|
+
.node ellipse,
|
|
454
|
+
.node polygon,
|
|
455
|
+
.node path {
|
|
456
|
+
fill: ${t.mainBkg};
|
|
457
|
+
stroke: ${t.nodeBorder};
|
|
458
|
+
stroke-width: 1px;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.node .label {
|
|
462
|
+
text-align: center;
|
|
463
|
+
}
|
|
464
|
+
.node.clickable {
|
|
465
|
+
cursor: pointer;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.arrowheadPath {
|
|
469
|
+
fill: ${t.arrowheadColor};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.edgePath .path {
|
|
473
|
+
stroke: ${t.lineColor};
|
|
474
|
+
stroke-width: 1.5px;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.flowchart-link {
|
|
478
|
+
stroke: ${t.lineColor};
|
|
479
|
+
fill: none;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.edgeLabel {
|
|
483
|
+
background-color: ${t.edgeLabelBackground};
|
|
484
|
+
rect {
|
|
485
|
+
opacity: 0.5;
|
|
486
|
+
}
|
|
487
|
+
text-align: center;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.cluster rect {
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.cluster text {
|
|
494
|
+
fill: ${t.titleColor};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
div.mermaidTooltip {
|
|
498
|
+
position: absolute;
|
|
499
|
+
text-align: center;
|
|
500
|
+
max-width: 200px;
|
|
501
|
+
padding: 2px;
|
|
502
|
+
font-family: ${t.fontFamily};
|
|
503
|
+
font-size: 12px;
|
|
504
|
+
background: ${t.tertiaryColor};
|
|
505
|
+
border: 1px solid ${t.border2};
|
|
506
|
+
border-radius: 2px;
|
|
507
|
+
pointer-events: none;
|
|
508
|
+
z-index: 100;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.task-type-0, .section-type-0 {
|
|
512
|
+
${t.fillType0 ? `fill: ${t.fillType0}` : ""};
|
|
513
|
+
}
|
|
514
|
+
.task-type-1, .section-type-1 {
|
|
515
|
+
${t.fillType0 ? `fill: ${t.fillType1}` : ""};
|
|
516
|
+
}
|
|
517
|
+
.task-type-2, .section-type-2 {
|
|
518
|
+
${t.fillType0 ? `fill: ${t.fillType2}` : ""};
|
|
519
|
+
}
|
|
520
|
+
.task-type-3, .section-type-3 {
|
|
521
|
+
${t.fillType0 ? `fill: ${t.fillType3}` : ""};
|
|
522
|
+
}
|
|
523
|
+
.task-type-4, .section-type-4 {
|
|
524
|
+
${t.fillType0 ? `fill: ${t.fillType4}` : ""};
|
|
525
|
+
}
|
|
526
|
+
.task-type-5, .section-type-5 {
|
|
527
|
+
${t.fillType0 ? `fill: ${t.fillType5}` : ""};
|
|
528
|
+
}
|
|
529
|
+
.task-type-6, .section-type-6 {
|
|
530
|
+
${t.fillType0 ? `fill: ${t.fillType6}` : ""};
|
|
531
|
+
}
|
|
532
|
+
.task-type-7, .section-type-7 {
|
|
533
|
+
${t.fillType0 ? `fill: ${t.fillType7}` : ""};
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.actor-0 {
|
|
537
|
+
${t.actor0 ? `fill: ${t.actor0}` : ""};
|
|
538
|
+
}
|
|
539
|
+
.actor-1 {
|
|
540
|
+
${t.actor1 ? `fill: ${t.actor1}` : ""};
|
|
541
|
+
}
|
|
542
|
+
.actor-2 {
|
|
543
|
+
${t.actor2 ? `fill: ${t.actor2}` : ""};
|
|
544
|
+
}
|
|
545
|
+
.actor-3 {
|
|
546
|
+
${t.actor3 ? `fill: ${t.actor3}` : ""};
|
|
547
|
+
}
|
|
548
|
+
.actor-4 {
|
|
549
|
+
${t.actor4 ? `fill: ${t.actor4}` : ""};
|
|
550
|
+
}
|
|
551
|
+
.actor-5 {
|
|
552
|
+
${t.actor5 ? `fill: ${t.actor5}` : ""};
|
|
553
|
+
}
|
|
554
|
+
${gt()}
|
|
555
|
+
`, "getStyles"), jt = Bt, K = /* @__PURE__ */ s(function(t, e) {
|
|
556
|
+
return kt(t, e);
|
|
557
|
+
}, "drawRect"), Nt = /* @__PURE__ */ s(function(t, e) {
|
|
558
|
+
const f = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), i = t.append("g");
|
|
559
|
+
i.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"), i.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");
|
|
560
|
+
function u(g) {
|
|
561
|
+
const m = it().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
562
|
+
g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
|
|
563
|
+
}
|
|
564
|
+
s(u, "smile");
|
|
565
|
+
function p(g) {
|
|
566
|
+
const m = it().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
567
|
+
g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
|
|
568
|
+
}
|
|
569
|
+
s(p, "sad");
|
|
570
|
+
function o(g) {
|
|
571
|
+
g.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");
|
|
572
|
+
}
|
|
573
|
+
return s(o, "ambivalent"), e.score > 3 ? u(i) : e.score < 3 ? p(i) : o(i), f;
|
|
574
|
+
}, "drawFace"), ot = /* @__PURE__ */ s(function(t, e) {
|
|
575
|
+
const a = t.append("circle");
|
|
576
|
+
return a.attr("cx", e.cx), a.attr("cy", e.cy), a.attr("class", "actor-" + e.pos), a.attr("fill", e.fill), a.attr("stroke", e.stroke), a.attr("r", e.r), a.class !== void 0 && a.attr("class", a.class), e.title !== void 0 && a.append("title").text(e.title), a;
|
|
577
|
+
}, "drawCircle"), ct = /* @__PURE__ */ s(function(t, e) {
|
|
578
|
+
return xt(t, e);
|
|
579
|
+
}, "drawText"), zt = /* @__PURE__ */ s(function(t, e) {
|
|
580
|
+
function a(i, u, p, o, g) {
|
|
581
|
+
return i + "," + u + " " + (i + p) + "," + u + " " + (i + p) + "," + (u + o - g) + " " + (i + p - g * 1.2) + "," + (u + o) + " " + i + "," + (u + o);
|
|
582
|
+
}
|
|
583
|
+
s(a, "genPoints");
|
|
584
|
+
const f = t.append("polygon");
|
|
585
|
+
f.attr("points", a(e.x, e.y, 50, 20, 7)), f.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, ct(t, e);
|
|
586
|
+
}, "drawLabel"), Wt = /* @__PURE__ */ s(function(t, e, a) {
|
|
587
|
+
const f = t.append("g"), i = lt();
|
|
588
|
+
i.x = e.x, i.y = e.y, i.fill = e.fill, i.width = a.width * e.taskCount + // width of the tasks
|
|
589
|
+
a.diagramMarginX * (e.taskCount - 1), i.height = a.height, i.class = "journey-section section-type-" + e.num, i.rx = 3, i.ry = 3, K(f, i), ht(a)(
|
|
590
|
+
e.text,
|
|
591
|
+
f,
|
|
592
|
+
i.x,
|
|
593
|
+
i.y,
|
|
594
|
+
i.width,
|
|
595
|
+
i.height,
|
|
596
|
+
{ class: "journey-section section-type-" + e.num },
|
|
597
|
+
a,
|
|
598
|
+
e.colour
|
|
599
|
+
);
|
|
600
|
+
}, "drawSection"), Z = -1, Ot = /* @__PURE__ */ s(function(t, e, a, f) {
|
|
601
|
+
const i = e.x + a.width / 2, u = t.append("g");
|
|
602
|
+
Z++, u.append("line").attr("id", f + "-task" + Z).attr("x1", i).attr("y1", e.y).attr("x2", i).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Nt(u, {
|
|
603
|
+
cx: i,
|
|
604
|
+
cy: 300 + (5 - e.score) * 30,
|
|
605
|
+
score: e.score
|
|
606
|
+
});
|
|
607
|
+
const o = lt();
|
|
608
|
+
o.x = e.x, o.y = e.y, o.fill = e.fill, o.width = a.width, o.height = a.height, o.class = "task task-type-" + e.num, o.rx = 3, o.ry = 3, K(u, o);
|
|
609
|
+
let g = e.x + 14;
|
|
610
|
+
e.people.forEach((m) => {
|
|
611
|
+
const x = e.actors[m].color, h = {
|
|
612
|
+
cx: g,
|
|
613
|
+
cy: e.y,
|
|
614
|
+
r: 7,
|
|
615
|
+
fill: x,
|
|
616
|
+
stroke: "#000",
|
|
617
|
+
title: m,
|
|
618
|
+
pos: e.actors[m].position
|
|
619
|
+
};
|
|
620
|
+
ot(u, h), g += 10;
|
|
621
|
+
}), ht(a)(
|
|
622
|
+
e.task,
|
|
623
|
+
u,
|
|
624
|
+
o.x,
|
|
625
|
+
o.y,
|
|
626
|
+
o.width,
|
|
627
|
+
o.height,
|
|
628
|
+
{ class: "task" },
|
|
629
|
+
a,
|
|
630
|
+
e.colour
|
|
631
|
+
);
|
|
632
|
+
}, "drawTask"), Yt = /* @__PURE__ */ s(function(t, e) {
|
|
633
|
+
mt(t, e);
|
|
634
|
+
}, "drawBackgroundRect"), ht = /* @__PURE__ */ (function() {
|
|
635
|
+
function t(i, u, p, o, g, m, x, h) {
|
|
636
|
+
const r = u.append("text").attr("x", p + g / 2).attr("y", o + m / 2 + 5).style("font-color", h).style("text-anchor", "middle").text(i);
|
|
637
|
+
f(r, x);
|
|
638
|
+
}
|
|
639
|
+
s(t, "byText");
|
|
640
|
+
function e(i, u, p, o, g, m, x, h, r) {
|
|
641
|
+
const { taskFontSize: n, taskFontFamily: l } = h, y = i.split(/<br\s*\/?>/gi);
|
|
642
|
+
for (let d = 0; d < y.length; d++) {
|
|
643
|
+
const c = d * n - n * (y.length - 1) / 2, v = u.append("text").attr("x", p + g / 2).attr("y", o).attr("fill", r).style("text-anchor", "middle").style("font-size", n).style("font-family", l);
|
|
644
|
+
v.append("tspan").attr("x", p + g / 2).attr("dy", c).text(y[d]), v.attr("y", o + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), f(v, x);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
s(e, "byTspan");
|
|
648
|
+
function a(i, u, p, o, g, m, x, h) {
|
|
649
|
+
const r = u.append("switch"), l = r.append("foreignObject").attr("x", p).attr("y", o).attr("width", g).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
650
|
+
l.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, r, p, o, g, m, x, h), f(l, x);
|
|
651
|
+
}
|
|
652
|
+
s(a, "byFo");
|
|
653
|
+
function f(i, u) {
|
|
654
|
+
for (const p in u)
|
|
655
|
+
p in u && i.attr(p, u[p]);
|
|
656
|
+
}
|
|
657
|
+
return s(f, "_setTextAttrs"), function(i) {
|
|
658
|
+
return i.textPlacement === "fo" ? a : i.textPlacement === "old" ? t : e;
|
|
659
|
+
};
|
|
660
|
+
})(), qt = /* @__PURE__ */ s(function(t, e) {
|
|
661
|
+
Z = -1, t.append("defs").append("marker").attr("id", e + "-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");
|
|
662
|
+
}, "initGraphics"), j = {
|
|
663
|
+
drawRect: K,
|
|
664
|
+
drawCircle: ot,
|
|
665
|
+
drawSection: Wt,
|
|
666
|
+
drawText: ct,
|
|
667
|
+
drawLabel: zt,
|
|
668
|
+
drawTask: Ot,
|
|
669
|
+
drawBackgroundRect: Yt,
|
|
670
|
+
initGraphics: qt
|
|
671
|
+
}, Ht = /* @__PURE__ */ s(function(t) {
|
|
672
|
+
Object.keys(t).forEach(function(a) {
|
|
673
|
+
$[a] = t[a];
|
|
674
|
+
});
|
|
675
|
+
}, "setConf"), E = {}, W = 0;
|
|
676
|
+
function ut(t) {
|
|
677
|
+
const e = R().journey, a = e.maxLabelWidth;
|
|
678
|
+
W = 0;
|
|
679
|
+
let f = 60;
|
|
680
|
+
Object.keys(E).forEach((i) => {
|
|
681
|
+
const u = E[i].color, p = {
|
|
682
|
+
cx: 20,
|
|
683
|
+
cy: f,
|
|
684
|
+
r: 7,
|
|
685
|
+
fill: u,
|
|
686
|
+
stroke: "#000",
|
|
687
|
+
pos: E[i].position
|
|
688
|
+
};
|
|
689
|
+
j.drawCircle(t, p);
|
|
690
|
+
let o = t.append("text").attr("visibility", "hidden").text(i);
|
|
691
|
+
const g = o.node().getBoundingClientRect().width;
|
|
692
|
+
o.remove();
|
|
693
|
+
let m = [];
|
|
694
|
+
if (g <= a)
|
|
695
|
+
m = [i];
|
|
696
|
+
else {
|
|
697
|
+
const x = i.split(" ");
|
|
698
|
+
let h = "";
|
|
699
|
+
o = t.append("text").attr("visibility", "hidden"), x.forEach((r) => {
|
|
700
|
+
const n = h ? `${h} ${r}` : r;
|
|
701
|
+
if (o.text(n), o.node().getBoundingClientRect().width > a) {
|
|
702
|
+
if (h && m.push(h), h = r, o.text(r), o.node().getBoundingClientRect().width > a) {
|
|
703
|
+
let y = "";
|
|
704
|
+
for (const d of r)
|
|
705
|
+
y += d, o.text(y + "-"), o.node().getBoundingClientRect().width > a && (m.push(y.slice(0, -1) + "-"), y = d);
|
|
706
|
+
h = y;
|
|
707
|
+
}
|
|
708
|
+
} else
|
|
709
|
+
h = n;
|
|
710
|
+
}), h && m.push(h), o.remove();
|
|
711
|
+
}
|
|
712
|
+
m.forEach((x, h) => {
|
|
713
|
+
const r = {
|
|
714
|
+
x: 40,
|
|
715
|
+
y: f + 7 + h * 20,
|
|
716
|
+
fill: "#666",
|
|
717
|
+
text: x,
|
|
718
|
+
textMargin: e.boxTextMargin ?? 5
|
|
719
|
+
}, l = j.drawText(t, r).node().getBoundingClientRect().width;
|
|
720
|
+
l > W && l > e.leftMargin - l && (W = l);
|
|
721
|
+
}), f += Math.max(20, m.length * 20);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
s(ut, "drawActorLegend");
|
|
725
|
+
var $ = R().journey, P = 0, Xt = /* @__PURE__ */ s(function(t, e, a, f) {
|
|
726
|
+
const i = R(), u = i.journey.titleColor, p = i.journey.titleFontSize, o = i.journey.titleFontFamily, g = i.securityLevel;
|
|
727
|
+
let m;
|
|
728
|
+
g === "sandbox" && (m = X("#i" + e));
|
|
729
|
+
const x = g === "sandbox" ? X(m.nodes()[0].contentDocument.body) : X("body");
|
|
730
|
+
S.init();
|
|
731
|
+
const h = x.select("#" + e);
|
|
732
|
+
j.initGraphics(h, e);
|
|
733
|
+
const r = f.db.getTasks(), n = f.db.getDiagramTitle(), l = f.db.getActors();
|
|
734
|
+
for (const C in E)
|
|
735
|
+
delete E[C];
|
|
736
|
+
let y = 0;
|
|
737
|
+
l.forEach((C) => {
|
|
738
|
+
E[C] = {
|
|
739
|
+
color: $.actorColours[y % $.actorColours.length],
|
|
740
|
+
position: y
|
|
741
|
+
}, y++;
|
|
742
|
+
}), ut(h), P = $.leftMargin + W, S.insert(0, 0, P, Object.keys(E).length * 50), Gt(h, r, 0, e);
|
|
743
|
+
const d = S.getBounds();
|
|
744
|
+
n && h.append("text").text(n).attr("x", P).attr("font-size", p).attr("font-weight", "bold").attr("y", 25).attr("fill", u).attr("font-family", o);
|
|
745
|
+
const c = d.stopy - d.starty + 2 * $.diagramMarginY, v = P + d.stopx + 2 * $.diagramMarginX;
|
|
746
|
+
$t(h, c, v, $.useMaxWidth), h.append("line").attr("x1", P).attr("y1", $.height * 4).attr("x2", v - P - 4).attr("y2", $.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#" + e + "-arrowhead)");
|
|
747
|
+
const k = n ? 70 : 0;
|
|
748
|
+
h.attr("viewBox", `${d.startx} -25 ${v} ${c + k}`), h.attr("preserveAspectRatio", "xMinYMin meet"), h.attr("height", c + k + 25);
|
|
749
|
+
}, "draw"), S = {
|
|
750
|
+
data: {
|
|
751
|
+
startx: void 0,
|
|
752
|
+
stopx: void 0,
|
|
753
|
+
starty: void 0,
|
|
754
|
+
stopy: void 0
|
|
755
|
+
},
|
|
756
|
+
verticalPos: 0,
|
|
757
|
+
sequenceItems: [],
|
|
758
|
+
init: /* @__PURE__ */ s(function() {
|
|
759
|
+
this.sequenceItems = [], this.data = {
|
|
760
|
+
startx: void 0,
|
|
761
|
+
stopx: void 0,
|
|
762
|
+
starty: void 0,
|
|
763
|
+
stopy: void 0
|
|
764
|
+
}, this.verticalPos = 0;
|
|
765
|
+
}, "init"),
|
|
766
|
+
updateVal: /* @__PURE__ */ s(function(t, e, a, f) {
|
|
767
|
+
t[e] === void 0 ? t[e] = a : t[e] = f(a, t[e]);
|
|
768
|
+
}, "updateVal"),
|
|
769
|
+
updateBounds: /* @__PURE__ */ s(function(t, e, a, f) {
|
|
770
|
+
const i = R().journey, u = this;
|
|
771
|
+
let p = 0;
|
|
772
|
+
function o(g) {
|
|
773
|
+
return /* @__PURE__ */ s(function(x) {
|
|
774
|
+
p++;
|
|
775
|
+
const h = u.sequenceItems.length - p + 1;
|
|
776
|
+
u.updateVal(x, "starty", e - h * i.boxMargin, Math.min), u.updateVal(x, "stopy", f + h * i.boxMargin, Math.max), u.updateVal(S.data, "startx", t - h * i.boxMargin, Math.min), u.updateVal(S.data, "stopx", a + h * i.boxMargin, Math.max), g !== "activation" && (u.updateVal(x, "startx", t - h * i.boxMargin, Math.min), u.updateVal(x, "stopx", a + h * i.boxMargin, Math.max), u.updateVal(S.data, "starty", e - h * i.boxMargin, Math.min), u.updateVal(S.data, "stopy", f + h * i.boxMargin, Math.max));
|
|
777
|
+
}, "updateItemBounds");
|
|
778
|
+
}
|
|
779
|
+
s(o, "updateFn"), this.sequenceItems.forEach(o());
|
|
780
|
+
}, "updateBounds"),
|
|
781
|
+
insert: /* @__PURE__ */ s(function(t, e, a, f) {
|
|
782
|
+
const i = Math.min(t, a), u = Math.max(t, a), p = Math.min(e, f), o = Math.max(e, f);
|
|
783
|
+
this.updateVal(S.data, "startx", i, Math.min), this.updateVal(S.data, "starty", p, Math.min), this.updateVal(S.data, "stopx", u, Math.max), this.updateVal(S.data, "stopy", o, Math.max), this.updateBounds(i, p, u, o);
|
|
784
|
+
}, "insert"),
|
|
785
|
+
bumpVerticalPos: /* @__PURE__ */ s(function(t) {
|
|
786
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
|
|
787
|
+
}, "bumpVerticalPos"),
|
|
788
|
+
getVerticalPos: /* @__PURE__ */ s(function() {
|
|
789
|
+
return this.verticalPos;
|
|
790
|
+
}, "getVerticalPos"),
|
|
791
|
+
getBounds: /* @__PURE__ */ s(function() {
|
|
792
|
+
return this.data;
|
|
793
|
+
}, "getBounds")
|
|
794
|
+
}, G = $.sectionFills, st = $.sectionColours, Gt = /* @__PURE__ */ s(function(t, e, a, f) {
|
|
795
|
+
const i = R().journey;
|
|
796
|
+
let u = "";
|
|
797
|
+
const p = i.height * 2 + i.diagramMarginY, o = a + p;
|
|
798
|
+
let g = 0, m = "#CCC", x = "black", h = 0;
|
|
799
|
+
for (const [r, n] of e.entries()) {
|
|
800
|
+
if (u !== n.section) {
|
|
801
|
+
m = G[g % G.length], h = g % G.length, x = st[g % st.length];
|
|
802
|
+
let y = 0;
|
|
803
|
+
const d = n.section;
|
|
804
|
+
for (let v = r; v < e.length && e[v].section == d; v++)
|
|
805
|
+
y = y + 1;
|
|
806
|
+
const c = {
|
|
807
|
+
x: r * i.taskMargin + r * i.width + P,
|
|
808
|
+
y: 50,
|
|
809
|
+
text: n.section,
|
|
810
|
+
fill: m,
|
|
811
|
+
num: h,
|
|
812
|
+
colour: x,
|
|
813
|
+
taskCount: y
|
|
814
|
+
};
|
|
815
|
+
j.drawSection(t, c, i), u = n.section, g++;
|
|
816
|
+
}
|
|
817
|
+
const l = n.people.reduce((y, d) => (E[d] && (y[d] = E[d]), y), {});
|
|
818
|
+
n.x = r * i.taskMargin + r * i.width + P, n.y = o, n.width = i.diagramMarginX, n.height = i.diagramMarginY, n.colour = x, n.fill = m, n.num = h, n.actors = l, j.drawTask(t, n, i, f), S.insert(n.x, n.y, n.x + n.width + i.taskMargin, 450);
|
|
819
|
+
}
|
|
820
|
+
}, "drawTasks"), at = {
|
|
821
|
+
setConf: Ht,
|
|
822
|
+
draw: Xt
|
|
823
|
+
}, Qt = {
|
|
824
|
+
parser: Et,
|
|
825
|
+
db: nt,
|
|
826
|
+
renderer: at,
|
|
827
|
+
styles: jt,
|
|
828
|
+
init: /* @__PURE__ */ s((t) => {
|
|
829
|
+
at.setConf(t.journey), nt.clear();
|
|
830
|
+
}, "init")
|
|
831
|
+
};
|
|
832
|
+
export {
|
|
833
|
+
Qt as diagram
|
|
834
|
+
};
|