@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,1306 @@
1
+ import { _ as a, aF as ui, l as Ft, Q as Bt, K as gi, E as At, D as Xt, C as xi, i as di, o as Nt, s as pi, g as fi, n as mi, b as yi, c as bi, t as Ai, H as wi, k as Ci } from "./index-f5aac161.mjs";
2
+ import { i as Si } from "./init-f9637058.mjs";
3
+ import { o as _i } from "./ordinal-980380c7.mjs";
4
+ import { l as Wt } from "./linear-3c81794f.mjs";
5
+ import "vue";
6
+ function ki(e, t, i) {
7
+ e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
8
+ for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, r = new Array(n); ++s < n; )
9
+ r[s] = e + s * i;
10
+ return r;
11
+ }
12
+ function pt() {
13
+ var e = _i().unknown(void 0), t = e.domain, i = e.range, s = 0, n = 1, r, u, f = !1, p = 0, k = 0, R = 0.5;
14
+ delete e.unknown;
15
+ function w() {
16
+ var y = t().length, D = n < s, S = D ? n : s, v = D ? s : n;
17
+ r = (v - S) / Math.max(1, y - p + k * 2), f && (r = Math.floor(r)), S += (v - S - r * (y - p)) * R, u = r * (1 - p), f && (S = Math.round(S), u = Math.round(u));
18
+ var m = ki(y).map(function(_) {
19
+ return S + r * _;
20
+ });
21
+ return i(D ? m.reverse() : m);
22
+ }
23
+ return e.domain = function(y) {
24
+ return arguments.length ? (t(y), w()) : t();
25
+ }, e.range = function(y) {
26
+ return arguments.length ? ([s, n] = y, s = +s, n = +n, w()) : [s, n];
27
+ }, e.rangeRound = function(y) {
28
+ return [s, n] = y, s = +s, n = +n, f = !0, w();
29
+ }, e.bandwidth = function() {
30
+ return u;
31
+ }, e.step = function() {
32
+ return r;
33
+ }, e.round = function(y) {
34
+ return arguments.length ? (f = !!y, w()) : f;
35
+ }, e.padding = function(y) {
36
+ return arguments.length ? (p = Math.min(1, k = +y), w()) : p;
37
+ }, e.paddingInner = function(y) {
38
+ return arguments.length ? (p = Math.min(1, y), w()) : p;
39
+ }, e.paddingOuter = function(y) {
40
+ return arguments.length ? (k = +y, w()) : k;
41
+ }, e.align = function(y) {
42
+ return arguments.length ? (R = Math.max(0, Math.min(1, y)), w()) : R;
43
+ }, e.copy = function() {
44
+ return pt(t(), [s, n]).round(f).paddingInner(p).paddingOuter(k).align(R);
45
+ }, Si.apply(w(), arguments);
46
+ }
47
+ var ft = function() {
48
+ var e = /* @__PURE__ */ a(function(B, h, c, g) {
49
+ for (c = c || {}, g = B.length; g--; c[B[g]] = h)
50
+ ;
51
+ return c;
52
+ }, "o"), t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], n = [1, 5], r = [1, 6], u = [1, 7], f = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], p = [1, 25], k = [1, 26], R = [1, 28], w = [1, 29], y = [1, 30], D = [1, 31], S = [1, 32], v = [1, 33], m = [1, 34], _ = [1, 35], l = [1, 36], E = [1, 37], X = [1, 43], vt = [1, 42], Pt = [1, 47], et = [1, 50], C = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], lt = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], I = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], Lt = [1, 64], ct = {
53
+ trace: /* @__PURE__ */ a(function() {
54
+ }, "trace"),
55
+ yy: {},
56
+ symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, commaSeparatedNumbers: 25, SQUARE_BRACES_END: 26, NUMBER_WITH_DECIMAL: 27, COMMA: 28, xAxisData: 29, bandData: 30, ARROW_DELIMITER: 31, commaSeparatedTexts: 32, yAxisData: 33, NEWLINE: 34, SEMI: 35, EOF: 36, alphaNum: 37, STR: 38, MD_STR: 39, alphaNumToken: 40, AMP: 41, NUM: 42, ALPHA: 43, PLUS: 44, EQUALS: 45, MULT: 46, DOT: 47, BRKT: 48, MINUS: 49, UNDERSCORE: 50, $accept: 0, $end: 1 },
57
+ terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" },
58
+ productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]],
59
+ performAction: /* @__PURE__ */ a(function(h, c, g, x, A, o, N) {
60
+ var d = o.length - 1;
61
+ switch (A) {
62
+ case 5:
63
+ x.setOrientation(o[d]);
64
+ break;
65
+ case 9:
66
+ x.setDiagramTitle(o[d].text.trim());
67
+ break;
68
+ case 12:
69
+ x.setLineData({ text: "", type: "text" }, o[d]);
70
+ break;
71
+ case 13:
72
+ x.setLineData(o[d - 1], o[d]);
73
+ break;
74
+ case 14:
75
+ x.setBarData({ text: "", type: "text" }, o[d]);
76
+ break;
77
+ case 15:
78
+ x.setBarData(o[d - 1], o[d]);
79
+ break;
80
+ case 16:
81
+ this.$ = o[d].trim(), x.setAccTitle(this.$);
82
+ break;
83
+ case 17:
84
+ case 18:
85
+ this.$ = o[d].trim(), x.setAccDescription(this.$);
86
+ break;
87
+ case 19:
88
+ this.$ = o[d - 1];
89
+ break;
90
+ case 20:
91
+ this.$ = [Number(o[d - 2]), ...o[d]];
92
+ break;
93
+ case 21:
94
+ this.$ = [Number(o[d])];
95
+ break;
96
+ case 22:
97
+ x.setXAxisTitle(o[d]);
98
+ break;
99
+ case 23:
100
+ x.setXAxisTitle(o[d - 1]);
101
+ break;
102
+ case 24:
103
+ x.setXAxisTitle({ type: "text", text: "" });
104
+ break;
105
+ case 25:
106
+ x.setXAxisBand(o[d]);
107
+ break;
108
+ case 26:
109
+ x.setXAxisRangeData(Number(o[d - 2]), Number(o[d]));
110
+ break;
111
+ case 27:
112
+ this.$ = o[d - 1];
113
+ break;
114
+ case 28:
115
+ this.$ = [o[d - 2], ...o[d]];
116
+ break;
117
+ case 29:
118
+ this.$ = [o[d]];
119
+ break;
120
+ case 30:
121
+ x.setYAxisTitle(o[d]);
122
+ break;
123
+ case 31:
124
+ x.setYAxisTitle(o[d - 1]);
125
+ break;
126
+ case 32:
127
+ x.setYAxisTitle({ type: "text", text: "" });
128
+ break;
129
+ case 33:
130
+ x.setYAxisRangeData(Number(o[d - 2]), Number(o[d]));
131
+ break;
132
+ case 37:
133
+ this.$ = { text: o[d], type: "text" };
134
+ break;
135
+ case 38:
136
+ this.$ = { text: o[d], type: "text" };
137
+ break;
138
+ case 39:
139
+ this.$ = { text: o[d], type: "markdown" };
140
+ break;
141
+ case 40:
142
+ this.$ = o[d];
143
+ break;
144
+ case 41:
145
+ this.$ = o[d - 1] + "" + o[d];
146
+ break;
147
+ }
148
+ }, "anonymous"),
149
+ table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 34: n, 35: r, 36: u }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 34: n, 35: r, 36: u }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: n, 35: r, 36: u }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, e(f, [2, 34]), e(f, [2, 35]), e(f, [2, 36]), { 1: [2, 1] }, e(t, i, { 4: 2, 7: 4, 3: 21, 5: s, 34: n, 35: r, 36: u }), { 1: [2, 3] }, e(f, [2, 5]), e(t, [2, 7], { 4: 22, 34: n, 35: r, 36: u }), { 11: 23, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 39, 13: 38, 24: X, 27: vt, 29: 40, 30: 41, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 45, 15: 44, 27: Pt, 33: 46, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 49, 17: 48, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 52, 17: 51, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 20: [1, 53] }, { 22: [1, 54] }, e(C, [2, 18]), { 1: [2, 2] }, e(C, [2, 8]), e(C, [2, 9]), e(lt, [2, 37], { 40: 55, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }), e(lt, [2, 38]), e(lt, [2, 39]), e(I, [2, 40]), e(I, [2, 42]), e(I, [2, 43]), e(I, [2, 44]), e(I, [2, 45]), e(I, [2, 46]), e(I, [2, 47]), e(I, [2, 48]), e(I, [2, 49]), e(I, [2, 50]), e(I, [2, 51]), e(C, [2, 10]), e(C, [2, 22], { 30: 41, 29: 56, 24: X, 27: vt }), e(C, [2, 24]), e(C, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 11]), e(C, [2, 30], { 33: 60, 27: Pt }), e(C, [2, 32]), { 31: [1, 61] }, e(C, [2, 12]), { 17: 62, 24: et }, { 25: 63, 27: Lt }, e(C, [2, 14]), { 17: 65, 24: et }, e(C, [2, 16]), e(C, [2, 17]), e(I, [2, 41]), e(C, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, e(C, [2, 31]), { 27: [1, 69] }, e(C, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, e(C, [2, 15]), e(C, [2, 26]), e(C, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 33]), e(C, [2, 19]), { 25: 73, 27: Lt }, { 26: [2, 28] }, { 26: [2, 20] }],
150
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
151
+ parseError: /* @__PURE__ */ a(function(h, c) {
152
+ if (c.recoverable)
153
+ this.trace(h);
154
+ else {
155
+ var g = new Error(h);
156
+ throw g.hash = c, g;
157
+ }
158
+ }, "parseError"),
159
+ parse: /* @__PURE__ */ a(function(h) {
160
+ var c = this, g = [0], x = [], A = [null], o = [], N = this.table, d = "", nt = 0, Et = 0, ri = 2, It = 1, hi = o.slice.call(arguments, 1), T = Object.create(this.lexer), W = { yy: {} };
161
+ for (var ut in this.yy)
162
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (W.yy[ut] = this.yy[ut]);
163
+ T.setInput(h, W.yy), W.yy.lexer = T, W.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
164
+ var gt = T.yylloc;
165
+ o.push(gt);
166
+ var li = T.options && T.options.ranges;
167
+ typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
168
+ function ci(L) {
169
+ g.length = g.length - 2 * L, A.length = A.length - L, o.length = o.length - L;
170
+ }
171
+ a(ci, "popStack");
172
+ function Mt() {
173
+ var L;
174
+ return L = x.pop() || T.lex() || It, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = c.symbols_[L] || L), L;
175
+ }
176
+ a(Mt, "lex");
177
+ for (var P, O, M, xt, z = {}, at, V, Vt, ot; ; ) {
178
+ if (O = g[g.length - 1], this.defaultActions[O] ? M = this.defaultActions[O] : ((P === null || typeof P > "u") && (P = Mt()), M = N[O] && N[O][P]), typeof M > "u" || !M.length || !M[0]) {
179
+ var dt = "";
180
+ ot = [];
181
+ for (at in N[O])
182
+ this.terminals_[at] && at > ri && ot.push("'" + this.terminals_[at] + "'");
183
+ T.showPosition ? dt = "Parse error on line " + (nt + 1) + `:
184
+ ` + T.showPosition() + `
185
+ Expecting ` + ot.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : dt = "Parse error on line " + (nt + 1) + ": Unexpected " + (P == It ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(dt, {
186
+ text: T.match,
187
+ token: this.terminals_[P] || P,
188
+ line: T.yylineno,
189
+ loc: gt,
190
+ expected: ot
191
+ });
192
+ }
193
+ if (M[0] instanceof Array && M.length > 1)
194
+ throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + P);
195
+ switch (M[0]) {
196
+ case 1:
197
+ g.push(P), A.push(T.yytext), o.push(T.yylloc), g.push(M[1]), P = null, Et = T.yyleng, d = T.yytext, nt = T.yylineno, gt = T.yylloc;
198
+ break;
199
+ case 2:
200
+ if (V = this.productions_[M[1]][1], z.$ = A[A.length - V], z._$ = {
201
+ first_line: o[o.length - (V || 1)].first_line,
202
+ last_line: o[o.length - 1].last_line,
203
+ first_column: o[o.length - (V || 1)].first_column,
204
+ last_column: o[o.length - 1].last_column
205
+ }, li && (z._$.range = [
206
+ o[o.length - (V || 1)].range[0],
207
+ o[o.length - 1].range[1]
208
+ ]), xt = this.performAction.apply(z, [
209
+ d,
210
+ Et,
211
+ nt,
212
+ W.yy,
213
+ M[1],
214
+ A,
215
+ o
216
+ ].concat(hi)), typeof xt < "u")
217
+ return xt;
218
+ V && (g = g.slice(0, -1 * V * 2), A = A.slice(0, -1 * V), o = o.slice(0, -1 * V)), g.push(this.productions_[M[1]][0]), A.push(z.$), o.push(z._$), Vt = N[g[g.length - 2]][g[g.length - 1]], g.push(Vt);
219
+ break;
220
+ case 3:
221
+ return !0;
222
+ }
223
+ }
224
+ return !0;
225
+ }, "parse")
226
+ }, oi = /* @__PURE__ */ function() {
227
+ var B = {
228
+ EOF: 1,
229
+ parseError: /* @__PURE__ */ a(function(c, g) {
230
+ if (this.yy.parser)
231
+ this.yy.parser.parseError(c, g);
232
+ else
233
+ throw new Error(c);
234
+ }, "parseError"),
235
+ // resets the lexer, sets new input
236
+ setInput: /* @__PURE__ */ a(function(h, c) {
237
+ return this.yy = c || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
238
+ first_line: 1,
239
+ first_column: 0,
240
+ last_line: 1,
241
+ last_column: 0
242
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
243
+ }, "setInput"),
244
+ // consumes and returns one char from the input
245
+ input: /* @__PURE__ */ a(function() {
246
+ var h = this._input[0];
247
+ this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h;
248
+ var c = h.match(/(?:\r\n?|\n).*/g);
249
+ return c ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h;
250
+ }, "input"),
251
+ // unshifts one char (or a string) into the input
252
+ unput: /* @__PURE__ */ a(function(h) {
253
+ var c = h.length, g = h.split(/(?:\r\n?|\n)/g);
254
+ this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
255
+ var x = this.match.split(/(?:\r\n?|\n)/g);
256
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), g.length - 1 && (this.yylineno -= g.length - 1);
257
+ var A = this.yylloc.range;
258
+ return this.yylloc = {
259
+ first_line: this.yylloc.first_line,
260
+ last_line: this.yylineno + 1,
261
+ first_column: this.yylloc.first_column,
262
+ last_column: g ? (g.length === x.length ? this.yylloc.first_column : 0) + x[x.length - g.length].length - g[0].length : this.yylloc.first_column - c
263
+ }, this.options.ranges && (this.yylloc.range = [A[0], A[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
264
+ }, "unput"),
265
+ // When called from action, caches matched text and appends it on next action
266
+ more: /* @__PURE__ */ a(function() {
267
+ return this._more = !0, this;
268
+ }, "more"),
269
+ // 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.
270
+ reject: /* @__PURE__ */ a(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
+ }, "reject"),
282
+ // retain first n characters of the match
283
+ less: /* @__PURE__ */ a(function(h) {
284
+ this.unput(this.match.slice(h));
285
+ }, "less"),
286
+ // displays already matched input, i.e. for error messages
287
+ pastInput: /* @__PURE__ */ a(function() {
288
+ var h = this.matched.substr(0, this.matched.length - this.match.length);
289
+ return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, "");
290
+ }, "pastInput"),
291
+ // displays upcoming input, i.e. for error messages
292
+ upcomingInput: /* @__PURE__ */ a(function() {
293
+ var h = this.match;
294
+ return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, "");
295
+ }, "upcomingInput"),
296
+ // displays the character position where the lexing error occurred, i.e. for error messages
297
+ showPosition: /* @__PURE__ */ a(function() {
298
+ var h = this.pastInput(), c = new Array(h.length + 1).join("-");
299
+ return h + this.upcomingInput() + `
300
+ ` + c + "^";
301
+ }, "showPosition"),
302
+ // test the lexed token: return FALSE when not a match, otherwise return token
303
+ test_match: /* @__PURE__ */ a(function(h, c) {
304
+ var g, x, A;
305
+ if (this.options.backtrack_lexer && (A = {
306
+ yylineno: this.yylineno,
307
+ yylloc: {
308
+ first_line: this.yylloc.first_line,
309
+ last_line: this.last_line,
310
+ first_column: this.yylloc.first_column,
311
+ last_column: this.yylloc.last_column
312
+ },
313
+ yytext: this.yytext,
314
+ match: this.match,
315
+ matches: this.matches,
316
+ matched: this.matched,
317
+ yyleng: this.yyleng,
318
+ offset: this.offset,
319
+ _more: this._more,
320
+ _input: this._input,
321
+ yy: this.yy,
322
+ conditionStack: this.conditionStack.slice(0),
323
+ done: this.done
324
+ }, this.options.ranges && (A.yylloc.range = this.yylloc.range.slice(0))), x = h[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
325
+ first_line: this.yylloc.last_line,
326
+ last_line: this.yylineno + 1,
327
+ first_column: this.yylloc.last_column,
328
+ last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length
329
+ }, this.yytext += h[0], this.match += h[0], this.matches = h, 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(h[0].length), this.matched += h[0], g = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g)
330
+ return g;
331
+ if (this._backtrack) {
332
+ for (var o in A)
333
+ this[o] = A[o];
334
+ return !1;
335
+ }
336
+ return !1;
337
+ }, "test_match"),
338
+ // return next match in input
339
+ next: /* @__PURE__ */ a(function() {
340
+ if (this.done)
341
+ return this.EOF;
342
+ this._input || (this.done = !0);
343
+ var h, c, g, x;
344
+ this._more || (this.yytext = "", this.match = "");
345
+ for (var A = this._currentRules(), o = 0; o < A.length; o++)
346
+ if (g = this._input.match(this.rules[A[o]]), g && (!c || g[0].length > c[0].length)) {
347
+ if (c = g, x = o, this.options.backtrack_lexer) {
348
+ if (h = this.test_match(g, A[o]), h !== !1)
349
+ return h;
350
+ if (this._backtrack) {
351
+ c = !1;
352
+ continue;
353
+ } else
354
+ return !1;
355
+ } else if (!this.options.flex)
356
+ break;
357
+ }
358
+ return c ? (h = this.test_match(c, A[x]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
359
+ ` + this.showPosition(), {
360
+ text: "",
361
+ token: null,
362
+ line: this.yylineno
363
+ });
364
+ }, "next"),
365
+ // return next match that has a token
366
+ lex: /* @__PURE__ */ a(function() {
367
+ var c = this.next();
368
+ return c || this.lex();
369
+ }, "lex"),
370
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
371
+ begin: /* @__PURE__ */ a(function(c) {
372
+ this.conditionStack.push(c);
373
+ }, "begin"),
374
+ // pop the previously active lexer condition state off the condition stack
375
+ popState: /* @__PURE__ */ a(function() {
376
+ var c = this.conditionStack.length - 1;
377
+ return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
378
+ }, "popState"),
379
+ // produce the lexer rule set which is active for the currently active lexer condition state
380
+ _currentRules: /* @__PURE__ */ a(function() {
381
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
382
+ }, "_currentRules"),
383
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
384
+ topState: /* @__PURE__ */ a(function(c) {
385
+ return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
386
+ }, "topState"),
387
+ // alias for begin(condition)
388
+ pushState: /* @__PURE__ */ a(function(c) {
389
+ this.begin(c);
390
+ }, "pushState"),
391
+ // return the number of states currently on the stack
392
+ stateStackSize: /* @__PURE__ */ a(function() {
393
+ return this.conditionStack.length;
394
+ }, "stateStackSize"),
395
+ options: { "case-insensitive": !0 },
396
+ performAction: /* @__PURE__ */ a(function(c, g, x, A) {
397
+ switch (x) {
398
+ case 0:
399
+ break;
400
+ case 1:
401
+ break;
402
+ case 2:
403
+ return this.popState(), 34;
404
+ case 3:
405
+ return this.popState(), 34;
406
+ case 4:
407
+ return 34;
408
+ case 5:
409
+ break;
410
+ case 6:
411
+ return 10;
412
+ case 7:
413
+ return this.pushState("acc_title"), 19;
414
+ case 8:
415
+ return this.popState(), "acc_title_value";
416
+ case 9:
417
+ return this.pushState("acc_descr"), 21;
418
+ case 10:
419
+ return this.popState(), "acc_descr_value";
420
+ case 11:
421
+ this.pushState("acc_descr_multiline");
422
+ break;
423
+ case 12:
424
+ this.popState();
425
+ break;
426
+ case 13:
427
+ return "acc_descr_multiline_value";
428
+ case 14:
429
+ return 5;
430
+ case 15:
431
+ return 8;
432
+ case 16:
433
+ return this.pushState("axis_data"), "X_AXIS";
434
+ case 17:
435
+ return this.pushState("axis_data"), "Y_AXIS";
436
+ case 18:
437
+ return this.pushState("axis_band_data"), 24;
438
+ case 19:
439
+ return 31;
440
+ case 20:
441
+ return this.pushState("data"), 16;
442
+ case 21:
443
+ return this.pushState("data"), 18;
444
+ case 22:
445
+ return this.pushState("data_inner"), 24;
446
+ case 23:
447
+ return 27;
448
+ case 24:
449
+ return this.popState(), 26;
450
+ case 25:
451
+ this.popState();
452
+ break;
453
+ case 26:
454
+ this.pushState("string");
455
+ break;
456
+ case 27:
457
+ this.popState();
458
+ break;
459
+ case 28:
460
+ return "STR";
461
+ case 29:
462
+ return 24;
463
+ case 30:
464
+ return 26;
465
+ case 31:
466
+ return 43;
467
+ case 32:
468
+ return "COLON";
469
+ case 33:
470
+ return 44;
471
+ case 34:
472
+ return 28;
473
+ case 35:
474
+ return 45;
475
+ case 36:
476
+ return 46;
477
+ case 37:
478
+ return 48;
479
+ case 38:
480
+ return 50;
481
+ case 39:
482
+ return 47;
483
+ case 40:
484
+ return 41;
485
+ case 41:
486
+ return 49;
487
+ case 42:
488
+ return 42;
489
+ case 43:
490
+ break;
491
+ case 44:
492
+ return 35;
493
+ case 45:
494
+ return 36;
495
+ }
496
+ }, "anonymous"),
497
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
498
+ conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [27, 28], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 } }
499
+ };
500
+ return B;
501
+ }();
502
+ ct.lexer = oi;
503
+ function st() {
504
+ this.yy = {};
505
+ }
506
+ return a(st, "Parser"), st.prototype = ct, ct.Parser = st, new st();
507
+ }();
508
+ ft.parser = ft;
509
+ var Ri = ft;
510
+ function mt(e) {
511
+ return e.type === "bar";
512
+ }
513
+ a(mt, "isBarPlot");
514
+ function wt(e) {
515
+ return e.type === "band";
516
+ }
517
+ a(wt, "isBandAxisData");
518
+ function F(e) {
519
+ return e.type === "linear";
520
+ }
521
+ a(F, "isLinearAxisData");
522
+ var $, Yt = ($ = class {
523
+ constructor(t) {
524
+ this.parentGroup = t;
525
+ }
526
+ getMaxDimension(t, i) {
527
+ if (!this.parentGroup)
528
+ return {
529
+ width: t.reduce((r, u) => Math.max(u.length, r), 0) * i,
530
+ height: i
531
+ };
532
+ const s = {
533
+ width: 0,
534
+ height: 0
535
+ }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
536
+ for (const r of t) {
537
+ const u = ui(n, 1, r), f = u ? u.width : r.length * i, p = u ? u.height : i;
538
+ s.width = Math.max(s.width, f), s.height = Math.max(s.height, p);
539
+ }
540
+ return n.remove(), s;
541
+ }
542
+ }, a($, "TextDimensionCalculatorWithFont"), $), Ot = 0.7, zt = 0.2, q, Ht = (q = class {
543
+ constructor(t, i, s, n) {
544
+ this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left";
545
+ }
546
+ setRange(t) {
547
+ this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
548
+ }
549
+ getRange() {
550
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
551
+ }
552
+ setAxisPosition(t) {
553
+ this.axisPosition = t, this.setRange(this.range);
554
+ }
555
+ getTickDistance() {
556
+ const t = this.getRange();
557
+ return Math.abs(t[0] - t[1]) / this.getTickValues().length;
558
+ }
559
+ getAxisOuterPadding() {
560
+ return this.outerPadding;
561
+ }
562
+ getLabelDimension() {
563
+ return this.textDimensionCalculator.getMaxDimension(
564
+ this.getTickValues().map((t) => t.toString()),
565
+ this.axisConfig.labelFontSize
566
+ );
567
+ }
568
+ recalculateOuterPaddingToDrawBar() {
569
+ Ot * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Ot * this.getTickDistance() / 2)), this.recalculateScale();
570
+ }
571
+ calculateSpaceIfDrawnHorizontally(t) {
572
+ let i = t.height;
573
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
574
+ const s = this.getLabelDimension(), n = zt * t.width;
575
+ this.outerPadding = Math.min(s.width / 2, n);
576
+ const r = s.height + this.axisConfig.labelPadding * 2;
577
+ this.labelTextHeight = s.height, r <= i && (i -= r, this.showLabel = !0);
578
+ }
579
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
580
+ const s = this.textDimensionCalculator.getMaxDimension(
581
+ [this.title],
582
+ this.axisConfig.titleFontSize
583
+ ), n = s.height + this.axisConfig.titlePadding * 2;
584
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
585
+ }
586
+ this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
587
+ }
588
+ calculateSpaceIfDrawnVertical(t) {
589
+ let i = t.width;
590
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
591
+ const s = this.getLabelDimension(), n = zt * t.height;
592
+ this.outerPadding = Math.min(s.height / 2, n);
593
+ const r = s.width + this.axisConfig.labelPadding * 2;
594
+ r <= i && (i -= r, this.showLabel = !0);
595
+ }
596
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
597
+ const s = this.textDimensionCalculator.getMaxDimension(
598
+ [this.title],
599
+ this.axisConfig.titleFontSize
600
+ ), n = s.height + this.axisConfig.titlePadding * 2;
601
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
602
+ }
603
+ this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
604
+ }
605
+ calculateSpace(t) {
606
+ return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
607
+ width: this.boundingRect.width,
608
+ height: this.boundingRect.height
609
+ };
610
+ }
611
+ setBoundingBoxXY(t) {
612
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
613
+ }
614
+ getDrawableElementsForLeftAxis() {
615
+ const t = [];
616
+ if (this.showAxisLine) {
617
+ const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
618
+ t.push({
619
+ type: "path",
620
+ groupTexts: ["left-axis", "axisl-line"],
621
+ data: [
622
+ {
623
+ path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
624
+ strokeFill: this.axisThemeConfig.axisLineColor,
625
+ strokeWidth: this.axisConfig.axisLineWidth
626
+ }
627
+ ]
628
+ });
629
+ }
630
+ if (this.showLabel && t.push({
631
+ type: "text",
632
+ groupTexts: ["left-axis", "label"],
633
+ data: this.getTickValues().map((i) => ({
634
+ text: i.toString(),
635
+ x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
636
+ y: this.getScaleValue(i),
637
+ fill: this.axisThemeConfig.labelColor,
638
+ fontSize: this.axisConfig.labelFontSize,
639
+ rotation: 0,
640
+ verticalPos: "middle",
641
+ horizontalPos: "right"
642
+ }))
643
+ }), this.showTick) {
644
+ const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
645
+ t.push({
646
+ type: "path",
647
+ groupTexts: ["left-axis", "ticks"],
648
+ data: this.getTickValues().map((s) => ({
649
+ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
650
+ strokeFill: this.axisThemeConfig.tickColor,
651
+ strokeWidth: this.axisConfig.tickWidth
652
+ }))
653
+ });
654
+ }
655
+ return this.showTitle && t.push({
656
+ type: "text",
657
+ groupTexts: ["left-axis", "title"],
658
+ data: [
659
+ {
660
+ text: this.title,
661
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
662
+ y: this.boundingRect.y + this.boundingRect.height / 2,
663
+ fill: this.axisThemeConfig.titleColor,
664
+ fontSize: this.axisConfig.titleFontSize,
665
+ rotation: 270,
666
+ verticalPos: "top",
667
+ horizontalPos: "center"
668
+ }
669
+ ]
670
+ }), t;
671
+ }
672
+ getDrawableElementsForBottomAxis() {
673
+ const t = [];
674
+ if (this.showAxisLine) {
675
+ const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
676
+ t.push({
677
+ type: "path",
678
+ groupTexts: ["bottom-axis", "axis-line"],
679
+ data: [
680
+ {
681
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
682
+ strokeFill: this.axisThemeConfig.axisLineColor,
683
+ strokeWidth: this.axisConfig.axisLineWidth
684
+ }
685
+ ]
686
+ });
687
+ }
688
+ if (this.showLabel && t.push({
689
+ type: "text",
690
+ groupTexts: ["bottom-axis", "label"],
691
+ data: this.getTickValues().map((i) => ({
692
+ text: i.toString(),
693
+ x: this.getScaleValue(i),
694
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
695
+ fill: this.axisThemeConfig.labelColor,
696
+ fontSize: this.axisConfig.labelFontSize,
697
+ rotation: 0,
698
+ verticalPos: "top",
699
+ horizontalPos: "center"
700
+ }))
701
+ }), this.showTick) {
702
+ const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
703
+ t.push({
704
+ type: "path",
705
+ groupTexts: ["bottom-axis", "ticks"],
706
+ data: this.getTickValues().map((s) => ({
707
+ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
708
+ strokeFill: this.axisThemeConfig.tickColor,
709
+ strokeWidth: this.axisConfig.tickWidth
710
+ }))
711
+ });
712
+ }
713
+ return this.showTitle && t.push({
714
+ type: "text",
715
+ groupTexts: ["bottom-axis", "title"],
716
+ data: [
717
+ {
718
+ text: this.title,
719
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
720
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
721
+ fill: this.axisThemeConfig.titleColor,
722
+ fontSize: this.axisConfig.titleFontSize,
723
+ rotation: 0,
724
+ verticalPos: "top",
725
+ horizontalPos: "center"
726
+ }
727
+ ]
728
+ }), t;
729
+ }
730
+ getDrawableElementsForTopAxis() {
731
+ const t = [];
732
+ if (this.showAxisLine) {
733
+ const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
734
+ t.push({
735
+ type: "path",
736
+ groupTexts: ["top-axis", "axis-line"],
737
+ data: [
738
+ {
739
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
740
+ strokeFill: this.axisThemeConfig.axisLineColor,
741
+ strokeWidth: this.axisConfig.axisLineWidth
742
+ }
743
+ ]
744
+ });
745
+ }
746
+ if (this.showLabel && t.push({
747
+ type: "text",
748
+ groupTexts: ["top-axis", "label"],
749
+ data: this.getTickValues().map((i) => ({
750
+ text: i.toString(),
751
+ x: this.getScaleValue(i),
752
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
753
+ fill: this.axisThemeConfig.labelColor,
754
+ fontSize: this.axisConfig.labelFontSize,
755
+ rotation: 0,
756
+ verticalPos: "top",
757
+ horizontalPos: "center"
758
+ }))
759
+ }), this.showTick) {
760
+ const i = this.boundingRect.y;
761
+ t.push({
762
+ type: "path",
763
+ groupTexts: ["top-axis", "ticks"],
764
+ data: this.getTickValues().map((s) => ({
765
+ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
766
+ strokeFill: this.axisThemeConfig.tickColor,
767
+ strokeWidth: this.axisConfig.tickWidth
768
+ }))
769
+ });
770
+ }
771
+ return this.showTitle && t.push({
772
+ type: "text",
773
+ groupTexts: ["top-axis", "title"],
774
+ data: [
775
+ {
776
+ text: this.title,
777
+ x: this.boundingRect.x + this.boundingRect.width / 2,
778
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
779
+ fill: this.axisThemeConfig.titleColor,
780
+ fontSize: this.axisConfig.titleFontSize,
781
+ rotation: 0,
782
+ verticalPos: "top",
783
+ horizontalPos: "center"
784
+ }
785
+ ]
786
+ }), t;
787
+ }
788
+ getDrawableElements() {
789
+ if (this.axisPosition === "left")
790
+ return this.getDrawableElementsForLeftAxis();
791
+ if (this.axisPosition === "right")
792
+ throw Error("Drawing of right axis is not implemented");
793
+ return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
794
+ }
795
+ }, a(q, "BaseAxis"), q), G, Ti = (G = class extends Ht {
796
+ constructor(t, i, s, n, r) {
797
+ super(t, n, r, i), this.categories = s, this.scale = pt().domain(this.categories).range(this.getRange());
798
+ }
799
+ setRange(t) {
800
+ super.setRange(t);
801
+ }
802
+ recalculateScale() {
803
+ this.scale = pt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Ft.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
804
+ }
805
+ getTickValues() {
806
+ return this.categories;
807
+ }
808
+ getScaleValue(t) {
809
+ return this.scale(t) ?? this.getRange()[0];
810
+ }
811
+ }, a(G, "BandAxis"), G), j, Di = (j = class extends Ht {
812
+ constructor(t, i, s, n, r) {
813
+ super(t, n, r, i), this.domain = s, this.scale = Wt().domain(this.domain).range(this.getRange());
814
+ }
815
+ getTickValues() {
816
+ return this.scale.ticks();
817
+ }
818
+ recalculateScale() {
819
+ const t = [...this.domain];
820
+ this.axisPosition === "left" && t.reverse(), this.scale = Wt().domain(t).range(this.getRange());
821
+ }
822
+ getScaleValue(t) {
823
+ return this.scale(t);
824
+ }
825
+ }, a(j, "LinearAxis"), j);
826
+ function yt(e, t, i, s) {
827
+ const n = new Yt(s);
828
+ return wt(e) ? new Ti(
829
+ t,
830
+ i,
831
+ e.categories,
832
+ e.title,
833
+ n
834
+ ) : new Di(
835
+ t,
836
+ i,
837
+ [e.min, e.max],
838
+ e.title,
839
+ n
840
+ );
841
+ }
842
+ a(yt, "getAxis");
843
+ var Q, vi = (Q = class {
844
+ constructor(t, i, s, n) {
845
+ this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, this.boundingRect = {
846
+ x: 0,
847
+ y: 0,
848
+ width: 0,
849
+ height: 0
850
+ }, this.showChartTitle = !1;
851
+ }
852
+ setBoundingBoxXY(t) {
853
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
854
+ }
855
+ calculateSpace(t) {
856
+ const i = this.textDimensionCalculator.getMaxDimension(
857
+ [this.chartData.title],
858
+ this.chartConfig.titleFontSize
859
+ ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding;
860
+ return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, this.showChartTitle = !0), {
861
+ width: this.boundingRect.width,
862
+ height: this.boundingRect.height
863
+ };
864
+ }
865
+ getDrawableElements() {
866
+ const t = [];
867
+ return this.showChartTitle && t.push({
868
+ groupTexts: ["chart-title"],
869
+ type: "text",
870
+ data: [
871
+ {
872
+ fontSize: this.chartConfig.titleFontSize,
873
+ text: this.chartData.title,
874
+ verticalPos: "middle",
875
+ horizontalPos: "center",
876
+ x: this.boundingRect.x + this.boundingRect.width / 2,
877
+ y: this.boundingRect.y + this.boundingRect.height / 2,
878
+ fill: this.chartThemeConfig.titleColor,
879
+ rotation: 0
880
+ }
881
+ ]
882
+ }), t;
883
+ }
884
+ }, a(Q, "ChartTitle"), Q);
885
+ function Ut(e, t, i, s) {
886
+ const n = new Yt(s);
887
+ return new vi(n, e, t, i);
888
+ }
889
+ a(Ut, "getChartTitleComponent");
890
+ var K, Pi = (K = class {
891
+ constructor(t, i, s, n, r) {
892
+ this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = r;
893
+ }
894
+ getDrawableElement() {
895
+ const t = this.plotData.data.map((s) => [
896
+ this.xAxis.getScaleValue(s[0]),
897
+ this.yAxis.getScaleValue(s[1])
898
+ ]);
899
+ let i;
900
+ return this.orientation === "horizontal" ? i = Bt().y((s) => s[0]).x((s) => s[1])(t) : i = Bt().x((s) => s[0]).y((s) => s[1])(t), i ? [
901
+ {
902
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
903
+ type: "path",
904
+ data: [
905
+ {
906
+ path: i,
907
+ strokeFill: this.plotData.strokeFill,
908
+ strokeWidth: this.plotData.strokeWidth
909
+ }
910
+ ]
911
+ }
912
+ ] : [];
913
+ }
914
+ }, a(K, "LinePlot"), K), Z, Li = (Z = class {
915
+ constructor(t, i, s, n, r, u) {
916
+ this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = r, this.plotIndex = u;
917
+ }
918
+ getDrawableElement() {
919
+ const t = this.barData.data.map((r) => [
920
+ this.xAxis.getScaleValue(r[0]),
921
+ this.yAxis.getScaleValue(r[1])
922
+ ]), i = 0.05, s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - i), n = s / 2;
923
+ return this.orientation === "horizontal" ? [
924
+ {
925
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
926
+ type: "rect",
927
+ data: t.map((r) => ({
928
+ x: this.boundingRect.x,
929
+ y: r[0] - n,
930
+ height: s,
931
+ width: r[1] - this.boundingRect.x,
932
+ fill: this.barData.fill,
933
+ strokeWidth: 0,
934
+ strokeFill: this.barData.fill
935
+ }))
936
+ }
937
+ ] : [
938
+ {
939
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
940
+ type: "rect",
941
+ data: t.map((r) => ({
942
+ x: r[0] - n,
943
+ y: r[1],
944
+ width: s,
945
+ height: this.boundingRect.y + this.boundingRect.height - r[1],
946
+ fill: this.barData.fill,
947
+ strokeWidth: 0,
948
+ strokeFill: this.barData.fill
949
+ }))
950
+ }
951
+ ];
952
+ }
953
+ }, a(Z, "BarPlot"), Z), J, Ei = (J = class {
954
+ constructor(t, i, s) {
955
+ this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
956
+ x: 0,
957
+ y: 0,
958
+ width: 0,
959
+ height: 0
960
+ };
961
+ }
962
+ setAxes(t, i) {
963
+ this.xAxis = t, this.yAxis = i;
964
+ }
965
+ setBoundingBoxXY(t) {
966
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
967
+ }
968
+ calculateSpace(t) {
969
+ return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
970
+ width: this.boundingRect.width,
971
+ height: this.boundingRect.height
972
+ };
973
+ }
974
+ getDrawableElements() {
975
+ if (!(this.xAxis && this.yAxis))
976
+ throw Error("Axes must be passed to render Plots");
977
+ const t = [];
978
+ for (const [i, s] of this.chartData.plots.entries())
979
+ switch (s.type) {
980
+ case "line":
981
+ {
982
+ const n = new Pi(
983
+ s,
984
+ this.xAxis,
985
+ this.yAxis,
986
+ this.chartConfig.chartOrientation,
987
+ i
988
+ );
989
+ t.push(...n.getDrawableElement());
990
+ }
991
+ break;
992
+ case "bar":
993
+ {
994
+ const n = new Li(
995
+ s,
996
+ this.boundingRect,
997
+ this.xAxis,
998
+ this.yAxis,
999
+ this.chartConfig.chartOrientation,
1000
+ i
1001
+ );
1002
+ t.push(...n.getDrawableElement());
1003
+ }
1004
+ break;
1005
+ }
1006
+ return t;
1007
+ }
1008
+ }, a(J, "BasePlot"), J);
1009
+ function $t(e, t, i) {
1010
+ return new Ei(e, t, i);
1011
+ }
1012
+ a($t, "getPlotComponent");
1013
+ var tt, Ii = (tt = class {
1014
+ constructor(t, i, s, n) {
1015
+ this.chartConfig = t, this.chartData = i, this.componentStore = {
1016
+ title: Ut(t, i, s, n),
1017
+ plot: $t(t, i, s),
1018
+ xAxis: yt(
1019
+ i.xAxis,
1020
+ t.xAxis,
1021
+ {
1022
+ titleColor: s.xAxisTitleColor,
1023
+ labelColor: s.xAxisLabelColor,
1024
+ tickColor: s.xAxisTickColor,
1025
+ axisLineColor: s.xAxisLineColor
1026
+ },
1027
+ n
1028
+ ),
1029
+ yAxis: yt(
1030
+ i.yAxis,
1031
+ t.yAxis,
1032
+ {
1033
+ titleColor: s.yAxisTitleColor,
1034
+ labelColor: s.yAxisLabelColor,
1035
+ tickColor: s.yAxisTickColor,
1036
+ axisLineColor: s.yAxisLineColor
1037
+ },
1038
+ n
1039
+ )
1040
+ };
1041
+ }
1042
+ calculateVerticalSpace() {
1043
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, r = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), u = Math.floor(
1044
+ i * this.chartConfig.plotReservedSpacePercent / 100
1045
+ ), f = this.componentStore.plot.calculateSpace({
1046
+ width: r,
1047
+ height: u
1048
+ });
1049
+ t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1050
+ width: this.chartConfig.width,
1051
+ height: i
1052
+ }), n = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1053
+ width: t,
1054
+ height: i
1055
+ }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1056
+ width: t,
1057
+ height: i
1058
+ }), s = f.width, t -= f.width, t > 0 && (r += t, t = 0), i > 0 && (u += i, i = 0), this.componentStore.plot.calculateSpace({
1059
+ width: r,
1060
+ height: u
1061
+ }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: n }), this.componentStore.xAxis.setRange([s, s + r]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: n + u }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: n }), this.chartData.plots.some((p) => mt(p)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1062
+ }
1063
+ calculateHorizontalSpace() {
1064
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, r = 0, u = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), f = Math.floor(
1065
+ i * this.chartConfig.plotReservedSpacePercent / 100
1066
+ ), p = this.componentStore.plot.calculateSpace({
1067
+ width: u,
1068
+ height: f
1069
+ });
1070
+ t -= p.width, i -= p.height, p = this.componentStore.title.calculateSpace({
1071
+ width: this.chartConfig.width,
1072
+ height: i
1073
+ }), s = p.height, i -= p.height, this.componentStore.xAxis.setAxisPosition("left"), p = this.componentStore.xAxis.calculateSpace({
1074
+ width: t,
1075
+ height: i
1076
+ }), t -= p.width, n = p.width, this.componentStore.yAxis.setAxisPosition("top"), p = this.componentStore.yAxis.calculateSpace({
1077
+ width: t,
1078
+ height: i
1079
+ }), i -= p.height, r = s + p.height, t > 0 && (u += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1080
+ width: u,
1081
+ height: f
1082
+ }), this.componentStore.plot.setBoundingBoxXY({ x: n, y: r }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: n, y: s }), this.componentStore.xAxis.setRange([r, r + f]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: r }), this.chartData.plots.some((k) => mt(k)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1083
+ }
1084
+ calculateSpace() {
1085
+ this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
1086
+ }
1087
+ getDrawableElement() {
1088
+ this.calculateSpace();
1089
+ const t = [];
1090
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1091
+ for (const i of Object.values(this.componentStore))
1092
+ t.push(...i.getDrawableElements());
1093
+ return t;
1094
+ }
1095
+ }, a(tt, "Orchestrator"), tt), it, Mi = (it = class {
1096
+ static build(t, i, s, n) {
1097
+ return new Ii(t, i, s, n).getDrawableElement();
1098
+ }
1099
+ }, a(it, "XYChartBuilder"), it), Y = 0, qt, H = _t(), U = St(), b = kt(), bt = U.plotColorPalette.split(",").map((e) => e.trim()), rt = !1, Ct = !1;
1100
+ function St() {
1101
+ const e = gi(), t = At();
1102
+ return Xt(e.xyChart, t.themeVariables.xyChart);
1103
+ }
1104
+ a(St, "getChartDefaultThemeConfig");
1105
+ function _t() {
1106
+ const e = At();
1107
+ return Xt(
1108
+ xi.xyChart,
1109
+ e.xyChart
1110
+ );
1111
+ }
1112
+ a(_t, "getChartDefaultConfig");
1113
+ function kt() {
1114
+ return {
1115
+ yAxis: {
1116
+ type: "linear",
1117
+ title: "",
1118
+ min: 1 / 0,
1119
+ max: -1 / 0
1120
+ },
1121
+ xAxis: {
1122
+ type: "band",
1123
+ title: "",
1124
+ categories: []
1125
+ },
1126
+ title: "",
1127
+ plots: []
1128
+ };
1129
+ }
1130
+ a(kt, "getChartDefaultData");
1131
+ function ht(e) {
1132
+ const t = At();
1133
+ return di(e.trim(), t);
1134
+ }
1135
+ a(ht, "textSanitizer");
1136
+ function Gt(e) {
1137
+ qt = e;
1138
+ }
1139
+ a(Gt, "setTmpSVGG");
1140
+ function jt(e) {
1141
+ e === "horizontal" ? H.chartOrientation = "horizontal" : H.chartOrientation = "vertical";
1142
+ }
1143
+ a(jt, "setOrientation");
1144
+ function Qt(e) {
1145
+ b.xAxis.title = ht(e.text);
1146
+ }
1147
+ a(Qt, "setXAxisTitle");
1148
+ function Rt(e, t) {
1149
+ b.xAxis = { type: "linear", title: b.xAxis.title, min: e, max: t }, rt = !0;
1150
+ }
1151
+ a(Rt, "setXAxisRangeData");
1152
+ function Kt(e) {
1153
+ b.xAxis = {
1154
+ type: "band",
1155
+ title: b.xAxis.title,
1156
+ categories: e.map((t) => ht(t.text))
1157
+ }, rt = !0;
1158
+ }
1159
+ a(Kt, "setXAxisBand");
1160
+ function Zt(e) {
1161
+ b.yAxis.title = ht(e.text);
1162
+ }
1163
+ a(Zt, "setYAxisTitle");
1164
+ function Jt(e, t) {
1165
+ b.yAxis = { type: "linear", title: b.yAxis.title, min: e, max: t }, Ct = !0;
1166
+ }
1167
+ a(Jt, "setYAxisRangeData");
1168
+ function ti(e) {
1169
+ const t = Math.min(...e), i = Math.max(...e), s = F(b.yAxis) ? b.yAxis.min : 1 / 0, n = F(b.yAxis) ? b.yAxis.max : -1 / 0;
1170
+ b.yAxis = {
1171
+ type: "linear",
1172
+ title: b.yAxis.title,
1173
+ min: Math.min(s, t),
1174
+ max: Math.max(n, i)
1175
+ };
1176
+ }
1177
+ a(ti, "setYAxisRangeFromPlotData");
1178
+ function Tt(e) {
1179
+ let t = [];
1180
+ if (e.length === 0)
1181
+ return t;
1182
+ if (!rt) {
1183
+ const i = F(b.xAxis) ? b.xAxis.min : 1 / 0, s = F(b.xAxis) ? b.xAxis.max : -1 / 0;
1184
+ Rt(Math.min(i, 1), Math.max(s, e.length));
1185
+ }
1186
+ if (Ct || ti(e), wt(b.xAxis) && (t = b.xAxis.categories.map((i, s) => [i, e[s]])), F(b.xAxis)) {
1187
+ const i = b.xAxis.min, s = b.xAxis.max, n = (s - i) / (e.length - 1), r = [];
1188
+ for (let u = i; u <= s; u += n)
1189
+ r.push(`${u}`);
1190
+ t = r.map((u, f) => [u, e[f]]);
1191
+ }
1192
+ return t;
1193
+ }
1194
+ a(Tt, "transformDataWithoutCategory");
1195
+ function Dt(e) {
1196
+ return bt[e === 0 ? 0 : e % bt.length];
1197
+ }
1198
+ a(Dt, "getPlotColorFromPalette");
1199
+ function ii(e, t) {
1200
+ const i = Tt(t);
1201
+ b.plots.push({
1202
+ type: "line",
1203
+ strokeFill: Dt(Y),
1204
+ strokeWidth: 2,
1205
+ data: i
1206
+ }), Y++;
1207
+ }
1208
+ a(ii, "setLineData");
1209
+ function ei(e, t) {
1210
+ const i = Tt(t);
1211
+ b.plots.push({
1212
+ type: "bar",
1213
+ fill: Dt(Y),
1214
+ data: i
1215
+ }), Y++;
1216
+ }
1217
+ a(ei, "setBarData");
1218
+ function si() {
1219
+ if (b.plots.length === 0)
1220
+ throw Error("No Plot to render, please provide a plot with some data");
1221
+ return b.title = Nt(), Mi.build(H, b, U, qt);
1222
+ }
1223
+ a(si, "getDrawableElem");
1224
+ function ni() {
1225
+ return U;
1226
+ }
1227
+ a(ni, "getChartThemeConfig");
1228
+ function ai() {
1229
+ return H;
1230
+ }
1231
+ a(ai, "getChartConfig");
1232
+ var Vi = /* @__PURE__ */ a(function() {
1233
+ Ai(), Y = 0, H = _t(), b = kt(), U = St(), bt = U.plotColorPalette.split(",").map((e) => e.trim()), rt = !1, Ct = !1;
1234
+ }, "clear"), Bi = {
1235
+ getDrawableElem: si,
1236
+ clear: Vi,
1237
+ setAccTitle: pi,
1238
+ getAccTitle: fi,
1239
+ setDiagramTitle: mi,
1240
+ getDiagramTitle: Nt,
1241
+ getAccDescription: yi,
1242
+ setAccDescription: bi,
1243
+ setOrientation: jt,
1244
+ setXAxisTitle: Qt,
1245
+ setXAxisRangeData: Rt,
1246
+ setXAxisBand: Kt,
1247
+ setYAxisTitle: Zt,
1248
+ setYAxisRangeData: Jt,
1249
+ setLineData: ii,
1250
+ setBarData: ei,
1251
+ setTmpSVGG: Gt,
1252
+ getChartThemeConfig: ni,
1253
+ getChartConfig: ai
1254
+ }, Wi = /* @__PURE__ */ a((e, t, i, s) => {
1255
+ const n = s.db, r = n.getChartThemeConfig(), u = n.getChartConfig();
1256
+ function f(m) {
1257
+ return m === "top" ? "text-before-edge" : "middle";
1258
+ }
1259
+ a(f, "getDominantBaseLine");
1260
+ function p(m) {
1261
+ return m === "left" ? "start" : m === "right" ? "end" : "middle";
1262
+ }
1263
+ a(p, "getTextAnchor");
1264
+ function k(m) {
1265
+ return `translate(${m.x}, ${m.y}) rotate(${m.rotation || 0})`;
1266
+ }
1267
+ a(k, "getTextTransformation"), Ft.debug(`Rendering xychart chart
1268
+ ` + e);
1269
+ const R = wi(t), w = R.append("g").attr("class", "main"), y = w.append("rect").attr("width", u.width).attr("height", u.height).attr("class", "background");
1270
+ Ci(R, u.height, u.width, !0), R.attr("viewBox", `0 0 ${u.width} ${u.height}`), y.attr("fill", r.backgroundColor), n.setTmpSVGG(R.append("g").attr("class", "mermaid-tmp-group"));
1271
+ const D = n.getDrawableElem(), S = {};
1272
+ function v(m) {
1273
+ let _ = w, l = "";
1274
+ for (const [E] of m.entries()) {
1275
+ let X = w;
1276
+ E > 0 && S[l] && (X = S[l]), l += m[E], _ = S[l], _ || (_ = S[l] = X.append("g").attr("class", m[E]));
1277
+ }
1278
+ return _;
1279
+ }
1280
+ a(v, "getGroup");
1281
+ for (const m of D) {
1282
+ if (m.data.length === 0)
1283
+ continue;
1284
+ const _ = v(m.groupTexts);
1285
+ switch (m.type) {
1286
+ case "rect":
1287
+ _.selectAll("rect").data(m.data).enter().append("rect").attr("x", (l) => l.x).attr("y", (l) => l.y).attr("width", (l) => l.width).attr("height", (l) => l.height).attr("fill", (l) => l.fill).attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1288
+ break;
1289
+ case "text":
1290
+ _.selectAll("text").data(m.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (l) => l.fill).attr("font-size", (l) => l.fontSize).attr("dominant-baseline", (l) => f(l.verticalPos)).attr("text-anchor", (l) => p(l.horizontalPos)).attr("transform", (l) => k(l)).text((l) => l.text);
1291
+ break;
1292
+ case "path":
1293
+ _.selectAll("path").data(m.data).enter().append("path").attr("d", (l) => l.path).attr("fill", (l) => l.fill ? l.fill : "none").attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1294
+ break;
1295
+ }
1296
+ }
1297
+ }, "draw"), Oi = {
1298
+ draw: Wi
1299
+ }, Hi = {
1300
+ parser: Ri,
1301
+ db: Bi,
1302
+ renderer: Oi
1303
+ };
1304
+ export {
1305
+ Hi as diagram
1306
+ };