drizzle-cube 0.4.2 → 0.4.4

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 (100) hide show
  1. package/dist/adapters/express/index.cjs +1 -1
  2. package/dist/adapters/express/index.js +1 -1
  3. package/dist/adapters/fastify/index.cjs +1 -1
  4. package/dist/adapters/fastify/index.js +1 -1
  5. package/dist/adapters/hono/index.cjs +1 -1
  6. package/dist/adapters/hono/index.js +1 -1
  7. package/dist/adapters/mcp-transport-BqLo4hKi.cjs +257 -0
  8. package/dist/adapters/{mcp-transport-Dmolep14.js → mcp-transport-YHDZWKOi.js} +1727 -1624
  9. package/dist/adapters/nextjs/index.cjs +1 -1
  10. package/dist/adapters/nextjs/index.js +1 -1
  11. package/dist/client/charts.js +13 -13
  12. package/dist/client/chunks/{RetentionCombinedChart-7bGP_ozM.js → RetentionCombinedChart-BK8N-MOQ.js} +2 -2
  13. package/dist/client/chunks/{RetentionCombinedChart-7bGP_ozM.js.map → RetentionCombinedChart-BK8N-MOQ.js.map} +1 -1
  14. package/dist/client/chunks/{analysis-builder-CIuNLos1.js → analysis-builder-CNBmAGAO.js} +8 -9
  15. package/dist/client/chunks/{analysis-builder-CIuNLos1.js.map → analysis-builder-CNBmAGAO.js.map} +1 -1
  16. package/dist/client/chunks/{analysis-builder-shared-gky0SKQH.js → analysis-builder-shared-INGGwyTG.js} +6 -6
  17. package/dist/client/chunks/{analysis-builder-shared-gky0SKQH.js.map → analysis-builder-shared-INGGwyTG.js.map} +1 -1
  18. package/dist/client/chunks/{chart-activity-grid-sUkuCJzm.js → chart-activity-grid-DvgTYQaE.js} +2 -2
  19. package/dist/client/chunks/{chart-activity-grid-sUkuCJzm.js.map → chart-activity-grid-DvgTYQaE.js.map} +1 -1
  20. package/dist/client/chunks/{chart-area-C4DIi9k_.js → chart-area-BKjd_STS.js} +3 -3
  21. package/dist/client/chunks/{chart-area-C4DIi9k_.js.map → chart-area-BKjd_STS.js.map} +1 -1
  22. package/dist/client/chunks/{chart-bar-7ZleGCsN.js → chart-bar-DBI41w05.js} +2 -2
  23. package/dist/client/chunks/{chart-bar-7ZleGCsN.js.map → chart-bar-DBI41w05.js.map} +1 -1
  24. package/dist/client/chunks/{chart-bubble-D-auWIjP.js → chart-bubble-BD-1kneU.js} +2 -2
  25. package/dist/client/chunks/{chart-bubble-D-auWIjP.js.map → chart-bubble-BD-1kneU.js.map} +1 -1
  26. package/dist/client/chunks/{chart-config-markdown-DZxdGNVQ.js → chart-config-markdown-6fsr-U6_.js} +38 -8
  27. package/dist/client/chunks/chart-config-markdown-6fsr-U6_.js.map +1 -0
  28. package/dist/client/chunks/{chart-data-table-DW6VNGeW.js → chart-data-table-B74HLpAx.js} +3 -3
  29. package/dist/client/chunks/{chart-data-table-DW6VNGeW.js.map → chart-data-table-B74HLpAx.js.map} +1 -1
  30. package/dist/client/chunks/{chart-funnel-eUJApzmA.js → chart-funnel-DQ9cW6j9.js} +2 -2
  31. package/dist/client/chunks/{chart-funnel-eUJApzmA.js.map → chart-funnel-DQ9cW6j9.js.map} +1 -1
  32. package/dist/client/chunks/{chart-heat-map-DR3O3GXx.js → chart-heat-map-CpIr4tbs.js} +2 -2
  33. package/dist/client/chunks/{chart-heat-map-DR3O3GXx.js.map → chart-heat-map-CpIr4tbs.js.map} +1 -1
  34. package/dist/client/chunks/{chart-kpi-delta-Bp9Yrgyc.js → chart-kpi-delta-DPcSazD3.js} +3 -3
  35. package/dist/client/chunks/{chart-kpi-delta-Bp9Yrgyc.js.map → chart-kpi-delta-DPcSazD3.js.map} +1 -1
  36. package/dist/client/chunks/{chart-kpi-number-B3yvgbr-.js → chart-kpi-number-D62PzKZ1.js} +2 -2
  37. package/dist/client/chunks/{chart-kpi-number-B3yvgbr-.js.map → chart-kpi-number-D62PzKZ1.js.map} +1 -1
  38. package/dist/client/chunks/{chart-kpi-text-D0TsUiaO.js → chart-kpi-text-B6Z5tFV1.js} +3 -3
  39. package/dist/client/chunks/{chart-kpi-text-D0TsUiaO.js.map → chart-kpi-text-B6Z5tFV1.js.map} +1 -1
  40. package/dist/client/chunks/{chart-line-C7VStgaJ.js → chart-line-Ds4BYA0K.js} +3 -3
  41. package/dist/client/chunks/{chart-line-C7VStgaJ.js.map → chart-line-Ds4BYA0K.js.map} +1 -1
  42. package/dist/client/chunks/chart-markdown-Rq6ORisB.js +276 -0
  43. package/dist/client/chunks/chart-markdown-Rq6ORisB.js.map +1 -0
  44. package/dist/client/chunks/{chart-pie-DPdYJSM3.js → chart-pie-BBrLh0iU.js} +2 -2
  45. package/dist/client/chunks/{chart-pie-DPdYJSM3.js.map → chart-pie-BBrLh0iU.js.map} +1 -1
  46. package/dist/client/chunks/{chart-radar-DF6VNSiC.js → chart-radar-vr5FgjHT.js} +2 -2
  47. package/dist/client/chunks/{chart-radar-DF6VNSiC.js.map → chart-radar-vr5FgjHT.js.map} +1 -1
  48. package/dist/client/chunks/{chart-radial-bar-7Ttfz-kO.js → chart-radial-bar-BV_3Nm5P.js} +2 -2
  49. package/dist/client/chunks/{chart-radial-bar-7Ttfz-kO.js.map → chart-radial-bar-BV_3Nm5P.js.map} +1 -1
  50. package/dist/client/chunks/{chart-sankey-D86RYk9B.js → chart-sankey-CHROzr4S.js} +2 -2
  51. package/dist/client/chunks/{chart-sankey-D86RYk9B.js.map → chart-sankey-CHROzr4S.js.map} +1 -1
  52. package/dist/client/chunks/{chart-scatter-BUnIiLr_.js → chart-scatter-DbRTU3FG.js} +2 -2
  53. package/dist/client/chunks/{chart-scatter-BUnIiLr_.js.map → chart-scatter-DbRTU3FG.js.map} +1 -1
  54. package/dist/client/chunks/{chart-sunburst-CsHlHfZQ.js → chart-sunburst-B-aPUzYL.js} +2 -2
  55. package/dist/client/chunks/{chart-sunburst-CsHlHfZQ.js.map → chart-sunburst-B-aPUzYL.js.map} +1 -1
  56. package/dist/client/chunks/{chart-tree-map-DFAbkeo1.js → chart-tree-map-qY148fiC.js} +2 -2
  57. package/dist/client/chunks/{chart-tree-map-DFAbkeo1.js.map → chart-tree-map-qY148fiC.js.map} +1 -1
  58. package/dist/client/chunks/{chartConfigRegistry-DNEbwgTc.js → chartConfigRegistry-Di34paQH.js} +2 -2
  59. package/dist/client/chunks/{chartConfigRegistry-DNEbwgTc.js.map → chartConfigRegistry-Di34paQH.js.map} +1 -1
  60. package/dist/client/chunks/{charts-core-DAF1iT_h.js → charts-core-T8UglYyq.js} +224 -224
  61. package/dist/client/chunks/charts-core-T8UglYyq.js.map +1 -0
  62. package/dist/client/chunks/{charts-loader-7pEaEz-f.js → charts-loader-YnhJHubD.js} +21 -21
  63. package/dist/client/chunks/{charts-loader-7pEaEz-f.js.map → charts-loader-YnhJHubD.js.map} +1 -1
  64. package/dist/client/chunks/components-D0i1yQsk.js +9835 -0
  65. package/dist/client/chunks/components-D0i1yQsk.js.map +1 -0
  66. package/dist/client/chunks/{core-DGLxd5v5.js → core-D_8mkGpQ.js} +2 -2
  67. package/dist/client/chunks/{core-DGLxd5v5.js.map → core-D_8mkGpQ.js.map} +1 -1
  68. package/dist/client/chunks/{providers-D2xswCYu.js → providers-CgxXm6Ll.js} +2 -2
  69. package/dist/client/chunks/{providers-D2xswCYu.js.map → providers-CgxXm6Ll.js.map} +1 -1
  70. package/dist/client/chunks/{syntaxHighlighting-DAT9C6Ss.js → syntaxHighlighting-BQfjio-i.js} +2 -2
  71. package/dist/client/chunks/{syntaxHighlighting-DAT9C6Ss.js.map → syntaxHighlighting-BQfjio-i.js.map} +1 -1
  72. package/dist/client/chunks/{useDirtyStateTracking-CTS_m9mg.js → useDirtyStateTracking-Cu1HSjmo.js} +9 -9
  73. package/dist/client/chunks/{useDirtyStateTracking-CTS_m9mg.js.map → useDirtyStateTracking-Cu1HSjmo.js.map} +1 -1
  74. package/dist/client/chunks/{vendor-DfDLOfBe.js → vendor-AVsJ2ni0.js} +4 -4
  75. package/dist/client/chunks/{vendor-DfDLOfBe.js.map → vendor-AVsJ2ni0.js.map} +1 -1
  76. package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +3 -1
  77. package/dist/client/components/FloatingEditToolbar.d.ts +3 -1
  78. package/dist/client/components/TextPortletModal.d.ts +12 -0
  79. package/dist/client/components.js +15 -352
  80. package/dist/client/components.js.map +1 -1
  81. package/dist/client/hooks/useDashboardHook.d.ts +7 -2
  82. package/dist/client/hooks.js +23 -23
  83. package/dist/client/index.js +8 -8
  84. package/dist/client/providers.js +1 -1
  85. package/dist/client/stores/dashboardStore.d.ts +14 -0
  86. package/dist/client/styles.css +1 -1
  87. package/dist/client/types.d.ts +3 -0
  88. package/dist/client/utils.js +6 -6
  89. package/dist/client-bundle-stats.html +1 -1
  90. package/dist/server/index.cjs +83 -83
  91. package/dist/server/index.d.ts +26 -2
  92. package/dist/server/index.js +3034 -2931
  93. package/package.json +1 -1
  94. package/dist/adapters/mcp-transport-h__yKJm9.cjs +0 -257
  95. package/dist/client/chunks/DashboardEditModal-D6TDeTBa.js +0 -9165
  96. package/dist/client/chunks/DashboardEditModal-D6TDeTBa.js.map +0 -1
  97. package/dist/client/chunks/chart-config-markdown-DZxdGNVQ.js.map +0 -1
  98. package/dist/client/chunks/chart-markdown-Cget3iEq.js +0 -257
  99. package/dist/client/chunks/chart-markdown-Cget3iEq.js.map +0 -1
  100. package/dist/client/chunks/charts-core-DAF1iT_h.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { useContext as L, useMemo as U, useRef as H, useState as E, useLayoutEffect as K } from "react";
