@actioneer/ads 0.4.0 → 0.5.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.
@@ -1,33 +1,25 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as e, Fragment as G } from "react/jsx-runtime";
3
- import * as k from "react";
4
- import { ResponsiveContainer as $, LineChart as re, Tooltip as F, Line as U, AreaChart as ae, Area as ne, CartesianGrid as Y, XAxis as H, YAxis as I, BarChart as ie, Bar as Z, Cell as X, ComposedChart as oe, ScatterChart as le, Scatter as se, PieChart as ce, Pie as de, RadarChart as me, PolarGrid as fe, PolarAngleAxis as q, PolarRadiusAxis as ue, Radar as he, RadialBarChart as xe, RadialBar as ve, Treemap as ge, FunnelChart as be, Funnel as pe, LabelList as ye, ReferenceArea as ke, ReferenceLine as Ne, ReferenceDot as we } from "recharts";
5
- import { MotionConfig as Ae, AnimatePresence as Ce, motion as Re } from "motion/react";
2
+ import { jsxs as y, jsx as e, Fragment as E } from "react/jsx-runtime";
3
+ import * as N from "react";
4
+ import { ResponsiveContainer as B, LineChart as te, Tooltip as F, Line as U, AreaChart as re, Area as ae, CartesianGrid as Y, XAxis as H, YAxis as I, BarChart as ne, Bar as Z, Cell as X, ComposedChart as ie, ScatterChart as oe, Scatter as le, PieChart as se, Pie as ce, RadarChart as de, PolarGrid as me, PolarAngleAxis as q, PolarRadiusAxis as fe, Radar as ue, RadialBarChart as he, RadialBar as xe, Treemap as ge, FunnelChart as ve, Funnel as be, LabelList as pe, ReferenceArea as ye, ReferenceLine as Ne, ReferenceDot as ke } from "recharts";
5
+ import { MotionConfig as we, AnimatePresence as Ae, motion as Ce } from "motion/react";
6
6
  import { cn as C } from "../lib/cn.js";
7
- import { floatVariants as Fe } from "../lib/motion.js";
8
- const J = (r) => `var(--color-chart-${r % 6 + 1})`, E = [
9
- "var(--color-ink-950)",
10
- "var(--color-ink-700)",
11
- "var(--color-ink-500)",
12
- "var(--color-ink-400)",
13
- "var(--color-ink-300)",
14
- "var(--color-ink-200)",
15
- "var(--color-ink-100)"
16
- ], B = (r) => E[r % E.length], _ = "var(--color-chart-3)", S = {
7
+ import { floatVariants as Re } from "../lib/motion.js";
8
+ const W = (r) => `var(--color-chart-${r % 6 + 1})`, j = (r) => W(r), _ = "var(--color-ink-300)", S = {
17
9
  primary: { ref: "var(--brand)", pill: "bg-fill text-fill-foreground" },
18
10
  success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
19
11
  warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
20
12
  danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
21
13
  info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
22
- }, L = (r) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(r), Q = (r, n) => {
14
+ }, L = (r) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(r), J = (r, n) => {
23
15
  const a = [];
24
16
  for (const i of r)
25
17
  for (const t of Object.keys(i))
26
18
  t !== n && typeof i[t] == "number" && !a.includes(t) && a.push(t);
27
19
  return a;
28
20
  };
29
- function T({ x: r, y: n, payload: a, anchor: i, dy: t, format: s }) {
30
- const c = (a == null ? void 0 : a.value) ?? "", m = s ? s(c) : c;
21
+ function T({ x: r, y: n, payload: a, anchor: i, dy: t, format: l }) {
22
+ const c = (a == null ? void 0 : a.value) ?? "", m = l ? l(c) : c;
31
23
  return /* @__PURE__ */ e("text", { x: r, y: n, dy: t, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: m });
32
24
  }
33
25
  function M({
@@ -36,31 +28,31 @@ function M({
36
28
  label: a,
37
29
  format: i,
38
30
  labelKey: t,
39
- renderer: s
31
+ renderer: l
40
32
  }) {
41
- var x, u;
33
+ var v, u;
42
34
  const c = (n ?? []).map((d, p) => {
43
- const h = d.payload && typeof d.payload == "object" ? d.payload : void 0;
35
+ const x = d.payload && typeof d.payload == "object" ? d.payload : void 0;
44
36
  return {
45
37
  key: d.dataKey ?? p,
46
38
  name: d.name ?? d.dataKey ?? p,
47
39
  value: d.value,
48
40
  color: d.color,
49
- datum: h
41
+ datum: x
50
42
  };
51
- }), m = t ? (u = (x = c[0]) == null ? void 0 : x.datum) == null ? void 0 : u[t] : void 0, f = {
43
+ }), m = t ? (u = (v = c[0]) == null ? void 0 : v.datum) == null ? void 0 : u[t] : void 0, f = {
52
44
  active: !!r,
53
45
  label: typeof m == "string" || typeof m == "number" ? m : a,
54
46
  items: c,
55
47
  formatValue: i
56
48
  };
57
- if (s) return /* @__PURE__ */ e(G, { children: s(f) });
49
+ if (l) return /* @__PURE__ */ e(E, { children: l(f) });
58
50
  if (!f.active || !c.length) return null;
59
- const l = c.length === 1, g = f.label ?? (l ? c[0].name : void 0);
51
+ const o = c.length === 1, b = f.label ?? (o ? c[0].name : void 0);
60
52
  return /* @__PURE__ */ y("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
61
- /* @__PURE__ */ e("div", { className: C("text-xs font-medium tracking-wide uppercase text-background/60", !l && "mb-1"), children: g }),
53
+ /* @__PURE__ */ e("div", { className: C("text-xs font-medium tracking-wide uppercase text-background/60", !o && "mb-1"), children: b }),
62
54
  c.map((d) => /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
63
- !l && /* @__PURE__ */ y(G, { children: [
55
+ !o && /* @__PURE__ */ y(E, { children: [
64
56
  /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: d.color } }),
65
57
  /* @__PURE__ */ e("span", { className: "text-background/70", children: d.name })
66
58
  ] }),
@@ -69,25 +61,25 @@ function M({
69
61
  ] });
70
62
  }
71
63
  const V = "pointer-events-none inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap";
72
- function Me({ viewBox: r, label: n, color: a, axis: i }) {
64
+ function Fe({ viewBox: r, label: n, color: a, axis: i }) {
73
65
  const t = r ?? {};
74
66
  return i === "y" ? /* @__PURE__ */ e("foreignObject", { x: t.x ?? 0, y: (t.y ?? 0) - 10, width: t.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: C(V, S[a].pill), children: n }) }) }) : /* @__PURE__ */ e("foreignObject", { x: (t.x ?? 0) - 90, y: (t.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: C(V, S[a].pill), children: n }) }) });
75
67
  }
76
- function Le({ viewBox: r, label: n, color: a }) {
68
+ function Me({ viewBox: r, label: n, color: a }) {
77
69
  const i = r ?? {};
78
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: C(V, S[a].pill), children: n }) }) });
79
71
  }
