@actioneer/ads 0.5.3 → 0.5.5

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 (95) hide show
  1. package/components/accordion.js +15 -15
  2. package/components/agent-icon.d.ts +64 -0
  3. package/components/agent-icon.js +251 -0
  4. package/components/ai-elements/agent-trace.d.ts +8 -1
  5. package/components/ai-elements/agent-trace.js +164 -129
  6. package/components/ai-elements/chain-of-thought-icon.d.ts +42 -0
  7. package/components/ai-elements/chain-of-thought-icon.js +283 -0
  8. package/components/ai-elements/chain-of-thought.js +7 -7
  9. package/components/ai-elements/chart.js +38 -35
  10. package/components/ai-elements/index.d.ts +1 -0
  11. package/components/ai-elements/inline-citation.js +40 -40
  12. package/components/ai-elements/message.js +5 -5
  13. package/components/ai-elements/queue.js +1 -1
  14. package/components/ai-elements/research-activity.d.ts +2 -0
  15. package/components/ai-elements/research-activity.js +79 -81
  16. package/components/ai-elements/task-progress.js +2 -2
  17. package/components/ai-elements/tool.d.ts +4 -2
  18. package/components/ai-elements/tool.js +74 -54
  19. package/components/ai-elements/transcript.js +1 -1
  20. package/components/alert.js +1 -1
  21. package/components/answer.d.ts +2643 -311
  22. package/components/answer.js +1836 -425
  23. package/components/assistant-ui/answer-tool-ui.js +23 -28
  24. package/components/assistant-ui/chain-of-thought.d.ts +7 -2
  25. package/components/assistant-ui/composer-harness.js +20 -16
  26. package/components/assistant-ui/reasoning.js +35 -31
  27. package/components/assistant-ui/tool-fallback.js +125 -122
  28. package/components/assistant-ui/tool-group.d.ts +3 -1
  29. package/components/assistant-ui/tool-group.js +48 -43
  30. package/components/audio-waveform.js +14 -14
  31. package/components/autocomplete.js +52 -48
  32. package/components/avatar.js +58 -44
  33. package/components/badge.js +3 -3
  34. package/components/brand-texture.js +1 -1
  35. package/components/breadcrumbs.d.ts +27 -1
  36. package/components/breadcrumbs.js +94 -42
  37. package/components/button.js +15 -15
  38. package/components/carousel.js +10 -10
  39. package/components/chart.d.ts +14 -0
  40. package/components/chart.js +747 -614
  41. package/components/chip.js +3 -3
  42. package/components/code-block.d.ts +39 -17
  43. package/components/code-block.js +153 -104
  44. package/components/command-palette.js +27 -25
  45. package/components/connector-card.js +2 -2
  46. package/components/dropdown.js +65 -61
  47. package/components/empty-state.js +15 -15
  48. package/components/field.js +23 -23
  49. package/components/index.d.ts +5 -0
  50. package/components/index.js +523 -470
  51. package/components/infinite-canvas.js +60 -60
  52. package/components/kbd.js +6 -6
  53. package/components/link.js +6 -6
  54. package/components/modal.js +22 -20
  55. package/components/page-header.js +1 -1
  56. package/components/pagination.js +22 -22
  57. package/components/pixel-blast-svg.js +1 -1
  58. package/components/pixel-icon.d.ts +31 -0
  59. package/components/pixel-icon.js +733 -0
  60. package/components/popover.js +46 -42
  61. package/components/ripple.d.ts +29 -0
  62. package/components/ripple.js +17 -0
  63. package/components/segmented.js +24 -23
  64. package/components/select.js +71 -67
  65. package/components/selection-action-bar.js +22 -22
  66. package/components/sidebar.d.ts +11 -3
  67. package/components/sidebar.js +161 -148
  68. package/components/stepper.d.ts +2 -0
  69. package/components/stepper.js +80 -43
  70. package/components/table.d.ts +7 -0
  71. package/components/table.js +223 -155
  72. package/components/tabs.d.ts +3 -1
  73. package/components/tabs.js +165 -144
  74. package/components/textarea.js +10 -8
  75. package/components/toast.js +48 -46
  76. package/components/tooltip.js +61 -59
  77. package/components/tree.js +44 -41
  78. package/components/typography.d.ts +1 -1
  79. package/components/typography.js +25 -25
  80. package/components/viz-charts.d.ts +62 -0
  81. package/components/viz-charts.js +408 -0
  82. package/fonts/aribau-grotesk-500.otf +0 -0
  83. package/fonts/aribau-grotesk-600.woff2 +0 -0
  84. package/fonts.css +6 -4
  85. package/lib/icons.d.ts +411 -402
  86. package/lib/icons.js +109 -107
  87. package/lib/viz-format.d.ts +25 -0
  88. package/lib/viz-format.js +40 -0
  89. package/llms.txt +111 -8
  90. package/manifest.json +1096 -58
  91. package/package.json +5 -5
  92. package/styles.css +226 -96
  93. package/theme.css +220 -92
  94. package/fonts/aribau-grotesk-400.otf +0 -0
  95. package/fonts/aribau-grotesk-700.otf +0 -0
@@ -1,154 +1,224 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as e, Fragment as H } from "react/jsx-runtime";
2
+ import { jsxs as N, jsx as e, Fragment as V } from "react/jsx-runtime";
3
3
  import * as k from "react";
4
- import { ResponsiveContainer as I, LineChart as me, Tooltip as O, Line as re, AreaChart as fe, Area as ue, CartesianGrid as X, XAxis as Z, YAxis as z, BarChart as he, Bar as ne, Cell as ie, ComposedChart as xe, ScatterChart as ve, Scatter as ge, PieChart as be, Pie as pe, RadarChart as ye, PolarGrid as Ne, PolarAngleAxis as oe, PolarRadiusAxis as ke, Radar as we, RadialBarChart as Ae, RadialBar as Ce, Treemap as Re, ReferenceArea as $e, ReferenceLine as Fe, ReferenceDot as Me } from "recharts";
5
- import { MotionConfig as Le, AnimatePresence as Oe, motion as Se } from "motion/react";
4
+ import { ResponsiveContainer as j, LineChart as ve, Tooltip as S, Line as ie, AreaChart as be, Area as ge, CartesianGrid as X, XAxis as Z, YAxis as E, BarChart as pe, Bar as le, Cell as oe, ComposedChart as Ne, ScatterChart as we, Scatter as Ae, PieChart as ye, Pie as Ce, RadarChart as ke, PolarGrid as Re, PolarAngleAxis as se, PolarRadiusAxis as Me, Radar as $e, RadialBarChart as Le, RadialBar as Fe, Treemap as Se, ReferenceArea as Oe, ReferenceLine as Te, ReferenceDot as Ie } from "recharts";
5
+ import { MotionConfig as Be, AnimatePresence as De, motion as We } from "motion/react";
6
6
  import { cn as $ } from "../lib/cn.js";
7
- import { floatVariants as Te } from "../lib/motion.js";
8
- const E = (t) => `var(--color-chart-${t % 6 + 1})`, V = (t) => E(t), Q = "var(--color-ink-300)", T = {
7
+ import { floatVariants as je } from "../lib/motion.js";
8
+ const _ = (t) => `var(--color-chart-${t % 6 + 1})`, Y = (t) => _(t), Q = "var(--chart-context)", D = {
9
9
  primary: { ref: "var(--brand)", pill: "bg-fill text-fill-foreground" },
10
10
  success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
11
11
  warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
12
12
  danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
13
13
  info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
14
- }, L = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), le = (t, n) => {
15
- const r = [];
16
- for (const i of t)
17
- for (const a of Object.keys(i))
18
- a !== n && typeof i[a] == "number" && !r.includes(a) && r.push(a);
19
- return r;
14
+ }, F = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), ce = (t, r) => {
15
+ const n = [];
16
+ for (const l of t)
17
+ for (const o of Object.keys(l))
18
+ o !== r && typeof l[o] == "number" && !n.includes(o) && n.push(o);
19
+ return n;
20
20
  };
21
- function B({ x: t, y: n, payload: r, anchor: i, dy: a, format: l }) {
22
- const s = (r == null ? void 0 : r.value) ?? "", d = l ? l(s) : s;
23
- return /* @__PURE__ */ e("text", { x: t, y: n, dy: a, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: d });
21
+ function I({ x: t, y: r, payload: n, anchor: l, dy: o, format: a }) {
22
+ const s = (n == null ? void 0 : n.value) ?? "", u = a ? a(s) : s;
23
+ return /* @__PURE__ */ e("text", { x: t, y: r, dy: o, textAnchor: l, className: "fill-tertiary text-xs tabular-nums", children: u });
24
24
  }
25
- function S({
25
+ function de({
26
+ x: t,
27
+ y: r,
28
+ value: n,
29
+ hidden: l,
30
+ format: o
31
+ }) {
32
+ if (l || t == null || r == null || n == null || n === "") return null;
33
+ const a = Number(n);
34
+ return Number.isNaN(a) ? null : /* @__PURE__ */ e(
35
+ "text",
36
+ {
37
+ x: Number(t),
38
+ y: Number(r) - 10,
39
+ textAnchor: "middle",
40
+ className: "fill-secondary text-xs tabular-nums",
41
+ children: o(a)
42
+ }
43
+ );
44
+ }
45
+ function ze({
46
+ x: t,
47
+ y: r,
48
+ width: n,
49
+ height: l,
50
+ value: o,
51
+ format: a,
52
+ horizontal: s
53
+ }) {
54
+ if (t == null || r == null || o == null || o === "") return null;
55
+ const u = Number(o);
56
+ if (Number.isNaN(u)) return null;
57
+ const c = Number(t), f = Number(r), d = Number(n ?? 0), x = Number(l ?? 0);
58
+ return s ? /* @__PURE__ */ e(
59
+ "text",
60
+ {
61
+ x: c + d + 8,
62
+ y: f + x / 2,
63
+ dy: "0.32em",
64
+ textAnchor: "start",
65
+ className: "fill-secondary text-xs tabular-nums",
66
+ children: a(u)
67
+ }
68
+ ) : /* @__PURE__ */ e(
69
+ "text",
70
+ {
71
+ x: c + d / 2,
72
+ y: f - 8,
73
+ textAnchor: "middle",
74
+ className: "fill-secondary text-xs tabular-nums",
75
+ children: a(u)
76
+ }
77
+ );
78
+ }
79
+ function q({
80
+ cx: t,
81
+ cy: r,
82
+ fill: n
83
+ }) {
84
+ return t == null || r == null ? null : /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 4.5, fill: n, stroke: "var(--background)", strokeWidth: 2 });
85
+ }
86
+ function O({
26
87
  active: t,
27
- payload: n,
28
- label: r,
29
- format: i,
30
- labelKey: a,
31
- renderer: l
88
+ payload: r,
89
+ label: n,
90
+ format: l,
91
+ labelKey: o,
92
+ renderer: a
32
93
  }) {
33
- var g, u;
34
- const s = (n ?? []).map((m, N) => {
35
- const v = m.payload && typeof m.payload == "object" ? m.payload : void 0;
94
+ var x, v;
95
+ const s = (r ?? []).map((m, b) => {
96
+ const w = m.payload && typeof m.payload == "object" ? m.payload : void 0;
36
97
  return {
37
- key: m.dataKey ?? N,
38
- name: m.name ?? m.dataKey ?? N,
98
+ key: m.dataKey ?? b,
99
+ name: m.name ?? m.dataKey ?? b,
39
100
  value: m.value,
40
101
  color: m.color,
41
- datum: v
102
+ datum: w
42
103
  };
43
- }), d = a ? (u = (g = s[0]) == null ? void 0 : g.datum) == null ? void 0 : u[a] : void 0, f = {
104
+ }), u = o ? (v = (x = s[0]) == null ? void 0 : x.datum) == null ? void 0 : v[o] : void 0, c = {
44
105
  active: !!t,
45
- label: typeof d == "string" || typeof d == "number" ? d : r,
106
+ label: typeof u == "string" || typeof u == "number" ? u : n,
46
107
  items: s,
47
- formatValue: i
108
+ formatValue: l
48
109
  };
49
- if (l) return /* @__PURE__ */ e(H, { children: l(f) });
50
- if (!f.active || !s.length) return null;
51
- const o = s.length === 1, p = f.label ?? (o ? s[0].name : void 0);
52
- return /* @__PURE__ */ y("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
53
- /* @__PURE__ */ e("div", { className: $("text-xs font-medium tracking-wide uppercase text-background/60", !o && "mb-1"), children: p }),
54
- s.map((m) => /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
55
- !o && /* @__PURE__ */ y(H, { children: [
110
+ if (a) return /* @__PURE__ */ e(V, { children: a(c) });
111
+ if (!c.active || !s.length) return null;
112
+ const f = s.length === 1, d = c.label ?? (f ? s[0].name : void 0);
113
+ return /* @__PURE__ */ N("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
114
+ /* @__PURE__ */ e("div", { className: $("text-xs font-normal tracking-wide uppercase text-background/60", !f && "mb-1"), children: d }),
115
+ s.map((m) => /* @__PURE__ */ N("div", { className: "flex items-center gap-1.5", children: [
116
+ !f && /* @__PURE__ */ N(V, { children: [
56
117
  /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: m.color } }),
57
118
  /* @__PURE__ */ e("span", { className: "text-background/70", children: m.name })
58
119
  ] }),
59
- /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof m.value == "number" ? i(m.value) : String(m.value ?? "") })
120
+ /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-normal tabular-nums", children: typeof m.value == "number" ? l(m.value) : String(m.value ?? "") })
60
121
  ] }, m.key))
61
122
  ] });
62
123
  }
