smart-chat-asp 2.11.1

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