lowcoder-comps 0.0.7 → 0.0.8

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 (79) hide show
  1. package/icons/icon-chart.svg +15 -0
  2. package/icons/icon-comp-calendar.svg +22 -0
  3. package/index.html +26 -0
  4. package/index.tsx +19 -0
  5. package/jest.config.js +5 -0
  6. package/package/012a06bb.js +34 -0
  7. package/package/06481cb7.js +1060 -0
  8. package/package/0c8b29d5.js +6 -0
  9. package/package/114884df.js +805 -0
  10. package/package/1264ddb2.js +194 -0
  11. package/package/1cee31ec.js +1095 -0
  12. package/package/269c3ba3.js +46662 -0
  13. package/package/2a2c2e55.js +799 -0
  14. package/package/2b3ab1e4.js +98763 -0
  15. package/package/37590a81.js +967 -0
  16. package/package/3cd7980e.js +184 -0
  17. package/package/40112498.js +424 -0
  18. package/package/4b6e1d6f.js +24 -0
  19. package/package/4bc1082b.js +86 -0
  20. package/package/53e49f9b.js +1600 -0
  21. package/package/55bd5c26.js +266 -0
  22. package/package/591684c8.js +2071 -0
  23. package/package/6c000872.js +16 -0
  24. package/package/756addec.js +775 -0
  25. package/package/7668124e.js +8 -0
  26. package/package/79e8eeeb.js +949 -0
  27. package/package/926fbfec.js +91 -0
  28. package/package/945eefb3.js +2665 -0
  29. package/package/a35f148e.js +1228 -0
  30. package/package/a4d12a43.js +175 -0
  31. package/package/a60de5d1.js +804 -0
  32. package/package/a8dde1ea.js +589 -0
  33. package/package/b4148642.js +7 -0
  34. package/package/b7dd22a2.js +847 -0
  35. package/package/d4f3a2c4.js +18046 -0
  36. package/package/e0f479f3.js +91 -0
  37. package/package/eaa160c9.js +341 -0
  38. package/package/f1bfd8b5.js +311 -0
  39. package/package/f1f9ba79.js +900 -0
  40. package/package/fba61f63.js +2868 -0
  41. package/package/icons/icon-chart.svg +15 -0
  42. package/package/icons/icon-comp-calendar.svg +22 -0
  43. package/package/index.js +5 -0
  44. package/package/package.json +73 -0
  45. package/package.json +1 -4
  46. package/src/__test__/allComp.test.tsx +61 -0
  47. package/src/app-env.d.ts +3 -0
  48. package/src/comps/calendarComp/calendarComp.tsx +442 -0
  49. package/src/comps/calendarComp/calendarConstants.tsx +897 -0
  50. package/src/comps/chartComp/chartComp.tsx +249 -0
  51. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  52. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  53. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +6 -0
  54. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  55. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  56. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  57. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  58. package/src/comps/chartComp/chartConstants.tsx +243 -0
  59. package/src/comps/chartComp/chartPropertyView.tsx +161 -0
  60. package/src/comps/chartComp/chartUtils.ts +240 -0
  61. package/src/comps/chartComp/reactEcharts/core.tsx +187 -0
  62. package/src/comps/chartComp/reactEcharts/index.ts +20 -0
  63. package/src/comps/chartComp/reactEcharts/types.ts +70 -0
  64. package/src/comps/chartComp/seriesComp.tsx +119 -0
  65. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  66. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  67. package/src/comps/imageEditorComp/index.tsx +184 -0
  68. package/src/comps/mermaidComp/index.tsx +44 -0
  69. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  70. package/src/global.ts +1 -0
  71. package/src/i18n/comps/index.tsx +29 -0
  72. package/src/i18n/comps/locales/en.ts +142 -0
  73. package/src/i18n/comps/locales/enObj.tsx +120 -0
  74. package/src/i18n/comps/locales/index.ts +7 -0
  75. package/src/i18n/comps/locales/types.tsx +9 -0
  76. package/src/i18n/comps/locales/zh.ts +4 -0
  77. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  78. package/src/index.ts +11 -0
  79. package/vite.config.js +10 -0