2
- import { C as V } from "./providers-D2xswCYu.js";
3
1
  import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
+ import { useMemo as U, useContext as L, useRef as H, useState as E, useLayoutEffect as K } from "react";
3
+ import { C as V } from "./providers-CgxXm6Ll.js";
4
4
  import { ResponsiveContainer as T, Tooltip as B } from "recharts";
5
5
  const G = {
6
6
  sm: "dc:h-6 dc:w-6",
@@ -21,13 +21,10 @@ function I({
21
21
  }
22
22
  );
23
23
  }
24
- function Q() {
25
- const e = L(V);
26
- if (!e)
27
- throw new Error("useCubeFieldLabel must be used within CubeProvider");
28
- return U(() => e.getFieldLabel, [e.getFieldLabel]);
24
+ function k({ children: e, className: t = "" }) {
25
+ return /* @__PURE__ */ l("h3", { className: `dc:text-sm dc:font-semibold text-dc-primary dc:uppercase dc:tracking-wide ${t}`, children: e });
29
26
  }
30
- function ee(e) {
27
+ function Q(e) {
31
28
  return e != null && !isNaN(Number(e));
32
29
  }
33
30
  function $(e) {
@@ -60,7 +57,7 @@ function F(e, t, c) {
60
57
  const f = a !== void 0 ? a : Number.isInteger(u) ? 0 : 2;
61
58
  switch (i) {
62
59
  case "currency": {
63
- const o = k(r);
60
+ const o = O(r);
64
61
  if (s && h) {
65
62
  const N = new Intl.NumberFormat(r, {
66
63
  style: "currency",
@@ -101,7 +98,7 @@ function F(e, t, c) {
101
98
  }).format(u) + h;
102
99
  }
103
100
  }
104
- function k(e) {
101
+ function O(e) {
105
102
  const c = e.split("-")[1]?.toUpperCase();
106
103
  return {
107
104
  US: "USD",
@@ -148,14 +145,14 @@ function k(e) {
148
145
  TR: "TRY"
149
146
  }[c] || "USD";
150
147
  }
151
- function te(e) {
148
+ function ee(e) {
152
149
  return (t) => F(t, e);
153
150
  }
154
- function O(e, t) {
151
+ function W(e, t) {
155
152
  return t[e] || e;
156
153
  }
157
- function re(e, t) {
158
- return e.map((c) => O(c, t));
154
+ function te(e, t) {
155
+ return e.map((c) => W(c, t));
159
156
  }
160
157
  function M(e, t) {
161
158
  if (!e) return String(e || "Unknown");
@@ -216,7 +213,7 @@ function P(e, t) {
216
213
  return;
217
214
  }
218
215
  }
219
- function W(e, t, c, n, r = (i) => i) {
216
+ function Y(e, t, c, n, r = (i) => i) {
220
217
  if (!e || e.length === 0) return [];
221
218
  const i = P(n, t);
222
219
  return e.map((s) => {
@@ -229,7 +226,7 @@ function W(e, t, c, n, r = (i) => i) {
229
226
  }), a;
230
227
  });
231
228
  }
232
- function ne(e, t, c, n, r, i = (s) => s) {
229
+ function re(e, t, c, n, r, i = (s) => s) {
233
230
  if (!e || e.length === 0)
234
231
  return { data: [], seriesKeys: [], hasDimensions: !1 };
235
232
  const s = n || {}, a = [
@@ -276,201 +273,22 @@ function ne(e, t, c, n, r, i = (s) => s) {
276
273
  hasDimensions: !0
277
274
  };
278
275
  }
279
- const h = W(e, t, c, n, i), f = c.map((o) => i(o));
276
+ const h = Y(e, t, c, n, i), f = c.map((o) => i(o));
280
277
  return {
281
278
  data: h,
282
279
  seriesKeys: f,
283
280
  hasDimensions: !1
284
281
  };
285
282
  }
286
- const ce = [
287
- "#3b82f6",
288
- // blue
289
- "#10b981",
290
- // green
291
- "#f59e0b",
292
- // yellow
293
- "#ef4444",
294
- // red
295
- "#8b5cf6",
296
- // purple
297
- "#f97316",
298
- // orange
299
- "#06b6d4",
300
- // cyan
301
- "#84cc16"
302
- // lime
303
- ], se = [
304
- "#440154",
305
- // dark purple
306
- "#414487",
307
- // purple-blue
308
- "#2a788e",
309
- // teal
310
- "#22a884",
311
- // green-teal
312
- "#7ad151",
313
- // green
314
- "#fde725"
315
- // yellow
316
- ], ie = "#10b981", ae = "#ef4444", oe = {
317
- top: 5,
318
- right: 30,
319
- left: 20,
320
- bottom: 5
321
- }, de = {
322
- top: 5,
323
- right: 30,
324
- left: 20,
325
- bottom: 60
326
- // Extra space for rotated labels
327
- };
328
- function le({ children: e, height: t = "100%" }) {
329
- const c = H(null), [n, r] = E(!1), [i, s] = E({ width: 0, height: 0 });
330
- K(() => {
331
- let a = !0, m = null;
332
- const d = () => {
333
- if (!a || !c.current) return;
334
- const u = c.current.getBoundingClientRect(), h = Math.max(c.current.clientWidth, u.width), f = Math.max(c.current.clientHeight, u.height);
335
- h > 0 && f > 0 && (s({ width: h, height: f }), r(!0));
336
- };
337
- return m = new ResizeObserver((u) => {
338
- for (const h of u) {
339
- const { width: f, height: o } = h.contentRect;
340
- f > 0 && o > 0 && (s({ width: f, height: o }), n || r(!0));
341
- }
342
- }), c.current && (m.observe(c.current), d()), () => {
343
- a = !1, m?.disconnect();
344
- };
345
- }, [n]);
346
- try {
347
- if (t === "100%")
348
- return /* @__PURE__ */ l(
349
- "div",
350
- {
351
- ref: c,
352
- className: "dc:w-full dc:h-full dc:flex-1 dc:flex dc:flex-col dc:relative",
353
- style: { minHeight: "250px", minWidth: "100px", overflow: "hidden", userSelect: "none" },
354
- children: n && i.width > 0 && i.height > 0 ? /* @__PURE__ */ l(
355
- T,
356
- {
357
- width: i.width,
358
- height: i.height - 16,
359
- debounce: 100,
360
- style: { marginTop: "16px" },
361
- children: e
362
- }
363
- ) : /* @__PURE__ */ l("div", { className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full", children: /* @__PURE__ */ l(I, { size: "sm" }) })
364
- }
365
- );
366
- const a = {
367
- height: typeof t == "number" ? `${t}px` : t,
368
- width: "100%",
369
- minHeight: "200px",
370
- minWidth: "100px",
371
- userSelect: "none"
372
- };
373
- return /* @__PURE__ */ l(
374
- "div",
375
- {
376
- ref: c,
377
- className: "dc:w-full dc:flex dc:flex-col dc:relative",
378
- style: { ...a, overflow: "hidden" },
379
- children: n && i.width > 0 && i.height > 0 ? /* @__PURE__ */ l(
380
- T,
381
- {
382
- width: i.width,
383
- height: i.height - 16,
384
- debounce: 100,
385
- style: { marginTop: "16px" },
386
- children: e
387
- }
388
- ) : /* @__PURE__ */ l("div", { className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full", children: /* @__PURE__ */ l(I, { size: "sm" }) })
389
- }
390
- );
391
- } catch (a) {
392
- return /* @__PURE__ */ p(
393
- "div",
394
- {
395
- className: "dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full dc:h-full dc:p-4 dc:text-center dc:border dc:border-dashed dc:rounded-lg",
396
- style: { height: t, borderColor: "var(--dc-border)", backgroundColor: "var(--dc-surface)" },
397
- children: [
398
- /* @__PURE__ */ l("div", { className: "dc:text-sm dc:font-semibold dc:mb-1 text-dc-text-muted", children: "Unable to display chart" }),
399
- /* @__PURE__ */ l("div", { className: "dc:text-xs text-dc-text-secondary", children: a instanceof Error ? a.message : "Failed to create responsive container" })
400
- ]
401
- }
402
- );
403
- }
404
- }
405
- const Y = (e, t) => e == null ? ["No data", t] : [A(e), t];
406
- function ue({ formatter: e, labelFormatter: t }) {
407
- return /* @__PURE__ */ l(
408
- B,
409
- {
410
- formatter: e || Y,
411
- labelFormatter: t,
412
- contentStyle: {
413
- backgroundColor: "white",
414
- border: "1px solid #e5e7eb",
415
- borderRadius: "0.5rem",
416
- fontSize: "0.875rem",
417
- color: "#1f2937",
418
- boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
419
- padding: "8px 12px"
420
- }
421
- }
422
- );
423
- }
424
- function me(e) {
425
- if (!e || typeof e != "string")
426
- return [];
427
- const t = e.trim();
428
- if (!t)
429
- return [];
430
- try {
431
- const c = t.split(",").map((n) => n.trim()).filter((n) => n !== "").map((n) => {
432
- const r = parseFloat(n);
433
- if (isNaN(r))
434
- throw new Error(`Invalid numeric value: ${n}`);
435
- return r;
436
- });
437
- return c.length > 0 ? c : [];
438
- } catch (c) {
439
- return console.warn("Failed to parse target values:", c), [];
440
- }
441
- }
442
- function fe(e, t) {
443
- if (e.length === 0 || t <= 0)
444
- return [];
445
- if (e.length === 1)
446
- return new Array(t).fill(e[0]);
447
- const c = [], n = Math.floor(t / e.length), r = t % e.length;
448
- let i = 0;
449
- for (let s = 0; s < e.length; s++) {
450
- const a = n + (s < r ? 1 : 0);
451
- for (let m = 0; m < a; m++)
452
- c[i++] = e[s];
453
- }
454
- return c;
455
- }
456
- function he(e, t) {
457
- return t === 0 ? e === 0 ? 0 : e > 0 ? 100 : -100 : (e - t) / t * 100;
458
- }
459
- function be(e, t = 1) {
460
- return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
461
- }
462
- function Z({ children: e, className: t = "" }) {
463
- return /* @__PURE__ */ l("h3", { className: `dc:text-sm dc:font-semibold text-dc-primary dc:uppercase dc:tracking-wide ${t}`, children: e });
464
- }
465
- function z() {
283
+ function Z() {
466
284
  const e = typeof navigator < "u" ? navigator.language : "en-US";
467
285
  return new Intl.NumberFormat(e, {
468
286
  style: "currency",
469
- currency: _(e),
287
+ currency: z(e),
470
288
  currencyDisplay: "narrowSymbol"
471
289
  }).format(0).replace(/[\d.,\s]/g, "").trim() || "$";
472
290
  }
473
- function _(e) {
291
+ function z(e) {
474
292
  const c = e.split("-")[1]?.toUpperCase();
475
293
  return {
476
294
  US: "USD",
@@ -517,13 +335,13 @@ function _(e) {
517
335
  TR: "TRY"
518
336
  }[c] || "USD";
519
337
  }
520
- function pe({
338
+ function ne({
521
339
  value: e,
522
340
  onChange: t,
523
341
  axisLabel: c,
524
342
  previewValue: n = 125e4
525
343
  }) {
526
- const r = U(() => e || {}, [e]), i = U(() => z(), []), s = U(() => F(n, r), [n, r]), a = (d) => {
344
+ const r = U(() => e || {}, [e]), i = U(() => Z(), []), s = U(() => F(n, r), [n, r]), a = (d) => {
527
345
  t({ ...r, ...d });
528
346
  }, m = [
529
347
  { value: "currency", label: i },
@@ -532,7 +350,7 @@ function pe({
532
350
  { value: "custom", label: "Custom" }
533
351
  ];
534
352
  return /* @__PURE__ */ p("div", { className: "dc:space-y-3 dc:pb-4", children: [
535
- /* @__PURE__ */ l(Z, { children: c }),
353
+ /* @__PURE__ */ l(k, { children: c }),
536
354
  /* @__PURE__ */ p("div", { className: "dc:space-y-1", children: [
537
355
  /* @__PURE__ */ l("label", { className: "dc:text-xs text-dc-text-secondary", children: "Label" }),
538
356
  /* @__PURE__ */ l(
@@ -647,33 +465,215 @@ function pe({
647
465
  ] })
648
466
  ] });
649
467
  }
468
+ function ce() {
469
+ const e = L(V);
470
+ if (!e)
471
+ throw new Error("useCubeFieldLabel must be used within CubeProvider");
472
+ return U(() => e.getFieldLabel, [e.getFieldLabel]);
473
+ }
474
+ const se = [
475
+ "#3b82f6",
476
+ // blue
477
+ "#10b981",
478
+ // green
479
+ "#f59e0b",
480
+ // yellow
481
+ "#ef4444",
482
+ // red
483
+ "#8b5cf6",
484
+ // purple
485
+ "#f97316",
486
+ // orange
487
+ "#06b6d4",
488
+ // cyan
489
+ "#84cc16"
490
+ // lime
491
+ ], ie = [
492
+ "#440154",
493
+ // dark purple
494
+ "#414487",
495
+ // purple-blue
496
+ "#2a788e",
497
+ // teal
498
+ "#22a884",
499
+ // green-teal
500
+ "#7ad151",
501
+ // green
502
+ "#fde725"
503
+ // yellow
504
+ ], ae = "#10b981", oe = "#ef4444", de = {
505
+ top: 5,
506
+ right: 30,
507
+ left: 20,
508
+ bottom: 5
509
+ }, le = {
510
+ top: 5,
511
+ right: 30,
512
+ left: 20,
513
+ bottom: 60
514
+ // Extra space for rotated labels
515
+ };
516
+ function ue({ children: e, height: t = "100%" }) {
517
+ const c = H(null), [n, r] = E(!1), [i, s] = E({ width: 0, height: 0 });
518
+ K(() => {
519
+ let a = !0, m = null;
520
+ const d = () => {
521
+ if (!a || !c.current) return;
522
+ const u = c.current.getBoundingClientRect(), h = Math.max(c.current.clientWidth, u.width), f = Math.max(c.current.clientHeight, u.height);
523
+ h > 0 && f > 0 && (s({ width: h, height: f }), r(!0));
524
+ };
525
+ return m = new ResizeObserver((u) => {
526
+ for (const h of u) {
527
+ const { width: f, height: o } = h.contentRect;
528
+ f > 0 && o > 0 && (s({ width: f, height: o }), n || r(!0));
529
+ }
530
+ }), c.current && (m.observe(c.current), d()), () => {
531
+ a = !1, m?.disconnect();
532
+ };
533
+ }, [n]);
534
+ try {
535
+ if (t === "100%")
536
+ return /* @__PURE__ */ l(
537
+ "div",
538
+ {
539
+ ref: c,
540
+ className: "dc:w-full dc:h-full dc:flex-1 dc:flex dc:flex-col dc:relative",
541
+ style: { minHeight: "250px", minWidth: "100px", overflow: "hidden", userSelect: "none" },
542
+ children: n && i.width > 0 && i.height > 0 ? /* @__PURE__ */ l(
543
+ T,
544
+ {
545
+ width: i.width,
546
+ height: i.height - 16,
547
+ debounce: 100,
548
+ style: { marginTop: "16px" },
549
+ children: e
550
+ }
551
+ ) : /* @__PURE__ */ l("div", { className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full", children: /* @__PURE__ */ l(I, { size: "sm" }) })
552
+ }
553
+ );
554
+ const a = {
555
+ height: typeof t == "number" ? `${t}px` : t,
556
+ width: "100%",
557
+ minHeight: "200px",
558
+ minWidth: "100px",
559
+ userSelect: "none"
560
+ };
561
+ return /* @__PURE__ */ l(
562
+ "div",
563
+ {
564
+ ref: c,
565
+ className: "dc:w-full dc:flex dc:flex-col dc:relative",
566
+ style: { ...a, overflow: "hidden" },
567
+ children: n && i.width > 0 && i.height > 0 ? /* @__PURE__ */ l(
568
+ T,
569
+ {
570
+ width: i.width,
571
+ height: i.height - 16,
572
+ debounce: 100,
573
+ style: { marginTop: "16px" },
574
+ children: e
575
+ }
576
+ ) : /* @__PURE__ */ l("div", { className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full", children: /* @__PURE__ */ l(I, { size: "sm" }) })
577
+ }
578
+ );
579
+ } catch (a) {
580
+ return /* @__PURE__ */ p(
581
+ "div",
582
+ {
583
+ className: "dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full dc:h-full dc:p-4 dc:text-center dc:border dc:border-dashed dc:rounded-lg",
584
+ style: { height: t, borderColor: "var(--dc-border)", backgroundColor: "var(--dc-surface)" },
585
+ children: [
586
+ /* @__PURE__ */ l("div", { className: "dc:text-sm dc:font-semibold dc:mb-1 text-dc-text-muted", children: "Unable to display chart" }),
587
+ /* @__PURE__ */ l("div", { className: "dc:text-xs text-dc-text-secondary", children: a instanceof Error ? a.message : "Failed to create responsive container" })
588
+ ]
589
+ }
590
+ );
591
+ }
592
+ }
593
+ const _ = (e, t) => e == null ? ["No data", t] : [A(e), t];
594
+ function me({ formatter: e, labelFormatter: t }) {
595
+ return /* @__PURE__ */ l(
596
+ B,
597
+ {
598
+ formatter: e || _,
599
+ labelFormatter: t,
600
+ contentStyle: {
601
+ backgroundColor: "white",
602
+ border: "1px solid #e5e7eb",
603
+ borderRadius: "0.5rem",
604
+ fontSize: "0.875rem",
605
+ color: "#1f2937",
606
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
607
+ padding: "8px 12px"
608
+ }
609
+ }
610
+ );
611
+ }
612
+ function fe(e) {
613
+ if (!e || typeof e != "string")
614
+ return [];
615
+ const t = e.trim();
616
+ if (!t)
617
+ return [];
618
+ try {
619
+ const c = t.split(",").map((n) => n.trim()).filter((n) => n !== "").map((n) => {
620
+ const r = parseFloat(n);
621
+ if (isNaN(r))
622
+ throw new Error(`Invalid numeric value: ${n}`);
623
+ return r;
624
+ });
625
+ return c.length > 0 ? c : [];
626
+ } catch (c) {
627
+ return console.warn("Failed to parse target values:", c), [];
628
+ }
629
+ }
630
+ function he(e, t) {
631
+ if (e.length === 0 || t <= 0)
632
+ return [];
633
+ if (e.length === 1)
634
+ return new Array(t).fill(e[0]);
635
+ const c = [], n = Math.floor(t / e.length), r = t % e.length;
636
+ let i = 0;
637
+ for (let s = 0; s < e.length; s++) {
638
+ const a = n + (s < r ? 1 : 0);
639
+ for (let m = 0; m < a; m++)
640
+ c[i++] = e[s];
641
+ }
642
+ return c;
643
+ }
644
+ function be(e, t) {
645
+ return t === 0 ? e === 0 ? 0 : e > 0 ? 100 : -100 : (e - t) / t * 100;
646
+ }
647
+ function pe(e, t = 1) {
648
+ return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
649
+ }
650
650
  export {
651
- pe as A,
652
- oe as C,
651
+ ne as A,
652
+ de as C,
653
653
  I as L,
654
- ae as N,
655
- ie as P,
656
- de as R,
657
- Z as S,
658
- le as a,
659
- ue as b,
660
- ce as c,
654
+ oe as N,
655
+ ae as P,
656
+ le as R,
657
+ k as S,
658
+ ue as a,
659
+ me as b,
660
+ se as c,
661
661
  M as d,
662
662
  $ as e,
663
663
  F as f,
664
664
  P as g,
665
- se as h,
666
- ee as i,
667
- he as j,
668
- be as k,
665
+ ie as h,
666
+ Q as i,
667
+ be as j,
668
+ pe as k,
669
669
  A as l,
670
- te as m,
671
- O as n,
672
- re as o,
673
- me as p,
674
- W as q,
675
- fe as s,
676
- ne as t,
677
- Q as u
670
+ ee as m,
671
+ W as n,
672
+ te as o,
673
+ fe as p,
674
+ Y as q,
675
+ he as s,
676
+ re as t,
677
+ ce as u
678
678
  };
679
- //# sourceMappingURL=charts-core-DAF1iT_h.js.map
679
+ //# sourceMappingURL=charts-core-T8UglYyq.js.map