63
- const Y = "pointer-events-none inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap";
64
- function Be({ viewBox: t, label: n, color: r, axis: i }) {
65
- const a = t ?? {};
66
- return i === "y" ? /* @__PURE__ */ e("foreignObject", { x: a.x ?? 0, y: (a.y ?? 0) - 10, width: a.width ?? 0, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: /* @__PURE__ */ e("span", { className: $(Y, T[r].pill), children: n }) }) }) : /* @__PURE__ */ e("foreignObject", { x: (a.x ?? 0) - 90, y: (a.y ?? 0) - 10, width: 180, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("span", { className: $(Y, T[r].pill), children: n }) }) });
124
+ const ue = "pointer-events-none inline-flex min-h-4 items-center rounded-full px-2 py-0.5 text-xs font-normal whitespace-nowrap";
125
+ function Pe({
126
+ viewBox: t,
127
+ label: r,
128
+ value: n,
129
+ color: l,
130
+ axis: o
131
+ }) {
132
+ const a = t ?? {}, s = /* @__PURE__ */ N("span", { className: $(ue, D[l].pill), children: [
133
+ r,
134
+ n != null && /* @__PURE__ */ e("span", { className: "ml-1 tabular-nums opacity-70", children: n })
135
+ ] });
136
+ return o === "y" ? /* @__PURE__ */ e("foreignObject", { x: a.x ?? 0, y: (a.y ?? 0) - 12, width: a.width ?? 0, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: s }) }) : /* @__PURE__ */ e("foreignObject", { x: (a.x ?? 0) - 90, y: (a.y ?? 0) - 12, width: 180, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: s }) });
67
137
  }
68
- function De({ viewBox: t, label: n, color: r }) {
69
- const i = t ?? {};
70
- return /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: i.y ?? 0, width: i.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: $(Y, T[r].pill), children: n }) }) });
138
+ function Ee({ viewBox: t, label: r, color: n }) {
139
+ const l = t ?? {};
140
+ return /* @__PURE__ */ e("foreignObject", { x: l.x ?? 0, y: l.y ?? 0, width: l.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: $(ue, D[n].pill), children: r }) }) });
71
141
  }
72
- function We({
142
+ function _e({
73
143
  cx: t,
74
- cy: n,
75
- n: r,
76
- ann: i,
77
- onEnter: a,
78
- onLeave: l
144
+ cy: r,
145
+ n,
146
+ ann: l,
147
+ onEnter: o,
148
+ onLeave: a
79
149
  }) {
80
- const [s, d] = k.useState(!1);
81
- if (t == null || n == null || !Number.isFinite(t) || !Number.isFinite(n)) return /* @__PURE__ */ e("g", {});
82
- const f = () => a({ ann: i, n: r, cx: t, cy: n }), o = () => l();
83
- return /* @__PURE__ */ y(
150
+ const [s, u] = k.useState(!1);
151
+ if (t == null || r == null || !Number.isFinite(t) || !Number.isFinite(r)) return /* @__PURE__ */ e("g", {});
152
+ const c = () => o({ ann: l, n, cx: t, cy: r }), f = () => a();
153
+ return /* @__PURE__ */ N(
84
154
  "g",
85
155
  {
86
156
  tabIndex: 0,
87
157
  role: "img",
88
- "aria-label": `Annotation ${r}: ${i.label}`,
158
+ "aria-label": `Annotation ${n}: ${l.label}`,
89
159
  className: "cursor-default outline-none [transform-box:fill-box] origin-center transition-transform ease-out [transition-duration:var(--duration-fast)] hover:scale-110 focus-visible:scale-110",
90
- onMouseEnter: f,
91
- onMouseLeave: o,
160
+ onMouseEnter: c,
161
+ onMouseLeave: f,
92
162
  onFocus: () => {
93
- d(!0), f();
163
+ u(!0), c();
94
164
  },
95
165
  onBlur: () => {
96
- d(!1), o();
166
+ u(!1), f();
97
167
  },
98
168
  children: [
99
- s && /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
100
- /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 10, fill: "var(--background)" }),
101
- /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 8, fill: T[i.color ?? "primary"].ref }),
169
+ s && /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
170
+ /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 10, fill: "var(--background)" }),
171
+ /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 8, fill: D[l.color ?? "primary"].ref }),
102
172
  /* @__PURE__ */ e(
103
173
  "text",
104
174
  {
105
175
  x: t,
106
- y: n,
176
+ y: r,
107
177
  dy: "0.35em",
108
178
  textAnchor: "middle",
109
- className: "pointer-events-none fill-brand-foreground text-xs font-bold select-none",
110
- children: r
179
+ className: "pointer-events-none fill-brand-foreground text-xs font-semibold select-none",
180
+ children: n
111
181
  }
112
182
  )
113
183
  ]
114
184
  }
115
185
  );
116
186
  }
