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