lowcoder-comps 0.0.8 → 0.0.9

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.
@@ -1,805 +0,0 @@
1
- import { aD as bt, aE as vt, z as kt, c as wt, l as I, h as J, t as St, aF as Et, aG as Tt } from "./2b3ab1e4.js";
2
- import { i as It } from "./7668124e.js";
3
- import { a as it } from "./4bc1082b.js";
4
- import "./e0f479f3.js";
5
- var D = function() {
6
- var n = function(_, r, a, h) {
7
- for (a = a || {}, h = _.length; h--; a[_[h]] = r)
8
- ;
9
- return a;
10
- }, t = [1, 2], e = [1, 5], s = [6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28], i = [1, 15], o = [1, 16], l = [1, 17], y = [1, 18], d = [1, 19], p = [1, 23], m = [1, 24], S = [1, 27], w = [4, 6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28], x = {
11
- trace: function() {
12
- },
13
- yy: {},
14
- symbols_: { error: 2, start: 3, timeline: 4, document: 5, EOF: 6, directive: 7, line: 8, SPACE: 9, statement: 10, NEWLINE: 11, openDirective: 12, typeDirective: 13, closeDirective: 14, ":": 15, argDirective: 16, title: 17, acc_title: 18, acc_title_value: 19, acc_descr: 20, acc_descr_value: 21, acc_descr_multiline_value: 22, section: 23, period_statement: 24, event_statement: 25, period: 26, event: 27, open_directive: 28, type_directive: 29, arg_directive: 30, close_directive: 31, $accept: 0, $end: 1 },
15
- terminals_: { 2: "error", 4: "timeline", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 17: "title", 18: "acc_title", 19: "acc_title_value", 20: "acc_descr", 21: "acc_descr_value", 22: "acc_descr_multiline_value", 23: "section", 26: "period", 27: "event", 28: "open_directive", 29: "type_directive", 30: "arg_directive", 31: "close_directive" },
16
- productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [24, 1], [25, 1], [12, 1], [13, 1], [16, 1], [14, 1]],
17
- performAction: function(r, a, h, u, g, c, T) {
18
- var f = c.length - 1;
19
- switch (g) {
20
- case 1:
21
- return c[f - 1];
22
- case 3:
23
- this.$ = [];
24
- break;
25
- case 4:
26
- c[f - 1].push(c[f]), this.$ = c[f - 1];
27
- break;
28
- case 5:
29
- case 6:
30
- this.$ = c[f];
31
- break;
32
- case 7:
33
- case 8:
34
- this.$ = [];
35
- break;
36
- case 11:
37
- u.getCommonDb().setDiagramTitle(c[f].substr(6)), this.$ = c[f].substr(6);
38
- break;
39
- case 12:
40
- this.$ = c[f].trim(), u.getCommonDb().setAccTitle(this.$);
41
- break;
42
- case 13:
43
- case 14:
44
- this.$ = c[f].trim(), u.getCommonDb().setAccDescription(this.$);
45
- break;
46
- case 15:
47
- u.addSection(c[f].substr(8)), this.$ = c[f].substr(8);
48
- break;
49
- case 19:
50
- u.addTask(c[f], 0, ""), this.$ = c[f];
51
- break;
52
- case 20:
53
- u.addEvent(c[f].substr(2)), this.$ = c[f];
54
- break;
55
- case 21:
56
- u.parseDirective("%%{", "open_directive");
57
- break;
58
- case 22:
59
- u.parseDirective(c[f], "type_directive");
60
- break;
61
- case 23:
62
- c[f] = c[f].trim().replace(/'/g, '"'), u.parseDirective(c[f], "arg_directive");
63
- break;
64
- case 24:
65
- u.parseDirective("}%%", "close_directive", "timeline");
66
- break;
67
- }
68
- },
69
- table: [{ 3: 1, 4: t, 7: 3, 12: 4, 28: e }, { 1: [3] }, n(s, [2, 3], { 5: 6 }), { 3: 7, 4: t, 7: 3, 12: 4, 28: e }, { 13: 8, 29: [1, 9] }, { 29: [2, 21] }, { 6: [1, 10], 7: 22, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: i, 18: o, 20: l, 22: y, 23: d, 24: 20, 25: 21, 26: p, 27: m, 28: e }, { 1: [2, 2] }, { 14: 25, 15: [1, 26], 31: S }, n([15, 31], [2, 22]), n(s, [2, 8], { 1: [2, 1] }), n(s, [2, 4]), { 7: 22, 10: 28, 12: 4, 17: i, 18: o, 20: l, 22: y, 23: d, 24: 20, 25: 21, 26: p, 27: m, 28: e }, n(s, [2, 6]), n(s, [2, 7]), n(s, [2, 11]), { 19: [1, 29] }, { 21: [1, 30] }, n(s, [2, 14]), n(s, [2, 15]), n(s, [2, 16]), n(s, [2, 17]), n(s, [2, 18]), n(s, [2, 19]), n(s, [2, 20]), { 11: [1, 31] }, { 16: 32, 30: [1, 33] }, { 11: [2, 24] }, n(s, [2, 5]), n(s, [2, 12]), n(s, [2, 13]), n(w, [2, 9]), { 14: 34, 31: S }, { 31: [2, 23] }, { 11: [1, 35] }, n(w, [2, 10])],
70
- defaultActions: { 5: [2, 21], 7: [2, 2], 27: [2, 24], 33: [2, 23] },
71
- parseError: function(r, a) {
72
- if (a.recoverable)
73
- this.trace(r);
74
- else {
75
- var h = new Error(r);
76
- throw h.hash = a, h;
77
- }
78
- },
79
- parse: function(r) {
80
- var a = this, h = [0], u = [], g = [null], c = [], T = this.table, f = "", P = 0, V = 0, j = 2, X = 1, q = c.slice.call(arguments, 1), b = Object.create(this.lexer), L = { yy: {} };
81
- for (var A in this.yy)
82
- Object.prototype.hasOwnProperty.call(this.yy, A) && (L.yy[A] = this.yy[A]);
83
- b.setInput(r, L.yy), L.yy.lexer = b, L.yy.parser = this, typeof b.yylloc == "undefined" && (b.yylloc = {});
84
- var k = b.yylloc;
85
- c.push(k);
86
- var H = b.options && b.options.ranges;
87
- typeof L.yy.parseError == "function" ? this.parseError = L.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
88
- function R() {
89
- var z;
90
- return z = u.pop() || b.lex() || X, typeof z != "number" && (z instanceof Array && (u = z, z = u.pop()), z = a.symbols_[z] || z), z;
91
- }
92
- for (var v, N, $, G, W = {}, U, C, nt, Z; ; ) {
93
- if (N = h[h.length - 1], this.defaultActions[N] ? $ = this.defaultActions[N] : ((v === null || typeof v == "undefined") && (v = R()), $ = T[N] && T[N][v]), typeof $ == "undefined" || !$.length || !$[0]) {
94
- var Y = "";
95
- Z = [];
96
- for (U in T[N])
97
- this.terminals_[U] && U > j && Z.push("'" + this.terminals_[U] + "'");
98
- b.showPosition ? Y = "Parse error on line " + (P + 1) + `:
99
- ` + b.showPosition() + `
100
- Expecting ` + Z.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : Y = "Parse error on line " + (P + 1) + ": Unexpected " + (v == X ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(Y, {
101
- text: b.match,
102
- token: this.terminals_[v] || v,
103
- line: b.yylineno,
104
- loc: k,
105
- expected: Z
106
- });
107
- }
108
- if ($[0] instanceof Array && $.length > 1)
109
- throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + v);
110
- switch ($[0]) {
111
- case 1:
112
- h.push(v), g.push(b.yytext), c.push(b.yylloc), h.push($[1]), v = null, V = b.yyleng, f = b.yytext, P = b.yylineno, k = b.yylloc;
113
- break;
114
- case 2:
115
- if (C = this.productions_[$[1]][1], W.$ = g[g.length - C], W._$ = {
116
- first_line: c[c.length - (C || 1)].first_line,
117
- last_line: c[c.length - 1].last_line,
118
- first_column: c[c.length - (C || 1)].first_column,
119
- last_column: c[c.length - 1].last_column
120
- }, H && (W._$.range = [
121
- c[c.length - (C || 1)].range[0],
122
- c[c.length - 1].range[1]
123
- ]), G = this.performAction.apply(W, [
124
- f,
125
- V,
126
- P,
127
- L.yy,
128
- $[1],
129
- g,
130
- c
131
- ].concat(q)), typeof G != "undefined")
132
- return G;
133
- C && (h = h.slice(0, -1 * C * 2), g = g.slice(0, -1 * C), c = c.slice(0, -1 * C)), h.push(this.productions_[$[1]][0]), g.push(W.$), c.push(W._$), nt = T[h[h.length - 2]][h[h.length - 1]], h.push(nt);
134
- break;
135
- case 3:
136
- return !0;
137
- }
138
- }
139
- return !0;
140
- }
141
- }, E = function() {
142
- var _ = {
143
- EOF: 1,
144
- parseError: function(a, h) {
145
- if (this.yy.parser)
146
- this.yy.parser.parseError(a, h);
147
- else
148
- throw new Error(a);
149
- },
150
- setInput: function(r, a) {
151
- 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 = {
152
- first_line: 1,
153
- first_column: 0,
154
- last_line: 1,
155
- last_column: 0
156
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
157
- },
158
- input: function() {
159
- var r = this._input[0];
160
- this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
161
- var a = r.match(/(?:\r\n?|\n).*/g);
162
- 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;
163
- },
164
- unput: function(r) {
165
- var a = r.length, h = r.split(/(?:\r\n?|\n)/g);
166
- this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
167
- var u = this.match.split(/(?:\r\n?|\n)/g);
168
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1);
169
- var g = this.yylloc.range;
170
- return this.yylloc = {
171
- first_line: this.yylloc.first_line,
172
- last_line: this.yylineno + 1,
173
- first_column: this.yylloc.first_column,
174
- last_column: h ? (h.length === u.length ? this.yylloc.first_column : 0) + u[u.length - h.length].length - h[0].length : this.yylloc.first_column - a
175
- }, this.options.ranges && (this.yylloc.range = [g[0], g[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
176
- },
177
- more: function() {
178
- return this._more = !0, this;
179
- },
180
- reject: function() {
181
- if (this.options.backtrack_lexer)
182
- this._backtrack = !0;
183
- else
184
- 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).
185
- ` + this.showPosition(), {
186
- text: "",
187
- token: null,
188
- line: this.yylineno
189
- });
190
- return this;
191
- },
192
- less: function(r) {
193
- this.unput(this.match.slice(r));
194
- },
195
- pastInput: function() {
196
- var r = this.matched.substr(0, this.matched.length - this.match.length);
197
- return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
198
- },
199
- upcomingInput: function() {
200
- var r = this.match;
201
- return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
202
- },
203
- showPosition: function() {
204
- var r = this.pastInput(), a = new Array(r.length + 1).join("-");
205
- return r + this.upcomingInput() + `
206
- ` + a + "^";
207
- },
208
- test_match: function(r, a) {
209
- var h, u, g;
210
- if (this.options.backtrack_lexer && (g = {
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 && (g.yylloc.range = this.yylloc.range.slice(0))), u = r[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.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: u ? u[u.length - 1].length - u[u.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], h = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h)
235
- return h;
236
- if (this._backtrack) {
237
- for (var c in g)
238
- this[c] = g[c];
239
- return !1;
240
- }
241
- return !1;
242
- },
243
- next: function() {
244
- if (this.done)
245
- return this.EOF;
246
- this._input || (this.done = !0);
247
- var r, a, h, u;
248
- this._more || (this.yytext = "", this.match = "");
249
- for (var g = this._currentRules(), c = 0; c < g.length; c++)
250
- if (h = this._input.match(this.rules[g[c]]), h && (!a || h[0].length > a[0].length)) {
251
- if (a = h, u = c, this.options.backtrack_lexer) {
252
- if (r = this.test_match(h, g[c]), r !== !1)
253
- return r;
254
- if (this._backtrack) {
255
- a = !1;
256
- continue;
257
- } else
258
- return !1;
259
- } else if (!this.options.flex)
260
- break;
261
- }
262
- return a ? (r = this.test_match(a, g[u]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
263
- ` + this.showPosition(), {
264
- text: "",
265
- token: null,
266
- line: this.yylineno
267
- });
268
- },
269
- lex: function() {
270
- var a = this.next();
271
- return a || this.lex();
272
- },
273
- begin: function(a) {
274
- this.conditionStack.push(a);
275
- },
276
- popState: function() {
277
- var a = this.conditionStack.length - 1;
278
- return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
279
- },
280
- _currentRules: function() {
281
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
282
- },
283
- topState: function(a) {
284
- return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
285
- },
286
- pushState: function(a) {
287
- this.begin(a);
288
- },
289
- stateStackSize: function() {
290
- return this.conditionStack.length;
291
- },
292
- options: { "case-insensitive": !0 },
293
- performAction: function(a, h, u, g) {
294
- switch (u) {
295
- case 0:
296
- return this.begin("open_directive"), 28;
297
- case 1:
298
- return this.begin("type_directive"), 29;
299
- case 2:
300
- return this.popState(), this.begin("arg_directive"), 15;
301
- case 3:
302
- return this.popState(), this.popState(), 31;
303
- case 4:
304
- return 30;
305
- case 5:
306
- break;
307
- case 6:
308
- break;
309
- case 7:
310
- return 11;
311
- case 8:
312
- break;
313
- case 9:
314
- break;
315
- case 10:
316
- return 4;
317
- case 11:
318
- return 17;
319
- case 12:
320
- return this.begin("acc_title"), 18;
321
- case 13:
322
- return this.popState(), "acc_title_value";
323
- case 14:
324
- return this.begin("acc_descr"), 20;
325
- case 15:
326
- return this.popState(), "acc_descr_value";
327
- case 16:
328
- this.begin("acc_descr_multiline");
329
- break;
330
- case 17:
331
- this.popState();
332
- break;
333
- case 18:
334
- return "acc_descr_multiline_value";
335
- case 19:
336
- return 23;
337
- case 20:
338
- return 27;
339
- case 21:
340
- return 26;
341
- case 22:
342
- return 6;
343
- case 23:
344
- return "INVALID";
345
- }
346
- },
347
- rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%(?!\{)[^\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],
348
- conditions: { open_directive: { rules: [1], inclusive: !1 }, type_directive: { rules: [2, 3], inclusive: !1 }, arg_directive: { rules: [3, 4], inclusive: !1 }, acc_descr_multiline: { rules: [17, 18], inclusive: !1 }, acc_descr: { rules: [15], inclusive: !1 }, acc_title: { rules: [13], inclusive: !1 }, INITIAL: { rules: [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23], inclusive: !0 } }
349
- };
350
- return _;
351
- }();
352
- x.lexer = E;
353
- function M() {
354
- this.yy = {};
355
- }
356
- return M.prototype = x, x.Parser = M, new M();
357
- }();
358
- D.parser = D;
359
- const Nt = D;
360
- let B = "", ct = 0;
361
- const tt = [], K = [], O = [], lt = () => bt, ot = (n, t, e) => {
362
- vt(globalThis, n, t, e);
363
- }, ht = function() {
364
- tt.length = 0, K.length = 0, B = "", O.length = 0, kt();
365
- }, dt = function(n) {
366
- B = n, tt.push(n);
367
- }, ut = function() {
368
- return tt;
369
- }, pt = function() {
370
- let n = st();
371
- const t = 100;
372
- let e = 0;
373
- for (; !n && e < t; )
374
- n = st(), e++;
375
- return K.push(...O), K;
376
- }, yt = function(n, t, e) {
377
- const s = {
378
- id: ct++,
379
- section: B,
380
- type: B,
381
- task: n,
382
- score: t || 0,
383
- events: e ? [e] : []
384
- };
385
- O.push(s);
386
- }, gt = function(n) {
387
- O.find((e) => e.id === ct - 1).events.push(n);
388
- }, ft = function(n) {
389
- const t = {
390
- section: B,
391
- type: B,
392
- description: n,
393
- task: n,
394
- classes: []
395
- };
396
- K.push(t);
397
- }, st = function() {
398
- const n = function(e) {
399
- return O[e].processed;
400
- };
401
- let t = !0;
402
- for (const [e, s] of O.entries())
403
- n(e), t = t && s.processed;
404
- return t;
405
- }, $t = {
406
- clear: ht,
407
- getCommonDb: lt,
408
- addSection: dt,
409
- getSections: ut,
410
- getTasks: pt,
411
- addTask: yt,
412
- addTaskOrg: ft,
413
- addEvent: gt,
414
- parseDirective: ot
415
- }, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
416
- __proto__: null,
417
- addEvent: gt,
418
- addSection: dt,
419
- addTask: yt,
420
- addTaskOrg: ft,
421
- clear: ht,
422
- default: $t,
423
- getCommonDb: lt,
424
- getSections: ut,
425
- getTasks: pt,
426
- parseDirective: ot
427
- }, Symbol.toStringTag, { value: "Module" })), Lt = 12, Q = function(n, t) {
428
- const e = n.append("rect");
429
- 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;
430
- }, At = function(n, t) {
431
- const s = n.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), i = n.append("g");
432
- i.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"), i.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");
433
- function o(d) {
434
- const p = it().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
435
- d.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")");
436
- }
437
- function l(d) {
438
- const p = it().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
439
- d.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")");
440
- }
441
- function y(d) {
442
- d.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");
443
- }
444
- return t.score > 3 ? o(i) : t.score < 3 ? l(i) : y(i), s;
445
- }, Pt = function(n, t) {
446
- const e = n.append("circle");
447
- 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;
448
- }, mt = function(n, t) {
449
- const e = t.text.replace(/<br\s*\/?>/gi, " "), s = n.append("text");
450
- 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);
451
- const i = s.append("tspan");
452
- return i.attr("x", t.x + t.textMargin * 2), i.text(e), s;
453
- }, Ht = function(n, t) {
454
- function e(i, o, l, y, d) {
455
- return i + "," + o + " " + (i + l) + "," + o + " " + (i + l) + "," + (o + y - d) + " " + (i + l - d * 1.2) + "," + (o + y) + " " + i + "," + (o + y);
456
- }
457
- const s = n.append("polygon");
458
- 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, mt(n, t);
459
- }, Ct = function(n, t, e) {
460
- const s = n.append("g"), i = et();
461
- i.x = t.x, i.y = t.y, i.fill = t.fill, i.width = e.width, i.height = e.height, i.class = "journey-section section-type-" + t.num, i.rx = 3, i.ry = 3, Q(s, i), xt(e)(
462
- t.text,
463
- s,
464
- i.x,
465
- i.y,
466
- i.width,
467
- i.height,
468
- { class: "journey-section section-type-" + t.num },
469
- e,
470
- t.colour
471
- );
472
- };
473
- let rt = -1;
474
- const zt = function(n, t, e) {
475
- const s = t.x + e.width / 2, i = n.append("g");
476
- rt++;
477
- const o = 300 + 5 * 30;
478
- i.append("line").attr("id", "task" + rt).attr("x1", s).attr("y1", t.y).attr("x2", s).attr("y2", o).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), At(i, {
479
- cx: s,
480
- cy: 300 + (5 - t.score) * 30,
481
- score: t.score
482
- });
483
- const l = et();
484
- l.x = t.x, l.y = t.y, l.fill = t.fill, l.width = e.width, l.height = e.height, l.class = "task task-type-" + t.num, l.rx = 3, l.ry = 3, Q(i, l), t.x + 14, xt(e)(
485
- t.task,
486
- i,
487
- l.x,
488
- l.y,
489
- l.width,
490
- l.height,
491
- { class: "task" },
492
- e,
493
- t.colour
494
- );
495
- }, Vt = function(n, t) {
496
- Q(n, {
497
- x: t.startx,
498
- y: t.starty,
499
- width: t.stopx - t.startx,
500
- height: t.stopy - t.starty,
501
- fill: t.fill,
502
- class: "rect"
503
- }).lower();
504
- }, Rt = function() {
505
- return {
506
- x: 0,
507
- y: 0,
508
- fill: void 0,
509
- "text-anchor": "start",
510
- width: 100,
511
- height: 100,
512
- textMargin: 0,
513
- rx: 0,
514
- ry: 0
515
- };
516
- }, et = function() {
517
- return {
518
- x: 0,
519
- y: 0,
520
- width: 100,
521
- anchor: "start",
522
- height: 100,
523
- rx: 0,
524
- ry: 0
525
- };
526
- }, xt = function() {
527
- function n(i, o, l, y, d, p, m, S) {
528
- const w = o.append("text").attr("x", l + d / 2).attr("y", y + p / 2 + 5).style("font-color", S).style("text-anchor", "middle").text(i);
529
- s(w, m);
530
- }
531
- function t(i, o, l, y, d, p, m, S, w) {
532
- const { taskFontSize: x, taskFontFamily: E } = S, M = i.split(/<br\s*\/?>/gi);
533
- for (let _ = 0; _ < M.length; _++) {
534
- const r = _ * x - x * (M.length - 1) / 2, a = o.append("text").attr("x", l + d / 2).attr("y", y).attr("fill", w).style("text-anchor", "middle").style("font-size", x).style("font-family", E);
535
- a.append("tspan").attr("x", l + d / 2).attr("dy", r).text(M[_]), a.attr("y", y + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(a, m);
536
- }
537
- }
538
- function e(i, o, l, y, d, p, m, S) {
539
- const w = o.append("switch"), E = w.append("foreignObject").attr("x", l).attr("y", y).attr("width", d).attr("height", p).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
540
- E.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, w, l, y, d, p, m, S), s(E, m);
541
- }
542
- function s(i, o) {
543
- for (const l in o)
544
- l in o && i.attr(l, o[l]);
545
- }
546
- return function(i) {
547
- return i.textPlacement === "fo" ? e : i.textPlacement === "old" ? n : t;
548
- };
549
- }(), Ft = function(n) {
550
- 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");
551
- };
552
- function _t(n, t) {
553
- n.each(function() {
554
- var e = J(this), s = e.text().split(/(\s+|<br>)/).reverse(), i, o = [], l = 1.1, y = e.attr("y"), d = parseFloat(e.attr("dy")), p = e.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", d + "em");
555
- for (let m = 0; m < s.length; m++)
556
- i = s[s.length - 1 - m], o.push(i), p.text(o.join(" ").trim()), (p.node().getComputedTextLength() > t || i === "<br>") && (o.pop(), p.text(o.join(" ").trim()), i === "<br>" ? o = [""] : o = [i], p = e.append("tspan").attr("x", 0).attr("y", y).attr("dy", l + "em").text(i));
557
- });
558
- }
559
- const Wt = function(n, t, e, s) {
560
- const i = e % Lt - 1, o = n.append("g");
561
- t.section = i, o.attr(
562
- "class",
563
- (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + i)
564
- );
565
- const l = o.append("g"), y = o.append("g"), p = y.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(_t, t.width).node().getBBox(), m = s.fontSize && s.fontSize.replace ? s.fontSize.replace("px", "") : s.fontSize;
566
- return t.height = p.height + m * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, y.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), Ot(l, t, i), t;
567
- }, Bt = function(n, t, e) {
568
- const s = n.append("g"), o = s.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(_t, t.width).node().getBBox(), l = e.fontSize && e.fontSize.replace ? e.fontSize.replace("px", "") : e.fontSize;
569
- return s.remove(), o.height + l * 1.1 * 0.5 + t.padding;
570
- }, Ot = function(n, t, e) {
571
- n.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr(
572
- "d",
573
- `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`
574
- ), n.append("line").attr("class", "node-line-" + e).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);
575
- }, F = {
576
- drawRect: Q,
577
- drawCircle: Pt,
578
- drawSection: Ct,
579
- drawText: mt,
580
- drawLabel: Ht,
581
- drawTask: zt,
582
- drawBackgroundRect: Vt,
583
- getTextObj: Rt,
584
- getNoteRect: et,
585
- initGraphics: Ft,
586
- drawNode: Wt,
587
- getVirtualNodeHeight: Bt
588
- }, jt = function(n, t, e, s) {
589
- var q, b, L;
590
- var i, o, l, y;
591
- const d = wt(), p = (q = d.leftMargin) != null ? q : 50;
592
- (o = (i = s.db).clear) == null || o.call(i), s.parser.parse(n + `
593
- `), I.debug("timeline", s.db);
594
- const m = d.securityLevel;
595
- let S;
596
- m === "sandbox" && (S = J("#i" + t));
597
- const x = (m === "sandbox" ? J(S.nodes()[0].contentDocument.body) : J("body")).select("#" + t);
598
- x.append("g");
599
- const E = s.db.getTasks(), M = s.db.getCommonDb().getDiagramTitle();
600
- I.debug("task", E), F.initGraphics(x);
601
- const _ = s.db.getSections();
602
- I.debug("sections", _);
603
- let r = 0, a = 0, h = 0, u = 0, g = 50 + p, c = 50;
604
- u = 50;
605
- let T = 0, f = !0;
606
- _.forEach(function(A) {
607
- const k = {
608
- number: T,
609
- descr: A,
610
- section: T,
611
- width: 150,
612
- padding: 20,
613
- maxHeight: r
614
- }, H = F.getVirtualNodeHeight(x, k, d);
615
- I.debug("sectionHeight before draw", H), r = Math.max(r, H + 20);
616
- });
617
- let P = 0, V = 0;
618
- I.debug("tasks.length", E.length);
619
- for (const [A, k] of E.entries()) {
620
- const H = {
621
- number: A,
622
- descr: k,
623
- section: k.section,
624
- width: 150,
625
- padding: 20,
626
- maxHeight: a
627
- }, R = F.getVirtualNodeHeight(x, H, d);
628
- I.debug("taskHeight before draw", R), a = Math.max(a, R + 20), P = Math.max(P, k.events.length);
629
- let v = 0;
630
- for (let N = 0; N < k.events.length; N++) {
631
- const G = {
632
- descr: k.events[N],
633
- section: k.section,
634
- number: k.section,
635
- width: 150,
636
- padding: 20,
637
- maxHeight: 50
638
- };
639
- v += F.getVirtualNodeHeight(x, G, d);
640
- }
641
- V = Math.max(V, v);
642
- }
643
- I.debug("maxSectionHeight before draw", r), I.debug("maxTaskHeight before draw", a), _ && _.length > 0 ? _.forEach((A) => {
644
- const k = E.filter((N) => N.section === A), H = {
645
- number: T,
646
- descr: A,
647
- section: T,
648
- width: 200 * Math.max(k.length, 1) - 50,
649
- padding: 20,
650
- maxHeight: r
651
- };
652
- I.debug("sectionNode", H);
653
- const R = x.append("g"), v = F.drawNode(R, H, T, d);
654
- I.debug("sectionNode output", v), R.attr("transform", `translate(${g}, ${u})`), c += r + 50, k.length > 0 && at(
655
- x,
656
- k,
657
- T,
658
- g,
659
- c,
660
- a,
661
- d,
662
- P,
663
- V,
664
- r,
665
- !1
666
- ), g += 200 * Math.max(k.length, 1), c = u, T++;
667
- }) : (f = !1, at(
668
- x,
669
- E,
670
- T,
671
- g,
672
- c,
673
- a,
674
- d,
675
- P,
676
- V,
677
- r,
678
- !0
679
- ));
680
- const j = x.node().getBBox();
681
- I.debug("bounds", j), M && x.append("text").text(M).attr("x", j.width / 2 - p).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), h = f ? r + a + 150 : a + 100, x.append("g").attr("class", "lineWrapper").append("line").attr("x1", p).attr("y1", h).attr("x2", j.width + 3 * p).attr("y2", h).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), St(
682
- void 0,
683
- x,
684
- (b = (l = d.timeline) == null ? void 0 : l.padding) != null ? b : 50,
685
- (L = (y = d.timeline) == null ? void 0 : y.useMaxWidth) != null ? L : !1
686
- );
687
- }, at = function(n, t, e, s, i, o, l, y, d, p, m) {
688
- var S;
689
- for (const w of t) {
690
- const x = {
691
- descr: w.task,
692
- section: e,
693
- number: e,
694
- width: 150,
695
- padding: 20,
696
- maxHeight: o
697
- };
698
- I.debug("taskNode", x);
699
- const E = n.append("g").attr("class", "taskWrapper"), _ = F.drawNode(E, x, e, l).height;
700
- if (I.debug("taskHeight after draw", _), E.attr("transform", `translate(${s}, ${i})`), o = Math.max(o, _), w.events) {
701
- const r = n.append("g").attr("class", "lineWrapper");
702
- let a = o;
703
- i += 100, a = a + Gt(n, w.events, e, s, i, l), i -= 100, r.append("line").attr("x1", s + 190 / 2).attr("y1", i + o).attr("x2", s + 190 / 2).attr(
704
- "y2",
705
- i + o + (m ? o : p) + d + 120
706
- ).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
707
- }
708
- s = s + 200, m && !((S = l.timeline) != null && S.disableMulticolor) && e++;
709
- }
710
- i = i - 10;
711
- }, Gt = function(n, t, e, s, i, o) {
712
- let l = 0;
713
- const y = i;
714
- i = i + 100;
715
- for (const d of t) {
716
- const p = {
717
- descr: d,
718
- section: e,
719
- number: e,
720
- width: 150,
721
- padding: 20,
722
- maxHeight: 50
723
- };
724
- I.debug("eventNode", p);
725
- const m = n.append("g").attr("class", "eventWrapper"), w = F.drawNode(m, p, e, o).height;
726
- l = l + w, m.attr("transform", `translate(${s}, ${i})`), i = i + 10 + w;
727
- }
728
- return i = y, l;
729
- }, qt = {
730
- setConf: () => {
731
- },
732
- draw: jt
733
- }, Ut = (n) => {
734
- let t = "";
735
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++)
736
- n["lineColor" + e] = n["lineColor" + e] || n["cScaleInv" + e], It(n["lineColor" + e]) ? n["lineColor" + e] = Et(n["lineColor" + e], 20) : n["lineColor" + e] = Tt(n["lineColor" + e], 20);
737
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++) {
738
- const s = "" + (17 - 3 * e);
739
- t += `
740
- .section-${e - 1} rect, .section-${e - 1} path, .section-${e - 1} circle, .section-${e - 1} path {
741
- fill: ${n["cScale" + e]};
742
- }
743
- .section-${e - 1} text {
744
- fill: ${n["cScaleLabel" + e]};
745
- }
746
- .node-icon-${e - 1} {
747
- font-size: 40px;
748
- color: ${n["cScaleLabel" + e]};
749
- }
750
- .section-edge-${e - 1}{
751
- stroke: ${n["cScale" + e]};
752
- }
753
- .edge-depth-${e - 1}{
754
- stroke-width: ${s};
755
- }
756
- .section-${e - 1} line {
757
- stroke: ${n["cScaleInv" + e]} ;
758
- stroke-width: 3;
759
- }
760
-
761
- .lineWrapper line{
762
- stroke: ${n["cScaleLabel" + e]} ;
763
- }
764
-
765
- .disabled, .disabled circle, .disabled text {
766
- fill: lightgray;
767
- }
768
- .disabled text {
769
- fill: #efefef;
770
- }
771
- `;
772
- }
773
- return t;
774
- }, Zt = (n) => `
775
- .edge {
776
- stroke-width: 3;
777
- }
778
- ${Ut(n)}
779
- .section-root rect, .section-root path, .section-root circle {
780
- fill: ${n.git0};
781
- }
782
- .section-root text {
783
- fill: ${n.gitBranchLabel0};
784
- }
785
- .icon-container {
786
- height:100%;
787
- display: flex;
788
- justify-content: center;
789
- align-items: center;
790
- }
791
- .edge {
792
- fill: none;
793
- }
794
- .eventWrapper {
795
- filter: brightness(120%);
796
- }
797
- `, Jt = Zt, Dt = {
798
- db: Mt,
799
- renderer: qt,
800
- parser: Nt,
801
- styles: Jt
802
- };
803
- export {
804
- Dt as diagram
805
- };