@svgrid/grid-wc 3.0.0 → 3.0.1

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 (36) hide show
  1. package/README.md +110 -110
  2. package/dist/{GridMenus-DpmS1pzo.js → GridMenus-YwTw9Upd.js} +64 -62
  3. package/dist/{SvDateRangeInput-u4ibte8S.js → SvDateRangeInput-CrxeppBV.js} +6 -6
  4. package/dist/{shadow/SvDateTimePicker-DVFiDxUq.js → SvDateTimePicker-xAO-Pb4S.js} +22 -22
  5. package/dist/{shadow/SvField-ChCI-O2O.js → SvField-CE345DyF.js} +3 -3
  6. package/dist/{SvGridCellEditor-DvsQyE9a.js → SvGridCellEditor-D7SyHtff.js} +2 -2
  7. package/dist/SvGridChart-CMaVmlso.js +1477 -0
  8. package/dist/SvGridChartPanel-Pc_IW0eA.js +833 -0
  9. package/dist/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
  10. package/dist/{shadow/SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
  11. package/dist/{cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
  12. package/dist/chart-GRBAgN1M.js +1658 -0
  13. package/dist/{date-format-CPHqTHN6.js → date-format-D_oQ5Yw0.js} +13 -13
  14. package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
  15. package/dist/shadow/{GridMenus-DpmS1pzo.js → GridMenus-YwTw9Upd.js} +64 -62
  16. package/dist/shadow/{SvDateRangeInput-u4ibte8S.js → SvDateRangeInput-CrxeppBV.js} +6 -6
  17. package/dist/{SvDateTimePicker-DVFiDxUq.js → shadow/SvDateTimePicker-xAO-Pb4S.js} +22 -22
  18. package/dist/{SvField-ChCI-O2O.js → shadow/SvField-CE345DyF.js} +3 -3
  19. package/dist/shadow/{SvGridCellEditor-DvsQyE9a.js → SvGridCellEditor-D7SyHtff.js} +2 -2
  20. package/dist/shadow/SvGridChart-CMaVmlso.js +1477 -0
  21. package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +833 -0
  22. package/dist/shadow/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
  23. package/dist/{SvGridDropdown-DnAESFDu.js → shadow/SvGridDropdown-DUncHqM-.js} +2 -2
  24. package/dist/shadow/{cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
  25. package/dist/shadow/chart-GRBAgN1M.js +1658 -0
  26. package/dist/shadow/{date-format-CPHqTHN6.js → date-format-D_oQ5Yw0.js} +13 -13
  27. package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
  28. package/dist/shadow/sv-grid-shadow-element.js +2160 -2000
  29. package/dist/sv-grid-element.js +2158 -1998
  30. package/package.json +3 -3
  31. package/dist/SvGridChart-yK5Zv85y.js +0 -1199
  32. package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
  33. package/dist/chart-uvs3sFJA.js +0 -1220
  34. package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
  35. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
  36. package/dist/shadow/chart-uvs3sFJA.js +0 -1220
@@ -0,0 +1,1477 @@
1
+ import { a as e, n as t, r as n, s as r, t as i } from "./chart-GRBAgN1M.js";
2
+ import { $ as a, A as o, D as s, E as c, F as l, H as u, I as d, J as f, K as p, L as m, M as h, O as g, P as _, R as v, T as y, V as b, X as x, Y as ee, Z as S, a as te, et as ne, f as C, j as w, k as T, n as re, nt as ie, q as E, rt as D, tt as ae, v as O, w as k, y as A } from "./client-DjwUji8D.js";
3
+ //#region ../grid/dist/SvGridChart.svelte
4
+ var oe = w("<button type=\"button\" class=\"sv-grid-chart-tool svelte-kvdein\" title=\"Reset zoom (or double-click the plot)\"><svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 7v6h6\"></path><path d=\"M21 17a9 9 0 0 0-15-6.7L3 13\"></path></svg> Reset zoom</button>"), se = w("<button type=\"button\"><svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v6\"></path><circle cx=\"12\" cy=\"11\" r=\"3\"></circle><path d=\"M12 14v8\"></path></svg> Annotate</button>"), ce = w("<div class=\"sv-grid-chart-toolbar svelte-kvdein\"><!> <!> <button type=\"button\" class=\"sv-grid-chart-tool svelte-kvdein\" title=\"Download PNG\">PNG</button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-kvdein\" title=\"Download SVG\">SVG</button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-kvdein\" title=\"Copy chart as image\"> </button></div>"), le = h("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\"><rect width=\"6\" height=\"6\"></rect><rect width=\"3\" height=\"6\" fill=\"rgba(255,255,255,0.35)\"></rect></pattern>"), ue = h("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\"><rect width=\"6\" height=\"6\"></rect><path d=\"M0 0L6 6 M6 0L0 6\" stroke=\"rgba(255,255,255,0.45)\" stroke-width=\"1\"></path></pattern>"), de = h("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\"><rect width=\"6\" height=\"6\"></rect><circle cx=\"3\" cy=\"3\" r=\"1.2\" fill=\"rgba(255,255,255,0.55)\"></circle></pattern>"), fe = h("<pattern width=\"8\" height=\"8\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(-45)\"><rect width=\"8\" height=\"8\"></rect><line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"8\" stroke=\"rgba(0,0,0,0.18)\" stroke-width=\"2\"></line></pattern>"), pe = h("<defs></defs>"), me = h("<line class=\"sv-grid-chart-gridline svelte-kvdein\"></line><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"middle\"> </text>", 1), he = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"end\"> </text>"), ge = h("<text class=\"sv-grid-chart-axis-title svelte-kvdein\" text-anchor=\"middle\"> </text>"), _e = h("<text class=\"sv-grid-chart-axis-title svelte-kvdein\" text-anchor=\"middle\"> </text>"), ve = h("<!><!><!><!>", 1), ye = h("<line></line><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"end\"> </text>", 1), be = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\"> </text>"), xe = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"end\"> </text>"), Se = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"middle\"> </text>"), Ce = h("<line class=\"sv-grid-chart-gridline svelte-kvdein\" opacity=\"0.5\"></line>"), we = h("<line class=\"sv-grid-chart-gridline svelte-kvdein\"></line><!><text class=\"sv-grid-chart-axis sv-grid-chart-group-label svelte-kvdein\" text-anchor=\"middle\"> </text>", 1), Te = h("<text class=\"sv-grid-chart-axis-title svelte-kvdein\" text-anchor=\"middle\"> </text>"), Ee = h("<text class=\"sv-grid-chart-axis-title svelte-kvdein\" text-anchor=\"middle\"> </text>"), De = h("<text class=\"sv-grid-chart-axis-title svelte-kvdein\" text-anchor=\"middle\"> </text>"), Oe = h("<!><!><!><!><!><!><!>", 1), ke = h("<path class=\"sv-grid-chart-band\" fill-opacity=\"0.12\" stroke=\"none\"></path>"), Ae = h("<path class=\"sv-grid-chart-area svelte-kvdein\" fill-opacity=\"0.15\" stroke=\"none\"></path>"), je = h("<circle class=\"sv-grid-chart-dot is-active svelte-kvdein\" r=\"4\"></circle>"), Me = h("<text class=\"sv-grid-chart-datalabel svelte-kvdein\" text-anchor=\"middle\"> </text>"), Ne = h("<circle></circle><!>", 1), Pe = h("<g><!><!><path class=\"sv-grid-chart-linepath svelte-kvdein\" fill=\"none\" stroke-width=\"2\" stroke-linejoin=\"round\" stroke-linecap=\"round\"></path><!></g>"), Fe = h("<text> </text>"), Ie = h("<text text-anchor=\"middle\"> </text>"), Le = h("<rect class=\"sv-grid-chart-bar svelte-kvdein\" rx=\"1\"></rect><!>", 1), Re = h("<line class=\"sv-grid-chart-ohlc svelte-kvdein\"></line><line class=\"sv-grid-chart-ohlc svelte-kvdein\"></line><line class=\"sv-grid-chart-ohlc svelte-kvdein\"></line>", 1), ze = h("<line class=\"sv-grid-chart-wick svelte-kvdein\"></line><rect class=\"sv-grid-chart-candle svelte-kvdein\"></rect>", 1), Be = h("<circle class=\"sv-grid-chart-outlier svelte-kvdein\" r=\"2\" fill=\"none\"></circle>"), Ve = h("<line class=\"sv-grid-chart-whisker svelte-kvdein\"></line><line class=\"sv-grid-chart-whisker svelte-kvdein\"></line><line class=\"sv-grid-chart-whisker svelte-kvdein\"></line><rect class=\"sv-grid-chart-box svelte-kvdein\" fill-opacity=\"0.25\"></rect><line class=\"sv-grid-chart-median svelte-kvdein\"></line><!>", 1), He = h("<line class=\"sv-grid-chart-errorbar svelte-kvdein\"></line><line class=\"sv-grid-chart-errorbar svelte-kvdein\"></line><line class=\"sv-grid-chart-errorbar svelte-kvdein\"></line>", 1), Ue = h("<circle class=\"sv-grid-chart-scatter svelte-kvdein\" fill-opacity=\"0.7\"></circle>"), We = h("<line class=\"sv-grid-chart-refline svelte-kvdein\"></line><text class=\"sv-grid-chart-reflabel svelte-kvdein\" text-anchor=\"end\"> </text>", 1), Ge = h("<line class=\"sv-grid-chart-refline svelte-kvdein\"></line><text class=\"sv-grid-chart-reflabel svelte-kvdein\" text-anchor=\"start\"> </text>", 1), Ke = h("<path class=\"sv-grid-chart-overlay svelte-kvdein\" fill=\"none\" stroke-width=\"2\" stroke-dasharray=\"6 4\" stroke-linejoin=\"round\" stroke-linecap=\"round\"></path>"), qe = h("<circle stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1.5\"></circle><text class=\"sv-grid-chart-annotation-label svelte-kvdein\"> </text>", 1), Je = h("<line class=\"sv-grid-chart-crosshair svelte-kvdein\"></line>"), Ye = h("<line class=\"sv-grid-chart-crosshair svelte-kvdein\"></line>"), Xe = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"end\"> </text>"), Ze = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"middle\"> </text>"), Qe = h("<text class=\"sv-grid-chart-heatlabel svelte-kvdein\" text-anchor=\"middle\"> </text>"), $e = h("<rect class=\"sv-grid-chart-heatcell svelte-kvdein\"></rect><!>", 1), et = h("<stop></stop>"), tt = h("<defs><linearGradient x1=\"0\" y1=\"1\" x2=\"0\" y2=\"0\"></linearGradient></defs><rect class=\"sv-grid-chart-heatlegend svelte-kvdein\" width=\"10\"></rect><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\"> </text><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\"> </text>", 1), nt = h("<!><!><!><!>", 1), rt = h("<path class=\"sv-grid-chart-funnel-seg svelte-kvdein\"></path><text class=\"sv-grid-chart-funnel-label svelte-kvdein\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-funnel-value svelte-kvdein\" text-anchor=\"middle\"> </text>", 1), it = h("<circle class=\"sv-grid-chart-radar-ring svelte-kvdein\"></circle>"), at = h("<line class=\"sv-grid-chart-radar-spoke svelte-kvdein\"></line><text class=\"sv-grid-chart-axis svelte-kvdein\"> </text>", 1), ot = h("<circle class=\"sv-grid-chart-radar-dot svelte-kvdein\" r=\"3\"></circle>"), st = h("<path class=\"sv-grid-chart-radar-poly svelte-kvdein\" fill-opacity=\"0.18\" stroke-width=\"2\"></path><!>", 1), ct = h("<!><!><!>", 1), lt = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\"> </text>"), ut = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"end\"> </text>"), dt = h("<rect rx=\"2\"></rect>"), ft = h("<rect class=\"sv-grid-chart-calendar-legend svelte-kvdein\" width=\"10\" height=\"10\" rx=\"2\"></rect><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\"> </text>", 1), pt = h("<text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\">Less</text><!><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"start\">More</text>", 1), mt = h("<!><!><!><!>", 1), ht = h("<line></line>"), gt = h("<path fill=\"none\" stroke-width=\"4\" stroke-linecap=\"butt\" opacity=\"0.7\"></path>"), _t = h("<line stroke=\"var(--sg-fg, #0f172a)\" stroke-width=\"2.5\" stroke-linecap=\"round\"></line>"), vt = h("<!><path fill=\"none\" stroke=\"var(--sg-border, #e2e8f0)\" stroke-width=\"16\" stroke-linecap=\"round\"></path><!><path fill=\"none\" stroke-width=\"16\" stroke-linecap=\"round\"></path><!><path class=\"sv-grid-chart-gauge-needle svelte-kvdein\"></path><circle class=\"sv-grid-chart-gauge-hub svelte-kvdein\"></circle><circle class=\"sv-grid-chart-gauge-hub-dot svelte-kvdein\" r=\"2.5\"></circle><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-axis svelte-kvdein\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-gauge-value svelte-kvdein\" text-anchor=\"middle\"> </text>", 1), yt = h("<text class=\"sv-grid-chart-treemap-label svelte-kvdein\"> </text>"), bt = h("<text class=\"sv-grid-chart-treemap-value svelte-kvdein\" opacity=\"0.85\"> </text>"), xt = h("<rect class=\"sv-grid-chart-treemap-cell svelte-kvdein\"></rect><!><!>", 1), St = h("<path class=\"sv-grid-chart-sankey-link svelte-kvdein\" fill=\"none\" stroke-opacity=\"0.35\"></path>"), Ct = h("<rect class=\"sv-grid-chart-sankey-node svelte-kvdein\"></rect><text class=\"sv-grid-chart-sankey-label svelte-kvdein\"> </text>", 1), wt = h("<!><!>", 1), Tt = h("<text class=\"sv-grid-chart-datalabel on-bar svelte-kvdein\" text-anchor=\"middle\" dominant-baseline=\"middle\"> </text>"), Et = h("<path class=\"sv-grid-chart-slice svelte-kvdein\" stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1\"></path><!>", 1), Dt = h("<text class=\"sv-grid-chart-donut-total svelte-kvdein\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-donut-label svelte-kvdein\" text-anchor=\"middle\">Total</text>", 1), Ot = h("<rect class=\"sv-grid-chart-cat-hit svelte-kvdein\" data-dense=\"true\"></rect>"), kt = h("<rect class=\"sv-grid-chart-cat-hit svelte-kvdein\"></rect>"), At = h("<rect class=\"sv-grid-chart-zoom-rect svelte-kvdein\"></rect>"), jt = h("<path fill-opacity=\"0.10\" stroke=\"none\"></path>"), Mt = h("<!><path fill=\"none\" stroke-width=\"1.2\" opacity=\"0.75\"></path>", 1), Nt = h("<rect opacity=\"0.55\"></rect>"), Pt = h("<svg class=\"sv-grid-chart-brush svelte-kvdein\" width=\"100%\" role=\"img\" aria-label=\"Range brush\"><!><!><rect class=\"sv-grid-chart-brush-mask svelte-kvdein\"></rect><rect class=\"sv-grid-chart-brush-mask svelte-kvdein\"></rect><rect class=\"sv-grid-chart-brush-window svelte-kvdein\"></rect><rect class=\"sv-grid-chart-brush-handle svelte-kvdein\" width=\"8\"></rect><rect class=\"sv-grid-chart-brush-handle svelte-kvdein\" width=\"8\"></rect></svg>"), Ft = w("<div class=\"sv-grid-chart-empty svelte-kvdein\">No data</div>"), It = w("<span class=\"sv-grid-chart-tooltip-dot svelte-kvdein\"></span>"), Lt = w("<span class=\"sv-grid-chart-tooltip-row-label svelte-kvdein\"> </span>"), Rt = w("<span class=\"sv-grid-chart-tooltip-row svelte-kvdein\"><!> <!> <span class=\"sv-grid-chart-tooltip-row-value svelte-kvdein\"> </span></span>"), zt = w("<div><span class=\"sv-grid-chart-tooltip-title svelte-kvdein\"> </span> <!></div>"), Bt = w("<button type=\"button\"><span class=\"sv-grid-chart-swatch svelte-kvdein\"></span> </button>"), Vt = w("<button type=\"button\" class=\"sv-grid-chart-legend-more svelte-kvdein\"> </button>"), Ht = w("<div class=\"sv-grid-chart-legend svelte-kvdein\"><!> <!></div>"), Ut = w("<th> </th>"), Wt = w("<td> </td>"), Gt = w("<tr></tr>"), Kt = w("<div class=\"sv-grid-chart svelte-kvdein\"><!> <svg width=\"100%\" role=\"img\"><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!></svg> <!> <!> <!> <!> <table class=\"sv-grid-chart-sr-only svelte-kvdein\"><caption> <!></caption><thead><tr></tr></thead><tbody></tbody></table></div>");
5
+ function j(l, h) {
6
+ ae(h, !0);
7
+ let w = re(h, "legend", 3, !0), j = re(h, "interactive", 3, !0), qt = re(h, "dataLabels", 3, !1), Jt = re(h, "zoomable", 3, !1), Yt = re(h, "brush", 3, !1), Xt = re(h, "brushHeight", 3, 88), Zt = re(h, "annotatable", 3, !1), Qt = a(() => h.toolbar ?? (Jt() || !!h.onDrill || Zt())), M = S(!1), N = (t) => h.formatValue ? h.formatValue(t) : h.spec.valueFormat ? e(t, h.spec.valueFormat, h.spec) : Number.isFinite(t) ? t.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(t), $t = S(ee(/* @__PURE__ */ new Set())), en = S(null), tn = S(null), nn = S(null), rn = a(() => h.spec.palette ?? v(tn) ?? i), an = `svgc-${Math.random().toString(36).slice(2, 8)}`, P = a(() => h.spec.series.map((e, t) => ({
8
+ ...e,
9
+ color: e.color ?? v(rn)[t % v(rn).length]
10
+ }))), on = a(() => h.spec.series.map((e, t) => e.pattern ? e.pattern : h.spec.patternFallback ? [
11
+ "stripe",
12
+ "crosshatch",
13
+ "dots",
14
+ "diagonal"
15
+ ][t % 4] : "solid")), sn = a(() => {
16
+ let e = {};
17
+ return v(P).forEach((t, n) => {
18
+ let r = v(on)[n];
19
+ e[t.label] = r === "solid" || !r ? t.color : `url(#${an}-pat-${n})`;
20
+ }), e;
21
+ }), cn = a(() => v(P).map((e, t) => ({
22
+ id: `${an}-pat-${t}`,
23
+ color: e.color,
24
+ kind: v(on)[t] ?? "solid"
25
+ })).filter((e) => e.kind !== "solid")), ln = a(() => {
26
+ if (v(en) == null) return v($t);
27
+ let e = h.spec.type === "pie" ? h.spec.categories : h.spec.series.map((e) => e.label);
28
+ return new Set(e.filter((e) => e !== v(en)));
29
+ }), F = S(null), un = a(() => v(F) !== null);
30
+ function dn() {
31
+ x(F, null);
32
+ }
33
+ let I = S(null), L = S(null), R = S(null), fn = a(() => {
34
+ if (!v(L) || !v(R)) return null;
35
+ let e = Math.min(v(L).x, v(R).x), t = Math.min(v(L).y, v(R).y), n = Math.abs(v(R).x - v(L).x), r = Math.abs(v(R).y - v(L).y);
36
+ return n > 4 && r > 4 ? {
37
+ x: e,
38
+ y: t,
39
+ w: n,
40
+ h: r
41
+ } : null;
42
+ });
43
+ function pn(e) {
44
+ if (!v(I)) return null;
45
+ let t = v(I).getBoundingClientRect();
46
+ return {
47
+ x: (e.clientX - t.left) / t.width * v(H).width,
48
+ y: (e.clientY - t.top) / t.height * v(H).height
49
+ };
50
+ }
51
+ function mn(e) {
52
+ let t = v(U) ? e.y - v(H).plot.y : e.x - v(H).plot.x, n = Math.floor(t / v(W));
53
+ return Math.max(0, Math.min(v(V).categories.length - 1, n));
54
+ }
55
+ function hn(e) {
56
+ if (v(M) || !Jt() || !v(jn)) return;
57
+ let t = pn(e);
58
+ t && (t.x < v(H).plot.x || t.x > v(H).plot.x + v(H).plot.w || t.y < v(H).plot.y || t.y > v(H).plot.y + v(H).plot.h || (x(L, t, !0), x(R, t, !0), e.target.setPointerCapture?.(e.pointerId)));
59
+ }
60
+ function gn(e) {
61
+ v(L) && x(R, pn(e), !0);
62
+ }
63
+ function _n() {
64
+ if (!v(L) || !v(R)) {
65
+ x(L, null), x(R, null);
66
+ return;
67
+ }
68
+ let e = v(fn);
69
+ if (e) {
70
+ let t = mn({
71
+ x: e.x,
72
+ y: e.y
73
+ }), n = mn({
74
+ x: e.x + e.w,
75
+ y: e.y + e.h
76
+ }), r = v(F) ? v(F).i0 : 0, i = r + Math.min(t, n), a = r + Math.max(t, n);
77
+ a > i && x(F, {
78
+ i0: i,
79
+ i1: a
80
+ }, !0);
81
+ }
82
+ x(L, null), x(R, null);
83
+ }
84
+ function vn() {
85
+ Jt() && v(un) && dn();
86
+ }
87
+ let yn = a(() => h.spec.type === "candlestick" || h.spec.type === "ohlc"), bn = a(() => h.spec.type === "ohlc"), xn = a(() => Yt() && h.spec.type !== "pie" && h.spec.type !== "heatmap"), Sn = a(() => ({
88
+ ...h.spec,
89
+ height: Xt(),
90
+ yAxisTitle: void 0,
91
+ y2AxisTitle: void 0,
92
+ xAxisTitle: void 0,
93
+ referenceLines: void 0,
94
+ annotations: void 0,
95
+ type: v(yn) || h.spec.type === "boxplot" ? "line" : h.spec.type,
96
+ series: v(P).filter((e) => !v(ln).has(e.label)).map((e) => e.ohlc || e.boxes ? {
97
+ ...e,
98
+ ohlc: void 0,
99
+ boxes: void 0,
100
+ errors: void 0,
101
+ type: "line"
102
+ } : e.errors ? {
103
+ ...e,
104
+ errors: void 0
105
+ } : e)
106
+ })), z = a(() => v(xn) ? t(v(Sn)) : null), Cn = a(() => {
107
+ let e = h.spec.categories.length;
108
+ return !v(F) || e === 0 ? {
109
+ t0: 0,
110
+ t1: 1
111
+ } : {
112
+ t0: v(F).i0 / e,
113
+ t1: (v(F).i1 + 1) / e
114
+ };
115
+ }), B = S(null);
116
+ function wn(e, t) {
117
+ let n = t.getBoundingClientRect();
118
+ return v(z) ? (e.clientX - n.left) / n.width * v(z).width : 0;
119
+ }
120
+ function Tn(e, t) {
121
+ if (!v(z)) return;
122
+ let n = e.currentTarget, r = wn(e, n.ownerSVGElement ?? n);
123
+ x(B, {
124
+ mode: t,
125
+ startX: r,
126
+ startT0: v(Cn).t0,
127
+ startT1: v(Cn).t1
128
+ }, !0), e.currentTarget.setPointerCapture?.(e.pointerId), e.stopPropagation();
129
+ }
130
+ function En(e) {
131
+ if (!v(B) || !v(z)) return;
132
+ let t = (wn(e, e.currentTarget.ownerSVGElement ?? e.currentTarget) - v(B).startX) / v(z).plot.w, n = h.spec.categories.length;
133
+ if (n === 0) return;
134
+ let r = v(B).startT0, i = v(B).startT1;
135
+ if (v(B).mode === "move") {
136
+ let e = i - r;
137
+ r = Math.max(0, Math.min(1 - e, r + t)), i = r + e;
138
+ } else v(B).mode === "left" ? r = Math.max(0, Math.min(i - 1 / n, r + t)) : i = Math.min(1, Math.max(r + 1 / n, i + t));
139
+ let a = Math.max(0, Math.floor(r * n)), o = Math.min(n - 1, Math.ceil(i * n) - 1);
140
+ a === 0 && o === n - 1 ? x(F, null) : x(F, {
141
+ i0: a,
142
+ i1: Math.max(a, o)
143
+ }, !0);
144
+ }
145
+ function Dn(e) {
146
+ x(B, null), e.currentTarget.releasePointerCapture?.(e.pointerId);
147
+ }
148
+ let V = a(() => {
149
+ if (h.spec.type === "pie") {
150
+ let e = v(P)[0];
151
+ if (!e) return h.spec;
152
+ let t = e.values.map((e, t) => v(ln).has(h.spec.categories[t] ?? String(t)) ? 0 : e);
153
+ return {
154
+ ...h.spec,
155
+ series: [{
156
+ ...e,
157
+ values: t
158
+ }]
159
+ };
160
+ }
161
+ let e = v(P).filter((e) => !v(ln).has(e.label));
162
+ return v(F) ? r({
163
+ ...h.spec,
164
+ series: e
165
+ }, v(F).i0, v(F).i1) : {
166
+ ...h.spec,
167
+ series: e
168
+ };
169
+ }), On = S(!1), H = a(() => t({
170
+ ...v(V),
171
+ palette: v(rn),
172
+ ...h.width || h.height ? {
173
+ width: h.width,
174
+ height: h.height
175
+ } : {}
176
+ }, v(On) ? "dark" : "light")), kn = a(() => n(v(H))), An = a(() => ({
177
+ geo: v(H),
178
+ scales: v(kn),
179
+ xOf: v(kn)?.xOf ?? null,
180
+ yOf: v(kn)?.yOf ?? null
181
+ })), jn = a(() => h.spec.type !== "pie" && h.spec.type !== "heatmap" && h.spec.type !== "funnel" && h.spec.type !== "radar" && h.spec.type !== "calendar" && h.spec.type !== "gauge" && h.spec.type !== "treemap" && h.spec.type !== "sankey"), Mn = a(() => h.spec.type === "scatter"), Nn = a(() => h.spec.type === "heatmap"), Pn = a(() => h.spec.type === "funnel"), Fn = a(() => h.spec.type === "radar"), In = a(() => h.spec.type === "calendar"), Ln = a(() => h.spec.type === "gauge"), Rn = a(() => h.spec.type === "treemap"), zn = a(() => h.spec.type === "sankey"), U = a(() => v(H).orientation === "horizontal"), W = a(() => (v(U) ? v(H).plot.h : v(H).plot.w) / Math.max(1, v(V).categories.length)), Bn = a(() => v(jn) && !v(Mn) && !v(U) && v(W) < 4 && v(V).categories.length > 1), Vn = 1e3;
182
+ function Hn(e, t, n) {
183
+ let r = n.ownerSVGElement ?? n;
184
+ if (!r || typeof r.getBoundingClientRect != "function") return null;
185
+ let i = r.getBoundingClientRect();
186
+ if (!i.width || !i.height) return null;
187
+ let a = r.viewBox?.baseVal, o = a && a.width ? a.width / i.width : 1, s = a && a.height ? a.height / i.height : 1;
188
+ return {
189
+ x: (e - i.left) * o + (a ? a.x : 0),
190
+ y: (t - i.top) * s + (a ? a.y : 0)
191
+ };
192
+ }
193
+ function Un(e, t) {
194
+ let n = Hn(e, 0, t);
195
+ if (!n) return null;
196
+ let r = n.x, i = v(H).lines[0]?.points, a = v(V).categories.length;
197
+ if (!i || i.length !== a) {
198
+ let e = Math.floor((r - v(H).plot.x) / v(W));
199
+ return e >= 0 && e < a ? e : null;
200
+ }
201
+ let o = 0, s = i.length - 1;
202
+ for (; o < s;) {
203
+ let e = o + s >> 1;
204
+ i[e].x < r ? o = e + 1 : s = e;
205
+ }
206
+ return o > 0 && Math.abs(i[o - 1].x - r) <= Math.abs(i[o].x - r) && --o, o;
207
+ }
208
+ let G = S(0);
209
+ function Wn(e) {
210
+ let t = v(V).categories.length - 1, n = Math.max(1, Math.floor(t / 10)), r = v(G);
211
+ switch (e.key) {
212
+ case "ArrowRight":
213
+ case "ArrowDown":
214
+ r = Math.min(t, v(G) + 1);
215
+ break;
216
+ case "ArrowLeft":
217
+ case "ArrowUp":
218
+ r = Math.max(0, v(G) - 1);
219
+ break;
220
+ case "Home":
221
+ r = 0;
222
+ break;
223
+ case "End":
224
+ r = t;
225
+ break;
226
+ case "PageDown":
227
+ r = Math.min(t, v(G) + n);
228
+ break;
229
+ case "PageUp":
230
+ r = Math.max(0, v(G) - n);
231
+ break;
232
+ case "Enter":
233
+ case " ":
234
+ e.preventDefault(), Q(v(V).categories[v(G)] ?? "", "", 0, v(G));
235
+ return;
236
+ default: return;
237
+ }
238
+ e.preventDefault(), x(G, r, !0), or(e.currentTarget, r);
239
+ }
240
+ let K = (e) => v(nn) && v(nn) !== e ? .18 : 1, Gn = a(() => h.spec.type === "pie" ? h.spec.categories.map((e, t) => ({
241
+ label: e,
242
+ color: v(rn)[t % v(rn).length],
243
+ off: v($t).has(e)
244
+ })) : v(P).map((e) => ({
245
+ label: e.label,
246
+ color: e.color,
247
+ off: v($t).has(e.label)
248
+ }))), Kn = S(!1), qn = a(() => v(Gn).length > 10), Jn = a(() => v(qn) && !v(Kn) ? v(Gn).slice(0, 10) : v(Gn)), Yn = a(() => h.spec.type === "pie" ? v(H).slices.every((e) => e.value <= 0) : h.spec.type === "scatter" ? v(H).scatterPoints.length === 0 : h.spec.type === "heatmap" ? v(H).heatmapCells.length === 0 : h.spec.type === "funnel" ? v(H).funnelSegments.length === 0 : h.spec.type === "radar" ? v(H).radarSeries.length === 0 : h.spec.type === "calendar" ? v(H).calendarCells.length === 0 : h.spec.type === "gauge" ? !v(H).gauge : h.spec.type === "treemap" ? v(H).treemapCells.length === 0 : h.spec.type === "sankey" ? v(H).sankeyNodes.length === 0 : v(yn) ? v(H).candles.length === 0 : h.spec.type === "boxplot" ? v(H).boxes.length === 0 : v(H).bars.length === 0 && v(H).lines.every((e) => e.points.every((e) => !e.defined)));
249
+ function Xn(e) {
250
+ if (!j()) return;
251
+ if (v(en) != null) {
252
+ x(en, null);
253
+ return;
254
+ }
255
+ let t = new Set(v($t));
256
+ t.has(e) ? t.delete(e) : t.add(e), x($t, t, !0);
257
+ }
258
+ function Zn(e) {
259
+ j() && x(en, v(en) === e ? null : e, !0);
260
+ }
261
+ let Qn = a(() => {
262
+ if (h.spec.type === "pie") {
263
+ let e = v(P)[0];
264
+ return {
265
+ cols: ["Category", "Value"],
266
+ rows: h.spec.categories.map((t, n) => [t, N(e?.values[n] ?? 0)])
267
+ };
268
+ }
269
+ if (v(Mn)) {
270
+ let e = [];
271
+ for (let t of v(P)) for (let n of t.points ?? []) e.push([
272
+ t.label,
273
+ N(n.x),
274
+ N(n.y),
275
+ n.r == null ? "" : N(n.r)
276
+ ]);
277
+ return {
278
+ cols: [
279
+ "Series",
280
+ "X",
281
+ "Y",
282
+ "Size"
283
+ ],
284
+ rows: e
285
+ };
286
+ }
287
+ if (v(yn)) {
288
+ let e = [];
289
+ for (let t of v(P)) (t.ohlc ?? []).forEach((n, r) => {
290
+ n && e.push([
291
+ h.spec.categories[r] ?? String(r),
292
+ t.label,
293
+ N(n.o),
294
+ N(n.h),
295
+ N(n.l),
296
+ N(n.c)
297
+ ]);
298
+ });
299
+ return {
300
+ cols: [
301
+ "Date",
302
+ "Series",
303
+ "Open",
304
+ "High",
305
+ "Low",
306
+ "Close"
307
+ ],
308
+ rows: e
309
+ };
310
+ }
311
+ return {
312
+ cols: ["Category", ...v(P).map((e) => e.label)],
313
+ rows: h.spec.categories.map((e, t) => [e, ...v(P).map((e) => N(e.values[t] ?? 0))])
314
+ };
315
+ }), $n = a(() => v(Qn).rows.length > Vn), er = a(() => v($n) ? v(Qn).rows.slice(0, Vn) : v(Qn).rows);
316
+ function q(e, t = 12) {
317
+ return e.length > t ? e.slice(0, t - 1) + "…" : e;
318
+ }
319
+ let tr = (e, t) => h.formatValue ? h.formatValue(e) : t, nr = S(null);
320
+ function rr(e) {
321
+ if (!e) return !1;
322
+ let t = 0, n = 0, r = 0, i = e.trim().startsWith("#") ? e.trim().slice(1) : "";
323
+ if (i.length === 6) t = parseInt(i.slice(0, 2), 16), n = parseInt(i.slice(2, 4), 16), r = parseInt(i.slice(4, 6), 16);
324
+ else {
325
+ let i = /rgba?\(([^)]+)\)/.exec(e);
326
+ if (!i) return !1;
327
+ let a = i[1].split(",").map((e) => parseFloat(e));
328
+ t = a[0] ?? 0, n = a[1] ?? 0, r = a[2] ?? 0;
329
+ }
330
+ return .299 * t + .587 * n + .114 * r < 128;
331
+ }
332
+ u(() => {
333
+ if (!v(nr) || typeof window > "u") return;
334
+ let e = v(nr), t = () => {
335
+ let t = getComputedStyle(e);
336
+ x(On, rr(t.getPropertyValue("--sg-bg")), !0);
337
+ let n = [];
338
+ for (let e = 1; e <= 8; e += 1) {
339
+ let r = t.getPropertyValue(`--sg-chart-${e}`).trim();
340
+ n.push(r || i[e - 1]);
341
+ }
342
+ (!v(tn) || n.some((e, t) => e !== v(tn)[t])) && x(tn, n.some((e, t) => e !== i[t]) ? n : null, !0);
343
+ };
344
+ t();
345
+ let n = new MutationObserver(t);
346
+ return n.observe(document.documentElement, {
347
+ attributes: !0,
348
+ attributeFilter: [
349
+ "data-theme",
350
+ "class",
351
+ "style"
352
+ ]
353
+ }), () => n.disconnect();
354
+ });
355
+ let J = S(null), Y = S(null);
356
+ function X(e, t, n, r) {
357
+ if (!j() || !v(nr) || r.length === 0) return;
358
+ let i = v(nr).getBoundingClientRect(), a = Math.max(70, Math.min(i.width - 70, e - i.left)), o = t - i.top;
359
+ x(J, {
360
+ left: a,
361
+ top: o,
362
+ below: o < 44,
363
+ title: n,
364
+ rows: r
365
+ }, !0);
366
+ }
367
+ function ir(e) {
368
+ let t = [];
369
+ for (let n of v(V).series) {
370
+ let r = n.color, i = n.ohlc?.[e];
371
+ if (i) {
372
+ t.push({
373
+ label: `${n.label} O`,
374
+ color: r,
375
+ value: N(i.o)
376
+ }), t.push({
377
+ label: `${n.label} H`,
378
+ value: N(i.h)
379
+ }), t.push({
380
+ label: `${n.label} L`,
381
+ value: N(i.l)
382
+ }), t.push({
383
+ label: `${n.label} C`,
384
+ value: N(i.c)
385
+ });
386
+ continue;
387
+ }
388
+ let a = n.boxes?.[e];
389
+ if (a) {
390
+ t.push({
391
+ label: `${n.label} max`,
392
+ color: r,
393
+ value: N(a.max)
394
+ }), t.push({
395
+ label: `${n.label} Q3`,
396
+ value: N(a.q3)
397
+ }), t.push({
398
+ label: `${n.label} median`,
399
+ value: N(a.median)
400
+ }), t.push({
401
+ label: `${n.label} Q1`,
402
+ value: N(a.q1)
403
+ }), t.push({
404
+ label: `${n.label} min`,
405
+ value: N(a.min)
406
+ }), a.outliers?.length && t.push({
407
+ label: `${n.label} outliers`,
408
+ value: String(a.outliers.length)
409
+ });
410
+ continue;
411
+ }
412
+ let o = n.values[e];
413
+ if (Number.isFinite(o)) {
414
+ t.push({
415
+ label: n.label,
416
+ color: r,
417
+ value: N(o)
418
+ });
419
+ let i = n.errors?.[e];
420
+ if (i != null) {
421
+ let e = typeof i == "number" ? o - Math.abs(i) : Math.min(i.lo, i.hi), r = typeof i == "number" ? o + Math.abs(i) : Math.max(i.lo, i.hi);
422
+ Number.isFinite(e) && Number.isFinite(r) && t.push({
423
+ label: `${n.label} range`,
424
+ value: `${N(e)} - ${N(r)}`
425
+ });
426
+ }
427
+ }
428
+ }
429
+ return t;
430
+ }
431
+ function ar(e, t, n) {
432
+ x(Y, n, !0), X(e, t, v(V).categories[n] ?? "", ir(n));
433
+ }
434
+ function or(e, t) {
435
+ let n = e.getBoundingClientRect();
436
+ ar(n.left + n.width / 2, n.top + 12, t);
437
+ }
438
+ function Z() {
439
+ x(Y, null), x(J, null);
440
+ }
441
+ function sr(e, t, n, r, i) {
442
+ X(e, t, n, [{ value: `${N(r)} · ${i.toFixed(1)}%` }]);
443
+ }
444
+ function cr(e, t, n) {
445
+ let r = [{
446
+ label: "x",
447
+ value: N(n.x)
448
+ }, {
449
+ label: "y",
450
+ value: N(n.y)
451
+ }];
452
+ X(e, t, n.label || n.series, r);
453
+ }
454
+ function lr(e, t, n) {
455
+ X(e, t, `${n.rowLabel} · ${n.colLabel}`, [{
456
+ color: n.color,
457
+ value: N(n.value)
458
+ }]);
459
+ }
460
+ function ur(e, t, n) {
461
+ let r = [{ value: N(n.value) }, {
462
+ label: "conversion",
463
+ value: `${(n.conversion * 100).toFixed(1)}%`
464
+ }];
465
+ n.dropoff > 0 && r.push({
466
+ label: "drop-off",
467
+ value: `${(n.dropoff * 100).toFixed(1)}%`
468
+ }), X(e, t, n.label, r);
469
+ }
470
+ function dr(e, t, n, r, i, a) {
471
+ X(e, t, `${n} · ${r}`, [{
472
+ color: a,
473
+ value: N(i)
474
+ }]);
475
+ }
476
+ function Q(e, t, n, r) {
477
+ if (v(M) && h.onAnnotate && r !== void 0) {
478
+ let i = t ? n : v(V).series[0]?.values[r];
479
+ h.onAnnotate({
480
+ category: e,
481
+ index: r,
482
+ value: Number.isFinite(i) ? i : 0
483
+ });
484
+ return;
485
+ }
486
+ let i;
487
+ if (r !== void 0) {
488
+ let e = [];
489
+ for (let n of v(V).series) {
490
+ if (!n.rowIds || t && n.label !== t) continue;
491
+ let i = n.rowIds[r];
492
+ i?.length && e.push(i);
493
+ }
494
+ e.length && (i = e.flat());
495
+ }
496
+ let a = {
497
+ category: e,
498
+ series: t,
499
+ value: n,
500
+ rowIds: i
501
+ };
502
+ h.onSelect?.(a), i && i.length && h.onDrill?.(a);
503
+ }
504
+ function fr(e, t) {
505
+ let n = e.ownerSVGElement ?? e.closest("svg");
506
+ if (!n) return;
507
+ let r = n.querySelector(`[data-cat-index="${t}"]`);
508
+ r && (r.focus?.(), or(r, t));
509
+ }
510
+ function pr(e, t) {
511
+ let n = v(V).categories.length - 1, r = e.currentTarget;
512
+ switch (e.key) {
513
+ case "ArrowRight":
514
+ case "ArrowDown":
515
+ e.preventDefault(), fr(r, Math.min(n, t + 1));
516
+ return;
517
+ case "ArrowLeft":
518
+ case "ArrowUp":
519
+ e.preventDefault(), fr(r, Math.max(0, t - 1));
520
+ return;
521
+ case "Home":
522
+ e.preventDefault(), fr(r, 0);
523
+ return;
524
+ case "End":
525
+ e.preventDefault(), fr(r, n);
526
+ return;
527
+ case "PageDown":
528
+ e.preventDefault(), fr(r, Math.min(n, t + Math.max(1, Math.floor(n / 10))));
529
+ return;
530
+ case "PageUp":
531
+ e.preventDefault(), fr(r, Math.max(0, t - Math.max(1, Math.floor(n / 10))));
532
+ return;
533
+ case "Enter":
534
+ case " ":
535
+ if (!h.onSelect) return;
536
+ e.preventDefault(), Q(v(V).categories[t] ?? "", "", 0, t);
537
+ return;
538
+ }
539
+ }
540
+ function mr(e, t, n) {
541
+ h.onSelect && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q(t, t, n));
542
+ }
543
+ let hr = S("idle");
544
+ function gr() {
545
+ if (!v(I)) return null;
546
+ let e = v(I).cloneNode(!0);
547
+ e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.removeAttribute("class");
548
+ let t = v(I).getBoundingClientRect();
549
+ t.width && e.setAttribute("width", String(Math.round(t.width))), t.height && e.setAttribute("height", String(Math.round(t.height)));
550
+ let n = document.createElement("style"), r = Array.from(document.styleSheets), i = [];
551
+ for (let e of r) try {
552
+ for (let t of Array.from(e.cssRules ?? [])) {
553
+ let e = t.cssText;
554
+ e.includes(".sv-grid-chart") && i.push(e);
555
+ }
556
+ } catch {}
557
+ return n.textContent = i.join("\n"), e.insertBefore(n, e.firstChild), new XMLSerializer().serializeToString(e);
558
+ }
559
+ function _r(e, t) {
560
+ let n = URL.createObjectURL(e), r = document.createElement("a");
561
+ r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
562
+ }
563
+ async function vr(e) {
564
+ return new Promise((t) => {
565
+ let n = v(I)?.getBoundingClientRect(), r = Math.max(1, Math.round(n?.width ?? v(H).width)), i = Math.max(1, Math.round(n?.height ?? v(H).height)), a = window.devicePixelRatio || 1, o = document.createElement("canvas");
566
+ o.width = r * a, o.height = i * a;
567
+ let s = o.getContext("2d");
568
+ if (!s) {
569
+ t(null);
570
+ return;
571
+ }
572
+ let c = new Image();
573
+ c.onload = () => {
574
+ s.scale(a, a), s.drawImage(c, 0, 0, r, i), o.toBlob((e) => t(e), "image/png");
575
+ }, c.onerror = () => t(null), c.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(e);
576
+ });
577
+ }
578
+ async function yr(e) {
579
+ let t = gr();
580
+ if (!t) return;
581
+ let n = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
582
+ if (e === "svg") {
583
+ _r(new Blob([t], { type: "image/svg+xml" }), `chart-${n}.svg`);
584
+ return;
585
+ }
586
+ let r = await vr(t);
587
+ r && _r(r, `chart-${n}.png`);
588
+ }
589
+ async function br() {
590
+ let e = gr();
591
+ if (!e) {
592
+ x(hr, "err");
593
+ return;
594
+ }
595
+ try {
596
+ let t = await vr(e);
597
+ if (!t) throw Error("rasterize failed");
598
+ let n = window.ClipboardItem;
599
+ n && navigator.clipboard?.write ? await navigator.clipboard.write([new n({ "image/png": t })]) : await navigator.clipboard.writeText(e), x(hr, "ok");
600
+ } catch {
601
+ x(hr, "err");
602
+ }
603
+ setTimeout(() => x(hr, "idle"), 1500);
604
+ }
605
+ var xr = Kt(), Sr = p(xr), Cr = (e) => {
606
+ var t = ce(), n = p(t), r = (e) => {
607
+ var t = oe();
608
+ d("click", t, dn), T(e, t);
609
+ };
610
+ c(n, (e) => {
611
+ Jt() && v(un) && e(r);
612
+ });
613
+ var i = f(n, 2), a = (e) => {
614
+ var t = se();
615
+ let n;
616
+ b(() => {
617
+ n = A(t, 1, "sv-grid-chart-tool svelte-kvdein", null, n, { "is-on": v(M) }), C(t, "aria-pressed", v(M)), C(t, "title", v(M) ? "Click the plot to pin a note, or a marker to remove it" : "Pin notes on the chart");
618
+ }), d("click", t, () => x(M, !v(M))), T(e, t);
619
+ };
620
+ c(i, (e) => {
621
+ Zt() && e(a);
622
+ });
623
+ var o = f(i, 2), s = f(o, 2), l = f(s, 2), u = p(l, !0);
624
+ D(l), D(t), b(() => g(u, v(hr) === "ok" ? "✓ Copied" : "Copy")), d("click", o, () => yr("png")), d("click", s, () => yr("svg")), d("click", l, br), T(e, t);
625
+ };
626
+ c(Sr, (e) => {
627
+ v(Qt) && e(Cr);
628
+ });
629
+ var $ = f(Sr, 2);
630
+ let wr;
631
+ var Tr = p($), Er = (e) => {
632
+ var t = pe();
633
+ k(t, 21, () => v(cn), (e) => e.id, (e, t) => {
634
+ var n = o(), r = E(n), i = (e) => {
635
+ var n = le(), r = p(n);
636
+ ie(), D(n), b(() => {
637
+ C(n, "id", v(t).id), C(r, "fill", v(t).color);
638
+ }), T(e, n);
639
+ }, a = (e) => {
640
+ var n = ue(), r = p(n);
641
+ ie(), D(n), b(() => {
642
+ C(n, "id", v(t).id), C(r, "fill", v(t).color);
643
+ }), T(e, n);
644
+ }, s = (e) => {
645
+ var n = de(), r = p(n);
646
+ ie(), D(n), b(() => {
647
+ C(n, "id", v(t).id), C(r, "fill", v(t).color);
648
+ }), T(e, n);
649
+ }, l = (e) => {
650
+ var n = fe(), r = p(n);
651
+ ie(), D(n), b(() => {
652
+ C(n, "id", v(t).id), C(r, "fill", v(t).color);
653
+ }), T(e, n);
654
+ };
655
+ c(r, (e) => {
656
+ v(t).kind === "stripe" ? e(i) : v(t).kind === "crosshatch" ? e(a, 1) : v(t).kind === "dots" ? e(s, 2) : v(t).kind === "diagonal" && e(l, 3);
657
+ }), T(e, n);
658
+ }), D(t), T(e, t);
659
+ };
660
+ c(Tr, (e) => {
661
+ v(cn).length && e(Er);
662
+ });
663
+ var Dr = f(Tr), Or = (e) => {
664
+ var t = ve(), n = E(t);
665
+ k(n, 17, () => v(H).valueTicks, (e) => e.label + e.x, (e, t) => {
666
+ var n = me(), r = E(n), i = f(r), a = p(i, !0);
667
+ D(i), b(() => {
668
+ C(r, "x1", v(t).x), C(r, "y1", v(H).plot.y), C(r, "x2", v(t).x), C(r, "y2", v(H).plot.y + v(H).plot.h), C(i, "x", v(t).x), C(i, "y", v(H).plot.y + v(H).plot.h + 14), g(a, v(t).label);
669
+ }), T(e, n);
670
+ });
671
+ var r = f(n);
672
+ k(r, 17, () => v(H).catTicks, (e) => e.value, (e, t) => {
673
+ var n = he(), r = p(n, !0);
674
+ D(n), b((e) => {
675
+ C(n, "x", v(H).plot.x - 6), C(n, "y", v(t).y + 3), g(r, e);
676
+ }, [() => q(v(t).label, 18)]), T(e, n);
677
+ });
678
+ var i = f(r), a = (e) => {
679
+ var t = ge();
680
+ C(t, "x", 13);
681
+ var n = p(t, !0);
682
+ D(t), b(() => {
683
+ C(t, "y", v(H).plot.y + v(H).plot.h / 2), C(t, "transform", `rotate(-90 13 ${v(H).plot.y + v(H).plot.h / 2})`), g(n, h.spec.yAxisTitle);
684
+ }), T(e, t);
685
+ };
686
+ c(i, (e) => {
687
+ h.spec.yAxisTitle && e(a);
688
+ });
689
+ var o = f(i), s = (e) => {
690
+ var t = _e(), n = p(t, !0);
691
+ D(t), b(() => {
692
+ C(t, "x", v(H).plot.x + v(H).plot.w / 2), C(t, "y", v(H).height - 3), g(n, h.spec.xAxisTitle);
693
+ }), T(e, t);
694
+ };
695
+ c(o, (e) => {
696
+ h.spec.xAxisTitle && e(s);
697
+ }), T(e, t);
698
+ }, kr = (e) => {
699
+ var t = Oe(), n = E(t);
700
+ k(n, 17, () => v(H).yTicks, (e) => e.value, (e, t) => {
701
+ var n = ye(), r = E(n);
702
+ let i;
703
+ var a = f(r), o = p(a, !0);
704
+ D(a), b((e) => {
705
+ i = A(r, 0, "sv-grid-chart-gridline svelte-kvdein", null, i, { "is-zero": v(t).value === 0 }), C(r, "x1", v(H).plot.x), C(r, "y1", v(t).y), C(r, "x2", v(H).plot.x + v(H).plot.w), C(r, "y2", v(t).y), C(a, "x", v(H).plot.x - 6), C(a, "y", v(t).y + 3), g(o, e);
706
+ }, [() => tr(v(t).value, v(t).label)]), T(e, n);
707
+ });
708
+ var r = f(n), i = (e) => {
709
+ var t = o(), n = E(t);
710
+ k(n, 17, () => v(H).y2Ticks, (e) => e.value, (e, t) => {
711
+ var n = be(), r = p(n, !0);
712
+ D(n), b((e) => {
713
+ C(n, "x", v(H).plot.x + v(H).plot.w + 6), C(n, "y", v(t).y + 3), g(r, e);
714
+ }, [() => tr(v(t).value, v(t).label)]), T(e, n);
715
+ }), T(e, t);
716
+ };
717
+ c(r, (e) => {
718
+ v(H).hasRightAxis && e(i);
719
+ });
720
+ var s = f(r);
721
+ k(s, 17, () => v(H).xTicks, (e) => e.label + e.x, (e, t) => {
722
+ var n = o(), r = E(n), i = (e) => {
723
+ var n = xe(), r = p(n, !0);
724
+ D(n), b((e) => {
725
+ C(n, "x", v(t).x), C(n, "y", v(H).plot.y + v(H).plot.h + 12), C(n, "transform", `rotate(-40 ${v(t).x} ${v(H).plot.y + v(H).plot.h + 12})`), g(r, e);
726
+ }, [() => q(v(t).label)]), T(e, n);
727
+ }, a = (e) => {
728
+ var n = Se(), r = p(n, !0);
729
+ D(n), b((e) => {
730
+ C(n, "x", v(t).x), C(n, "y", v(H).plot.y + v(H).plot.h + 16), g(r, e);
731
+ }, [() => q(v(t).label, 16)]), T(e, n);
732
+ };
733
+ c(r, (e) => {
734
+ v(H).xLabelRotated ? e(i) : e(a, -1);
735
+ }), T(e, n);
736
+ });
737
+ var l = f(s);
738
+ k(l, 17, () => v(H).categoryGroupTicks, (e) => e.label + e.x0, (e, t) => {
739
+ let n = a(() => v(H).plot.y + v(H).plot.h + (v(H).xLabelRotated ? 46 : 32));
740
+ var r = we(), i = E(r), o = f(i), s = (e) => {
741
+ var r = Ce();
742
+ b(() => {
743
+ C(r, "x1", v(t).x0), C(r, "y1", v(H).plot.y + v(H).plot.h), C(r, "x2", v(t).x0), C(r, "y2", v(n) - 9);
744
+ }), T(e, r);
745
+ };
746
+ c(o, (e) => {
747
+ v(t).x0 > v(H).plot.x + 1 && e(s);
748
+ });
749
+ var l = f(o), u = p(l, !0);
750
+ D(l), b((e) => {
751
+ C(i, "x1", v(t).x0 + 3), C(i, "y1", v(n) - 9), C(i, "x2", v(t).x1 - 3), C(i, "y2", v(n) - 9), C(l, "x", v(t).xCenter), C(l, "y", v(n)), g(u, e);
752
+ }, [() => q(v(t).label, Math.max(4, Math.floor((v(t).x1 - v(t).x0) / 7)))]), T(e, r);
753
+ });
754
+ var u = f(l), d = (e) => {
755
+ var t = Te();
756
+ C(t, "x", 13);
757
+ var n = p(t, !0);
758
+ D(t), b(() => {
759
+ C(t, "y", v(H).plot.y + v(H).plot.h / 2), C(t, "transform", `rotate(-90 13 ${v(H).plot.y + v(H).plot.h / 2})`), g(n, h.spec.yAxisTitle);
760
+ }), T(e, t);
761
+ };
762
+ c(u, (e) => {
763
+ h.spec.yAxisTitle && e(d);
764
+ });
765
+ var m = f(u), _ = (e) => {
766
+ var t = Ee(), n = p(t, !0);
767
+ D(t), b(() => {
768
+ C(t, "x", v(H).width - 5), C(t, "y", v(H).plot.y + v(H).plot.h / 2), C(t, "transform", `rotate(90 ${v(H).width - 5} ${v(H).plot.y + v(H).plot.h / 2})`), g(n, h.spec.y2AxisTitle);
769
+ }), T(e, t);
770
+ };
771
+ c(m, (e) => {
772
+ h.spec.y2AxisTitle && e(_);
773
+ });
774
+ var y = f(m), x = (e) => {
775
+ var t = De(), n = p(t, !0);
776
+ D(t), b(() => {
777
+ C(t, "x", v(H).plot.x + v(H).plot.w / 2), C(t, "y", v(H).height - 3), g(n, h.spec.xAxisTitle);
778
+ }), T(e, t);
779
+ };
780
+ c(y, (e) => {
781
+ h.spec.xAxisTitle && e(x);
782
+ }), T(e, t);
783
+ };
784
+ c(Dr, (e) => {
785
+ v(U) ? e(Or) : v(jn) && e(kr, 1);
786
+ });
787
+ var Ar = f(Dr);
788
+ k(Ar, 19, () => v(H).lines, (e, t) => e.label + t, (e, t) => {
789
+ var n = Pe(), r = p(n), i = (e) => {
790
+ var n = ke();
791
+ b(() => {
792
+ C(n, "d", v(t).bandPath), C(n, "fill", v(t).color);
793
+ }), T(e, n);
794
+ };
795
+ c(r, (e) => {
796
+ v(t).bandPath && e(i);
797
+ });
798
+ var s = f(r), l = (e) => {
799
+ var n = Ae();
800
+ b(() => {
801
+ C(n, "d", v(t).areaPath), C(n, "fill", v(sn)[v(t).label] ?? v(t).color);
802
+ }), T(e, n);
803
+ };
804
+ c(s, (e) => {
805
+ v(t).areaPath && e(l);
806
+ });
807
+ var u = f(s), d = f(u), m = (e) => {
808
+ let n = a(() => v(t).points[v(Y) ?? -1]);
809
+ var r = o(), i = E(r), s = (e) => {
810
+ var r = je();
811
+ b(() => {
812
+ C(r, "cx", v(n).x), C(r, "cy", v(n).y), C(r, "fill", v(t).color);
813
+ }), T(e, r);
814
+ };
815
+ c(i, (e) => {
816
+ v(n)?.defined && e(s);
817
+ }), T(e, r);
818
+ }, h = (e) => {
819
+ var n = o(), r = E(n);
820
+ k(r, 17, () => v(t).points, y, (e, n, r) => {
821
+ var i = o(), a = E(i), s = (e) => {
822
+ var i = Ne(), a = E(i);
823
+ let o;
824
+ var s = f(a), l = (e) => {
825
+ var t = Me(), r = p(t, !0);
826
+ D(t), b((e) => {
827
+ C(t, "x", v(n).x), C(t, "y", v(n).y - 7), g(r, e);
828
+ }, [() => N(v(n).value)]), T(e, t);
829
+ };
830
+ c(s, (e) => {
831
+ qt() && e(l);
832
+ }), b(() => {
833
+ o = A(a, 0, "sv-grid-chart-dot svelte-kvdein", null, o, { "is-active": v(Y) === r }), C(a, "cx", v(n).x), C(a, "cy", v(n).y), C(a, "r", v(Y) === r ? 4 : 3), C(a, "fill", v(t).color);
834
+ }), T(e, i);
835
+ };
836
+ c(a, (e) => {
837
+ v(n).defined && e(s);
838
+ }), T(e, i);
839
+ }), T(e, n);
840
+ };
841
+ c(d, (e) => {
842
+ v(Bn) ? e(m) : e(h, -1);
843
+ }), D(n), b((e) => {
844
+ O(n, e), C(u, "d", v(t).path), C(u, "stroke", v(t).color);
845
+ }, [() => `opacity:${K(v(t).label)}`]), T(e, n);
846
+ });
847
+ var jr = f(Ar), Mr = (e) => {
848
+ var t = o(), n = E(t);
849
+ s(n, () => h.underlay, () => v(An)), T(e, t);
850
+ };
851
+ c(jr, (e) => {
852
+ h.underlay && e(Mr);
853
+ });
854
+ var Nr = f(jr);
855
+ k(Nr, 17, () => v(H).bars, y, (e, t) => {
856
+ var n = Le(), r = E(n), i = f(r), a = (e) => {
857
+ var n = Fe();
858
+ let r;
859
+ var i = p(n, !0);
860
+ D(n), b((e) => {
861
+ r = A(n, 0, "sv-grid-chart-datalabel svelte-kvdein", null, r, { "on-bar": h.spec.stacked || h.spec.stacked100 }), C(n, "x", h.spec.stacked || h.spec.stacked100 ? v(t).x + v(t).w / 2 : v(t).value >= 0 ? v(t).x + v(t).w + 3 : v(t).x - 3), C(n, "y", v(t).y + v(t).h / 2 + 3), C(n, "text-anchor", h.spec.stacked || h.spec.stacked100 ? "middle" : v(t).value >= 0 ? "start" : "end"), g(i, e);
862
+ }, [() => N(v(t).value)]), T(e, n);
863
+ }, o = (e) => {
864
+ var n = Ie();
865
+ let r;
866
+ var i = p(n, !0);
867
+ D(n), b((e) => {
868
+ r = A(n, 0, "sv-grid-chart-datalabel svelte-kvdein", null, r, { "on-bar": h.spec.stacked || h.spec.stacked100 }), C(n, "x", v(t).x + v(t).w / 2), C(n, "y", h.spec.stacked || h.spec.stacked100 ? v(t).y + v(t).h / 2 + 3 : v(t).value >= 0 ? v(t).y - 3 : v(t).y + v(t).h + 11), g(i, e);
869
+ }, [() => N(v(t).value)]), T(e, n);
870
+ };
871
+ c(i, (e) => {
872
+ qt() && v(U) && v(t).w > 18 ? e(a) : qt() && !v(U) && v(t).h > 13 && e(o, 1);
873
+ }), b((e) => {
874
+ C(r, "x", v(t).x), C(r, "y", v(t).y), C(r, "width", v(t).w), C(r, "height", v(t).h), C(r, "fill", v(sn)[v(t).series] ?? v(t).color), O(r, e);
875
+ }, [() => `opacity:${K(v(t).series)}`]), T(e, n);
876
+ });
877
+ var Pr = f(Nr);
878
+ k(Pr, 17, () => v(H).candles, y, (e, t) => {
879
+ var n = o(), r = E(n), i = (e) => {
880
+ var n = Re(), r = E(n), i = f(r), a = f(i);
881
+ b((e, n, o) => {
882
+ C(r, "x1", v(t).xCenter), C(r, "y1", v(t).yHigh), C(r, "x2", v(t).xCenter), C(r, "y2", v(t).yLow), C(r, "stroke", v(t).color), O(r, e), C(i, "x1", v(t).x), C(i, "y1", v(t).yOpen), C(i, "x2", v(t).xCenter), C(i, "y2", v(t).yOpen), C(i, "stroke", v(t).color), O(i, n), C(a, "x1", v(t).xCenter), C(a, "y1", v(t).yClose), C(a, "x2", v(t).x + v(t).w), C(a, "y2", v(t).yClose), C(a, "stroke", v(t).color), O(a, o);
883
+ }, [
884
+ () => `opacity:${K(v(t).series)}`,
885
+ () => `opacity:${K(v(t).series)}`,
886
+ () => `opacity:${K(v(t).series)}`
887
+ ]), T(e, n);
888
+ }, a = (e) => {
889
+ var n = ze(), r = E(n), i = f(r);
890
+ b((e, n) => {
891
+ C(r, "x1", v(t).xCenter), C(r, "y1", v(t).yHigh), C(r, "x2", v(t).xCenter), C(r, "y2", v(t).yLow), C(r, "stroke", v(t).color), O(r, e), C(i, "x", v(t).x), C(i, "y", v(t).bodyY), C(i, "width", v(t).w), C(i, "height", v(t).bodyH), C(i, "fill", v(t).up ? "none" : v(t).color), C(i, "stroke", v(t).color), O(i, n);
892
+ }, [() => `opacity:${K(v(t).series)}`, () => `opacity:${K(v(t).series)}`]), T(e, n);
893
+ };
894
+ c(r, (e) => {
895
+ v(bn) ? e(i) : e(a, -1);
896
+ }), T(e, n);
897
+ });
898
+ var Fr = f(Pr);
899
+ k(Fr, 17, () => v(H).boxes, y, (e, t) => {
900
+ var n = Ve(), r = E(n), i = f(r), a = f(i), o = f(a), s = f(o), c = f(s);
901
+ k(c, 17, () => v(t).outliers, y, (e, n) => {
902
+ var r = Be();
903
+ b((e) => {
904
+ C(r, "cx", v(t).xCenter), C(r, "cy", v(n).y), C(r, "stroke", v(t).color), O(r, e);
905
+ }, [() => `opacity:${K(v(t).series)}`]), T(e, r);
906
+ }), b((e, n, c, l, u) => {
907
+ C(r, "x1", v(t).xCenter), C(r, "y1", v(t).yMax), C(r, "x2", v(t).xCenter), C(r, "y2", v(t).yMin), C(r, "stroke", v(t).color), O(r, e), C(i, "x1", v(t).x + v(t).w * .25), C(i, "y1", v(t).yMax), C(i, "x2", v(t).x + v(t).w * .75), C(i, "y2", v(t).yMax), C(i, "stroke", v(t).color), O(i, n), C(a, "x1", v(t).x + v(t).w * .25), C(a, "y1", v(t).yMin), C(a, "x2", v(t).x + v(t).w * .75), C(a, "y2", v(t).yMin), C(a, "stroke", v(t).color), O(a, c), C(o, "x", v(t).x), C(o, "y", v(t).boxY), C(o, "width", v(t).w), C(o, "height", v(t).boxH), C(o, "fill", v(t).color), C(o, "stroke", v(t).color), O(o, l), C(s, "x1", v(t).x), C(s, "y1", v(t).yMedian), C(s, "x2", v(t).x + v(t).w), C(s, "y2", v(t).yMedian), C(s, "stroke", v(t).color), O(s, u);
908
+ }, [
909
+ () => `opacity:${K(v(t).series)}`,
910
+ () => `opacity:${K(v(t).series)}`,
911
+ () => `opacity:${K(v(t).series)}`,
912
+ () => `opacity:${K(v(t).series)}`,
913
+ () => `opacity:${K(v(t).series)}`
914
+ ]), T(e, n);
915
+ });
916
+ var Ir = f(Fr);
917
+ k(Ir, 17, () => v(H).errorBars, y, (e, t) => {
918
+ var n = He(), r = E(n), i = f(r), a = f(i);
919
+ b((e, n, o) => {
920
+ C(r, "x1", v(t).xCenter), C(r, "y1", v(t).yHi), C(r, "x2", v(t).xCenter), C(r, "y2", v(t).yLo), C(r, "stroke", v(t).color), O(r, e), C(i, "x1", v(t).xCenter - v(t).cap), C(i, "y1", v(t).yHi), C(i, "x2", v(t).xCenter + v(t).cap), C(i, "y2", v(t).yHi), C(i, "stroke", v(t).color), O(i, n), C(a, "x1", v(t).xCenter - v(t).cap), C(a, "y1", v(t).yLo), C(a, "x2", v(t).xCenter + v(t).cap), C(a, "y2", v(t).yLo), C(a, "stroke", v(t).color), O(a, o);
921
+ }, [
922
+ () => `opacity:${K(v(t).series)}`,
923
+ () => `opacity:${K(v(t).series)}`,
924
+ () => `opacity:${K(v(t).series)}`
925
+ ]), T(e, n);
926
+ });
927
+ var Lr = f(Ir);
928
+ k(Lr, 17, () => v(H).scatterPoints, y, (e, t) => {
929
+ var n = Ue();
930
+ b((e) => {
931
+ C(n, "cx", v(t).cx), C(n, "cy", v(t).cy), C(n, "r", v(t).r), C(n, "fill", v(t).color), C(n, "stroke", v(t).color), O(n, e);
932
+ }, [() => `opacity:${K(v(t).series)}`]), d("mousemove", n, (e) => cr(e.clientX, e.clientY, v(t))), m("mouseleave", n, Z), T(e, n);
933
+ });
934
+ var Rr = f(Lr);
935
+ k(Rr, 17, () => v(H).referenceLines, y, (e, t) => {
936
+ var n = We(), r = E(n), i = f(r), a = p(i, !0);
937
+ D(i), b(() => {
938
+ C(r, "x1", v(H).plot.x), C(r, "y1", v(t).y), C(r, "x2", v(H).plot.x + v(H).plot.w), C(r, "y2", v(t).y), C(r, "stroke", v(t).color), C(r, "stroke-dasharray", v(t).dashed ? "5 4" : void 0), C(i, "x", v(H).plot.x + v(H).plot.w - 3), C(i, "y", v(t).y - 3), C(i, "fill", v(t).color), g(a, v(t).label);
939
+ }), T(e, n);
940
+ });
941
+ var zr = f(Rr);
942
+ k(zr, 17, () => v(H).referenceLinesV, y, (e, t) => {
943
+ var n = Ge(), r = E(n), i = f(r), a = p(i, !0);
944
+ D(i), b(() => {
945
+ C(r, "x1", v(t).x), C(r, "y1", v(H).plot.y), C(r, "x2", v(t).x), C(r, "y2", v(H).plot.y + v(H).plot.h), C(r, "stroke", v(t).color), C(r, "stroke-dasharray", v(t).dashed ? "5 4" : void 0), C(i, "x", v(t).x + 3), C(i, "y", v(H).plot.y + 9), C(i, "fill", v(t).color), g(a, v(t).label);
946
+ }), T(e, n);
947
+ });
948
+ var Br = f(zr);
949
+ k(Br, 19, () => v(H).overlays, (e, t) => e.label + t, (e, t) => {
950
+ var n = Ke();
951
+ b(() => {
952
+ C(n, "d", v(t).path), C(n, "stroke", v(t).color);
953
+ }), T(e, n);
954
+ });
955
+ var Vr = f(Br), Hr = (e) => {
956
+ var t = o(), n = E(t);
957
+ s(n, () => h.overlay, () => v(An)), T(e, t);
958
+ };
959
+ c(Vr, (e) => {
960
+ h.overlay && e(Hr);
961
+ });
962
+ var Ur = f(Vr);
963
+ k(Ur, 19, () => v(H).annotations, (e, t) => e.label + t, (e, t, n) => {
964
+ let r = a(() => v(t).placement === "left" ? -8 : v(t).placement === "right" ? 8 : 0), i = a(() => v(t).placement === "bottom" ? 14 : v(t).placement === "top" ? -8 : 0), o = a(() => v(t).placement === "left" ? "end" : v(t).placement === "right" ? "start" : "middle");
965
+ var s = qe(), c = E(s);
966
+ let l;
967
+ var u = f(c), m = p(u, !0);
968
+ D(u), b(() => {
969
+ l = A(c, 0, "sv-grid-chart-annotation-marker svelte-kvdein", null, l, { "is-removable": v(M) && !!h.onAnnotationRemove }), C(c, "cx", v(t).x), C(c, "cy", v(t).y), C(c, "r", v(M) && h.onAnnotationRemove ? 6 : 4), C(c, "fill", v(t).color), C(c, "role", v(M) && h.onAnnotationRemove ? "button" : void 0), C(c, "tabindex", v(M) && h.onAnnotationRemove ? 0 : void 0), C(c, "aria-label", v(M) && h.onAnnotationRemove ? `Remove note: ${v(t).label}` : void 0), C(u, "x", v(t).x + v(r)), C(u, "y", v(t).y + v(i)), C(u, "text-anchor", v(o)), C(u, "fill", v(t).color), g(m, v(t).label);
970
+ }), d("click", c, (e) => {
971
+ !v(M) || !h.onAnnotationRemove || (e.stopPropagation(), h.onAnnotationRemove(v(n)));
972
+ }), d("keydown", c, (e) => {
973
+ !v(M) || !h.onAnnotationRemove || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), h.onAnnotationRemove(v(n)));
974
+ }), T(e, s);
975
+ });
976
+ var Wr = f(Ur), Gr = (e) => {
977
+ var t = o(), n = E(t), r = (e) => {
978
+ let t = a(() => v(H).plot.y + v(W) * v(Y) + v(W) / 2);
979
+ var n = Je();
980
+ b(() => {
981
+ C(n, "x1", v(H).plot.x), C(n, "y1", v(t)), C(n, "x2", v(H).plot.x + v(H).plot.w), C(n, "y2", v(t));
982
+ }), T(e, n);
983
+ }, i = (e) => {
984
+ let t = a(() => v(H).lines[0]?.points[v(Y)]), n = a(() => v(t) && Number.isFinite(v(t).x) ? v(t).x : v(H).plot.x + v(W) * v(Y) + v(W) / 2);
985
+ var r = Ye();
986
+ b(() => {
987
+ C(r, "x1", v(n)), C(r, "y1", v(H).plot.y), C(r, "x2", v(n)), C(r, "y2", v(H).plot.y + v(H).plot.h);
988
+ }), T(e, r);
989
+ };
990
+ c(n, (e) => {
991
+ v(U) ? e(r) : e(i, -1);
992
+ }), T(e, t);
993
+ };
994
+ c(Wr, (e) => {
995
+ v(jn) && v(Y) !== null && e(Gr);
996
+ });
997
+ var Kr = f(Wr), qr = (e) => {
998
+ var t = nt(), n = E(t);
999
+ k(n, 17, () => v(H).heatmapRowTicks, (e) => e.value, (e, t) => {
1000
+ var n = Xe(), r = p(n, !0);
1001
+ D(n), b((e) => {
1002
+ C(n, "x", v(H).plot.x - 8), C(n, "y", v(t).y + 3), g(r, e);
1003
+ }, [() => q(v(t).label, 22)]), T(e, n);
1004
+ });
1005
+ var r = f(n);
1006
+ k(r, 19, () => v(H).heatmapColTicks, (e, t) => e.label + t, (e, t) => {
1007
+ var n = Ze(), r = p(n, !0);
1008
+ D(n), b((e) => {
1009
+ C(n, "x", v(t).x), C(n, "y", v(H).plot.y + v(H).plot.h + 14), g(r, e);
1010
+ }, [() => q(v(t).label, 14)]), T(e, n);
1011
+ });
1012
+ var i = f(r);
1013
+ k(i, 17, () => v(H).heatmapCells, y, (e, t) => {
1014
+ var n = $e(), r = E(n), i = f(r), a = (e) => {
1015
+ var n = Qe(), r = p(n, !0);
1016
+ D(n), b((e) => {
1017
+ C(n, "x", v(t).x + v(t).w / 2), C(n, "y", v(t).y + v(t).h / 2 + 3), C(n, "fill", v(t).textColor), g(r, e);
1018
+ }, [() => N(v(t).value)]), T(e, n);
1019
+ };
1020
+ c(i, (e) => {
1021
+ qt() && v(t).w > 22 && v(t).h > 14 && e(a);
1022
+ }), b((e) => {
1023
+ C(r, "x", v(t).x), C(r, "y", v(t).y), C(r, "width", v(t).w), C(r, "height", v(t).h), C(r, "fill", v(t).color), C(r, "role", h.onSelect ? "button" : "presentation"), C(r, "tabindex", h.onSelect ? 0 : void 0), C(r, "aria-label", e);
1024
+ }, [() => `${v(t).rowLabel} ${v(t).colLabel}: ${N(v(t).value)}`]), d("mousemove", r, (e) => lr(e.clientX, e.clientY, v(t))), m("mouseleave", r, Z), d("click", r, () => Q(v(t).colLabel, v(t).rowLabel, v(t).value)), d("keydown", r, (e) => {
1025
+ h.onSelect && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q(v(t).colLabel, v(t).rowLabel, v(t).value));
1026
+ }), T(e, n);
1027
+ });
1028
+ var o = f(i), s = (e) => {
1029
+ let t = a(() => v(H).plot.x + v(H).plot.w + 14), n = a(() => v(H).plot.h - 20), r = a(() => v(H).heatmapLegend);
1030
+ var i = tt(), o = E(i), s = p(o);
1031
+ k(s, 21, () => v(r), y, (e, t, n) => {
1032
+ var i = et();
1033
+ b(() => {
1034
+ C(i, "offset", `${n / (v(r).length - 1) * 100}%`), C(i, "stop-color", v(t).color);
1035
+ }), T(e, i);
1036
+ }), D(s), D(o);
1037
+ var c = f(o), l = f(c), u = p(l, !0);
1038
+ D(l);
1039
+ var d = f(l), m = p(d, !0);
1040
+ D(d), b(() => {
1041
+ C(s, "id", `${an}-heatscale`), C(c, "x", v(t)), C(c, "y", v(H).plot.y + 10), C(c, "height", v(n)), C(c, "fill", `url(#${an}-heatscale)`), C(l, "x", v(t) + 14), C(l, "y", v(H).plot.y + 14), g(u, v(r)[v(r).length - 1].label), C(d, "x", v(t) + 14), C(d, "y", v(H).plot.y + 10 + v(n)), g(m, v(r)[0].label);
1042
+ }), T(e, i);
1043
+ };
1044
+ c(o, (e) => {
1045
+ v(H).heatmapLegend.length && e(s);
1046
+ }), T(e, t);
1047
+ };
1048
+ c(Kr, (e) => {
1049
+ v(Nn) && e(qr);
1050
+ });
1051
+ var Jr = f(Kr), Yr = (e) => {
1052
+ var t = o(), n = E(t);
1053
+ k(n, 17, () => v(H).funnelSegments, y, (e, t, n) => {
1054
+ var r = rt(), i = E(r), a = f(i), o = p(a, !0);
1055
+ D(a);
1056
+ var s = f(a), c = p(s);
1057
+ D(s), b((e, n, r, l) => {
1058
+ C(i, "d", v(t).path), C(i, "fill", v(t).color), C(i, "role", h.onSelect ? "button" : "presentation"), C(i, "tabindex", h.onSelect ? 0 : void 0), C(i, "aria-label", e), C(a, "x", v(t).cx), C(a, "y", v(t).cy - 3), C(a, "fill", v(t).textColor), g(o, n), C(s, "x", v(t).cx), C(s, "y", v(t).cy + 11), C(s, "fill", v(t).textColor), g(c, `${r ?? ""} · ${l ?? ""}%`);
1059
+ }, [
1060
+ () => `${v(t).label}: ${N(v(t).value)}`,
1061
+ () => q(v(t).label, 24),
1062
+ () => N(v(t).value),
1063
+ () => (v(t).conversion * 100).toFixed(0)
1064
+ ]), d("mousemove", i, (e) => ur(e.clientX, e.clientY, v(t))), m("mouseleave", i, Z), d("click", i, () => Q(v(t).label, v(t).label, v(t).value, n)), d("keydown", i, (e) => {
1065
+ h.onSelect && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q(v(t).label, v(t).label, v(t).value, n));
1066
+ }), T(e, r);
1067
+ }), T(e, t);
1068
+ };
1069
+ c(Jr, (e) => {
1070
+ v(Pn) && e(Yr);
1071
+ });
1072
+ var Xr = f(Jr), Zr = (e) => {
1073
+ let t = a(() => v(H).radarCenter);
1074
+ var n = ct(), r = E(n);
1075
+ k(r, 17, () => v(H).radarRings, y, (e, n, r) => {
1076
+ let i = a(() => v(t).r * ((r + 1) / v(H).radarRings.length));
1077
+ var o = it();
1078
+ b(() => {
1079
+ C(o, "cx", v(t).cx), C(o, "cy", v(t).cy), C(o, "r", v(i));
1080
+ }), T(e, o);
1081
+ });
1082
+ var i = f(r);
1083
+ k(i, 17, () => v(H).radarAxes, y, (e, n) => {
1084
+ let r = a(() => v(n).x - v(t).cx), i = a(() => v(n).y - v(t).cy), o = a(() => v(t).cx + v(r) * 1.08), s = a(() => v(t).cy + v(i) * 1.08);
1085
+ var c = at(), l = E(c), u = f(l), d = p(u, !0);
1086
+ D(u), b((e) => {
1087
+ C(l, "x1", v(t).cx), C(l, "y1", v(t).cy), C(l, "x2", v(n).x), C(l, "y2", v(n).y), C(u, "x", v(o)), C(u, "y", v(s) + 3), C(u, "text-anchor", e), g(d, v(n).label);
1088
+ }, [() => Math.abs(v(r)) < 1 ? "middle" : v(r) > 0 ? "start" : "end"]), T(e, c);
1089
+ });
1090
+ var o = f(i);
1091
+ k(o, 17, () => v(H).radarSeries, y, (e, t) => {
1092
+ var n = st(), r = E(n), i = f(r);
1093
+ k(i, 17, () => v(t).points, y, (e, n) => {
1094
+ var r = ot();
1095
+ b(() => {
1096
+ C(r, "cx", v(n).x), C(r, "cy", v(n).y), C(r, "fill", v(t).color);
1097
+ }), d("mousemove", r, (e) => dr(e.clientX, e.clientY, v(t).label, v(n).axis, v(n).value, v(t).color)), m("mouseleave", r, Z), T(e, r);
1098
+ }), b((e) => {
1099
+ C(r, "d", v(t).path), C(r, "fill", v(t).color), C(r, "stroke", v(t).color), O(r, e);
1100
+ }, [() => `opacity:${K(v(t).label)}`]), T(e, n);
1101
+ }), T(e, n);
1102
+ };
1103
+ c(Xr, (e) => {
1104
+ v(Fn) && v(H).radarCenter && e(Zr);
1105
+ });
1106
+ var Qr = f(Xr), $r = (e) => {
1107
+ var t = mt(), n = E(t);
1108
+ k(n, 17, () => v(H).calendarMonthTicks, y, (e, t) => {
1109
+ var n = lt(), r = p(n, !0);
1110
+ D(n), b(() => {
1111
+ C(n, "x", v(t).x), C(n, "y", v(H).plot.y - 8), g(r, v(t).label);
1112
+ }), T(e, n);
1113
+ });
1114
+ var r = f(n);
1115
+ k(r, 16, () => [
1116
+ "Mon",
1117
+ "Wed",
1118
+ "Fri"
1119
+ ], y, (e, t, n) => {
1120
+ let r = a(() => [
1121
+ 1,
1122
+ 3,
1123
+ 5
1124
+ ][n]), i = a(() => v(H).calendarCells[v(r)]);
1125
+ var s = o(), l = E(s), u = (e) => {
1126
+ var n = ut(), r = p(n, !0);
1127
+ D(n), b(() => {
1128
+ C(n, "x", v(H).plot.x - 6), C(n, "y", v(i).y + v(i).size / 2 + 3), g(r, t);
1129
+ }), T(e, n);
1130
+ };
1131
+ c(l, (e) => {
1132
+ v(i) && e(u);
1133
+ }), T(e, s);
1134
+ });
1135
+ var i = f(r);
1136
+ k(i, 17, () => v(H).calendarCells, y, (e, t) => {
1137
+ var n = dt();
1138
+ let r;
1139
+ b((e) => {
1140
+ r = A(n, 0, "sv-grid-chart-calendar-cell svelte-kvdein", null, r, { "is-blank": !v(t).defined }), C(n, "x", v(t).x + 1), C(n, "y", v(t).y + 1), C(n, "width", v(t).size - 2), C(n, "height", v(t).size - 2), C(n, "fill", v(t).defined ? v(t).color : "transparent"), C(n, "aria-label", e);
1141
+ }, [() => `${v(t).date}: ${v(t).defined ? N(v(t).value) : "no data"}`]), d("mousemove", n, (e) => v(t).defined && X(e.clientX, e.clientY, v(t).date, [{
1142
+ color: v(t).color,
1143
+ value: N(v(t).value)
1144
+ }])), m("mouseleave", n, Z), T(e, n);
1145
+ });
1146
+ var s = f(i), l = (e) => {
1147
+ let t = a(() => v(H).plot.x + v(H).plot.w + 12), n = a(() => v(H).plot.y + 4);
1148
+ var r = pt(), i = E(r), o = f(i);
1149
+ k(o, 17, () => v(H).calendarLegend, y, (e, r, i) => {
1150
+ var a = ft(), o = E(a), s = f(o), c = p(s, !0);
1151
+ D(s), b(() => {
1152
+ C(o, "x", v(t)), C(o, "y", v(n) + 6 + i * 13), C(o, "fill", v(r).color), C(s, "x", v(t) + 14), C(s, "y", v(n) + 14 + i * 13), g(c, v(r).label);
1153
+ }), T(e, a);
1154
+ });
1155
+ var s = f(o);
1156
+ b(() => {
1157
+ C(i, "x", v(t)), C(i, "y", v(n)), C(s, "x", v(t)), C(s, "y", v(n) + 12 + v(H).calendarLegend.length * 13);
1158
+ }), T(e, r);
1159
+ };
1160
+ c(s, (e) => {
1161
+ v(H).calendarLegend.length && e(l);
1162
+ }), T(e, t);
1163
+ };
1164
+ c(Qr, (e) => {
1165
+ v(In) && e($r);
1166
+ });
1167
+ var ei = f(Qr), ti = (e) => {
1168
+ let t = a(() => v(H).gauge);
1169
+ var n = vt(), r = E(n);
1170
+ k(r, 17, () => v(t).ticks, y, (e, t) => {
1171
+ var n = ht();
1172
+ let r;
1173
+ b(() => {
1174
+ r = A(n, 0, "sv-grid-chart-gauge-tick svelte-kvdein", null, r, { "is-major": v(t).major }), C(n, "x1", v(t).x1), C(n, "y1", v(t).y1), C(n, "x2", v(t).x2), C(n, "y2", v(t).y2);
1175
+ }), T(e, n);
1176
+ });
1177
+ var i = f(r), o = f(i);
1178
+ k(o, 17, () => v(t).rangePaths, y, (e, t) => {
1179
+ var n = gt();
1180
+ b(() => {
1181
+ C(n, "d", v(t).path), C(n, "stroke", v(t).color);
1182
+ }), T(e, n);
1183
+ });
1184
+ var s = f(o), l = f(s), u = (e) => {
1185
+ var n = _t();
1186
+ b(() => {
1187
+ C(n, "x1", v(t).target.x1), C(n, "y1", v(t).target.y1), C(n, "x2", v(t).target.x2), C(n, "y2", v(t).target.y2);
1188
+ }), T(e, n);
1189
+ };
1190
+ c(l, (e) => {
1191
+ v(t).target && e(u);
1192
+ });
1193
+ var d = f(l), m = f(d), h = f(m), _ = f(h), x = p(_, !0);
1194
+ D(_);
1195
+ var ee = f(_), S = p(ee, !0);
1196
+ D(ee);
1197
+ var te = f(ee), ne = p(te);
1198
+ D(te), b((e, n, r) => {
1199
+ C(i, "d", v(t).trackPath), C(s, "d", v(t).valuePath), C(s, "stroke", v(t).valueColor ?? "var(--sg-accent, #2563eb)"), C(d, "d", v(t).needle.path), C(m, "cx", v(t).cx), C(m, "cy", v(t).cy), C(m, "r", v(t).needle.hubR), C(h, "cx", v(t).cx), C(h, "cy", v(t).cy), C(_, "x", v(t).minLabel.x), C(_, "y", v(t).minLabel.y), g(x, e), C(ee, "x", v(t).maxLabel.x), C(ee, "y", v(t).maxLabel.y), g(S, n), C(te, "x", v(t).cx), C(te, "y", v(t).cy + 38), g(ne, `${r ?? ""}${v(t).unit ? ` ${v(t).unit}` : ""}`);
1200
+ }, [
1201
+ () => N(v(t).min),
1202
+ () => N(v(t).max),
1203
+ () => N(v(t).value)
1204
+ ]), T(e, n);
1205
+ };
1206
+ c(ei, (e) => {
1207
+ v(Ln) && v(H).gauge && e(ti);
1208
+ });
1209
+ var ni = f(ei), ri = (e) => {
1210
+ var t = o(), n = E(t);
1211
+ k(n, 17, () => v(H).treemapCells, y, (e, t) => {
1212
+ var n = xt(), r = E(n), i = f(r), a = (e) => {
1213
+ var n = yt(), r = p(n, !0);
1214
+ D(n), b((e) => {
1215
+ C(n, "x", v(t).x + 4), C(n, "y", v(t).y + 12), C(n, "fill", v(t).textColor), g(r, e);
1216
+ }, [() => q(v(t).name, Math.max(3, Math.floor(v(t).w / 7)))]), T(e, n);
1217
+ };
1218
+ c(i, (e) => {
1219
+ v(t).w > 36 && v(t).h > 18 && e(a);
1220
+ });
1221
+ var o = f(i), s = (e) => {
1222
+ var n = bt(), r = p(n, !0);
1223
+ D(n), b((e) => {
1224
+ C(n, "x", v(t).x + 4), C(n, "y", v(t).y + 24), C(n, "fill", v(t).textColor), g(r, e);
1225
+ }, [() => N(v(t).value)]), T(e, n);
1226
+ };
1227
+ c(o, (e) => {
1228
+ v(t).w > 60 && v(t).h > 30 && e(s);
1229
+ }), b((e) => {
1230
+ C(r, "x", v(t).x), C(r, "y", v(t).y), C(r, "width", v(t).w), C(r, "height", v(t).h), C(r, "fill", v(t).color), C(r, "role", h.onSelect ? "button" : "presentation"), C(r, "tabindex", h.onSelect ? 0 : void 0), C(r, "aria-label", e);
1231
+ }, [() => `${v(t).name}: ${N(v(t).value)}`]), d("mousemove", r, (e) => X(e.clientX, e.clientY, v(t).name, [{
1232
+ color: v(t).color,
1233
+ value: N(v(t).value)
1234
+ }])), m("mouseleave", r, Z), d("click", r, () => Q(v(t).name, "", v(t).value)), d("keydown", r, (e) => {
1235
+ h.onSelect && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q(v(t).name, "", v(t).value));
1236
+ }), T(e, n);
1237
+ }), T(e, t);
1238
+ };
1239
+ c(ni, (e) => {
1240
+ v(Rn) && e(ri);
1241
+ });
1242
+ var ii = f(ni), ai = (e) => {
1243
+ var t = wt(), n = E(t);
1244
+ k(n, 17, () => v(H).sankeyLinks, y, (e, t) => {
1245
+ var n = St();
1246
+ b((e) => {
1247
+ C(n, "d", v(t).path), C(n, "stroke", v(t).color), C(n, "stroke-width", v(t).width), C(n, "aria-label", e);
1248
+ }, [() => `${v(t).source} -> ${v(t).target}: ${N(v(t).value)}`]), d("mousemove", n, (e) => X(e.clientX, e.clientY, `${v(t).source} -> ${v(t).target}`, [{
1249
+ color: v(t).color,
1250
+ value: N(v(t).value)
1251
+ }])), m("mouseleave", n, Z), T(e, n);
1252
+ });
1253
+ var r = f(n);
1254
+ k(r, 17, () => v(H).sankeyNodes, y, (e, t) => {
1255
+ var n = Ct(), r = E(n);
1256
+ C(r, "tabindex", 0);
1257
+ var i = f(r), a = p(i, !0);
1258
+ D(i), b((e) => {
1259
+ C(r, "x", v(t).x), C(r, "y", v(t).y), C(r, "width", v(t).w), C(r, "height", v(t).h), C(r, "fill", v(t).color), C(r, "aria-label", e), C(i, "x", v(t).column === 0 ? v(t).x + v(t).w + 4 : v(t).x - 4), C(i, "y", v(t).y + v(t).h / 2 + 3), C(i, "text-anchor", v(t).column === 0 ? "start" : "end"), g(a, v(t).label);
1260
+ }, [() => `${v(t).label}: in ${N(v(t).totalIn)}, out ${N(v(t).totalOut)}`]), d("mousemove", r, (e) => X(e.clientX, e.clientY, v(t).label, [{
1261
+ label: "in",
1262
+ value: N(v(t).totalIn)
1263
+ }, {
1264
+ label: "out",
1265
+ value: N(v(t).totalOut)
1266
+ }])), m("mouseleave", r, Z), m("focus", r, (e) => {
1267
+ let n = e.currentTarget.getBoundingClientRect();
1268
+ X(n.left + n.width / 2, n.top, v(t).label, [{
1269
+ label: "in",
1270
+ value: N(v(t).totalIn)
1271
+ }, {
1272
+ label: "out",
1273
+ value: N(v(t).totalOut)
1274
+ }]);
1275
+ }), m("blur", r, Z), T(e, n);
1276
+ }), T(e, t);
1277
+ };
1278
+ c(ii, (e) => {
1279
+ v(zn) && e(ai);
1280
+ });
1281
+ var oi = f(ii);
1282
+ k(oi, 17, () => v(H).slices, y, (e, t, n) => {
1283
+ var r = Et(), i = E(r), a = f(i), o = (e) => {
1284
+ var n = Tt(), r = p(n);
1285
+ D(n), b((e) => {
1286
+ C(n, "x", v(t).cx), C(n, "y", v(t).cy), g(r, `${e ?? ""}%`);
1287
+ }, [() => v(t).percent.toFixed(0)]), T(e, n);
1288
+ };
1289
+ c(a, (e) => {
1290
+ qt() && v(t).percent >= 6 && e(o);
1291
+ }), b((e) => {
1292
+ C(i, "d", v(t).path), C(i, "fill", v(t).color), C(i, "role", h.onSelect ? "button" : "presentation"), C(i, "tabindex", h.onSelect ? 0 : void 0), C(i, "aria-label", e);
1293
+ }, [() => `${v(t).label}: ${N(v(t).value)}, ${v(t).percent.toFixed(1)}%`]), d("mousemove", i, (e) => sr(e.clientX, e.clientY, v(t).label, v(t).value, v(t).percent)), m("mouseleave", i, Z), m("focus", i, (e) => {
1294
+ let n = e.currentTarget.getBoundingClientRect();
1295
+ sr(n.left + n.width / 2, n.top, v(t).label, v(t).value, v(t).percent);
1296
+ }), m("blur", i, Z), d("click", i, () => Q(v(t).label, v(t).label, v(t).value, n)), d("keydown", i, (e) => mr(e, v(t).label, v(t).value)), T(e, r);
1297
+ });
1298
+ var si = f(oi), ci = (e) => {
1299
+ var t = Dt(), n = E(t), r = p(n, !0);
1300
+ D(n);
1301
+ var i = f(n);
1302
+ b((e) => {
1303
+ C(n, "x", v(H).donut.cx), C(n, "y", v(H).donut.cy - 4), g(r, e), C(i, "x", v(H).donut.cx), C(i, "y", v(H).donut.cy + 11);
1304
+ }, [() => N(v(H).donut.total)]), T(e, t);
1305
+ };
1306
+ c(si, (e) => {
1307
+ v(H).donut && e(ci);
1308
+ });
1309
+ var li = f(si), ui = (e) => {
1310
+ var t = o(), n = E(t), r = (e) => {
1311
+ var t = Ot();
1312
+ b(() => {
1313
+ C(t, "x", v(H).plot.x), C(t, "y", v(H).plot.y), C(t, "width", v(H).plot.w), C(t, "height", v(H).plot.h), C(t, "role", h.onSelect ? "button" : "img"), C(t, "tabindex", j() ? 0 : void 0), C(t, "data-cat-index", v(G)), C(t, "aria-label", `${v(V).categories.length} points, ${v(V).categories[0] ?? ""} to ${v(V).categories[v(V).categories.length - 1] ?? ""}. Arrow keys step through values.`);
1314
+ }), d("mousemove", t, (e) => {
1315
+ let t = Un(e.clientX, e.currentTarget);
1316
+ t != null && (x(G, t, !0), ar(e.clientX, e.clientY, t));
1317
+ }), m("mouseleave", t, Z), m("focus", t, (e) => or(e.currentTarget, v(G))), m("blur", t, Z), d("click", t, () => Q(v(V).categories[v(G)] ?? "", "", 0, v(G))), d("keydown", t, Wn), T(e, t);
1318
+ }, i = (e) => {
1319
+ var t = o(), n = E(t);
1320
+ k(n, 19, () => v(V).categories, (e, t) => e + t, (e, t, n) => {
1321
+ let r = a(() => v(H).lines[0]?.points), i = a(() => v(r)?.[v(n)]?.x), o = a(() => !v(U) && v(r) && v(r).length === v(V).categories.length && Number.isFinite(v(i))), s = a(() => v(o) && v(n) > 0 ? v(r)[v(n) - 1].x : null), c = a(() => v(o) && v(n) < v(r).length - 1 ? v(r)[v(n) + 1].x : null), l = a(() => v(o) ? v(s) == null ? v(H).plot.x : (v(s) + v(i)) / 2 : v(H).plot.x + v(W) * v(n)), u = a(() => v(o) ? v(c) == null ? v(H).plot.x + v(H).plot.w : (v(i) + v(c)) / 2 : v(H).plot.x + v(W) * (v(n) + 1));
1322
+ var f = kt();
1323
+ b((e, t) => {
1324
+ C(f, "x", v(U) ? v(H).plot.x : v(l)), C(f, "y", v(U) ? v(H).plot.y + v(W) * v(n) : v(H).plot.y), C(f, "width", e), C(f, "height", v(U) ? v(W) : v(H).plot.h), C(f, "role", h.onSelect ? "button" : "img"), C(f, "tabindex", j() ? v(n) === 0 ? 0 : -1 : void 0), C(f, "data-cat-index", v(n)), C(f, "aria-label", t);
1325
+ }, [() => v(U) ? v(H).plot.w : Math.max(0, v(u) - v(l)), () => `${v(t)}: ${ir(v(n)).map((e) => `${e.label} ${e.value}`).join(", ")}`]), d("mousemove", f, (e) => ar(e.clientX, e.clientY, v(n))), m("mouseleave", f, Z), m("focus", f, (e) => or(e.currentTarget, v(n))), m("blur", f, Z), d("click", f, () => Q(v(t), "", 0, v(n))), d("keydown", f, (e) => pr(e, v(n))), T(e, f);
1326
+ }), T(e, t);
1327
+ };
1328
+ c(n, (e) => {
1329
+ v(Bn) ? e(r) : e(i, -1);
1330
+ }), T(e, t);
1331
+ };
1332
+ c(li, (e) => {
1333
+ v(jn) && !v(Mn) && e(ui);
1334
+ });
1335
+ var di = f(li), fi = (e) => {
1336
+ var t = At();
1337
+ b(() => {
1338
+ C(t, "x", v(fn).x), C(t, "y", v(fn).y), C(t, "width", v(fn).w), C(t, "height", v(fn).h);
1339
+ }), T(e, t);
1340
+ };
1341
+ c(di, (e) => {
1342
+ v(fn) && e(fi);
1343
+ }), D($), te($, (e) => x(I, e), () => v(I));
1344
+ var pi = f($, 2), mi = (e) => {
1345
+ let t = a(() => v(z).plot.x + v(Cn).t0 * v(z).plot.w), n = a(() => (v(Cn).t1 - v(Cn).t0) * v(z).plot.w);
1346
+ var r = Pt(), i = p(r);
1347
+ k(i, 17, () => v(z).lines, y, (e, t) => {
1348
+ var n = Mt(), r = E(n), i = (e) => {
1349
+ var n = jt();
1350
+ b(() => {
1351
+ C(n, "d", v(t).areaPath), C(n, "fill", v(t).color);
1352
+ }), T(e, n);
1353
+ };
1354
+ c(r, (e) => {
1355
+ v(t).areaPath && e(i);
1356
+ });
1357
+ var a = f(r);
1358
+ b(() => {
1359
+ C(a, "d", v(t).path), C(a, "stroke", v(t).color);
1360
+ }), T(e, n);
1361
+ });
1362
+ var o = f(i);
1363
+ k(o, 17, () => v(z).bars, y, (e, t) => {
1364
+ var n = Nt();
1365
+ b(() => {
1366
+ C(n, "x", v(t).x), C(n, "y", v(t).y), C(n, "width", v(t).w), C(n, "height", v(t).h), C(n, "fill", v(t).color);
1367
+ }), T(e, n);
1368
+ });
1369
+ var s = f(o), l = f(s), u = f(l), h = f(u), g = f(h);
1370
+ D(r), b(() => {
1371
+ C(r, "viewBox", `0 0 ${v(z).width} ${v(z).height}`), C(s, "x", v(z).plot.x), C(s, "y", v(z).plot.y), C(s, "width", v(t) - v(z).plot.x), C(s, "height", v(z).plot.h), C(l, "x", v(t) + v(n)), C(l, "y", v(z).plot.y), C(l, "width", v(z).plot.x + v(z).plot.w - (v(t) + v(n))), C(l, "height", v(z).plot.h), C(u, "x", v(t)), C(u, "y", v(z).plot.y), C(u, "width", v(n)), C(u, "height", v(z).plot.h), C(h, "x", v(t) - 4), C(h, "y", v(z).plot.y), C(h, "height", v(z).plot.h), C(g, "x", v(t) + v(n) - 4), C(g, "y", v(z).plot.y), C(g, "height", v(z).plot.h);
1372
+ }), d("pointermove", r, En), d("pointerdown", u, (e) => Tn(e, "move")), d("pointerup", u, Dn), m("pointercancel", u, Dn), d("pointerdown", h, (e) => Tn(e, "left")), d("pointerup", h, Dn), m("pointercancel", h, Dn), d("pointerdown", g, (e) => Tn(e, "right")), d("pointerup", g, Dn), m("pointercancel", g, Dn), T(e, r);
1373
+ };
1374
+ c(pi, (e) => {
1375
+ v(xn) && v(z) && e(mi);
1376
+ });
1377
+ var hi = f(pi, 2), gi = (e) => {
1378
+ var t = Ft();
1379
+ T(e, t);
1380
+ };
1381
+ c(hi, (e) => {
1382
+ v(Yn) && e(gi);
1383
+ });
1384
+ var _i = f(hi, 2), vi = (e) => {
1385
+ var t = zt();
1386
+ let n;
1387
+ var r = p(t), i = p(r, !0);
1388
+ D(r);
1389
+ var a = f(r, 2);
1390
+ k(a, 17, () => v(J).rows, y, (e, t) => {
1391
+ var n = Rt(), r = p(n), i = (e) => {
1392
+ var n = It();
1393
+ b(() => O(n, `background:${v(t).color}`)), T(e, n);
1394
+ };
1395
+ c(r, (e) => {
1396
+ v(t).color && e(i);
1397
+ });
1398
+ var a = f(r, 2), o = (e) => {
1399
+ var n = Lt(), r = p(n, !0);
1400
+ D(n), b(() => g(r, v(t).label)), T(e, n);
1401
+ };
1402
+ c(a, (e) => {
1403
+ v(t).label && e(o);
1404
+ });
1405
+ var s = f(a, 2), l = p(s, !0);
1406
+ D(s), D(n), b(() => g(l, v(t).value)), T(e, n);
1407
+ }), D(t), b(() => {
1408
+ n = A(t, 1, "sv-grid-chart-tooltip svelte-kvdein", null, n, { "is-below": v(J).below }), O(t, `left:${v(J).left}px; top:${v(J).top}px;`), g(i, v(J).title);
1409
+ }), T(e, t);
1410
+ };
1411
+ c(_i, (e) => {
1412
+ v(J) && e(vi);
1413
+ });
1414
+ var yi = f(_i, 2), bi = (e) => {
1415
+ var t = Ht(), n = p(t);
1416
+ k(n, 17, () => v(Jn), (e) => e.label, (e, t) => {
1417
+ var n = Bt();
1418
+ let r;
1419
+ var i = p(n), a = f(i);
1420
+ D(n), b(() => {
1421
+ r = A(n, 1, "sv-grid-chart-legend-item svelte-kvdein", null, r, {
1422
+ "is-off": v(t).off,
1423
+ "is-isolated": v(en) === v(t).label
1424
+ }), n.disabled = !j(), C(n, "aria-pressed", !v(t).off), C(n, "title", j() ? `${v(t).off ? "Show" : "Hide"} ${v(t).label} · double-click to isolate` : v(t).label), O(i, `background:${v(t).off ? "transparent" : v(t).color}; border-color:${v(t).color}`), g(a, ` ${v(t).label ?? ""}`);
1425
+ }), d("click", n, () => Xn(v(t).label)), d("dblclick", n, () => Zn(v(t).label)), m("pointerenter", n, () => j() && x(nn, v(t).label, !0)), m("pointerleave", n, () => x(nn, null)), T(e, n);
1426
+ });
1427
+ var r = f(n, 2), i = (e) => {
1428
+ var t = Vt(), n = p(t, !0);
1429
+ D(t), b(() => g(n, v(Kn) ? "Show less" : `+${v(Gn).length - 10} more`)), d("click", t, () => x(Kn, !v(Kn))), T(e, t);
1430
+ };
1431
+ c(r, (e) => {
1432
+ v(qn) && e(i);
1433
+ }), D(t), T(e, t);
1434
+ };
1435
+ c(yi, (e) => {
1436
+ w() && v(Gn).length && e(bi);
1437
+ });
1438
+ var xi = f(yi, 2), Si = p(xi), Ci = p(Si), wi = f(Ci), Ti = (e) => {
1439
+ var t = _();
1440
+ b(() => g(t, `, first 1000 of ${v(Qn).rows.length ?? ""} rows`)), T(e, t);
1441
+ };
1442
+ c(wi, (e) => {
1443
+ v($n) && e(Ti);
1444
+ }), D(Si);
1445
+ var Ei = f(Si), Di = p(Ei);
1446
+ k(Di, 20, () => v(Qn).cols, (e) => e, (e, t) => {
1447
+ var n = Ut(), r = p(n, !0);
1448
+ D(n), b(() => g(r, t)), T(e, n);
1449
+ }), D(Di), D(Ei);
1450
+ var Oi = f(Ei);
1451
+ k(Oi, 21, () => v(er), y, (e, t) => {
1452
+ var n = Gt();
1453
+ k(n, 21, () => v(t), y, (e, t) => {
1454
+ var n = Wt(), r = p(n, !0);
1455
+ D(n), b(() => g(r, v(t))), T(e, n);
1456
+ }), D(n), T(e, n);
1457
+ }), D(Oi), D(xi), D(xr), te(xr, (e) => x(nr, e), () => v(nr)), b(() => {
1458
+ wr = A($, 0, "sv-grid-chart-svg svelte-kvdein", null, wr, {
1459
+ "is-interactive": j(),
1460
+ "is-clickable": !!h.onSelect || !!h.onDrill,
1461
+ "is-zoomable": Jt() && v(jn) && !v(M),
1462
+ "is-annotating": v(M),
1463
+ "is-dragging": !!v(L)
1464
+ }), C($, "viewBox", `0 0 ${v(H).width} ${v(H).height}`), C($, "aria-label", `${h.spec.type} chart`), C($, "aria-describedby", `${an}-table`), C(xi, "id", `${an}-table`), g(Ci, `${h.spec.type ?? ""} chart data`);
1465
+ }), d("pointerdown", $, hn), d("pointermove", $, gn), d("pointerup", $, _n), m("pointercancel", $, _n), d("dblclick", $, vn), T(l, xr), ne();
1466
+ }
1467
+ l([
1468
+ "click",
1469
+ "pointerdown",
1470
+ "pointermove",
1471
+ "pointerup",
1472
+ "dblclick",
1473
+ "mousemove",
1474
+ "keydown"
1475
+ ]);
1476
+ //#endregion
1477
+ export { j as t };