@ucap-llm/ai-ui 1.1.6 → 1.1.7

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