117
- function Ie({ hovered: t, frameWidth: n, format: r }) {
118
- return /* @__PURE__ */ e(Le, { reducedMotion: "user", children: /* @__PURE__ */ e(Oe, { children: t && /* @__PURE__ */ e(
187
+ function Ge({ hovered: t, frameWidth: r, format: n }) {
188
+ return /* @__PURE__ */ e(Be, { reducedMotion: "user", children: /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ e(
119
189
  "div",
120
190
  {
121
191
  className: "pointer-events-none absolute z-10",
122
192
  style: {
123
- left: Math.max(96, Math.min(t.cx, Math.max(n - 96, 96))),
193
+ left: Math.max(96, Math.min(t.cx, Math.max(r - 96, 96))),
124
194
  top: t.cy - 16
125
195
  },
126
- children: /* @__PURE__ */ y(
127
- Se.div,
196
+ children: /* @__PURE__ */ N(
197
+ We.div,
128
198
  {
129
- variants: Te,
199
+ variants: je,
130
200
  initial: "hidden",
131
201
  animate: "visible",
132
202
  exit: "hidden",
133
203
  className: "w-max max-w-60 -translate-x-1/2 -translate-y-full origin-bottom rounded-lg bg-elevated p-3 shadow-elevation",
134
204
  children: [
135
- /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
205
+ /* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
136
206
  /* @__PURE__ */ e(
137
207
  "span",
138
208
  {
139
209
  "aria-hidden": !0,
140
- className: "flex size-4.5 shrink-0 items-center justify-center rounded-full text-xs font-bold text-brand-foreground",
141
- style: { background: T[t.ann.color ?? "primary"].ref },
210
+ className: "flex size-4.5 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-brand-foreground",
211
+ style: { background: D[t.ann.color ?? "primary"].ref },
142
212
  children: t.n
143
213
  }
144
214
  ),
145
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-foreground", children: t.ann.label })
215
+ /* @__PURE__ */ e("span", { className: "text-xs font-normal text-foreground", children: t.ann.label })
146
216
  ] }),
147
217
  t.ann.description && /* @__PURE__ */ e("p", { className: "mt-1.5 text-xs leading-relaxed text-secondary", children: t.ann.description }),
148
- /* @__PURE__ */ y("div", { className: "mt-1.5 text-xs font-medium tracking-wide uppercase text-tertiary tabular-nums", children: [
218
+ /* @__PURE__ */ N("div", { className: "mt-1.5 text-xs font-normal tracking-wide uppercase text-tertiary tabular-nums", children: [
149
219
  t.ann.x,
150
220
  " · ",
151
- r(t.ann.y)
221
+ n(t.ann.y)
152
222
  ] })
153
223
  ]
154
224
  }
@@ -156,245 +226,303 @@ function Ie({ hovered: t, frameWidth: n, format: r }) {
156
226
  }
157
227
  ) }) });
158
228
  }
159
- function se(t) {
160
- const [n, r] = k.useState(null), i = k.useCallback(() => r(null), []), { back: a, front: l } = k.useMemo(() => {
161
- const s = [], d = [];
229
+ function me(t, r) {
230
+ const [n, l] = k.useState(null), o = k.useCallback(() => l(null), []), { back: a, front: s } = k.useMemo(() => {
231
+ const u = [], c = [];
162
232
  let f = 0;
163
- return (t ?? []).forEach((o, p) => {
164
- const g = o.color ?? "primary";
165
- if (o.kind === "band") {
166
- const u = o.axis ?? "y";
167
- s.push(
233
+ return (t ?? []).forEach((d, x) => {
234
+ const v = d.color ?? "primary";
235
+ if (d.kind === "band") {
236
+ const m = d.axis ?? "y";
237
+ u.push(
168
238
  /* @__PURE__ */ e(
169
- $e,
239
+ Oe,
170
240
  {
171
- ...u === "y" ? { y1: o.from, y2: o.to } : { x1: o.from, x2: o.to },
172
- fill: T[g].ref,
241
+ ...m === "y" ? { y1: d.from, y2: d.to } : { x1: d.from, x2: d.to },
242
+ fill: D[v].ref,
173
243
  fillOpacity: 0.06,
174
244
  stroke: "none",
175
- ifOverflow: u === "y" ? "extendDomain" : "visible",
176
- label: o.label ? /* @__PURE__ */ e(De, { label: o.label, color: g }) : void 0
245
+ ifOverflow: m === "y" ? "extendDomain" : "visible",
246
+ label: d.label ? /* @__PURE__ */ e(Ee, { label: d.label, color: v }) : void 0
177
247
  },
178
- `ann-${p}`
248
+ `ann-${x}`
179
249
  )
180
250
  );
181
- } else if (o.kind === "line") {
182
- const u = o.axis ?? "y";
183
- d.push(
251
+ } else if (d.kind === "line") {
252
+ const m = d.axis ?? "y";
253
+ c.push(
184
254
  /* @__PURE__ */ e(
185
- Fe,
255
+ Te,
186
256
  {
187
- ...u === "y" ? { y: o.value } : { x: o.value },
188
- stroke: T[g].ref,
257
+ ...m === "y" ? { y: d.value } : { x: d.value },
258
+ stroke: D[v].ref,
189
259
  strokeWidth: 1,
190
260
  strokeDasharray: "4 4",
191
- ifOverflow: u === "y" ? "extendDomain" : "visible",
192
- label: o.label ? /* @__PURE__ */ e(Be, { label: o.label, color: g, axis: u }) : void 0
261
+ ifOverflow: m === "y" ? "extendDomain" : "visible",
262
+ label: d.label ? /* @__PURE__ */ e(
263
+ Pe,
264
+ {
265
+ label: d.label,
266
+ value: typeof d.value == "number" ? r(d.value) : String(d.value),
267
+ color: v,
268
+ axis: m
269
+ }
270
+ ) : void 0
193
271
  },
194
- `ann-${p}`
272
+ `ann-${x}`
195
273
  )
196
274
  );
197
275
  } else {
198
276
  f += 1;
199
- const u = f;
200
- d.push(
277
+ const m = f;
278
+ c.push(
201
279
  /* @__PURE__ */ e(
202
- Me,
280
+ Ie,
203
281
  {
204
- x: o.x,
205
- y: o.y,
282
+ x: d.x,
283
+ y: d.y,
206
284
  ifOverflow: "visible",
207
- shape: (m) => /* @__PURE__ */ e(We, { cx: m.cx, cy: m.cy, n: u, ann: o, onEnter: r, onLeave: i })
285
+ shape: (b) => /* @__PURE__ */ e(_e, { cx: b.cx, cy: b.cy, n: m, ann: d, onEnter: l, onLeave: o })
208
286
  },
209
- `ann-${p}`
287
+ `ann-${x}`
210
288
  )
211
289
  );
212
290
  }
213
- }), { back: s, front: d };
214
- }, [t, i]);
215
- return { back: a, front: l, hovered: n };
291
+ }), { back: u, front: c };
292
+ }, [t, r, o]);
293
+ return { back: a, front: s, hovered: n };
216
294
  }
217
- function _({
295
+ function G({
218
296
  items: t,
219
- align: n = "end",
220
- className: r
297
+ align: r = "end",
298
+ className: n
221
299
  }) {
222
- const i = {
300
+ const l = {
223
301
  start: "justify-start",
224
302
  center: "justify-center",
225
303
  end: "justify-end"
226
- }[n];
227
- return /* @__PURE__ */ e("div", { className: $("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", i, r), children: t.map((a) => /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5 text-xs text-secondary", children: [
228
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: a.color } }),
229
- a.label
230
- ] }, a.label)) });
304
+ }[r];
305
+ return /* @__PURE__ */ e("div", { className: $("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", l, n), children: t.map((o) => /* @__PURE__ */ N("span", { className: "inline-flex items-center gap-1.5 text-xs text-secondary", children: [
306
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: o.color } }),
307
+ o.label
308
+ ] }, o.label)) });
231
309
  }
232
310
  const W = k.forwardRef(
233
- ({ className: t, height: n, legendItems: r, hovered: i, format: a, children: l, ...s }, d) => {
234
- var p;
235
- const f = k.useRef(null);
236
- return /* @__PURE__ */ y("div", { ref: (g) => {
237
- f.current = g, typeof d == "function" ? d(g) : d && (d.current = g);
311
+ ({ className: t, height: r, legendItems: n, hovered: l, format: o, children: a, ...s }, u) => {
312
+ var d;
313
+ const c = k.useRef(null);
314
+ return /* @__PURE__ */ N("div", { ref: (x) => {
315
+ c.current = x, typeof u == "function" ? u(x) : u && (u.current = x);
238
316
  }, className: $("relative w-full font-sans", t), ...s, children: [
239
- r && /* @__PURE__ */ e(_, { items: r }),
240
- /* @__PURE__ */ e(I, { width: "100%", height: n, children: l }),
241
- /* @__PURE__ */ e(Ie, { hovered: i, frameWidth: ((p = f.current) == null ? void 0 : p.clientWidth) ?? 0, format: a })
317
+ n && /* @__PURE__ */ e(G, { items: n }),
318
+ /* @__PURE__ */ e(j, { width: "100%", height: Math.max(r, T), children: a }),
319
+ /* @__PURE__ */ e(Ge, { hovered: l, frameWidth: ((d = c.current) == null ? void 0 : d.clientWidth) ?? 0, format: o })
242
320
  ] });
243
321
  }
244
322
  );
245
323
  W.displayName = "ChartFrame";
246
- function G(t) {
324
+ function H(t) {
247
325
  const {
248
- data: n,
249
- categoryKey: r,
250
- series: i,
251
- seriesLabels: a,
252
- highlight: l,
326
+ data: r,
327
+ categoryKey: n,
328
+ series: l,
329
+ seriesLabels: o,
330
+ highlight: a,
253
331
  annotations: s,
254
- grid: d = !0,
255
- legend: f,
256
- showYAxis: o = !0,
257
- formatValue: p,
258
- xScale: g = "category",
259
- xDomain: u,
332
+ grid: u = !1,
333
+ legend: c,
334
+ showYAxis: f = !0,
335
+ formatValue: d,
336
+ xScale: x = "category",
337
+ xDomain: v,
260
338
  yDomain: m,
261
- xTickFormatter: N,
262
- yTickFormatter: v,
263
- yAxisWidth: c = 44
264
- } = t, x = k.useMemo(() => i ?? le(n, r), [i, n, r]), h = p ?? L, A = v ?? ((C) => typeof C == "number" ? h(C) : C), F = se(s), w = (C, D) => l && x.includes(l) ? C === l ? "var(--color-chart-1)" : Q : E(D), R = (C) => (a == null ? void 0 : a[C]) ?? C, b = f ?? x.length > 1 ? x.map((C, D) => ({ label: R(C), color: w(C, D) })) : null;
265
- return { names: x, format: h, layers: F, legendItems: b, furniture: [
266
- d ? /* @__PURE__ */ e(X, { vertical: !1, stroke: "var(--border)" }, "grid") : null,
339
+ xTickFormatter: b,
340
+ yTickFormatter: w,
341
+ yAxisWidth: A = 44
342
+ } = t, p = k.useMemo(() => l ?? ce(r, n), [l, r, n]), i = d ?? F, h = w ?? ((M) => typeof M == "number" ? i(M) : M), y = me(s, i), C = (M, B) => a && p.includes(a) ? M === a ? "var(--color-chart-1)" : Q : _(B), R = (M) => (o == null ? void 0 : o[M]) ?? M, g = c ?? p.length > 1 ? p.map((M, B) => ({ label: R(M), color: C(M, B) })) : null;
343
+ return { names: p, format: i, layers: y, legendItems: g, furniture: [
344
+ /* Gridlines one step below the border token — guides, not content. */
345
+ u ? /* @__PURE__ */ e(X, { vertical: !1, stroke: "var(--chart-grid)" }, "grid") : null,
267
346
  /* @__PURE__ */ e(
268
347
  Z,
269
348
  {
270
- dataKey: r,
271
- type: g === "time" ? "number" : "category",
272
- scale: g === "time" ? "time" : "auto",
273
- domain: g === "time" ? u ?? ["dataMin", "dataMax"] : u,
274
- allowDataOverflow: !!u,
275
- axisLine: !1,
349
+ dataKey: n,
350
+ type: x === "time" ? "number" : "category",
351
+ scale: x === "time" ? "time" : "auto",
352
+ domain: x === "time" ? v ?? ["dataMin", "dataMax"] : v,
353
+ allowDataOverflow: !!v,
354
+ axisLine: { stroke: "var(--chart-axis)" },
276
355
  tickLine: !1,
277
356
  minTickGap: 28,
278
- tickMargin: 10,
279
- tick: /* @__PURE__ */ e(B, { anchor: "middle", dy: 0, format: N })
357
+ tickMargin: 24,
358
+ padding: { left: 16, right: 16 },
359
+ height: 40,
360
+ tick: /* @__PURE__ */ e(I, { anchor: "middle", dy: 0, format: b })
280
361
  },
281
362
  "x"
282
363
  ),
283
- o ? /* @__PURE__ */ e(
284
- z,
364
+ f ? /* @__PURE__ */ e(
365
+ E,
285
366
  {
286
- width: c,
367
+ width: A,
287
368
  domain: m,
288
369
  allowDataOverflow: !!m,
289
- axisLine: !1,
370
+ axisLine: { stroke: "var(--chart-axis)" },
290
371
  tickLine: !1,
291
- tickMargin: 6,
292
- tick: /* @__PURE__ */ e(B, { anchor: "end", dy: "0.32em", format: A })
372
+ tickMargin: 12,
373
+ tick: /* @__PURE__ */ e(I, { anchor: "end", dy: "0.32em", format: h })
293
374
  },
294
375
  "y"
295
376
  ) : null
296
- ], colorFor: w, labelFor: R };
377
+ ], colorFor: C, labelFor: R };
297
378
  }
298
- const j = { top: 20, right: 12, bottom: 4, left: 0 }, je = k.forwardRef(
299
- ({ height: t = 280, curve: n = "natural", forecastKeys: r, className: i, ...a }, l) => {
300
- const { names: s, format: d, layers: f, legendItems: o, furniture: p, colorFor: g, labelFor: u } = G(a);
301
- return /* @__PURE__ */ e(W, { ref: l, className: i, height: t, legendItems: o, hovered: f.hovered, format: d, children: /* @__PURE__ */ y(me, { data: a.data, margin: j, children: [
302
- p,
303
- a.tooltip !== !1 && /* @__PURE__ */ e(
304
- O,
305
- {
306
- content: /* @__PURE__ */ e(
379
+ const T = 300, z = { top: 24, right: 12, bottom: 8, left: 0 };
380
+ function J(t, r, n, l) {
381
+ if (l === !0) return new Set(t);
382
+ if (l === !1) return /* @__PURE__ */ new Set();
383
+ if (n && t.includes(n)) {
384
+ const a = (r ?? []).filter((s) => s !== n);
385
+ return /* @__PURE__ */ new Set([n, ...a]);
386
+ }
387
+ return t.filter((a) => !(r != null && r.includes(a))).length === 1 ? new Set(t) : /* @__PURE__ */ new Set();
388
+ }
389
+ function fe(t, r, n) {
390
+ return k.useCallback(
391
+ (l, o) => {
392
+ if (!(r != null && r.includes(l))) return n(l, o);
393
+ const a = t.filter((u) => !r.includes(u)), s = a[r.indexOf(l)] ?? a[0];
394
+ return s ? n(s, t.indexOf(s)) : n(l, o);
395
+ },
396
+ [t, r, n]
397
+ );
398
+ }
399
+ const He = k.forwardRef(
400
+ // Straight segments by default: the house line is a solid stroke with a DOT
401
+ // at every observation — the data points are visible, the path connects them
402
+ // without inventing values between them.
403
+ // A smooth curve invents values between observations; opt back in with
404
+ // `curve="natural"` when the interpolation is the point.
405
+ ({ height: t = T, curve: r = "linear", forecastKeys: n, showValues: l, className: o, ...a }, s) => {
406
+ const { names: u, format: c, layers: f, legendItems: d, furniture: x, colorFor: v, labelFor: m } = H(a), b = fe(u, n, v), w = J(u, n, a.highlight, l), [A, p] = k.useState(null);
407
+ return /* @__PURE__ */ e(W, { ref: s, className: o, height: t, legendItems: d, hovered: f.hovered, format: c, children: /* @__PURE__ */ N(
408
+ ve,
409
+ {
410
+ data: a.data,
411
+ margin: z,
412
+ onMouseMove: (i) => p((i == null ? void 0 : i.activeTooltipIndex) ?? null),
413
+ onMouseLeave: () => p(null),
414
+ children: [
415
+ x,
416
+ a.tooltip !== !1 && /* @__PURE__ */ e(
307
417
  S,
308
418
  {
309
- format: d,
310
- renderer: a.tooltip
419
+ content: /* @__PURE__ */ e(
420
+ O,
421
+ {
422
+ format: c,
423
+ renderer: a.tooltip
424
+ }
425
+ ),
426
+ cursor: { stroke: "var(--border-strong)" },
427
+ isAnimationActive: !1
311
428
  }
312
429
  ),
313
- cursor: { stroke: "var(--border-strong)" },
314
- isAnimationActive: !1
315
- }
316
- ),
317
- f.back,
318
- s.map((m, N) => /* @__PURE__ */ e(
319
- re,
320
- {
321
- dataKey: m,
322
- name: u(m),
323
- type: n,
324
- stroke: g(m, N),
325
- strokeWidth: 2,
326
- strokeDasharray: r != null && r.includes(m) ? "6 4" : void 0,
327
- dot: !1,
328
- activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
329
- isAnimationActive: !1
330
- },
331
- m
332
- )),
333
- f.front
334
- ] }) });
430
+ f.back,
431
+ u.map((i, h) => /* @__PURE__ */ e(
432
+ ie,
433
+ {
434
+ dataKey: i,
435
+ name: m(i),
436
+ type: r,
437
+ stroke: b(i, h),
438
+ strokeWidth: 1.5,
439
+ strokeDasharray: n != null && n.includes(i) ? "6 4" : void 0,
440
+ dot: { r: 3, fill: b(i, h), strokeWidth: 0 },
441
+ activeDot: /* @__PURE__ */ e(q, { fill: b(i, h) }),
442
+ label: w.has(i) ? /* @__PURE__ */ e(de, { format: c, hidden: A != null }) : void 0,
443
+ isAnimationActive: !1
444
+ },
445
+ i
446
+ )),
447
+ f.front
448
+ ]
449
+ }
450
+ ) });
335
451
  }
336
452
  );
337
- je.displayName = "LineChart";
338
- const Pe = k.forwardRef(
339
- ({ height: t = 280, curve: n = "natural", stacked: r = !1, forecastKeys: i, className: a, ...l }, s) => {
340
- const { names: d, format: f, layers: o, legendItems: p, furniture: g, colorFor: u, labelFor: m } = G(l), N = k.useId().replace(/[^a-zA-Z0-9]/g, "");
341
- return /* @__PURE__ */ e(W, { ref: s, className: a, height: t, legendItems: p, hovered: o.hovered, format: f, children: /* @__PURE__ */ y(fe, { data: l.data, margin: j, children: [
342
- /* @__PURE__ */ e("defs", { children: d.map((v, c) => /* @__PURE__ */ y("linearGradient", { id: `${N}-${c}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
343
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: u(v, c), stopOpacity: 0.18 }),
344
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: u(v, c), stopOpacity: 0.02 })
345
- ] }, v)) }),
346
- g,
347
- l.tooltip !== !1 && /* @__PURE__ */ e(
348
- O,
349
- {
350
- content: /* @__PURE__ */ e(
453
+ He.displayName = "LineChart";
454
+ const Ue = k.forwardRef(
455
+ ({ height: t = T, curve: r = "linear", stacked: n = !1, forecastKeys: l, showValues: o, className: a, ...s }, u) => {
456
+ const { names: c, format: f, layers: d, legendItems: x, furniture: v, colorFor: m, labelFor: b } = H(s), w = fe(c, l, m), A = n ? /* @__PURE__ */ new Set() : J(c, l, s.highlight, o), [p, i] = k.useState(null), h = k.useId().replace(/[^a-zA-Z0-9]/g, "");
457
+ return /* @__PURE__ */ e(W, { ref: u, className: a, height: t, legendItems: x, hovered: d.hovered, format: f, children: /* @__PURE__ */ N(
458
+ be,
459
+ {
460
+ data: s.data,
461
+ margin: z,
462
+ onMouseMove: (y) => i((y == null ? void 0 : y.activeTooltipIndex) ?? null),
463
+ onMouseLeave: () => i(null),
464
+ children: [
465
+ /* @__PURE__ */ e("defs", { children: c.map((y, C) => /* @__PURE__ */ N("linearGradient", { id: `${h}-${C}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
466
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: m(y, C), stopOpacity: 0.18 }),
467
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: m(y, C), stopOpacity: 0.02 })
468
+ ] }, y)) }),
469
+ v,
470
+ s.tooltip !== !1 && /* @__PURE__ */ e(
351
471
  S,
352
472
  {
353
- format: f,
354
- renderer: l.tooltip
473
+ content: /* @__PURE__ */ e(
474
+ O,
475
+ {
476
+ format: f,
477
+ renderer: s.tooltip
478
+ }
479
+ ),
480
+ cursor: { stroke: "var(--border-strong)" },
481
+ isAnimationActive: !1
355
482
  }
356
483
  ),
357
- cursor: { stroke: "var(--border-strong)" },
358
- isAnimationActive: !1
359
- }
360
- ),
361
- o.back,
362
- d.map((v, c) => /* @__PURE__ */ e(
363
- ue,
364
- {
365
- dataKey: v,
366
- name: m(v),
367
- type: n,
368
- stackId: r ? "stack" : void 0,
369
- stroke: u(v, c),
370
- strokeWidth: 2,
371
- strokeDasharray: i != null && i.includes(v) ? "6 4" : void 0,
372
- fill: `url(#${N}-${c})`,
373
- activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
374
- isAnimationActive: !1
375
- },
376
- v
377
- )),
378
- o.front
379
- ] }) });
484
+ d.back,
485
+ c.map((y, C) => /* @__PURE__ */ e(
486
+ ge,
487
+ {
488
+ dataKey: y,
489
+ name: b(y),
490
+ type: r,
491
+ stackId: n ? "stack" : void 0,
492
+ stroke: w(y, C),
493
+ strokeWidth: 1.5,
494
+ strokeDasharray: l != null && l.includes(y) ? "6 4" : void 0,
495
+ fill: `url(#${h}-${C})`,
496
+ dot: { r: 3, fill: m(y, C), strokeWidth: 0 },
497
+ activeDot: /* @__PURE__ */ e(q, { fill: w(y, C) }),
498
+ label: A.has(y) ? /* @__PURE__ */ e(de, { format: f, hidden: p != null }) : void 0,
499
+ isAnimationActive: !1
500
+ },
501
+ y
502
+ )),
503
+ d.front
504
+ ]
505
+ }
506
+ ) });
380
507
  }
381
508
  );
382
- Pe.displayName = "AreaChart";
383
- const ze = k.forwardRef(
509
+ Ue.displayName = "AreaChart";
510
+ const Ve = k.forwardRef(
384
511
  ({
385
- height: t = 280,
386
- stacked: n = !1,
387
- layout: r = "vertical",
388
- className: i,
512
+ height: t = T,
513
+ stacked: r = !1,
514
+ layout: n = "vertical",
515
+ showValues: l,
516
+ className: o,
389
517
  ...a
390
- }, l) => {
391
- const { names: s, format: d, layers: f, legendItems: o, furniture: p, colorFor: g, labelFor: u } = G(a), m = r === "horizontal", N = a.xTickFormatter ?? ((x) => typeof x == "number" ? d(x) : x), v = [
518
+ }, s) => {
519
+ const { names: u, format: c, layers: f, legendItems: d, furniture: x, colorFor: v, labelFor: m } = H(a), b = n === "horizontal", w = r ? /* @__PURE__ */ new Set() : J(u, void 0, a.highlight, l), A = a.xTickFormatter ?? ((h) => typeof h == "number" ? c(h) : h), p = [
392
520
  a.grid !== !1 ? /* @__PURE__ */ e(
393
521
  X,
394
522
  {
395
523
  horizontal: !1,
396
524
  vertical: !0,
397
- stroke: "var(--border)"
525
+ stroke: "var(--chart-grid)"
398
526
  },
399
527
  "grid"
400
528
  ) : null,
@@ -408,12 +536,12 @@ const ze = k.forwardRef(
408
536
  tickLine: !1,
409
537
  minTickGap: 28,
410
538
  tickMargin: 10,
411
- tick: /* @__PURE__ */ e(B, { anchor: "middle", dy: 0, format: N })
539
+ tick: /* @__PURE__ */ e(I, { anchor: "middle", dy: 0, format: A })
412
540
  },
413
541
  "x"
414
542
  ),
415
543
  a.showYAxis !== !1 ? /* @__PURE__ */ e(
416
- z,
544
+ E,
417
545
  {
418
546
  type: "category",
419
547
  dataKey: a.categoryKey,
@@ -422,7 +550,7 @@ const ze = k.forwardRef(
422
550
  tickLine: !1,
423
551
  tickMargin: 6,
424
552
  tick: /* @__PURE__ */ e(
425
- B,
553
+ I,
426
554
  {
427
555
  anchor: "end",
428
556
  dy: "0.32em",
@@ -432,23 +560,23 @@ const ze = k.forwardRef(
432
560
  },
433
561
  "y"
434
562
  ) : null
435
- ], c = a.highlight && s.length === 1 && !s.includes(a.highlight) ? a.highlight : null;
436
- return /* @__PURE__ */ e(W, { ref: l, className: i, height: t, legendItems: o, hovered: f.hovered, format: d, children: /* @__PURE__ */ y(
437
- he,
563
+ ], i = a.highlight && u.length === 1 && !u.includes(a.highlight) ? a.highlight : null;
564
+ return /* @__PURE__ */ e(W, { ref: s, className: o, height: t, legendItems: d, hovered: f.hovered, format: c, children: /* @__PURE__ */ N(
565
+ pe,
438
566
  {
439
567
  data: a.data,
440
- layout: m ? "vertical" : "horizontal",
441
- margin: j,
568
+ layout: b ? "vertical" : "horizontal",
569
+ margin: z,
442
570
  barCategoryGap: "24%",
443
571
  children: [
444
- m ? v : p,
572
+ b ? p : x,
445
573
  a.tooltip !== !1 && /* @__PURE__ */ e(
446
- O,
574
+ S,
447
575
  {
448
576
  content: /* @__PURE__ */ e(
449
- S,
577
+ O,
450
578
  {
451
- format: d,
579
+ format: c,
452
580
  renderer: a.tooltip
453
581
  }
454
582
  ),
@@ -457,27 +585,28 @@ const ze = k.forwardRef(
457
585
  }
458
586
  ),
459
587
  f.back,
460
- s.map((x, h) => {
461
- const A = n ? h === s.length - 1 : !0, F = m ? [0, 4, 4, 0] : [4, 4, 0, 0];
588
+ u.map((h, y) => {
589
+ const C = r ? y === u.length - 1 : !0, R = b ? [0, 4, 4, 0] : [4, 4, 0, 0];
462
590
  return /* @__PURE__ */ e(
463
- ne,
591
+ le,
464
592
  {
465
- dataKey: x,
466
- name: u(x),
467
- stackId: n ? "stack" : void 0,
468
- fill: g(x, h),
469
- radius: A ? F : 0,
593
+ dataKey: h,
594
+ name: m(h),
595
+ stackId: r ? "stack" : void 0,
596
+ fill: v(h, y),
597
+ radius: C ? R : 0,
470
598
  maxBarSize: 48,
599
+ label: w.has(h) ? /* @__PURE__ */ e(ze, { format: c, horizontal: b }) : void 0,
471
600
  isAnimationActive: !1,
472
- children: c && a.data.map((w) => /* @__PURE__ */ e(
473
- ie,
601
+ children: i && a.data.map((g) => /* @__PURE__ */ e(
602
+ oe,
474
603
  {
475
- fill: w[a.categoryKey] === c ? "var(--color-chart-1)" : Q
604
+ fill: g[a.categoryKey] === i ? "var(--color-chart-1)" : Q
476
605
  },
477
- String(w[a.categoryKey])
606
+ String(g[a.categoryKey])
478
607
  ))
479
608
  },
480
- x
609
+ h
481
610
  );
482
611
  }),
483
612
  f.front
@@ -486,14 +615,17 @@ const ze = k.forwardRef(
486
615
  ) });
487
616
  }
488
617
  );
489
- ze.displayName = "BarChart";
490
- const ce = k.forwardRef(
491
- ({ height: t = 280, lineKeys: n, dualAxis: r = !1, stacked: i = !1, forecastKeys: a, className: l, ...s }, d) => {
492
- const { names: f, format: o, layers: p, legendItems: g, furniture: u, colorFor: m, labelFor: N } = G(s), v = f.filter((c) => !n.includes(c));
493
- return /* @__PURE__ */ e(W, { ref: d, className: l, height: t, legendItems: g, hovered: p.hovered, format: o, children: /* @__PURE__ */ y(xe, { data: s.data, margin: j, barCategoryGap: "24%", children: [
494
- u,
495
- r && /* @__PURE__ */ e(
496
- z,
618
+ Ve.displayName = "BarChart";
619
+ const he = k.forwardRef(
620
+ ({ height: t = T, lineKeys: r, dualAxis: n = !1, stacked: l = !1, forecastKeys: o, className: a, ...s }, u) => {
621
+ const { names: c, format: f, layers: d, furniture: x, colorFor: v, labelFor: m } = H(s), b = c.filter((i) => !r.includes(i)), w = (i, h) => r.length ? "var(--chart-axis)" : v(i, h), A = (i, h) => r.length ? "var(--color-chart-1)" : v(i, h), p = c.length > 1 ? [
622
+ ...b.map((i) => ({ label: m(i), color: w(i, c.indexOf(i)) })),
623
+ ...r.map((i) => ({ label: m(i), color: A(i, c.indexOf(i)) }))
624
+ ] : null;
625
+ return /* @__PURE__ */ e(W, { ref: u, className: a, height: t, legendItems: p, hovered: d.hovered, format: f, children: /* @__PURE__ */ N(Ne, { data: s.data, margin: z, barCategoryGap: "24%", children: [
626
+ x,
627
+ n && /* @__PURE__ */ e(
628
+ E,
497
629
  {
498
630
  yAxisId: "right",
499
631
  orientation: "right",
@@ -502,22 +634,22 @@ const ce = k.forwardRef(
502
634
  tickLine: !1,
503
635
  tickMargin: 6,
504
636
  tick: /* @__PURE__ */ e(
505
- B,
637
+ I,
506
638
  {
507
639
  anchor: "start",
508
640
  dy: "0.32em",
509
- format: (c) => typeof c == "number" ? o(c) : c
641
+ format: (i) => typeof i == "number" ? f(i) : i
510
642
  }
511
643
  )
512
644
  }
513
645
  ),
514
646
  s.tooltip !== !1 && /* @__PURE__ */ e(
515
- O,
647
+ S,
516
648
  {
517
649
  content: /* @__PURE__ */ e(
518
- S,
650
+ O,
519
651
  {
520
- format: o,
652
+ format: f,
521
653
  renderer: s.tooltip
522
654
  }
523
655
  ),
@@ -525,121 +657,121 @@ const ce = k.forwardRef(
525
657
  isAnimationActive: !1
526
658
  }
527
659
  ),
528
- p.back,
529
- v.map((c) => {
530
- const x = f.indexOf(c), h = i ? c === v[v.length - 1] : !0;
660
+ d.back,
661
+ b.map((i) => {
662
+ const h = c.indexOf(i), y = l ? i === b[b.length - 1] : !0;
531
663
  return /* @__PURE__ */ e(
532
- ne,
664
+ le,
533
665
  {
534
- dataKey: c,
535
- name: N(c),
536
- stackId: i ? "stack" : void 0,
537
- fill: m(c, x),
538
- radius: h ? [4, 4, 0, 0] : 0,
666
+ dataKey: i,
667
+ name: m(i),
668
+ stackId: l ? "stack" : void 0,
669
+ fill: w(i, h),
670
+ radius: y ? [4, 4, 0, 0] : 0,
539
671
  maxBarSize: 48,
540
672
  isAnimationActive: !1
541
673
  },
542
- c
674
+ i
543
675
  );
544
676
  }),
545
- n.map((c) => {
546
- const x = f.indexOf(c);
677
+ r.map((i) => {
678
+ const h = c.indexOf(i);
547
679
  return /* @__PURE__ */ e(
548
- re,
680
+ ie,
549
681
  {
550
- dataKey: c,
551
- name: N(c),
552
- yAxisId: r ? "right" : void 0,
553
- type: "natural",
554
- stroke: m(c, x),
682
+ dataKey: i,
683
+ name: m(i),
684
+ yAxisId: n ? "right" : void 0,
685
+ type: "linear",
686
+ stroke: A(i, h),
555
687
  strokeWidth: 2,
556
- strokeDasharray: a != null && a.includes(c) ? "6 4" : void 0,
557
- dot: !1,
558
- activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
688
+ strokeDasharray: o != null && o.includes(i) ? "6 4" : void 0,
689
+ dot: { r: 3, fill: A(i, h), strokeWidth: 0 },
690
+ activeDot: /* @__PURE__ */ e(q, { fill: A(i, h) }),
559
691
  isAnimationActive: !1
560
692
  },
561
- c
693
+ i
562
694
  );
563
695
  }),
564
- p.front
696
+ d.front
565
697
  ] }) });
566
698
  }
567
699
  );
568
- ce.displayName = "ComboChart";
569
- const Ee = k.forwardRef(
570
- (t, n) => /* @__PURE__ */ e(ce, { ref: n, ...t })
700
+ he.displayName = "ComboChart";
701
+ const Ye = k.forwardRef(
702
+ (t, r) => /* @__PURE__ */ e(he, { ref: r, ...t })
571
703
  );
572
- Ee.displayName = "ComposedChart";
573
- const _e = k.forwardRef(
704
+ Ye.displayName = "ComposedChart";
705
+ const Xe = k.forwardRef(
574
706
  ({
575
707
  data: t,
576
- xKey: n,
577
- yKey: r,
578
- labelKey: i,
579
- annotations: a,
580
- height: l = 280,
581
- grid: s = !0,
582
- showYAxis: d = !0,
583
- formatValue: f,
584
- xScale: o = "number",
585
- xDomain: p,
586
- yDomain: g,
587
- xTickFormatter: u,
708
+ xKey: r,
709
+ yKey: n,
710
+ labelKey: l,
711
+ annotations: o,
712
+ height: a = T,
713
+ grid: s = !1,
714
+ showYAxis: u = !0,
715
+ formatValue: c,
716
+ xScale: f = "number",
717
+ xDomain: d,
718
+ yDomain: x,
719
+ xTickFormatter: v,
588
720
  yTickFormatter: m,
589
- yAxisWidth: N = 44,
590
- tooltip: v,
591
- className: c
592
- }, x) => {
593
- const h = f ?? L, A = u ?? ((R) => typeof R == "number" ? L(R) : R), F = m ?? ((R) => typeof R == "number" ? h(R) : R), w = se(a);
594
- return /* @__PURE__ */ e(W, { ref: x, className: c, height: l, legendItems: null, hovered: w.hovered, format: h, children: /* @__PURE__ */ y(ve, { margin: j, children: [
595
- s && /* @__PURE__ */ e(X, { vertical: !1, stroke: "var(--border)" }),
721
+ yAxisWidth: b = 44,
722
+ tooltip: w,
723
+ className: A
724
+ }, p) => {
725
+ const i = c ?? F, h = v ?? ((R) => typeof R == "number" ? F(R) : R), y = m ?? ((R) => typeof R == "number" ? i(R) : R), C = me(o, i);
726
+ return /* @__PURE__ */ e(W, { ref: p, className: A, height: a, legendItems: null, hovered: C.hovered, format: i, children: /* @__PURE__ */ N(we, { margin: z, children: [
727
+ s && /* @__PURE__ */ e(X, { vertical: !1, stroke: "var(--chart-grid)" }),
596
728
  /* @__PURE__ */ e(
597
729
  Z,
598
730
  {
599
731
  type: "number",
600
- dataKey: n,
601
- scale: o === "time" ? "time" : "auto",
602
- domain: p ?? (o === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
603
- allowDataOverflow: !!p,
732
+ dataKey: r,
733
+ scale: f === "time" ? "time" : "auto",
734
+ domain: d ?? (f === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
735
+ allowDataOverflow: !!d,
604
736
  axisLine: !1,
605
737
  tickLine: !1,
606
738
  minTickGap: 28,
607
739
  tickMargin: 10,
608
- tick: /* @__PURE__ */ e(B, { anchor: "middle", dy: 0, format: A })
740
+ tick: /* @__PURE__ */ e(I, { anchor: "middle", dy: 0, format: h })
609
741
  }
610
742
  ),
611
- d && /* @__PURE__ */ e(
612
- z,
743
+ u && /* @__PURE__ */ e(
744
+ E,
613
745
  {
614
746
  type: "number",
615
- dataKey: r,
616
- width: N,
617
- domain: g,
618
- allowDataOverflow: !!g,
747
+ dataKey: n,
748
+ width: b,
749
+ domain: x,
750
+ allowDataOverflow: !!x,
619
751
  axisLine: !1,
620
752
  tickLine: !1,
621
753
  tickMargin: 6,
622
- tick: /* @__PURE__ */ e(B, { anchor: "end", dy: "0.32em", format: F })
754
+ tick: /* @__PURE__ */ e(I, { anchor: "end", dy: "0.32em", format: y })
623
755
  }
624
756
  ),
625
- v !== !1 && /* @__PURE__ */ e(
626
- O,
757
+ w !== !1 && /* @__PURE__ */ e(
758
+ S,
627
759
  {
628
760
  content: /* @__PURE__ */ e(
629
- S,
761
+ O,
630
762
  {
631
- format: h,
632
- labelKey: i,
633
- renderer: v
763
+ format: i,
764
+ labelKey: l,
765
+ renderer: w
634
766
  }
635
767
  ),
636
768
  cursor: { stroke: "var(--border-strong)", strokeDasharray: "4 4" },
637
769
  isAnimationActive: !1
638
770
  }
639
771
  ),
640
- w.back,
772
+ C.back,
641
773
  /* @__PURE__ */ e(
642
- ge,
774
+ Ae,
643
775
  {
644
776
  data: t,
645
777
  fill: "var(--color-chart-1)",
@@ -647,107 +779,107 @@ const _e = k.forwardRef(
647
779
  isAnimationActive: !1
648
780
  }
649
781
  ),
650
- w.front
782
+ C.front
651
783
  ] }) });
652
784
  }
653
785
  );
654
- _e.displayName = "ScatterChart";
655
- const Ge = k.forwardRef(
786
+ Xe.displayName = "ScatterChart";
787
+ const Ze = k.forwardRef(
656
788
  ({
657
789
  data: t,
658
- nameKey: n,
659
- valueKey: r,
660
- donut: i = !0,
661
- centerLabel: a,
662
- highlight: l,
790
+ nameKey: r,
791
+ valueKey: n,
792
+ donut: l = !0,
793
+ centerLabel: o,
794
+ highlight: a,
663
795
  height: s = 260,
664
- legend: d = !0,
665
- formatValue: f,
666
- tooltip: o,
667
- className: p
668
- }, g) => {
669
- const u = f ?? L, m = t.reduce((x, h) => x + (typeof h[r] == "number" ? h[r] : 0), 0), N = (x, h) => E(h), v = (x) => l && x !== l ? 0.3 : 1, c = d ? t.map((x, h) => ({
670
- label: `${x[n]} · ${m ? Math.round(Number(x[r]) / m * 100) : 0}%`,
671
- color: N(String(x[n]), h)
796
+ legend: u = !0,
797
+ formatValue: c,
798
+ tooltip: f,
799
+ className: d
800
+ }, x) => {
801
+ const v = c ?? F, m = t.reduce((p, i) => p + (typeof i[n] == "number" ? i[n] : 0), 0), b = (p, i) => _(i), w = (p) => a && p !== a ? 0.3 : 1, A = u ? t.map((p, i) => ({
802
+ label: `${p[r]} · ${m ? Math.round(Number(p[n]) / m * 100) : 0}%`,
803
+ color: b(String(p[r]), i)
672
804
  })) : null;
673
- return /* @__PURE__ */ y("div", { ref: g, className: $("relative w-full font-sans", p), children: [
674
- c && /* @__PURE__ */ e(_, { items: c }),
675
- /* @__PURE__ */ y("div", { className: "relative", children: [
676
- /* @__PURE__ */ e(I, { width: "100%", height: s, children: /* @__PURE__ */ y(be, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
677
- o !== !1 && /* @__PURE__ */ e(
678
- O,
805
+ return /* @__PURE__ */ N("div", { ref: x, className: $("relative w-full font-sans", d), children: [
806
+ A && /* @__PURE__ */ e(G, { items: A }),
807
+ /* @__PURE__ */ N("div", { className: "relative", children: [
808
+ /* @__PURE__ */ e(j, { width: "100%", height: s, children: /* @__PURE__ */ N(ye, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
809
+ f !== !1 && /* @__PURE__ */ e(
810
+ S,
679
811
  {
680
812
  content: /* @__PURE__ */ e(
681
- S,
813
+ O,
682
814
  {
683
- format: u,
684
- renderer: o
815
+ format: v,
816
+ renderer: f
685
817
  }
686
818
  ),
687
819
  isAnimationActive: !1
688
820
  }
689
821
  ),
690
822
  /* @__PURE__ */ e(
691
- pe,
823
+ Ce,
692
824
  {
693
825
  data: t,
694
- dataKey: r,
695
- nameKey: n,
696
- innerRadius: i ? "62%" : 0,
826
+ dataKey: n,
827
+ nameKey: r,
828
+ innerRadius: l ? "62%" : 0,
697
829
  outerRadius: "88%",
698
- paddingAngle: i ? 2 : 1,
699
- cornerRadius: i ? 4 : 2,
830
+ paddingAngle: l ? 2 : 1,
831
+ cornerRadius: l ? 4 : 2,
700
832
  stroke: "none",
701
833
  isAnimationActive: !1,
702
- children: t.map((x, h) => /* @__PURE__ */ e(
703
- ie,
834
+ children: t.map((p, i) => /* @__PURE__ */ e(
835
+ oe,
704
836
  {
705
- fill: N(String(x[n]), h),
706
- fillOpacity: v(String(x[n]))
837
+ fill: b(String(p[r]), i),
838
+ fillOpacity: w(String(p[r]))
707
839
  },
708
- String(x[n])
840
+ String(p[r])
709
841
  ))
710
842
  }
711
843
  )
712
844
  ] }) }),
713
- i && /* @__PURE__ */ y("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
714
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: u(m) }),
715
- a && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: a })
845
+ l && /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
846
+ /* @__PURE__ */ e("div", { className: "text-xl font-semibold text-foreground tabular-nums", children: v(m) }),
847
+ o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
716
848
  ] })
717
849
  ] })
718
850
  ] });
719
851
  }
720
852
  );
721
- Ge.displayName = "PieChart";
722
- const Ue = k.forwardRef(
853
+ Ze.displayName = "PieChart";
854
+ const Qe = k.forwardRef(
723
855
  ({
724
856
  data: t,
725
- categoryKey: n,
726
- series: r,
727
- seriesLabels: i,
728
- highlight: a,
729
- maxValue: l,
857
+ categoryKey: r,
858
+ series: n,
859
+ seriesLabels: l,
860
+ highlight: o,
861
+ maxValue: a,
730
862
  height: s = 300,
731
- legend: d,
732
- formatValue: f,
733
- tooltip: o,
734
- className: p
735
- }, g) => {
736
- const u = k.useMemo(
737
- () => r ?? le(t, n),
738
- [n, t, r]
739
- ), m = f ?? L, N = l ?? Math.max(
863
+ legend: u,
864
+ formatValue: c,
865
+ tooltip: f,
866
+ className: d
867
+ }, x) => {
868
+ const v = k.useMemo(
869
+ () => n ?? ce(t, r),
870
+ [r, t, n]
871
+ ), m = c ?? F, b = a ?? Math.max(
740
872
  1,
741
873
  ...t.flatMap(
742
- (h) => u.map(
743
- (A) => typeof h[A] == "number" ? h[A] : 0
874
+ (i) => v.map(
875
+ (h) => typeof i[h] == "number" ? i[h] : 0
744
876
  )
745
877
  )
746
- ), v = (h) => (i == null ? void 0 : i[h]) ?? h, c = (h, A) => a && u.includes(a) ? h === a ? "var(--color-chart-1)" : Q : E(A), x = d ?? u.length > 1 ? u.map((h, A) => ({ label: v(h), color: c(h, A) })) : null;
747
- return /* @__PURE__ */ y("div", { ref: g, className: $("relative w-full font-sans", p), children: [
748
- x && /* @__PURE__ */ e(_, { items: x, align: "center" }),
749
- /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(I, { width: "100%", height: s, children: /* @__PURE__ */ y(
750
- ye,
878
+ ), w = (i) => (l == null ? void 0 : l[i]) ?? i, A = (i, h) => o && v.includes(o) ? i === o ? "var(--color-chart-1)" : Q : _(h), p = u ?? v.length > 1 ? v.map((i, h) => ({ label: w(i), color: A(i, h) })) : null;
879
+ return /* @__PURE__ */ N("div", { ref: x, className: $("relative w-full font-sans", d), children: [
880
+ p && /* @__PURE__ */ e(G, { items: p, align: "center" }),
881
+ /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(j, { width: "100%", height: s, children: /* @__PURE__ */ N(
882
+ ke,
751
883
  {
752
884
  data: t,
753
885
  cx: "50%",
@@ -755,50 +887,50 @@ const Ue = k.forwardRef(
755
887
  outerRadius: "68%",
756
888
  margin: { top: 10, right: 56, bottom: 16, left: 56 },
757
889
  children: [
758
- /* @__PURE__ */ e(Ne, { stroke: "var(--border)", radialLines: !0 }),
890
+ /* @__PURE__ */ e(Re, { stroke: "var(--border)", radialLines: !0 }),
759
891
  /* @__PURE__ */ e(
760
- oe,
892
+ se,
761
893
  {
762
- dataKey: n,
894
+ dataKey: r,
763
895
  tick: { fill: "var(--text-secondary)", fontSize: 11, fontWeight: 500 }
764
896
  }
765
897
  ),
766
898
  /* @__PURE__ */ e(
767
- ke,
899
+ Me,
768
900
  {
769
901
  angle: 90,
770
- domain: [0, N],
902
+ domain: [0, b],
771
903
  tick: !1,
772
904
  axisLine: !1,
773
905
  tickLine: !1
774
906
  }
775
907
  ),
776
- o !== !1 && /* @__PURE__ */ e(
777
- O,
908
+ f !== !1 && /* @__PURE__ */ e(
909
+ S,
778
910
  {
779
911
  content: /* @__PURE__ */ e(
780
- S,
912
+ O,
781
913
  {
782
914
  format: m,
783
- renderer: o
915
+ renderer: f
784
916
  }
785
917
  ),
786
918
  isAnimationActive: !1
787
919
  }
788
920
  ),
789
- u.map((h, A) => /* @__PURE__ */ e(
790
- we,
921
+ v.map((i, h) => /* @__PURE__ */ e(
922
+ $e,
791
923
  {
792
- dataKey: h,
793
- name: v(h),
794
- stroke: c(h, A),
795
- fill: c(h, A),
796
- fillOpacity: a ? h === a ? 0.16 : 0.05 : 0.1,
924
+ dataKey: i,
925
+ name: w(i),
926
+ stroke: A(i, h),
927
+ fill: A(i, h),
928
+ fillOpacity: o ? i === o ? 0.16 : 0.05 : 0.1,
797
929
  strokeWidth: 2,
798
- dot: { r: 2.5, fill: c(h, A), strokeWidth: 0 },
930
+ dot: { r: 2.5, fill: A(i, h), strokeWidth: 0 },
799
931
  isAnimationActive: !1
800
932
  },
801
- h
933
+ i
802
934
  ))
803
935
  ]
804
936
  }
@@ -806,61 +938,61 @@ const Ue = k.forwardRef(
806
938
  ] });
807
939
  }
808
940
  );
809
- Ue.displayName = "RadarChart";
810
- const He = k.forwardRef(
941
+ Qe.displayName = "RadarChart";
942
+ const qe = k.forwardRef(
811
943
  ({
812
944
  data: t,
813
- nameKey: n,
814
- valueKey: r,
815
- maxValue: i = 100,
816
- centerLabel: a,
817
- height: l = 280,
945
+ nameKey: r,
946
+ valueKey: n,
947
+ maxValue: l = 100,
948
+ centerLabel: o,
949
+ height: a = T,
818
950
  legend: s = !0,
819
- formatValue: d,
820
- tooltip: f,
821
- className: o
822
- }, p) => {
823
- const g = d ?? L, u = t.map((v, c) => ({
824
- ...v,
825
- name: String(v[n]),
826
- fill: V(c)
827
- })), m = u.length ? u.reduce(
828
- (v, c) => v + (typeof c[r] == "number" ? c[r] : 0),
951
+ formatValue: u,
952
+ tooltip: c,
953
+ className: f
954
+ }, d) => {
955
+ const x = u ?? F, v = t.map((w, A) => ({
956
+ ...w,
957
+ name: String(w[r]),
958
+ fill: Y(A)
959
+ })), m = v.length ? v.reduce(
960
+ (w, A) => w + (typeof A[n] == "number" ? A[n] : 0),
829
961
  0
830
- ) / u.length : 0, N = s ? u.map((v, c) => ({
831
- label: String(v[n]),
832
- color: V(c)
962
+ ) / v.length : 0, b = s ? v.map((w, A) => ({
963
+ label: String(w[r]),
964
+ color: Y(A)
833
965
  })) : null;
834
- return /* @__PURE__ */ y("div", { ref: p, className: $("relative w-full font-sans", o), children: [
835
- /* @__PURE__ */ y("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
836
- /* @__PURE__ */ e(I, { width: "100%", height: l, children: /* @__PURE__ */ y(
837
- Ae,
966
+ return /* @__PURE__ */ N("div", { ref: d, className: $("relative w-full font-sans", f), children: [
967
+ /* @__PURE__ */ N("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
968
+ /* @__PURE__ */ e(j, { width: "100%", height: a, children: /* @__PURE__ */ N(
969
+ Le,
838
970
  {
839
- data: u,
971
+ data: v,
840
972
  innerRadius: "48%",
841
973
  outerRadius: "82%",
842
974
  startAngle: 90,
843
975
  endAngle: -270,
844
976
  margin: { top: 6, right: 6, bottom: 6, left: 6 },
845
977
  children: [
846
- /* @__PURE__ */ e(oe, { type: "number", domain: [0, i], tick: !1 }),
847
- f !== !1 && /* @__PURE__ */ e(
848
- O,
978
+ /* @__PURE__ */ e(se, { type: "number", domain: [0, l], tick: !1 }),
979
+ c !== !1 && /* @__PURE__ */ e(
980
+ S,
849
981
  {
850
982
  content: /* @__PURE__ */ e(
851
- S,
983
+ O,
852
984
  {
853
- format: g,
854
- renderer: f
985
+ format: x,
986
+ renderer: c
855
987
  }
856
988
  ),
857
989
  isAnimationActive: !1
858
990
  }
859
991
  ),
860
992
  /* @__PURE__ */ e(
861
- Ce,
993
+ Fe,
862
994
  {
863
- dataKey: r,
995
+ dataKey: n,
864
996
  background: { fill: "var(--muted)" },
865
997
  cornerRadius: 999,
866
998
  maxBarSize: 18,
@@ -870,71 +1002,71 @@ const He = k.forwardRef(
870
1002
  ]
871
1003
  }
872
1004
  ) }),
873
- /* @__PURE__ */ y("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
874
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: g(Math.round(m)) }),
875
- a && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: a })
1005
+ /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
1006
+ /* @__PURE__ */ e("div", { className: "text-xl font-semibold text-foreground tabular-nums", children: x(Math.round(m)) }),
1007
+ o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
876
1008
  ] })
877
1009
  ] }),
878
- N && /* @__PURE__ */ e(_, { items: N, align: "center", className: "mb-0 mt-3" })
1010
+ b && /* @__PURE__ */ e(G, { items: b, align: "center", className: "mb-0 mt-3" })
879
1011
  ] });
880
1012
  }
881
1013
  );
882
- He.displayName = "RadialBarChart";
883
- function Ve({
1014
+ qe.displayName = "RadialBarChart";
1015
+ function Je({
884
1016
  x: t = 0,
885
- y: n = 0,
886
- width: r = 0,
887
- height: i = 0,
888
- depth: a = 0,
889
- index: l = 0,
1017
+ y: r = 0,
1018
+ width: n = 0,
1019
+ height: l = 0,
1020
+ depth: o = 0,
1021
+ index: a = 0,
890
1022
  name: s,
891
- value: d,
892
- format: f = L
1023
+ value: u,
1024
+ format: c = F
893
1025
  }) {
894
- if (a === 0) return /* @__PURE__ */ e("g", {});
895
- const o = a === 0 ? "transparent" : V(l), p = a > 0 && l < 4, g = r > 72 && i > 38;
896
- return /* @__PURE__ */ y("g", { children: [
1026
+ if (o === 0) return /* @__PURE__ */ e("g", {});
1027
+ const f = o === 0 ? "transparent" : Y(a), d = o > 0 && a < 4, x = n > 72 && l > 38;
1028
+ return /* @__PURE__ */ N("g", { children: [
897
1029
  /* @__PURE__ */ e(
898
1030
  "rect",
899
1031
  {
900
1032
  x: t,
901
- y: n,
902
- width: r,
903
- height: i,
1033
+ y: r,
1034
+ width: n,
1035
+ height: l,
904
1036
  rx: 6,
905
1037
  ry: 6,
906
- fill: o,
1038
+ fill: f,
907
1039
  stroke: "var(--background)",
908
1040
  strokeWidth: 4
909
1041
  }
910
1042
  ),
911
- g && /* @__PURE__ */ e(
1043
+ x && /* @__PURE__ */ e(
912
1044
  "foreignObject",
913
1045
  {
914
1046
  x: t + 8,
915
- y: n + 8,
916
- width: Math.max(0, r - 16),
917
- height: Math.max(0, i - 16),
1047
+ y: r + 8,
1048
+ width: Math.max(0, n - 16),
1049
+ height: Math.max(0, l - 16),
918
1050
  className: "pointer-events-none overflow-hidden",
919
- children: /* @__PURE__ */ y("div", { className: "flex h-full flex-col justify-between", children: [
1051
+ children: /* @__PURE__ */ N("div", { className: "flex h-full flex-col justify-between", children: [
920
1052
  /* @__PURE__ */ e(
921
1053
  "p",
922
1054
  {
923
1055
  className: $(
924
1056
  "truncate text-xs font-semibold",
925
- p ? "text-background" : "text-foreground"
1057
+ d ? "text-background" : "text-foreground"
926
1058
  ),
927
1059
  children: s
928
1060
  }
929
1061
  ),
930
- typeof d == "number" && i > 58 && /* @__PURE__ */ e(
1062
+ typeof u == "number" && l > 58 && /* @__PURE__ */ e(
931
1063
  "p",
932
1064
  {
933
1065
  className: $(
934
1066
  "text-xs tabular-nums",
935
- p ? "text-background/70" : "text-tertiary"
1067
+ d ? "text-background/70" : "text-tertiary"
936
1068
  ),
937
- children: f(d)
1069
+ children: c(u)
938
1070
  }
939
1071
  )
940
1072
  ] })
@@ -942,53 +1074,53 @@ function Ve({
942
1074
  )
943
1075
  ] });
944
1076
  }
945
- function Ye(t, n, r) {
946
- const i = [], a = (l) => {
947
- const s = Array.isArray(l.children) ? l.children : void 0;
1077
+ function Ke(t, r, n) {
1078
+ const l = [], o = (a) => {
1079
+ const s = Array.isArray(a.children) ? a.children : void 0;
948
1080
  if (s != null && s.length) {
949
- s.forEach(a);
1081
+ s.forEach(o);
950
1082
  return;
951
1083
  }
952
- typeof l[r] == "number" && i.push({
953
- ...l,
954
- name: String(l[n] ?? ""),
955
- value: l[r]
1084
+ typeof a[n] == "number" && l.push({
1085
+ ...a,
1086
+ name: String(a[r] ?? ""),
1087
+ value: a[n]
956
1088
  });
957
1089
  };
958
- return t.forEach(a), i.length ? i : t;
1090
+ return t.forEach(o), l.length ? l : t;
959
1091
  }
960
- const Xe = k.forwardRef(
1092
+ const et = k.forwardRef(
961
1093
  ({
962
1094
  data: t,
963
- nameKey: n,
964
- valueKey: r,
965
- height: i = 280,
966
- formatValue: a,
967
- tooltip: l,
1095
+ nameKey: r,
1096
+ valueKey: n,
1097
+ height: l = T,
1098
+ formatValue: o,
1099
+ tooltip: a,
968
1100
  className: s
969
- }, d) => {
970
- const f = a ?? L, o = k.useMemo(
971
- () => Ye(t, n, r),
972
- [t, n, r]
1101
+ }, u) => {
1102
+ const c = o ?? F, f = k.useMemo(
1103
+ () => Ke(t, r, n),
1104
+ [t, r, n]
973
1105
  );
974
- return /* @__PURE__ */ e("div", { ref: d, className: $("relative w-full font-sans", s), children: /* @__PURE__ */ e(I, { width: "100%", height: i, children: /* @__PURE__ */ e(
975
- Re,
1106
+ return /* @__PURE__ */ e("div", { ref: u, className: $("relative w-full font-sans", s), children: /* @__PURE__ */ e(j, { width: "100%", height: l, children: /* @__PURE__ */ e(
1107
+ Se,
976
1108
  {
977
- data: o,
978
- nameKey: n,
979
- dataKey: r,
1109
+ data: f,
1110
+ nameKey: r,
1111
+ dataKey: n,
980
1112
  type: "flat",
981
1113
  aspectRatio: 1.6,
982
- content: /* @__PURE__ */ e(Ve, { format: f }),
1114
+ content: /* @__PURE__ */ e(Je, { format: c }),
983
1115
  isAnimationActive: !1,
984
- children: l !== !1 && /* @__PURE__ */ e(
985
- O,
1116
+ children: a !== !1 && /* @__PURE__ */ e(
1117
+ S,
986
1118
  {
987
1119
  content: /* @__PURE__ */ e(
988
- S,
1120
+ O,
989
1121
  {
990
- format: f,
991
- renderer: l
1122
+ format: c,
1123
+ renderer: a
992
1124
  }
993
1125
  ),
994
1126
  isAnimationActive: !1
@@ -998,98 +1130,98 @@ const Xe = k.forwardRef(
998
1130
  ) }) });
999
1131
  }
1000
1132
  );
1001
- Xe.displayName = "TreemapChart";
1002
- const U = "var(--color-chart-1)", Ze = "var(--color-ink-100)", P = 24, Qe = 44, ee = 0.55, te = 4, ae = (t, n, r, i, a) => {
1003
- const l = Math.min(a, r / 2, i);
1004
- return `M ${t},${n + i} L ${t},${n + l} Q ${t},${n} ${t + l},${n} L ${t + r - l},${n} Q ${t + r},${n} ${t + r},${n + l} L ${t + r},${n + i} Z`;
1133
+ et.displayName = "TreemapChart";
1134
+ const U = "var(--color-chart-1)", tt = "var(--chart-track)", P = 24, rt = 44, re = 0.55, ne = 4, ae = (t, r, n, l, o) => {
1135
+ const a = Math.min(o, n / 2, l);
1136
+ return `M ${t},${r + l} L ${t},${r + a} Q ${t},${r} ${t + a},${r} L ${t + n - a},${r} Q ${t + n},${r} ${t + n},${r + a} L ${t + n},${r + l} Z`;
1005
1137
  };
1006
- function qe() {
1007
- const t = k.useRef(null), [n, r] = k.useState(0);
1138
+ function nt() {
1139
+ const t = k.useRef(null), [r, n] = k.useState(0);
1008
1140
  return k.useLayoutEffect(() => {
1009
- const i = t.current;
1010
- if (!i) return;
1011
- r(i.getBoundingClientRect().width);
1012
- const a = new ResizeObserver((l) => {
1013
- var d;
1014
- const s = ((d = l[0]) == null ? void 0 : d.contentRect.width) ?? 0;
1015
- r((f) => Math.abs(f - s) > 0.5 ? s : f);
1141
+ const l = t.current;
1142
+ if (!l) return;
1143
+ n(l.getBoundingClientRect().width);
1144
+ const o = new ResizeObserver((a) => {
1145
+ var u;
1146
+ const s = ((u = a[0]) == null ? void 0 : u.contentRect.width) ?? 0;
1147
+ n((c) => Math.abs(c - s) > 0.5 ? s : c);
1016
1148
  });
1017
- return a.observe(i), () => a.disconnect();
1018
- }, []), { ref: t, width: n };
1149
+ return o.observe(l), () => o.disconnect();
1150
+ }, []), { ref: t, width: r };
1019
1151
  }
1020
- const Je = k.forwardRef(
1152
+ const at = k.forwardRef(
1021
1153
  ({
1022
1154
  data: t,
1023
- nameKey: n,
1024
- valueKey: r,
1025
- height: i = 280,
1026
- formatValue: a,
1027
- label: l,
1155
+ nameKey: r,
1156
+ valueKey: n,
1157
+ height: l = T,
1158
+ formatValue: o,
1159
+ label: a,
1028
1160
  tooltip: s,
1029
- className: d
1030
- }, f) => {
1161
+ className: u
1162
+ }, c) => {
1031
1163
  var R;
1032
- const o = a ?? L, { ref: p, width: g } = qe(), [u, m] = k.useState(null), N = Number(((R = t[0]) == null ? void 0 : R[r]) ?? 0), v = t.length, c = Math.max(0, i - P - Qe), x = P + c, h = v > 0 ? g / (v + (v - 1) * ee) : 0, A = h * ee, F = t.map((b, M) => {
1033
- var K;
1034
- const C = Number(b[r]), D = Number(((K = t[M - 1]) == null ? void 0 : K[r]) ?? C), de = N ? C / N * 100 : 0, q = D ? C / D * 100 : 0, J = N && C > 0 ? Math.max(2, C / N * c) : 0;
1164
+ const f = o ?? F, { ref: d, width: x } = nt(), [v, m] = k.useState(null), b = Number(((R = t[0]) == null ? void 0 : R[n]) ?? 0), w = t.length, A = Math.max(0, l - P - rt), p = P + A, i = w > 0 ? x / (w + (w - 1) * re) : 0, h = i * re, y = t.map((g, L) => {
1165
+ var te;
1166
+ const M = Number(g[n]), B = Number(((te = t[L - 1]) == null ? void 0 : te[n]) ?? M), xe = b ? M / b * 100 : 0, K = B ? M / B * 100 : 0, ee = b && M > 0 ? Math.max(2, M / b * A) : 0;
1035
1167
  return {
1036
- datum: b,
1037
- index: M,
1038
- name: String(b[n]),
1039
- value: C,
1040
- conversionFromFirst: de,
1041
- conversionFromPrevious: q,
1042
- dropOffFromPrevious: M === 0 ? 0 : 100 - q,
1043
- x: M * (h + A),
1044
- y: x - J,
1045
- width: h,
1046
- height: J,
1047
- formatValue: o
1168
+ datum: g,
1169
+ index: L,
1170
+ name: String(g[r]),
1171
+ value: M,
1172
+ conversionFromFirst: xe,
1173
+ conversionFromPrevious: K,
1174
+ dropOffFromPrevious: L === 0 ? 0 : 100 - K,
1175
+ x: L * (i + h),
1176
+ y: p - ee,
1177
+ width: i,
1178
+ height: ee,
1179
+ formatValue: f
1048
1180
  };
1049
- }), w = u != null ? F[u] : void 0;
1050
- return /* @__PURE__ */ e("div", { ref: f, className: $("relative w-full font-sans", d), children: /* @__PURE__ */ y("div", { ref: p, className: "relative w-full", style: { height: i }, children: [
1051
- g > 0 && v > 0 && /* @__PURE__ */ y("svg", { width: g, height: i, className: "block", children: [
1052
- F.slice(1).map((b) => {
1053
- const M = F[b.index - 1];
1181
+ }), C = v != null ? y[v] : void 0;
1182
+ return /* @__PURE__ */ e("div", { ref: c, className: $("relative w-full font-sans", u), children: /* @__PURE__ */ N("div", { ref: d, className: "relative w-full", style: { height: l }, children: [
1183
+ x > 0 && w > 0 && /* @__PURE__ */ N("svg", { width: x, height: l, className: "block", children: [
1184
+ y.slice(1).map((g) => {
1185
+ const L = y[g.index - 1];
1054
1186
  return /* @__PURE__ */ e(
1055
1187
  "path",
1056
1188
  {
1057
- d: `M ${M.x + M.width},${M.y} L ${b.x},${b.y} L ${b.x},${x} L ${M.x + M.width},${x} Z`,
1189
+ d: `M ${L.x + L.width},${L.y} L ${g.x},${g.y} L ${g.x},${p} L ${L.x + L.width},${p} Z`,
1058
1190
  fill: U,
1059
1191
  opacity: 0.14
1060
1192
  },
1061
- `connector-${b.index}`
1193
+ `connector-${g.index}`
1062
1194
  );
1063
1195
  }),
1064
- F.map((b) => /* @__PURE__ */ y(
1196
+ y.map((g) => /* @__PURE__ */ N(
1065
1197
  "g",
1066
1198
  {
1067
1199
  role: "img",
1068
- "aria-label": `${b.name}: ${o(b.value)} (${Math.round(b.conversionFromFirst)}% of ${F[0].name})`,
1200
+ "aria-label": `${g.name}: ${f(g.value)} (${Math.round(g.conversionFromFirst)}% of ${y[0].name})`,
1069
1201
  children: [
1070
1202
  /* @__PURE__ */ e(
1071
1203
  "path",
1072
1204
  {
1073
- d: ae(b.x, P, b.width, c, te),
1074
- fill: Ze
1205
+ d: ae(g.x, P, g.width, A, ne),
1206
+ fill: tt
1075
1207
  }
1076
1208
  ),
1077
- b.height > 0 && /* @__PURE__ */ e(
1209
+ g.height > 0 && /* @__PURE__ */ e(
1078
1210
  "path",
1079
1211
  {
1080
- d: ae(b.x, b.y, b.width, b.height, te),
1212
+ d: ae(g.x, g.y, g.width, g.height, ne),
1081
1213
  fill: U
1082
1214
  }
1083
1215
  ),
1084
- l !== !1 && (l ? l(b) : /* @__PURE__ */ y(
1216
+ a !== !1 && (a ? a(g) : /* @__PURE__ */ N(
1085
1217
  "text",
1086
1218
  {
1087
- x: b.x,
1088
- y: b.y - 8,
1219
+ x: g.x,
1220
+ y: g.y - 8,
1089
1221
  textAnchor: "start",
1090
- className: "fill-secondary text-xs font-medium tabular-nums",
1222
+ className: "fill-secondary text-xs font-normal tabular-nums",
1091
1223
  children: [
1092
- Math.round(b.conversionFromFirst),
1224
+ Math.round(g.conversionFromFirst),
1093
1225
  "%"
1094
1226
  ]
1095
1227
  }
@@ -1097,68 +1229,68 @@ const Je = k.forwardRef(
1097
1229
  /* @__PURE__ */ e(
1098
1230
  "text",
1099
1231
  {
1100
- x: b.x,
1101
- y: x + 18,
1232
+ x: g.x,
1233
+ y: p + 18,
1102
1234
  textAnchor: "start",
1103
- className: "fill-primary text-xs font-medium",
1104
- children: b.name
1235
+ className: "fill-primary text-xs font-normal",
1236
+ children: g.name
1105
1237
  }
1106
1238
  ),
1107
1239
  /* @__PURE__ */ e(
1108
1240
  "text",
1109
1241
  {
1110
- x: b.x,
1111
- y: x + 34,
1242
+ x: g.x,
1243
+ y: p + 34,
1112
1244
  textAnchor: "start",
1113
1245
  className: "fill-tertiary text-xs tabular-nums",
1114
- children: o(b.value)
1246
+ children: f(g.value)
1115
1247
  }
1116
1248
  ),
1117
1249
  /* @__PURE__ */ e(
1118
1250
  "rect",
1119
1251
  {
1120
- x: b.x,
1252
+ x: g.x,
1121
1253
  y: P,
1122
- width: b.index === v - 1 ? h : h + A,
1123
- height: c,
1254
+ width: g.index === w - 1 ? i : i + h,
1255
+ height: A,
1124
1256
  fill: "transparent",
1125
- onMouseEnter: () => m(b.index),
1257
+ onMouseEnter: () => m(g.index),
1126
1258
  onMouseLeave: () => m(null)
1127
1259
  }
1128
1260
  )
1129
1261
  ]
1130
1262
  },
1131
- `${b.name}-${b.index}`
1263
+ `${g.name}-${g.index}`
1132
1264
  ))
1133
1265
  ] }),
1134
- s !== !1 && w && /* @__PURE__ */ e(
1266
+ s !== !1 && C && /* @__PURE__ */ e(
1135
1267
  "div",
1136
1268
  {
1137
1269
  className: "pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-full",
1138
- style: { left: w.x + w.width / 2, top: w.y - 10 },
1270
+ style: { left: C.x + C.width / 2, top: C.y - 10 },
1139
1271
  children: s ? s({
1140
1272
  active: !0,
1141
- label: w.name,
1273
+ label: C.name,
1142
1274
  items: [
1143
1275
  {
1144
- key: w.name,
1145
- name: w.name,
1146
- value: w.value,
1276
+ key: C.name,
1277
+ name: C.name,
1278
+ value: C.value,
1147
1279
  color: U,
1148
- datum: w.datum
1280
+ datum: C.datum
1149
1281
  }
1150
1282
  ],
1151
- formatValue: o
1152
- }) : /* @__PURE__ */ y("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs whitespace-nowrap text-background", children: [
1153
- /* @__PURE__ */ e("div", { className: "text-xs font-medium tracking-wide uppercase text-background/60", children: w.name }),
1154
- /* @__PURE__ */ e("div", { className: "font-medium tabular-nums", children: o(w.value) }),
1155
- /* @__PURE__ */ y("div", { className: "text-background/70 tabular-nums", children: [
1156
- Math.round(w.conversionFromFirst),
1283
+ formatValue: f
1284
+ }) : /* @__PURE__ */ N("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs whitespace-nowrap text-background", children: [
1285
+ /* @__PURE__ */ e("div", { className: "text-xs font-normal tracking-wide uppercase text-background/60", children: C.name }),
1286
+ /* @__PURE__ */ e("div", { className: "font-normal tabular-nums", children: f(C.value) }),
1287
+ /* @__PURE__ */ N("div", { className: "text-background/70 tabular-nums", children: [
1288
+ Math.round(C.conversionFromFirst),
1157
1289
  "% of ",
1158
- F[0].name,
1159
- w.index > 0 && /* @__PURE__ */ y(H, { children: [
1290
+ y[0].name,
1291
+ C.index > 0 && /* @__PURE__ */ N(V, { children: [
1160
1292
  " · −",
1161
- Math.round(w.dropOffFromPrevious),
1293
+ Math.round(C.dropOffFromPrevious),
1162
1294
  "% step"
1163
1295
  ] })
1164
1296
  ] })
@@ -1168,17 +1300,18 @@ const Je = k.forwardRef(
1168
1300
  ] }) });
1169
1301
  }
1170
1302
  );
1171
- Je.displayName = "FunnelChart";
1303
+ at.displayName = "FunnelChart";
1172
1304
  export {
1173
- Pe as AreaChart,
1174
- ze as BarChart,
1175
- ce as ComboChart,
1176
- Ee as ComposedChart,
1177
- Je as FunnelChart,
1178
- je as LineChart,
1179
- Ge as PieChart,
1180
- Ue as RadarChart,
1181
- He as RadialBarChart,
1182
- _e as ScatterChart,
1183
- Xe as TreemapChart
1305
+ Ue as AreaChart,
1306
+ Ve as BarChart,
1307
+ he as ComboChart,
1308
+ Ye as ComposedChart,
1309
+ at as FunnelChart,
1310
+ He as LineChart,
1311
+ T as MIN_HEIGHT,
1312
+ Ze as PieChart,
1313
+ Qe as RadarChart,
1314
+ qe as RadialBarChart,
1315
+ Xe as ScatterChart,
1316
+ et as TreemapChart
1184
1317
  };