@actioneer/ads 0.5.9 → 0.7.0

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