80
- function Oe({
72
+ function Le({
81
73
  cx: r,
82
74
  cy: n,
83
75
  n: a,
84
76
  ann: i,
85
77
  onEnter: t,
86
- onLeave: s
78
+ onLeave: l
87
79
  }) {
88
- const [c, m] = k.useState(!1);
80
+ const [c, m] = N.useState(!1);
89
81
  if (r == null || n == null || !Number.isFinite(r) || !Number.isFinite(n)) return /* @__PURE__ */ e("g", {});
90
- const f = () => t({ ann: i, n: a, cx: r, cy: n }), l = () => s();
82
+ const f = () => t({ ann: i, n: a, cx: r, cy: n }), o = () => l();
91
83
  return /* @__PURE__ */ y(
92
84
  "g",
93
85
  {
@@ -96,12 +88,12 @@ function Oe({
96
88
  "aria-label": `Annotation ${a}: ${i.label}`,
97
89
  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",
98
90
  onMouseEnter: f,
99
- onMouseLeave: l,
91
+ onMouseLeave: o,
100
92
  onFocus: () => {
101
93
  m(!0), f();
102
94
  },
103
95
  onBlur: () => {
104
- m(!1), l();
96
+ m(!1), o();
105
97
  },
106
98
  children: [
107
99
  c && /* @__PURE__ */ e("circle", { cx: r, cy: n, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
@@ -122,8 +114,8 @@ function Oe({
122
114
  }
123
115
  );
124
116
  }
125
- function Se({ hovered: r, frameWidth: n, format: a }) {
126
- return /* @__PURE__ */ e(Ae, { reducedMotion: "user", children: /* @__PURE__ */ e(Ce, { children: r && /* @__PURE__ */ e(
117
+ function Oe({ hovered: r, frameWidth: n, format: a }) {
118
+ return /* @__PURE__ */ e(we, { reducedMotion: "user", children: /* @__PURE__ */ e(Ae, { children: r && /* @__PURE__ */ e(
127
119
  "div",
128
120
  {
129
121
  className: "pointer-events-none absolute z-10",
@@ -132,9 +124,9 @@ function Se({ hovered: r, frameWidth: n, format: a }) {
132
124
  top: r.cy - 16
133
125
  },
134
126
  children: /* @__PURE__ */ y(
135
- Re.div,
127
+ Ce.div,
136
128
  {
137
- variants: Fe,
129
+ variants: Re,
138
130
  initial: "hidden",
139
131
  animate: "visible",
140
132
  exit: "hidden",
@@ -164,42 +156,42 @@ function Se({ hovered: r, frameWidth: n, format: a }) {
164
156
  }
165
157
  ) }) });
166
158
  }
167
- function K(r) {
168
- const [n, a] = k.useState(null), i = k.useCallback(() => a(null), []), { back: t, front: s } = k.useMemo(() => {
159
+ function Q(r) {
160
+ const [n, a] = N.useState(null), i = N.useCallback(() => a(null), []), { back: t, front: l } = N.useMemo(() => {
169
161
  const c = [], m = [];
170
162
  let f = 0;
171
- return (r ?? []).forEach((l, g) => {
172
- const x = l.color ?? "primary";
173
- if (l.kind === "band") {
174
- const u = l.axis ?? "y";
163
+ return (r ?? []).forEach((o, b) => {
164
+ const v = o.color ?? "primary";
165
+ if (o.kind === "band") {
166
+ const u = o.axis ?? "y";
175
167
  c.push(
176
168
  /* @__PURE__ */ e(
177
- ke,
169
+ ye,
178
170
  {
179
- ...u === "y" ? { y1: l.from, y2: l.to } : { x1: l.from, x2: l.to },
180
- fill: S[x].ref,
171
+ ...u === "y" ? { y1: o.from, y2: o.to } : { x1: o.from, x2: o.to },
172
+ fill: S[v].ref,
181
173
  fillOpacity: 0.06,
182
174
  stroke: "none",
183
175
  ifOverflow: u === "y" ? "extendDomain" : "visible",
184
- label: l.label ? /* @__PURE__ */ e(Le, { label: l.label, color: x }) : void 0
176
+ label: o.label ? /* @__PURE__ */ e(Me, { label: o.label, color: v }) : void 0
185
177
  },
186
- `ann-${g}`
178
+ `ann-${b}`
187
179
  )
188
180
  );
189
- } else if (l.kind === "line") {
190
- const u = l.axis ?? "y";
181
+ } else if (o.kind === "line") {
182
+ const u = o.axis ?? "y";
191
183
  m.push(
192
184
  /* @__PURE__ */ e(
193
185
  Ne,
194
186
  {
195
- ...u === "y" ? { y: l.value } : { x: l.value },
196
- stroke: S[x].ref,
187
+ ...u === "y" ? { y: o.value } : { x: o.value },
188
+ stroke: S[v].ref,
197
189
  strokeWidth: 1,
198
190
  strokeDasharray: "4 4",
199
191
  ifOverflow: u === "y" ? "extendDomain" : "visible",
200
- label: l.label ? /* @__PURE__ */ e(Me, { label: l.label, color: x, axis: u }) : void 0
192
+ label: o.label ? /* @__PURE__ */ e(Fe, { label: o.label, color: v, axis: u }) : void 0
201
193
  },
202
- `ann-${g}`
194
+ `ann-${b}`
203
195
  )
204
196
  );
205
197
  } else {
@@ -207,22 +199,22 @@ function K(r) {
207
199
  const u = f;
208
200
  m.push(
209
201
  /* @__PURE__ */ e(
210
- we,
202
+ ke,
211
203
  {
212
- x: l.x,
213
- y: l.y,
204
+ x: o.x,
205
+ y: o.y,
214
206
  ifOverflow: "visible",
215
- shape: (d) => /* @__PURE__ */ e(Oe, { cx: d.cx, cy: d.cy, n: u, ann: l, onEnter: a, onLeave: i })
207
+ shape: (d) => /* @__PURE__ */ e(Le, { cx: d.cx, cy: d.cy, n: u, ann: o, onEnter: a, onLeave: i })
216
208
  },
217
- `ann-${g}`
209
+ `ann-${b}`
218
210
  )
219
211
  );
220
212
  }
221
213
  }), { back: c, front: m };
222
214
  }, [r, i]);
223
- return { back: t, front: s, hovered: n };
215
+ return { back: t, front: l, hovered: n };
224
216
  }
225
- function W({
217
+ function z({
226
218
  items: r,
227
219
  align: n = "end",
228
220
  className: a
@@ -237,48 +229,48 @@ function W({
237
229
  t.label
238
230
  ] }, t.label)) });
239
231
  }
240
- const D = k.forwardRef(
241
- ({ className: r, height: n, legendItems: a, hovered: i, format: t, children: s, ...c }, m) => {
242
- var g;
243
- const f = k.useRef(null);
244
- return /* @__PURE__ */ y("div", { ref: (x) => {
245
- f.current = x, typeof m == "function" ? m(x) : m && (m.current = x);
232
+ const $ = N.forwardRef(
233
+ ({ className: r, height: n, legendItems: a, hovered: i, format: t, children: l, ...c }, m) => {
234
+ var b;
235
+ const f = N.useRef(null);
236
+ return /* @__PURE__ */ y("div", { ref: (v) => {
237
+ f.current = v, typeof m == "function" ? m(v) : m && (m.current = v);
246
238
  }, className: C("relative w-full font-sans", r), ...c, children: [
247
- a && /* @__PURE__ */ e(W, { items: a }),
248
- /* @__PURE__ */ e($, { width: "100%", height: n, children: s }),
249
- /* @__PURE__ */ e(Se, { hovered: i, frameWidth: ((g = f.current) == null ? void 0 : g.clientWidth) ?? 0, format: t })
239
+ a && /* @__PURE__ */ e(z, { items: a }),
240
+ /* @__PURE__ */ e(B, { width: "100%", height: n, children: l }),
241
+ /* @__PURE__ */ e(Oe, { hovered: i, frameWidth: ((b = f.current) == null ? void 0 : b.clientWidth) ?? 0, format: t })
250
242
  ] });
251
243
  }
252
244
  );
253
- D.displayName = "ChartFrame";
254
- function z(r) {
245
+ $.displayName = "ChartFrame";
246
+ function P(r) {
255
247
  const {
256
248
  data: n,
257
249
  categoryKey: a,
258
250
  series: i,
259
251
  seriesLabels: t,
260
- highlight: s,
252
+ highlight: l,
261
253
  annotations: c,
262
254
  grid: m = !0,
263
255
  legend: f,
264
- showYAxis: l = !0,
265
- formatValue: g,
266
- xScale: x = "category",
256
+ showYAxis: o = !0,
257
+ formatValue: b,
258
+ xScale: v = "category",
267
259
  xDomain: u,
268
260
  yDomain: d,
269
261
  xTickFormatter: p,
270
- yTickFormatter: h,
271
- yAxisWidth: o = 44
272
- } = r, v = k.useMemo(() => i ?? Q(n, a), [i, n, a]), b = g ?? L, N = h ?? ((R) => typeof R == "number" ? b(R) : R), O = K(c), w = (R, P) => s && v.includes(s) ? R === s ? "var(--color-chart-1)" : _ : J(P), A = (R) => (t == null ? void 0 : t[R]) ?? R, te = f ?? v.length > 1 ? v.map((R, P) => ({ label: A(R), color: w(R, P) })) : null;
273
- return { names: v, format: b, layers: O, legendItems: te, furniture: [
262
+ yTickFormatter: x,
263
+ yAxisWidth: s = 44
264
+ } = r, g = N.useMemo(() => i ?? J(n, a), [i, n, a]), h = b ?? L, k = x ?? ((R) => typeof R == "number" ? h(R) : R), O = Q(c), w = (R, G) => l && g.includes(l) ? R === l ? "var(--color-chart-1)" : _ : W(G), A = (R) => (t == null ? void 0 : t[R]) ?? R, ee = f ?? g.length > 1 ? g.map((R, G) => ({ label: A(R), color: w(R, G) })) : null;
265
+ return { names: g, format: h, layers: O, legendItems: ee, furniture: [
274
266
  m ? /* @__PURE__ */ e(Y, { vertical: !1, stroke: "var(--border)" }, "grid") : null,
275
267
  /* @__PURE__ */ e(
276
268
  H,
277
269
  {
278
270
  dataKey: a,
279
- type: x === "time" ? "number" : "category",
280
- scale: x === "time" ? "time" : "auto",
281
- domain: x === "time" ? u ?? ["dataMin", "dataMax"] : u,
271
+ type: v === "time" ? "number" : "category",
272
+ scale: v === "time" ? "time" : "auto",
273
+ domain: v === "time" ? u ?? ["dataMin", "dataMax"] : u,
282
274
  allowDataOverflow: !!u,
283
275
  axisLine: !1,
284
276
  tickLine: !1,
@@ -288,26 +280,26 @@ function z(r) {
288
280
  },
289
281
  "x"
290
282
  ),
291
- l ? /* @__PURE__ */ e(
283
+ o ? /* @__PURE__ */ e(
292
284
  I,
293
285
  {
294
- width: o,
286
+ width: s,
295
287
  domain: d,
296
288
  allowDataOverflow: !!d,
297
289
  axisLine: !1,
298
290
  tickLine: !1,
299
291
  tickMargin: 6,
300
- tick: /* @__PURE__ */ e(T, { anchor: "end", dy: "0.32em", format: N })
292
+ tick: /* @__PURE__ */ e(T, { anchor: "end", dy: "0.32em", format: k })
301
293
  },
302
294
  "y"
303
295
  ) : null
304
296
  ], colorFor: w, labelFor: A };
305
297
  }
306
- const j = { top: 20, right: 12, bottom: 4, left: 0 }, Te = k.forwardRef(
307
- ({ height: r = 280, curve: n = "natural", forecastKeys: a, className: i, ...t }, s) => {
308
- const { names: c, format: m, layers: f, legendItems: l, furniture: g, colorFor: x, labelFor: u } = z(t);
309
- return /* @__PURE__ */ e(D, { ref: s, className: i, height: r, legendItems: l, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(re, { data: t.data, margin: j, children: [
310
- g,
298
+ const D = { top: 20, right: 12, bottom: 4, left: 0 }, Se = N.forwardRef(
299
+ ({ height: r = 280, curve: n = "natural", forecastKeys: a, className: i, ...t }, l) => {
300
+ const { names: c, format: m, layers: f, legendItems: o, furniture: b, colorFor: v, labelFor: u } = P(t);
301
+ return /* @__PURE__ */ e($, { ref: l, className: i, height: r, legendItems: o, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(te, { data: t.data, margin: D, children: [
302
+ b,
311
303
  t.tooltip !== !1 && /* @__PURE__ */ e(
312
304
  F,
313
305
  {
@@ -329,7 +321,7 @@ const j = { top: 20, right: 12, bottom: 4, left: 0 }, Te = k.forwardRef(
329
321
  dataKey: d,
330
322
  name: u(d),
331
323
  type: n,
332
- stroke: x(d, p),
324
+ stroke: v(d, p),
333
325
  strokeWidth: 2,
334
326
  strokeDasharray: a != null && a.includes(d) ? "6 4" : void 0,
335
327
  dot: !1,
@@ -342,61 +334,61 @@ const j = { top: 20, right: 12, bottom: 4, left: 0 }, Te = k.forwardRef(
342
334
  ] }) });
343
335
  }
344
336
  );
345
- Te.displayName = "LineChart";
346
- const Be = k.forwardRef(
347
- ({ height: r = 280, curve: n = "natural", stacked: a = !1, forecastKeys: i, className: t, ...s }, c) => {
348
- const { names: m, format: f, layers: l, legendItems: g, furniture: x, colorFor: u, labelFor: d } = z(s), p = k.useId().replace(/[^a-zA-Z0-9]/g, "");
349
- return /* @__PURE__ */ e(D, { ref: c, className: t, height: r, legendItems: g, hovered: l.hovered, format: f, children: /* @__PURE__ */ y(ae, { data: s.data, margin: j, children: [
350
- /* @__PURE__ */ e("defs", { children: m.map((h, o) => /* @__PURE__ */ y("linearGradient", { id: `${p}-${o}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
351
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: u(h, o), stopOpacity: 0.18 }),
352
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: u(h, o), stopOpacity: 0.02 })
353
- ] }, h)) }),
354
- x,
355
- s.tooltip !== !1 && /* @__PURE__ */ e(
337
+ Se.displayName = "LineChart";
338
+ const Te = N.forwardRef(
339
+ ({ height: r = 280, curve: n = "natural", stacked: a = !1, forecastKeys: i, className: t, ...l }, c) => {
340
+ const { names: m, format: f, layers: o, legendItems: b, furniture: v, colorFor: u, labelFor: d } = P(l), p = N.useId().replace(/[^a-zA-Z0-9]/g, "");
341
+ return /* @__PURE__ */ e($, { ref: c, className: t, height: r, legendItems: b, hovered: o.hovered, format: f, children: /* @__PURE__ */ y(re, { data: l.data, margin: D, children: [
342
+ /* @__PURE__ */ e("defs", { children: m.map((x, s) => /* @__PURE__ */ y("linearGradient", { id: `${p}-${s}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
343
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: u(x, s), stopOpacity: 0.18 }),
344
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: u(x, s), stopOpacity: 0.02 })
345
+ ] }, x)) }),
346
+ v,
347
+ l.tooltip !== !1 && /* @__PURE__ */ e(
356
348
  F,
357
349
  {
358
350
  content: /* @__PURE__ */ e(
359
351
  M,
360
352
  {
361
353
  format: f,
362
- renderer: s.tooltip
354
+ renderer: l.tooltip
363
355
  }
364
356
  ),
365
357
  cursor: { stroke: "var(--border-strong)" },
366
358
  isAnimationActive: !1
367
359
  }
368
360
  ),
369
- l.back,
370
- m.map((h, o) => /* @__PURE__ */ e(
371
- ne,
361
+ o.back,
362
+ m.map((x, s) => /* @__PURE__ */ e(
363
+ ae,
372
364
  {
373
- dataKey: h,
374
- name: d(h),
365
+ dataKey: x,
366
+ name: d(x),
375
367
  type: n,
376
368
  stackId: a ? "stack" : void 0,
377
- stroke: u(h, o),
369
+ stroke: u(x, s),
378
370
  strokeWidth: 2,
379
- strokeDasharray: i != null && i.includes(h) ? "6 4" : void 0,
380
- fill: `url(#${p}-${o})`,
371
+ strokeDasharray: i != null && i.includes(x) ? "6 4" : void 0,
372
+ fill: `url(#${p}-${s})`,
381
373
  activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
382
374
  isAnimationActive: !1
383
375
  },
384
- h
376
+ x
385
377
  )),
386
- l.front
378
+ o.front
387
379
  ] }) });
388
380
  }
389
381
  );
390
- Be.displayName = "AreaChart";
391
- const $e = k.forwardRef(
382
+ Te.displayName = "AreaChart";
383
+ const Be = N.forwardRef(
392
384
  ({
393
385
  height: r = 280,
394
386
  stacked: n = !1,
395
387
  layout: a = "vertical",
396
388
  className: i,
397
389
  ...t
398
- }, s) => {
399
- const { names: c, format: m, layers: f, legendItems: l, furniture: g, colorFor: x, labelFor: u } = z(t), d = a === "horizontal", p = t.xTickFormatter ?? ((v) => typeof v == "number" ? m(v) : v), h = [
390
+ }, l) => {
391
+ const { names: c, format: m, layers: f, legendItems: o, furniture: b, colorFor: v, labelFor: u } = P(t), d = a === "horizontal", p = t.xTickFormatter ?? ((g) => typeof g == "number" ? m(g) : g), x = [
400
392
  t.grid !== !1 ? /* @__PURE__ */ e(
401
393
  Y,
402
394
  {
@@ -440,16 +432,16 @@ const $e = k.forwardRef(
440
432
  },
441
433
  "y"
442
434
  ) : null
443
- ], o = t.highlight && c.length === 1 && !c.includes(t.highlight) ? t.highlight : null;
444
- return /* @__PURE__ */ e(D, { ref: s, className: i, height: r, legendItems: l, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(
445
- ie,
435
+ ], s = t.highlight && c.length === 1 && !c.includes(t.highlight) ? t.highlight : null;
436
+ return /* @__PURE__ */ e($, { ref: l, className: i, height: r, legendItems: o, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(
437
+ ne,
446
438
  {
447
439
  data: t.data,
448
440
  layout: d ? "vertical" : "horizontal",
449
- margin: j,
441
+ margin: D,
450
442
  barCategoryGap: "24%",
451
443
  children: [
452
- d ? h : g,
444
+ d ? x : b,
453
445
  t.tooltip !== !1 && /* @__PURE__ */ e(
454
446
  F,
455
447
  {
@@ -465,27 +457,27 @@ const $e = k.forwardRef(
465
457
  }
466
458
  ),
467
459
  f.back,
468
- c.map((v, b) => {
469
- const N = n ? b === c.length - 1 : !0, O = d ? [0, 4, 4, 0] : [4, 4, 0, 0];
460
+ c.map((g, h) => {
461
+ const k = n ? h === c.length - 1 : !0, O = d ? [0, 4, 4, 0] : [4, 4, 0, 0];
470
462
  return /* @__PURE__ */ e(
471
463
  Z,
472
464
  {
473
- dataKey: v,
474
- name: u(v),
465
+ dataKey: g,
466
+ name: u(g),
475
467
  stackId: n ? "stack" : void 0,
476
- fill: x(v, b),
477
- radius: N ? O : 0,
468
+ fill: v(g, h),
469
+ radius: k ? O : 0,
478
470
  maxBarSize: 48,
479
471
  isAnimationActive: !1,
480
- children: o && t.data.map((w) => /* @__PURE__ */ e(
472
+ children: s && t.data.map((w) => /* @__PURE__ */ e(
481
473
  X,
482
474
  {
483
- fill: w[t.categoryKey] === o ? "var(--color-chart-1)" : _
475
+ fill: w[t.categoryKey] === s ? "var(--color-chart-1)" : _
484
476
  },
485
477
  String(w[t.categoryKey])
486
478
  ))
487
479
  },
488
- v
480
+ g
489
481
  );
490
482
  }),
491
483
  f.front
@@ -494,11 +486,11 @@ const $e = k.forwardRef(
494
486
  ) });
495
487
  }
496
488
  );
497
- $e.displayName = "BarChart";
498
- const ee = k.forwardRef(
499
- ({ height: r = 280, lineKeys: n, dualAxis: a = !1, stacked: i = !1, forecastKeys: t, className: s, ...c }, m) => {
500
- const { names: f, format: l, layers: g, legendItems: x, furniture: u, colorFor: d, labelFor: p } = z(c), h = f.filter((o) => !n.includes(o));
501
- return /* @__PURE__ */ e(D, { ref: m, className: s, height: r, legendItems: x, hovered: g.hovered, format: l, children: /* @__PURE__ */ y(oe, { data: c.data, margin: j, barCategoryGap: "24%", children: [
489
+ Be.displayName = "BarChart";
490
+ const K = N.forwardRef(
491
+ ({ height: r = 280, lineKeys: n, dualAxis: a = !1, stacked: i = !1, forecastKeys: t, className: l, ...c }, m) => {
492
+ const { names: f, format: o, layers: b, legendItems: v, furniture: u, colorFor: d, labelFor: p } = P(c), x = f.filter((s) => !n.includes(s));
493
+ return /* @__PURE__ */ e($, { ref: m, className: l, height: r, legendItems: v, hovered: b.hovered, format: o, children: /* @__PURE__ */ y(ie, { data: c.data, margin: D, barCategoryGap: "24%", children: [
502
494
  u,
503
495
  a && /* @__PURE__ */ e(
504
496
  I,
@@ -514,7 +506,7 @@ const ee = k.forwardRef(
514
506
  {
515
507
  anchor: "start",
516
508
  dy: "0.32em",
517
- format: (o) => typeof o == "number" ? l(o) : o
509
+ format: (s) => typeof s == "number" ? o(s) : s
518
510
  }
519
511
  )
520
512
  }
@@ -525,7 +517,7 @@ const ee = k.forwardRef(
525
517
  content: /* @__PURE__ */ e(
526
518
  M,
527
519
  {
528
- format: l,
520
+ format: o,
529
521
  renderer: c.tooltip
530
522
  }
531
523
  ),
@@ -533,87 +525,87 @@ const ee = k.forwardRef(
533
525
  isAnimationActive: !1
534
526
  }
535
527
  ),
536
- g.back,
537
- h.map((o) => {
538
- const v = f.indexOf(o), b = i ? o === h[h.length - 1] : !0;
528
+ b.back,
529
+ x.map((s) => {
530
+ const g = f.indexOf(s), h = i ? s === x[x.length - 1] : !0;
539
531
  return /* @__PURE__ */ e(
540
532
  Z,
541
533
  {
542
- dataKey: o,
543
- name: p(o),
534
+ dataKey: s,
535
+ name: p(s),
544
536
  stackId: i ? "stack" : void 0,
545
- fill: d(o, v),
546
- radius: b ? [4, 4, 0, 0] : 0,
537
+ fill: d(s, g),
538
+ radius: h ? [4, 4, 0, 0] : 0,
547
539
  maxBarSize: 48,
548
540
  isAnimationActive: !1
549
541
  },
550
- o
542
+ s
551
543
  );
552
544
  }),
553
- n.map((o) => {
554
- const v = f.indexOf(o);
545
+ n.map((s) => {
546
+ const g = f.indexOf(s);
555
547
  return /* @__PURE__ */ e(
556
548
  U,
557
549
  {
558
- dataKey: o,
559
- name: p(o),
550
+ dataKey: s,
551
+ name: p(s),
560
552
  yAxisId: a ? "right" : void 0,
561
553
  type: "natural",
562
- stroke: d(o, v),
554
+ stroke: d(s, g),
563
555
  strokeWidth: 2,
564
- strokeDasharray: t != null && t.includes(o) ? "6 4" : void 0,
556
+ strokeDasharray: t != null && t.includes(s) ? "6 4" : void 0,
565
557
  dot: !1,
566
558
  activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
567
559
  isAnimationActive: !1
568
560
  },
569
- o
561
+ s
570
562
  );
571
563
  }),
572
- g.front
564
+ b.front
573
565
  ] }) });
574
566
  }
575
567
  );
576
- ee.displayName = "ComboChart";
577
- const De = k.forwardRef(
578
- (r, n) => /* @__PURE__ */ e(ee, { ref: n, ...r })
568
+ K.displayName = "ComboChart";
569
+ const $e = N.forwardRef(
570
+ (r, n) => /* @__PURE__ */ e(K, { ref: n, ...r })
579
571
  );
580
- De.displayName = "ComposedChart";
581
- const je = k.forwardRef(
572
+ $e.displayName = "ComposedChart";
573
+ const De = N.forwardRef(
582
574
  ({
583
575
  data: r,
584
576
  xKey: n,
585
577
  yKey: a,
586
578
  labelKey: i,
587
579
  annotations: t,
588
- height: s = 280,
580
+ height: l = 280,
589
581
  grid: c = !0,
590
582
  showYAxis: m = !0,
591
583
  formatValue: f,
592
- xScale: l = "number",
593
- xDomain: g,
594
- yDomain: x,
584
+ xScale: o = "number",
585
+ xDomain: b,
586
+ yDomain: v,
595
587
  xTickFormatter: u,
596
588
  yTickFormatter: d,
597
589
  yAxisWidth: p = 44,
598
- tooltip: h,
599
- className: o
600
- }, v) => {
601
- const b = f ?? L, N = u ?? ((A) => typeof A == "number" ? L(A) : A), O = d ?? ((A) => typeof A == "number" ? b(A) : A), w = K(t);
602
- return /* @__PURE__ */ e(D, { ref: v, className: o, height: s, legendItems: null, hovered: w.hovered, format: b, children: /* @__PURE__ */ y(le, { margin: j, children: [
590
+ tooltip: x,
591
+ className: s
592
+ }, g) => {
593
+ const h = f ?? L, k = u ?? ((A) => typeof A == "number" ? L(A) : A), O = d ?? ((A) => typeof A == "number" ? h(A) : A), w = Q(t);
594
+ return /* @__PURE__ */ e($, { ref: g, className: s, height: l, legendItems: null, hovered: w.hovered, format: h, children: /* @__PURE__ */ y(oe, { margin: D, children: [
603
595
  c && /* @__PURE__ */ e(Y, { vertical: !1, stroke: "var(--border)" }),
604
596
  /* @__PURE__ */ e(
605
597
  H,
606
598
  {
607
599
  type: "number",
608
600
  dataKey: n,
609
- scale: l === "time" ? "time" : "auto",
610
- domain: g ?? (l === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
611
- allowDataOverflow: !!g,
601
+ scale: o === "time" ? "time" : "auto",
602
+ domain: b ?? (o === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
603
+ allowDataOverflow: !!b,
612
604
  axisLine: !1,
613
605
  tickLine: !1,
614
606
  minTickGap: 28,
615
607
  tickMargin: 10,
616
- tick: /* @__PURE__ */ e(T, { anchor: "middle", dy: 0, format: N })
608
+ tick: /* @__PURE__ */ e(T, { anchor: "middle", dy: 0, format: k })
617
609
  }
618
610
  ),
619
611
  m && /* @__PURE__ */ e(
@@ -622,23 +614,23 @@ const je = k.forwardRef(
622
614
  type: "number",
623
615
  dataKey: a,
624
616
  width: p,
625
- domain: x,
626
- allowDataOverflow: !!x,
617
+ domain: v,
618
+ allowDataOverflow: !!v,
627
619
  axisLine: !1,
628
620
  tickLine: !1,
629
621
  tickMargin: 6,
630
622
  tick: /* @__PURE__ */ e(T, { anchor: "end", dy: "0.32em", format: O })
631
623
  }
632
624
  ),
633
- h !== !1 && /* @__PURE__ */ e(
625
+ x !== !1 && /* @__PURE__ */ e(
634
626
  F,
635
627
  {
636
628
  content: /* @__PURE__ */ e(
637
629
  M,
638
630
  {
639
- format: b,
631
+ format: h,
640
632
  labelKey: i,
641
- renderer: h
633
+ renderer: x
642
634
  }
643
635
  ),
644
636
  cursor: { stroke: "var(--border-strong)", strokeDasharray: "4 4" },
@@ -647,7 +639,7 @@ const je = k.forwardRef(
647
639
  ),
648
640
  w.back,
649
641
  /* @__PURE__ */ e(
650
- se,
642
+ le,
651
643
  {
652
644
  data: r,
653
645
  fill: "var(--color-chart-1)",
@@ -659,44 +651,44 @@ const je = k.forwardRef(
659
651
  ] }) });
660
652
  }
661
653
  );
662
- je.displayName = "ScatterChart";
663
- const Ie = k.forwardRef(
654
+ De.displayName = "ScatterChart";
655
+ const je = N.forwardRef(
664
656
  ({
665
657
  data: r,
666
658
  nameKey: n,
667
659
  valueKey: a,
668
660
  donut: i = !0,
669
661
  centerLabel: t,
670
- highlight: s,
662
+ highlight: l,
671
663
  height: c = 260,
672
664
  legend: m = !0,
673
665
  formatValue: f,
674
- tooltip: l,
675
- className: g
676
- }, x) => {
677
- const u = f ?? L, d = r.reduce((o, v) => o + (typeof v[a] == "number" ? v[a] : 0), 0), p = (o, v) => s ? o === s ? "var(--color-chart-1)" : B(Math.min(v + 3, E.length - 1)) : B(v), h = m ? r.map((o, v) => ({
678
- label: `${o[n]} · ${d ? Math.round(Number(o[a]) / d * 100) : 0}%`,
679
- color: p(String(o[n]), v)
666
+ tooltip: o,
667
+ className: b
668
+ }, v) => {
669
+ const u = f ?? L, d = r.reduce((g, h) => g + (typeof h[a] == "number" ? h[a] : 0), 0), p = (g, h) => W(h), x = (g) => l && g !== l ? 0.3 : 1, s = m ? r.map((g, h) => ({
670
+ label: `${g[n]} · ${d ? Math.round(Number(g[a]) / d * 100) : 0}%`,
671
+ color: p(String(g[n]), h)
680
672
  })) : null;
681
- return /* @__PURE__ */ y("div", { ref: x, className: C("relative w-full font-sans", g), children: [
682
- h && /* @__PURE__ */ e(W, { items: h }),
673
+ return /* @__PURE__ */ y("div", { ref: v, className: C("relative w-full font-sans", b), children: [
674
+ s && /* @__PURE__ */ e(z, { items: s }),
683
675
  /* @__PURE__ */ y("div", { className: "relative", children: [
684
- /* @__PURE__ */ e($, { width: "100%", height: c, children: /* @__PURE__ */ y(ce, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
685
- l !== !1 && /* @__PURE__ */ e(
676
+ /* @__PURE__ */ e(B, { width: "100%", height: c, children: /* @__PURE__ */ y(se, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
677
+ o !== !1 && /* @__PURE__ */ e(
686
678
  F,
687
679
  {
688
680
  content: /* @__PURE__ */ e(
689
681
  M,
690
682
  {
691
683
  format: u,
692
- renderer: l
684
+ renderer: o
693
685
  }
694
686
  ),
695
687
  isAnimationActive: !1
696
688
  }
697
689
  ),
698
690
  /* @__PURE__ */ e(
699
- de,
691
+ ce,
700
692
  {
701
693
  data: r,
702
694
  dataKey: a,
@@ -707,7 +699,14 @@ const Ie = k.forwardRef(
707
699
  cornerRadius: i ? 4 : 2,
708
700
  stroke: "none",
709
701
  isAnimationActive: !1,
710
- children: r.map((o, v) => /* @__PURE__ */ e(X, { fill: p(String(o[n]), v) }, String(o[n])))
702
+ children: r.map((g, h) => /* @__PURE__ */ e(
703
+ X,
704
+ {
705
+ fill: p(String(g[n]), h),
706
+ fillOpacity: x(String(g[n]))
707
+ },
708
+ String(g[n])
709
+ ))
711
710
  }
712
711
  )
713
712
  ] }) }),
@@ -719,36 +718,36 @@ const Ie = k.forwardRef(
719
718
  ] });
720
719
  }
721
720
  );
722
- Ie.displayName = "PieChart";
723
- const We = k.forwardRef(
721
+ je.displayName = "PieChart";
722
+ const Ie = N.forwardRef(
724
723
  ({
725
724
  data: r,
726
725
  categoryKey: n,
727
726
  series: a,
728
727
  seriesLabels: i,
729
728
  highlight: t,
730
- maxValue: s,
729
+ maxValue: l,
731
730
  height: c = 300,
732
731
  legend: m,
733
732
  formatValue: f,
734
- tooltip: l,
735
- className: g
736
- }, x) => {
737
- const u = k.useMemo(
738
- () => a ?? Q(r, n),
733
+ tooltip: o,
734
+ className: b
735
+ }, v) => {
736
+ const u = N.useMemo(
737
+ () => a ?? J(r, n),
739
738
  [n, r, a]
740
- ), d = f ?? L, p = s ?? Math.max(
739
+ ), d = f ?? L, p = l ?? Math.max(
741
740
  1,
742
741
  ...r.flatMap(
743
- (b) => u.map(
744
- (N) => typeof b[N] == "number" ? b[N] : 0
742
+ (h) => u.map(
743
+ (k) => typeof h[k] == "number" ? h[k] : 0
745
744
  )
746
745
  )
747
- ), h = (b) => (i == null ? void 0 : i[b]) ?? b, o = (b, N) => t && u.includes(t) ? b === t ? "var(--color-chart-1)" : _ : J(N), v = m ?? u.length > 1 ? u.map((b, N) => ({ label: h(b), color: o(b, N) })) : null;
748
- return /* @__PURE__ */ y("div", { ref: x, className: C("relative w-full font-sans", g), children: [
749
- v && /* @__PURE__ */ e(W, { items: v, align: "center" }),
750
- /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e($, { width: "100%", height: c, children: /* @__PURE__ */ y(
751
- me,
746
+ ), x = (h) => (i == null ? void 0 : i[h]) ?? h, s = (h, k) => t && u.includes(t) ? h === t ? "var(--color-chart-1)" : _ : W(k), g = m ?? u.length > 1 ? u.map((h, k) => ({ label: x(h), color: s(h, k) })) : null;
747
+ return /* @__PURE__ */ y("div", { ref: v, className: C("relative w-full font-sans", b), children: [
748
+ g && /* @__PURE__ */ e(z, { items: g, align: "center" }),
749
+ /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(B, { width: "100%", height: c, children: /* @__PURE__ */ y(
750
+ de,
752
751
  {
753
752
  data: r,
754
753
  cx: "50%",
@@ -756,7 +755,7 @@ const We = k.forwardRef(
756
755
  outerRadius: "68%",
757
756
  margin: { top: 10, right: 56, bottom: 16, left: 56 },
758
757
  children: [
759
- /* @__PURE__ */ e(fe, { stroke: "var(--border)", radialLines: !0 }),
758
+ /* @__PURE__ */ e(me, { stroke: "var(--border)", radialLines: !0 }),
760
759
  /* @__PURE__ */ e(
761
760
  q,
762
761
  {
@@ -765,7 +764,7 @@ const We = k.forwardRef(
765
764
  }
766
765
  ),
767
766
  /* @__PURE__ */ e(
768
- ue,
767
+ fe,
769
768
  {
770
769
  angle: 90,
771
770
  domain: [0, p],
@@ -774,32 +773,32 @@ const We = k.forwardRef(
774
773
  tickLine: !1
775
774
  }
776
775
  ),
777
- l !== !1 && /* @__PURE__ */ e(
776
+ o !== !1 && /* @__PURE__ */ e(
778
777
  F,
779
778
  {
780
779
  content: /* @__PURE__ */ e(
781
780
  M,
782
781
  {
783
782
  format: d,
784
- renderer: l
783
+ renderer: o
785
784
  }
786
785
  ),
787
786
  isAnimationActive: !1
788
787
  }
789
788
  ),
790
- u.map((b, N) => /* @__PURE__ */ e(
791
- he,
789
+ u.map((h, k) => /* @__PURE__ */ e(
790
+ ue,
792
791
  {
793
- dataKey: b,
794
- name: h(b),
795
- stroke: o(b, N),
796
- fill: o(b, N),
797
- fillOpacity: t ? b === t ? 0.16 : 0.05 : 0.1,
792
+ dataKey: h,
793
+ name: x(h),
794
+ stroke: s(h, k),
795
+ fill: s(h, k),
796
+ fillOpacity: t ? h === t ? 0.16 : 0.05 : 0.1,
798
797
  strokeWidth: 2,
799
- dot: { r: 2.5, fill: o(b, N), strokeWidth: 0 },
798
+ dot: { r: 2.5, fill: s(h, k), strokeWidth: 0 },
800
799
  isAnimationActive: !1
801
800
  },
802
- b
801
+ h
803
802
  ))
804
803
  ]
805
804
  }
@@ -807,35 +806,35 @@ const We = k.forwardRef(
807
806
  ] });
808
807
  }
809
808
  );
810
- We.displayName = "RadarChart";
811
- const ze = k.forwardRef(
809
+ Ie.displayName = "RadarChart";
810
+ const We = N.forwardRef(
812
811
  ({
813
812
  data: r,
814
813
  nameKey: n,
815
814
  valueKey: a,
816
815
  maxValue: i = 100,
817
816
  centerLabel: t,
818
- height: s = 280,
817
+ height: l = 280,
819
818
  legend: c = !0,
820
819
  formatValue: m,
821
820
  tooltip: f,
822
- className: l
823
- }, g) => {
824
- const x = m ?? L, u = r.map((h, o) => ({
825
- ...h,
826
- name: String(h[n]),
827
- fill: B(o)
821
+ className: o
822
+ }, b) => {
823
+ const v = m ?? L, u = r.map((x, s) => ({
824
+ ...x,
825
+ name: String(x[n]),
826
+ fill: j(s)
828
827
  })), d = u.length ? u.reduce(
829
- (h, o) => h + (typeof o[a] == "number" ? o[a] : 0),
828
+ (x, s) => x + (typeof s[a] == "number" ? s[a] : 0),
830
829
  0
831
- ) / u.length : 0, p = c ? u.map((h, o) => ({
832
- label: String(h[n]),
833
- color: B(o)
830
+ ) / u.length : 0, p = c ? u.map((x, s) => ({
831
+ label: String(x[n]),
832
+ color: j(s)
834
833
  })) : null;
835
- return /* @__PURE__ */ y("div", { ref: g, className: C("relative w-full font-sans", l), children: [
834
+ return /* @__PURE__ */ y("div", { ref: b, className: C("relative w-full font-sans", o), children: [
836
835
  /* @__PURE__ */ y("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
837
- /* @__PURE__ */ e($, { width: "100%", height: s, children: /* @__PURE__ */ y(
838
- xe,
836
+ /* @__PURE__ */ e(B, { width: "100%", height: l, children: /* @__PURE__ */ y(
837
+ he,
839
838
  {
840
839
  data: u,
841
840
  innerRadius: "48%",
@@ -851,7 +850,7 @@ const ze = k.forwardRef(
851
850
  content: /* @__PURE__ */ e(
852
851
  M,
853
852
  {
854
- format: x,
853
+ format: v,
855
854
  renderer: f
856
855
  }
857
856
  ),
@@ -859,7 +858,7 @@ const ze = k.forwardRef(
859
858
  }
860
859
  ),
861
860
  /* @__PURE__ */ e(
862
- ve,
861
+ xe,
863
862
  {
864
863
  dataKey: a,
865
864
  background: { fill: "var(--muted)" },
@@ -872,28 +871,28 @@ const ze = k.forwardRef(
872
871
  }
873
872
  ) }),
874
873
  /* @__PURE__ */ y("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
875
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: x(Math.round(d)) }),
874
+ /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: v(Math.round(d)) }),
876
875
  t && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: t })
877
876
  ] })
878
877
  ] }),
879
- p && /* @__PURE__ */ e(W, { items: p, align: "center", className: "mb-0 mt-3" })
878
+ p && /* @__PURE__ */ e(z, { items: p, align: "center", className: "mb-0 mt-3" })
880
879
  ] });
881
880
  }
882
881
  );
883
- ze.displayName = "RadialBarChart";
884
- function Pe({
882
+ We.displayName = "RadialBarChart";
883
+ function ze({
885
884
  x: r = 0,
886
885
  y: n = 0,
887
886
  width: a = 0,
888
887
  height: i = 0,
889
888
  depth: t = 0,
890
- index: s = 0,
889
+ index: l = 0,
891
890
  name: c,
892
891
  value: m,
893
892
  format: f = L
894
893
  }) {
895
894
  if (t === 0) return /* @__PURE__ */ e("g", {});
896
- const l = t === 0 ? "transparent" : B(s), g = t > 0 && s < 4, x = a > 72 && i > 38;
895
+ const o = t === 0 ? "transparent" : j(l), b = t > 0 && l < 4, v = a > 72 && i > 38;
897
896
  return /* @__PURE__ */ y("g", { children: [
898
897
  /* @__PURE__ */ e(
899
898
  "rect",
@@ -904,12 +903,12 @@ function Pe({
904
903
  height: i,
905
904
  rx: 6,
906
905
  ry: 6,
907
- fill: l,
906
+ fill: o,
908
907
  stroke: "var(--background)",
909
908
  strokeWidth: 4
910
909
  }
911
910
  ),
912
- x && /* @__PURE__ */ e(
911
+ v && /* @__PURE__ */ e(
913
912
  "foreignObject",
914
913
  {
915
914
  x: r + 8,
@@ -923,7 +922,7 @@ function Pe({
923
922
  {
924
923
  className: C(
925
924
  "truncate text-xs font-semibold",
926
- g ? "text-background" : "text-foreground"
925
+ b ? "text-background" : "text-foreground"
927
926
  ),
928
927
  children: c
929
928
  }
@@ -933,7 +932,7 @@ function Pe({
933
932
  {
934
933
  className: C(
935
934
  "text-xs tabular-nums",
936
- g ? "text-background/70" : "text-tertiary"
935
+ b ? "text-background/70" : "text-tertiary"
937
936
  ),
938
937
  children: f(m)
939
938
  }
@@ -943,53 +942,53 @@ function Pe({
943
942
  )
944
943
  ] });
945
944
  }
946
- function Ge(r, n, a) {
947
- const i = [], t = (s) => {
948
- const c = Array.isArray(s.children) ? s.children : void 0;
945
+ function Pe(r, n, a) {
946
+ const i = [], t = (l) => {
947
+ const c = Array.isArray(l.children) ? l.children : void 0;
949
948
  if (c != null && c.length) {
950
949
  c.forEach(t);
951
950
  return;
952
951
  }
953
- typeof s[a] == "number" && i.push({
954
- ...s,
955
- name: String(s[n] ?? ""),
956
- value: s[a]
952
+ typeof l[a] == "number" && i.push({
953
+ ...l,
954
+ name: String(l[n] ?? ""),
955
+ value: l[a]
957
956
  });
958
957
  };
959
958
  return r.forEach(t), i.length ? i : r;
960
959
  }
961
- const Ee = k.forwardRef(
960
+ const Ge = N.forwardRef(
962
961
  ({
963
962
  data: r,
964
963
  nameKey: n,
965
964
  valueKey: a,
966
965
  height: i = 280,
967
966
  formatValue: t,
968
- tooltip: s,
967
+ tooltip: l,
969
968
  className: c
970
969
  }, m) => {
971
- const f = t ?? L, l = k.useMemo(
972
- () => Ge(r, n, a),
970
+ const f = t ?? L, o = N.useMemo(
971
+ () => Pe(r, n, a),
973
972
  [r, n, a]
974
973
  );
975
- return /* @__PURE__ */ e("div", { ref: m, className: C("relative w-full font-sans", c), children: /* @__PURE__ */ e($, { width: "100%", height: i, children: /* @__PURE__ */ e(
974
+ return /* @__PURE__ */ e("div", { ref: m, className: C("relative w-full font-sans", c), children: /* @__PURE__ */ e(B, { width: "100%", height: i, children: /* @__PURE__ */ e(
976
975
  ge,
977
976
  {
978
- data: l,
977
+ data: o,
979
978
  nameKey: n,
980
979
  dataKey: a,
981
980
  type: "flat",
982
981
  aspectRatio: 1.6,
983
- content: /* @__PURE__ */ e(Pe, { format: f }),
982
+ content: /* @__PURE__ */ e(ze, { format: f }),
984
983
  isAnimationActive: !1,
985
- children: s !== !1 && /* @__PURE__ */ e(
984
+ children: l !== !1 && /* @__PURE__ */ e(
986
985
  F,
987
986
  {
988
987
  content: /* @__PURE__ */ e(
989
988
  M,
990
989
  {
991
990
  format: f,
992
- renderer: s
991
+ renderer: l
993
992
  }
994
993
  ),
995
994
  isAnimationActive: !1
@@ -999,39 +998,39 @@ const Ee = k.forwardRef(
999
998
  ) }) });
1000
999
  }
1001
1000
  );
1002
- Ee.displayName = "TreemapChart";
1003
- const Ve = k.forwardRef(
1001
+ Ge.displayName = "TreemapChart";
1002
+ const Ee = N.forwardRef(
1004
1003
  ({
1005
1004
  data: r,
1006
1005
  nameKey: n,
1007
1006
  valueKey: a,
1008
1007
  height: i = 280,
1009
1008
  formatValue: t,
1010
- label: s,
1009
+ label: l,
1011
1010
  labelWidth: c = 176,
1012
1011
  tooltip: m,
1013
1012
  className: f
1014
- }, l) => {
1013
+ }, o) => {
1015
1014
  var d;
1016
- const g = t ?? L, x = Number(((d = r[0]) == null ? void 0 : d[a]) ?? 0), u = (p) => {
1015
+ const b = t ?? L, v = Number(((d = r[0]) == null ? void 0 : d[a]) ?? 0), u = (p) => {
1017
1016
  var A;
1018
- const h = p.index ?? 0, o = r[h];
1019
- if (!o) return /* @__PURE__ */ e("g", {});
1020
- const v = Number(o[a]), b = Number(((A = r[h - 1]) == null ? void 0 : A[a]) ?? v), N = x ? v / x * 100 : 0, O = b ? v / b * 100 : 0, w = {
1021
- datum: o,
1022
- index: h,
1023
- name: String(o[n]),
1024
- value: v,
1025
- conversionFromFirst: N,
1017
+ const x = p.index ?? 0, s = r[x];
1018
+ if (!s) return /* @__PURE__ */ e("g", {});
1019
+ const g = Number(s[a]), h = Number(((A = r[x - 1]) == null ? void 0 : A[a]) ?? g), k = v ? g / v * 100 : 0, O = h ? g / h * 100 : 0, w = {
1020
+ datum: s,
1021
+ index: x,
1022
+ name: String(s[n]),
1023
+ value: g,
1024
+ conversionFromFirst: k,
1026
1025
  conversionFromPrevious: O,
1027
- dropOffFromPrevious: h === 0 ? 0 : 100 - O,
1026
+ dropOffFromPrevious: x === 0 ? 0 : 100 - O,
1028
1027
  x: Number(p.x ?? 0),
1029
1028
  y: Number(p.y ?? 0),
1030
1029
  width: Number(p.width ?? 0),
1031
1030
  height: Number(p.height ?? 0),
1032
- formatValue: g
1031
+ formatValue: b
1033
1032
  };
1034
- return s === !1 ? /* @__PURE__ */ e("g", {}) : s ? /* @__PURE__ */ e(G, { children: s(w) }) : /* @__PURE__ */ y(
1033
+ return l === !1 ? /* @__PURE__ */ e("g", {}) : l ? /* @__PURE__ */ e(E, { children: l(w) }) : /* @__PURE__ */ y(
1035
1034
  "text",
1036
1035
  {
1037
1036
  x: w.x + w.width + 12,
@@ -1043,23 +1042,23 @@ const Ve = k.forwardRef(
1043
1042
  /* @__PURE__ */ e("tspan", { className: "fill-primary font-medium", children: w.name }),
1044
1043
  /* @__PURE__ */ y("tspan", { className: "fill-secondary", children: [
1045
1044
  " · ",
1046
- g(v)
1045
+ b(g)
1047
1046
  ] }),
1048
1047
  /* @__PURE__ */ y("tspan", { className: "fill-tertiary", children: [
1049
1048
  " · ",
1050
- Math.round(N),
1049
+ Math.round(k),
1051
1050
  "%"
1052
1051
  ] })
1053
1052
  ]
1054
1053
  }
1055
1054
  );
1056
1055
  };
1057
- return /* @__PURE__ */ e("div", { ref: l, className: C("relative w-full font-sans", f), children: /* @__PURE__ */ e($, { width: "100%", height: i, children: /* @__PURE__ */ y(
1058
- be,
1056
+ return /* @__PURE__ */ e("div", { ref: o, className: C("relative w-full font-sans", f), children: /* @__PURE__ */ e(B, { width: "100%", height: i, children: /* @__PURE__ */ y(
1057
+ ve,
1059
1058
  {
1060
1059
  margin: {
1061
1060
  top: 8,
1062
- right: s === !1 ? 8 : c,
1061
+ right: l === !1 ? 8 : c,
1063
1062
  bottom: 8,
1064
1063
  left: 8
1065
1064
  },
@@ -1070,33 +1069,33 @@ const Ve = k.forwardRef(
1070
1069
  content: /* @__PURE__ */ e(
1071
1070
  M,
1072
1071
  {
1073
- format: g,
1072
+ format: b,
1074
1073
  renderer: m
1075
1074
  }
1076
1075
  ),
1077
1076
  isAnimationActive: !1
1078
1077
  }
1079
1078
  ),
1080
- /* @__PURE__ */ y(pe, { data: r, dataKey: a, nameKey: n, isAnimationActive: !1, children: [
1081
- r.map((p, h) => /* @__PURE__ */ e(X, { fill: B(h) }, String(p[n]))),
1082
- /* @__PURE__ */ e(ye, { position: "right", content: u })
1079
+ /* @__PURE__ */ y(be, { data: r, dataKey: a, nameKey: n, isAnimationActive: !1, children: [
1080
+ r.map((p, x) => /* @__PURE__ */ e(X, { fill: j(x) }, String(p[n]))),
1081
+ /* @__PURE__ */ e(pe, { position: "right", content: u })
1083
1082
  ] })
1084
1083
  ]
1085
1084
  }
1086
1085
  ) }) });
1087
1086
  }
1088
1087
  );
1089
- Ve.displayName = "FunnelChart";
1088
+ Ee.displayName = "FunnelChart";
1090
1089
  export {
1091
- Be as AreaChart,
1092
- $e as BarChart,
1093
- ee as ComboChart,
1094
- De as ComposedChart,
1095
- Ve as FunnelChart,
1096
- Te as LineChart,
1097
- Ie as PieChart,
1098
- We as RadarChart,
1099
- ze as RadialBarChart,
1100
- je as ScatterChart,
1101
- Ee as TreemapChart
1090
+ Te as AreaChart,
1091
+ Be as BarChart,
1092
+ K as ComboChart,
1093
+ $e as ComposedChart,
1094
+ Ee as FunnelChart,
1095
+ Se as LineChart,
1096
+ je as PieChart,
1097
+ Ie as RadarChart,
1098
+ We as RadialBarChart,
1099
+ De as ScatterChart,
1100
+ Ge as TreemapChart
1102
1101
  };