@schmitech/chatbot-widget 0.5.3 → 0.6.0

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