@@ -0,0 +1,589 @@
1
+ import { am as nt, c as q, s as gt, g as dt, v as mt, x as _t, a as vt, b as bt, m as kt, k as xt, l as U, z as St, h as rt, i as wt, an as At } from "./2b3ab1e4.js";
2
+ import { i as Et } from "./6c000872.js";
3
+ import { a as Dt } from "./0c8b29d5.js";
4
+ import { c as j } from "./e0f479f3.js";
5
+ import { a as ct } from "./4bc1082b.js";
6
+ class ot extends Map {
7
+ constructor(r, o = It) {
8
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: o } }), r != null)
9
+ for (const [u, p] of r)
10
+ this.set(u, p);
11
+ }
12
+ get(r) {
13
+ return super.get(ht(this, r));
14
+ }
15
+ has(r) {
16
+ return super.has(ht(this, r));
17
+ }
18
+ set(r, o) {
19
+ return super.set(Tt(this, r), o);
20
+ }
21
+ delete(r) {
22
+ return super.delete($t(this, r));
23
+ }
24
+ }
25
+ function ht({ _intern: t, _key: r }, o) {
26
+ const u = r(o);
27
+ return t.has(u) ? t.get(u) : o;
28
+ }
29
+ function Tt({ _intern: t, _key: r }, o) {
30
+ const u = r(o);
31
+ return t.has(u) ? t.get(u) : (t.set(u, o), o);
32
+ }
33
+ function $t({ _intern: t, _key: r }, o) {
34
+ const u = r(o);
35
+ return t.has(u) && (o = t.get(u), t.delete(u)), o;
36
+ }
37
+ function It(t) {
38
+ return t !== null && typeof t == "object" ? t.valueOf() : t;
39
+ }
40
+ const ut = Symbol("implicit");
41
+ function ft() {
42
+ var t = new ot(), r = [], o = [], u = ut;
43
+ function p(g) {
44
+ let f = t.get(g);
45
+ if (f === void 0) {
46
+ if (u !== ut)
47
+ return u;
48
+ t.set(g, f = r.push(g) - 1);
49
+ }
50
+ return o[f % o.length];
51
+ }
52
+ return p.domain = function(g) {
53
+ if (!arguments.length)
54
+ return r.slice();
55
+ r = [], t = new ot();
56
+ for (const f of g)
57
+ t.has(f) || t.set(f, r.push(f) - 1);
58
+ return p;
59
+ }, p.range = function(g) {
60
+ return arguments.length ? (o = Array.from(g), p) : o.slice();
61
+ }, p.unknown = function(g) {
62
+ return arguments.length ? (u = g, p) : u;
63
+ }, p.copy = function() {
64
+ return ft(r, o).unknown(u);
65
+ }, Et.apply(p, arguments), p;
66
+ }
67
+ function Vt(t, r) {
68
+ return r < t ? -1 : r > t ? 1 : r >= t ? 0 : NaN;
69
+ }
70
+ function Pt(t) {
71
+ return t;
72
+ }
73
+ function Ot() {
74
+ var t = Pt, r = Vt, o = null, u = j(0), p = j(nt), g = j(0);
75
+ function f(h) {
76
+ var d, y = (h = Dt(h)).length, S, N, C = 0, b = new Array(y), w = new Array(y), I = +u.apply(this, arguments), D = Math.min(nt, Math.max(-nt, p.apply(this, arguments) - I)), F, M = Math.min(Math.abs(D) / y, g.apply(this, arguments)), V = M * (D < 0 ? -1 : 1), A;
77
+ for (d = 0; d < y; ++d)
78
+ (A = w[b[d] = d] = +t(h[d], d, h)) > 0 && (C += A);
79
+ for (r != null ? b.sort(function(k, _) {
80
+ return r(w[k], w[_]);
81
+ }) : o != null && b.sort(function(k, _) {
82
+ return o(h[k], h[_]);
83
+ }), d = 0, N = C ? (D - y * V) / C : 0; d < y; ++d, I = F)
84
+ S = b[d], A = w[S], F = I + (A > 0 ? A * N : 0) + V, w[S] = {
85
+ data: h[S],
86
+ index: d,
87
+ value: A,
88
+ startAngle: I,
89
+ endAngle: F,
90
+ padAngle: M
91
+ };
92
+ return w;
93
+ }
94
+ return f.value = function(h) {
95
+ return arguments.length ? (t = typeof h == "function" ? h : j(+h), f) : t;
96
+ }, f.sortValues = function(h) {
97
+ return arguments.length ? (r = h, o = null, f) : r;
98
+ }, f.sort = function(h) {
99
+ return arguments.length ? (o = h, r = null, f) : o;
100
+ }, f.startAngle = function(h) {
101
+ return arguments.length ? (u = typeof h == "function" ? h : j(+h), f) : u;
102
+ }, f.endAngle = function(h) {
103
+ return arguments.length ? (p = typeof h == "function" ? h : j(+h), f) : p;
104
+ }, f.padAngle = function(h) {
105
+ return arguments.length ? (g = typeof h == "function" ? h : j(+h), f) : g;
106
+ }, f;
107
+ }
108
+ var st = function() {
109
+ var t = function(_, e, i, s) {
110
+ for (i = i || {}, s = _.length; s--; i[_[s]] = e)
111
+ ;
112
+ return i;
113
+ }, r = [1, 4], o = [1, 5], u = [1, 6], p = [1, 7], g = [1, 9], f = [1, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], h = [2, 5], d = [1, 6, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], y = [26, 27, 28], S = [2, 8], N = [1, 18], C = [1, 19], b = [1, 20], w = [1, 21], I = [1, 22], D = [1, 23], F = [1, 28], M = [6, 26, 27, 28, 29], V = {
114
+ trace: function() {
115
+ },
116
+ yy: {},
117
+ symbols_: { error: 2, start: 3, eol: 4, directive: 5, PIE: 6, document: 7, showData: 8, line: 9, statement: 10, txt: 11, value: 12, title: 13, title_value: 14, acc_title: 15, acc_title_value: 16, acc_descr: 17, acc_descr_value: 18, acc_descr_multiline_value: 19, section: 20, openDirective: 21, typeDirective: 22, closeDirective: 23, ":": 24, argDirective: 25, NEWLINE: 26, ";": 27, EOF: 28, open_directive: 29, type_directive: 30, arg_directive: 31, close_directive: 32, $accept: 0, $end: 1 },
118
+ terminals_: { 2: "error", 6: "PIE", 8: "showData", 11: "txt", 12: "value", 13: "title", 14: "title_value", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 24: ":", 26: "NEWLINE", 27: ";", 28: "EOF", 29: "open_directive", 30: "type_directive", 31: "arg_directive", 32: "close_directive" },
119
+ productions_: [0, [3, 2], [3, 2], [3, 2], [3, 3], [7, 0], [7, 2], [9, 2], [10, 0], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [5, 3], [5, 5], [4, 1], [4, 1], [4, 1], [21, 1], [22, 1], [25, 1], [23, 1]],
120
+ performAction: function(e, i, s, l, a, n, E) {
121
+ var c = n.length - 1;
122
+ switch (a) {
123
+ case 4:
124
+ l.setShowData(!0);
125
+ break;
126
+ case 7:
127
+ this.$ = n[c - 1];
128
+ break;
129
+ case 9:
130
+ l.addSection(n[c - 1], l.cleanupValue(n[c]));
131
+ break;
132
+ case 10:
133
+ this.$ = n[c].trim(), l.setDiagramTitle(this.$);
134
+ break;
135
+ case 11:
136
+ this.$ = n[c].trim(), l.setAccTitle(this.$);
137
+ break;
138
+ case 12:
139
+ case 13:
140
+ this.$ = n[c].trim(), l.setAccDescription(this.$);
141
+ break;
142
+ case 14:
143
+ l.addSection(n[c].substr(8)), this.$ = n[c].substr(8);
144
+ break;
145
+ case 21:
146
+ l.parseDirective("%%{", "open_directive");
147
+ break;
148
+ case 22:
149
+ l.parseDirective(n[c], "type_directive");
150
+ break;
151
+ case 23:
152
+ n[c] = n[c].trim().replace(/'/g, '"'), l.parseDirective(n[c], "arg_directive");
153
+ break;
154
+ case 24:
155
+ l.parseDirective("}%%", "close_directive", "pie");
156
+ break;
157
+ }
158
+ },
159
+ table: [{ 3: 1, 4: 2, 5: 3, 6: r, 21: 8, 26: o, 27: u, 28: p, 29: g }, { 1: [3] }, { 3: 10, 4: 2, 5: 3, 6: r, 21: 8, 26: o, 27: u, 28: p, 29: g }, { 3: 11, 4: 2, 5: 3, 6: r, 21: 8, 26: o, 27: u, 28: p, 29: g }, t(f, h, { 7: 12, 8: [1, 13] }), t(d, [2, 18]), t(d, [2, 19]), t(d, [2, 20]), { 22: 14, 30: [1, 15] }, { 30: [2, 21] }, { 1: [2, 1] }, { 1: [2, 2] }, t(y, S, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 3], 11: N, 13: C, 15: b, 17: w, 19: I, 20: D, 29: g }), t(f, h, { 7: 25 }), { 23: 26, 24: [1, 27], 32: F }, t([24, 32], [2, 22]), t(f, [2, 6]), { 4: 29, 26: o, 27: u, 28: p }, { 12: [1, 30] }, { 14: [1, 31] }, { 16: [1, 32] }, { 18: [1, 33] }, t(y, [2, 13]), t(y, [2, 14]), t(y, [2, 15]), t(y, S, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 4], 11: N, 13: C, 15: b, 17: w, 19: I, 20: D, 29: g }), t(M, [2, 16]), { 25: 34, 31: [1, 35] }, t(M, [2, 24]), t(f, [2, 7]), t(y, [2, 9]), t(y, [2, 10]), t(y, [2, 11]), t(y, [2, 12]), { 23: 36, 32: F }, { 32: [2, 23] }, t(M, [2, 17])],
160
+ defaultActions: { 9: [2, 21], 10: [2, 1], 11: [2, 2], 35: [2, 23] },
161
+ parseError: function(e, i) {
162
+ if (i.recoverable)
163
+ this.trace(e);
164
+ else {
165
+ var s = new Error(e);
166
+ throw s.hash = i, s;
167
+ }
168
+ },
169
+ parse: function(e) {
170
+ var i = this, s = [0], l = [], a = [null], n = [], E = this.table, c = "", T = 0, Y = 0, Q = 2, G = 1, X = n.slice.call(arguments, 1), m = Object.create(this.lexer), W = { yy: {} };
171
+ for (var Z in this.yy)
172
+ Object.prototype.hasOwnProperty.call(this.yy, Z) && (W.yy[Z] = this.yy[Z]);
173
+ m.setInput(e, W.yy), W.yy.lexer = m, W.yy.parser = this, typeof m.yylloc == "undefined" && (m.yylloc = {});
174
+ var tt = m.yylloc;
175
+ n.push(tt);
176
+ var pt = m.options && m.options.ranges;
177
+ typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
178
+ function yt() {
179
+ var O;
180
+ return O = l.pop() || m.lex() || G, typeof O != "number" && (O instanceof Array && (l = O, O = l.pop()), O = i.symbols_[O] || O), O;
181
+ }
182
+ for (var v, z, x, et, R = {}, H, P, lt, J; ; ) {
183
+ if (z = s[s.length - 1], this.defaultActions[z] ? x = this.defaultActions[z] : ((v === null || typeof v == "undefined") && (v = yt()), x = E[z] && E[z][v]), typeof x == "undefined" || !x.length || !x[0]) {
184
+ var it = "";
185
+ J = [];
186
+ for (H in E[z])
187
+ this.terminals_[H] && H > Q && J.push("'" + this.terminals_[H] + "'");
188
+ m.showPosition ? it = "Parse error on line " + (T + 1) + `:
189
+ ` + m.showPosition() + `
190
+ Expecting ` + J.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : it = "Parse error on line " + (T + 1) + ": Unexpected " + (v == G ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(it, {
191
+ text: m.match,
192
+ token: this.terminals_[v] || v,
193
+ line: m.yylineno,
194
+ loc: tt,
195
+ expected: J
196
+ });
197
+ }
198
+ if (x[0] instanceof Array && x.length > 1)
199
+ throw new Error("Parse Error: multiple actions possible at state: " + z + ", token: " + v);
200
+ switch (x[0]) {
201
+ case 1:
202
+ s.push(v), a.push(m.yytext), n.push(m.yylloc), s.push(x[1]), v = null, Y = m.yyleng, c = m.yytext, T = m.yylineno, tt = m.yylloc;
203
+ break;
204
+ case 2:
205
+ if (P = this.productions_[x[1]][1], R.$ = a[a.length - P], R._$ = {
206
+ first_line: n[n.length - (P || 1)].first_line,
207
+ last_line: n[n.length - 1].last_line,
208
+ first_column: n[n.length - (P || 1)].first_column,
209
+ last_column: n[n.length - 1].last_column
210
+ }, pt && (R._$.range = [
211
+ n[n.length - (P || 1)].range[0],
212
+ n[n.length - 1].range[1]
213
+ ]), et = this.performAction.apply(R, [
214
+ c,
215
+ Y,
216
+ T,
217
+ W.yy,
218
+ x[1],
219
+ a,
220
+ n
221
+ ].concat(X)), typeof et != "undefined")
222
+ return et;
223
+ P && (s = s.slice(0, -1 * P * 2), a = a.slice(0, -1 * P), n = n.slice(0, -1 * P)), s.push(this.productions_[x[1]][0]), a.push(R.$), n.push(R._$), lt = E[s[s.length - 2]][s[s.length - 1]], s.push(lt);
224
+ break;
225
+ case 3:
226
+ return !0;
227
+ }
228
+ }
229
+ return !0;
230
+ }
231
+ }, A = function() {
232
+ var _ = {
233
+ EOF: 1,
234
+ parseError: function(i, s) {
235
+ if (this.yy.parser)
236
+ this.yy.parser.parseError(i, s);
237
+ else
238
+ throw new Error(i);
239
+ },
240
+ setInput: function(e, i) {
241
+ return this.yy = i || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
242
+ first_line: 1,
243
+ first_column: 0,
244
+ last_line: 1,
245
+ last_column: 0
246
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
247
+ },
248
+ input: function() {
249
+ var e = this._input[0];
250
+ this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e;
251
+ var i = e.match(/(?:\r\n?|\n).*/g);
252
+ return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
253
+ },
254
+ unput: function(e) {
255
+ var i = e.length, s = e.split(/(?:\r\n?|\n)/g);
256
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
257
+ var l = this.match.split(/(?:\r\n?|\n)/g);
258
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1);
259
+ var a = this.yylloc.range;
260
+ return this.yylloc = {
261
+ first_line: this.yylloc.first_line,
262
+ last_line: this.yylineno + 1,
263
+ first_column: this.yylloc.first_column,
264
+ last_column: s ? (s.length === l.length ? this.yylloc.first_column : 0) + l[l.length - s.length].length - s[0].length : this.yylloc.first_column - i
265
+ }, this.options.ranges && (this.yylloc.range = [a[0], a[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
266
+ },
267
+ more: function() {
268
+ return this._more = !0, this;
269
+ },
270
+ reject: function() {
271
+ if (this.options.backtrack_lexer)
272
+ this._backtrack = !0;
273
+ else
274
+ 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).
275
+ ` + this.showPosition(), {
276
+ text: "",
277
+ token: null,
278
+ line: this.yylineno
279
+ });
280
+ return this;
281
+ },
282
+ less: function(e) {
283
+ this.unput(this.match.slice(e));
284
+ },
285
+ pastInput: function() {
286
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
287
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
288
+ },
289
+ upcomingInput: function() {
290
+ var e = this.match;
291
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
292
+ },
293
+ showPosition: function() {
294
+ var e = this.pastInput(), i = new Array(e.length + 1).join("-");
295
+ return e + this.upcomingInput() + `
296
+ ` + i + "^";
297
+ },
298
+ test_match: function(e, i) {
299
+ var s, l, a;
300
+ if (this.options.backtrack_lexer && (a = {
301
+ yylineno: this.yylineno,
302
+ yylloc: {
303
+ first_line: this.yylloc.first_line,
304
+ last_line: this.last_line,
305
+ first_column: this.yylloc.first_column,
306
+ last_column: this.yylloc.last_column
307
+ },
308
+ yytext: this.yytext,
309
+ match: this.match,
310
+ matches: this.matches,
311
+ matched: this.matched,
312
+ yyleng: this.yyleng,
313
+ offset: this.offset,
314
+ _more: this._more,
315
+ _input: this._input,
316
+ yy: this.yy,
317
+ conditionStack: this.conditionStack.slice(0),
318
+ done: this.done
319
+ }, this.options.ranges && (a.yylloc.range = this.yylloc.range.slice(0))), l = e[0].match(/(?:\r\n?|\n).*/g), l && (this.yylineno += l.length), this.yylloc = {
320
+ first_line: this.yylloc.last_line,
321
+ last_line: this.yylineno + 1,
322
+ first_column: this.yylloc.last_column,
323
+ last_column: l ? l[l.length - 1].length - l[l.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
324
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], s = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), s)
325
+ return s;
326
+ if (this._backtrack) {
327
+ for (var n in a)
328
+ this[n] = a[n];
329
+ return !1;
330
+ }
331
+ return !1;
332
+ },
333
+ next: function() {
334
+ if (this.done)
335
+ return this.EOF;
336
+ this._input || (this.done = !0);
337
+ var e, i, s, l;
338
+ this._more || (this.yytext = "", this.match = "");
339
+ for (var a = this._currentRules(), n = 0; n < a.length; n++)
340
+ if (s = this._input.match(this.rules[a[n]]), s && (!i || s[0].length > i[0].length)) {
341
+ if (i = s, l = n, this.options.backtrack_lexer) {
342
+ if (e = this.test_match(s, a[n]), e !== !1)
343
+ return e;
344
+ if (this._backtrack) {
345
+ i = !1;
346
+ continue;
347
+ } else
348
+ return !1;
349
+ } else if (!this.options.flex)
350
+ break;
351
+ }
352
+ return i ? (e = this.test_match(i, a[l]), e !== !1 ? e : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
353
+ ` + this.showPosition(), {
354
+ text: "",
355
+ token: null,
356
+ line: this.yylineno
357
+ });
358
+ },
359
+ lex: function() {
360
+ var i = this.next();
361
+ return i || this.lex();
362
+ },
363
+ begin: function(i) {
364
+ this.conditionStack.push(i);
365
+ },
366
+ popState: function() {
367
+ var i = this.conditionStack.length - 1;
368
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
369
+ },
370
+ _currentRules: function() {
371
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
372
+ },
373
+ topState: function(i) {
374
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
375
+ },
376
+ pushState: function(i) {
377
+ this.begin(i);
378
+ },
379
+ stateStackSize: function() {
380
+ return this.conditionStack.length;
381
+ },
382
+ options: { "case-insensitive": !0 },
383
+ performAction: function(i, s, l, a) {
384
+ switch (l) {
385
+ case 0:
386
+ return this.begin("open_directive"), 29;
387
+ case 1:
388
+ return this.begin("type_directive"), 30;
389
+ case 2:
390
+ return this.popState(), this.begin("arg_directive"), 24;
391
+ case 3:
392
+ return this.popState(), this.popState(), 32;
393
+ case 4:
394
+ return 31;
395
+ case 5:
396
+ break;
397
+ case 6:
398
+ break;
399
+ case 7:
400
+ return 26;
401
+ case 8:
402
+ break;
403
+ case 9:
404
+ break;
405
+ case 10:
406
+ return this.begin("title"), 13;
407
+ case 11:
408
+ return this.popState(), "title_value";
409
+ case 12:
410
+ return this.begin("acc_title"), 15;
411
+ case 13:
412
+ return this.popState(), "acc_title_value";
413
+ case 14:
414
+ return this.begin("acc_descr"), 17;
415
+ case 15:
416
+ return this.popState(), "acc_descr_value";
417
+ case 16:
418
+ this.begin("acc_descr_multiline");
419
+ break;
420
+ case 17:
421
+ this.popState();
422
+ break;
423
+ case 18:
424
+ return "acc_descr_multiline_value";
425
+ case 19:
426
+ this.begin("string");
427
+ break;
428
+ case 20:
429
+ this.popState();
430
+ break;
431
+ case 21:
432
+ return "txt";
433
+ case 22:
434
+ return 6;
435
+ case 23:
436
+ return 8;
437
+ case 24:
438
+ return "value";
439
+ case 25:
440
+ return 28;
441
+ }
442
+ },
443
+ rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i],
444
+ conditions: { acc_descr_multiline: { rules: [17, 18], inclusive: !1 }, acc_descr: { rules: [15], inclusive: !1 }, acc_title: { rules: [13], inclusive: !1 }, close_directive: { rules: [], inclusive: !1 }, arg_directive: { rules: [3, 4], inclusive: !1 }, type_directive: { rules: [2, 3], inclusive: !1 }, open_directive: { rules: [1], inclusive: !1 }, title: { rules: [11], inclusive: !1 }, string: { rules: [20, 21], inclusive: !1 }, INITIAL: { rules: [0, 5, 6, 7, 8, 9, 10, 12, 14, 16, 19, 22, 23, 24, 25], inclusive: !0 } }
445
+ };
446
+ return _;
447
+ }();
448
+ V.lexer = A;
449
+ function k() {
450
+ this.yy = {};
451
+ }
452
+ return k.prototype = V, V.Parser = k, new k();
453
+ }();
454
+ st.parser = st;
455
+ const Lt = st;
456
+ let K = {}, at = !1;
457
+ const Nt = function(t, r, o) {
458
+ kt.parseDirective(this, t, r, o);
459
+ }, Ct = function(t, r) {
460
+ t = xt.sanitizeText(t, q()), K[t] === void 0 && (K[t] = r, U.debug("Added new section :", t));
461
+ }, Ft = () => K, Mt = function(t) {
462
+ at = t;
463
+ }, Wt = function() {
464
+ return at;
465
+ }, zt = function(t) {
466
+ return t.substring(0, 1) === ":" && (t = t.substring(1).trim()), Number(t.trim());
467
+ }, jt = function() {
468
+ K = {}, at = !1, St();
469
+ }, Rt = {
470
+ parseDirective: Nt,
471
+ getConfig: () => q().pie,
472
+ addSection: Ct,
473
+ getSections: Ft,
474
+ cleanupValue: zt,
475
+ clear: jt,
476
+ setAccTitle: gt,
477
+ getAccTitle: dt,
478
+ setDiagramTitle: mt,
479
+ getDiagramTitle: _t,
480
+ setShowData: Mt,
481
+ getShowData: Wt,
482
+ getAccDescription: vt,
483
+ setAccDescription: bt
484
+ }, Yt = (t) => `
485
+ .pieCircle{
486
+ stroke: ${t.pieStrokeColor};
487
+ stroke-width : ${t.pieStrokeWidth};
488
+ opacity : ${t.pieOpacity};
489
+ }
490
+ .pieOuterCircle{
491
+ stroke: ${t.pieOuterStrokeColor};
492
+ stroke-width: ${t.pieOuterStrokeWidth};
493
+ fill: none;
494
+ }
495
+ .pieTitleText {
496
+ text-anchor: middle;
497
+ font-size: ${t.pieTitleTextSize};
498
+ fill: ${t.pieTitleTextColor};
499
+ font-family: ${t.fontFamily};
500
+ }
501
+ .slice {
502
+ font-family: ${t.fontFamily};
503
+ fill: ${t.pieSectionTextColor};
504
+ font-size:${t.pieSectionTextSize};
505
+ // fill: white;
506
+ }
507
+ .legend text {
508
+ fill: ${t.pieLegendTextColor};
509
+ font-family: ${t.fontFamily};
510
+ font-size: ${t.pieLegendTextSize};
511
+ }
512
+ `, Bt = Yt;
513
+ let $ = q(), L;
514
+ const B = 450, Ut = (t, r, o, u) => {
515
+ var A;
516
+ var p;
517
+ try {
518
+ $ = q(), U.debug(`Rendering info diagram
519
+ ` + t);
520
+ const k = q().securityLevel;
521
+ let _;
522
+ k === "sandbox" && (_ = rt("#i" + r));
523
+ const e = k === "sandbox" ? rt(_.nodes()[0].contentDocument.body) : rt("body"), i = k === "sandbox" ? _.nodes()[0].contentDocument : document;
524
+ u.db.clear(), u.parser.parse(t), U.debug("Parsed info diagram");
525
+ const s = i.getElementById(r);
526
+ L = s.parentElement.offsetWidth, L === void 0 && (L = 1200), $.useWidth !== void 0 && (L = $.useWidth), $.pie.useWidth !== void 0 && (L = $.pie.useWidth);
527
+ const l = e.select("#" + r);
528
+ wt(l, B, L, $.pie.useMaxWidth), s.setAttribute("viewBox", "0 0 " + L + " " + B);
529
+ var g = 40, f = 18, h = 4, d = Math.min(L, B) / 2 - g, y = l.append("g").attr("transform", "translate(" + L / 2 + "," + B / 2 + ")"), S = u.db.getSections(), N = 0;
530
+ Object.keys(S).forEach(function(c) {
531
+ N += S[c];
532
+ });
533
+ const a = $.themeVariables;
534
+ var C = [
535
+ a.pie1,
536
+ a.pie2,
537
+ a.pie3,
538
+ a.pie4,
539
+ a.pie5,
540
+ a.pie6,
541
+ a.pie7,
542
+ a.pie8,
543
+ a.pie9,
544
+ a.pie10,
545
+ a.pie11,
546
+ a.pie12
547
+ ];
548
+ const n = (A = (p = $.pie) == null ? void 0 : p.textPosition) != null ? A : 0.75;
549
+ let [E] = At(a.pieOuterStrokeWidth);
550
+ E != null || (E = 2);
551
+ var b = ft().range(C), w = Object.entries(S).map(function(c, T) {
552
+ return {
553
+ order: T,
554
+ name: c[0],
555
+ value: c[1]
556
+ };
557
+ }), I = Ot().value(function(c) {
558
+ return c.value;
559
+ }).sort(function(c, T) {
560
+ return c.order - T.order;
561
+ }), D = I(w), F = ct().innerRadius(0).outerRadius(d), M = ct().innerRadius(d * n).outerRadius(d * n);
562
+ y.append("circle").attr("cx", 0).attr("cy", 0).attr("r", d + E / 2).attr("class", "pieOuterCircle"), y.selectAll("mySlices").data(D).enter().append("path").attr("d", F).attr("fill", function(c) {
563
+ return b(c.data.name);
564
+ }).attr("class", "pieCircle"), y.selectAll("mySlices").data(D).enter().append("text").text(function(c) {
565
+ return (c.data.value / N * 100).toFixed(0) + "%";
566
+ }).attr("transform", function(c) {
567
+ return "translate(" + M.centroid(c) + ")";
568
+ }).style("text-anchor", "middle").attr("class", "slice"), y.append("text").text(u.db.getDiagramTitle()).attr("x", 0).attr("y", -(B - 50) / 2).attr("class", "pieTitleText");
569
+ var V = y.selectAll(".legend").data(b.domain()).enter().append("g").attr("class", "legend").attr("transform", function(c, T) {
570
+ const Y = f + h, Q = Y * b.domain().length / 2, G = 12 * f, X = T * Y - Q;
571
+ return "translate(" + G + "," + X + ")";
572
+ });
573
+ V.append("rect").attr("width", f).attr("height", f).style("fill", b).style("stroke", b), V.data(D).append("text").attr("x", f + h).attr("y", f - h).text(function(c) {
574
+ return u.db.getShowData() || $.showData || $.pie.showData ? c.data.name + " [" + c.data.value + "]" : c.data.name;
575
+ });
576
+ } catch (k) {
577
+ U.error("Error while rendering info diagram"), U.error(k);
578
+ }
579
+ }, qt = {
580
+ draw: Ut
581
+ }, Xt = {
582
+ parser: Lt,
583
+ db: Rt,
584
+ renderer: qt,
585
+ styles: Bt
586
+ };
587
+ export {
588
+ Xt as diagram
589
+ };
@@ -0,0 +1,7 @@
1
+ import { $ as t, a0 as n, a1 as o } from "./2b3ab1e4.js";
2
+ function a(e) {
3
+ return typeof e == "string" ? new t([document.querySelectorAll(e)], [document.documentElement]) : new t([o(e)], n);
4
+ }
5
+ export {
6
+ a as s
7
+ };