mal-ui 0.1.3

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 (82) hide show
  1. package/README.md +244 -0
  2. package/dist/carousel/extensions.d.ts +1 -0
  3. package/dist/carousel/index.d.ts +2 -0
  4. package/dist/carousel/index.js +424 -0
  5. package/dist/carousel/index.js.map +15 -0
  6. package/dist/charts/extensions.d.ts +1 -0
  7. package/dist/charts/index.d.ts +2 -0
  8. package/dist/charts/index.js +3499 -0
  9. package/dist/charts/index.js.map +53 -0
  10. package/dist/chunks/index-3ffbn0gc.js +29976 -0
  11. package/dist/chunks/index-3ffbn0gc.js.map +637 -0
  12. package/dist/chunks/index-6b5mapr4.js +2 -0
  13. package/dist/chunks/index-6b5mapr4.js.map +9 -0
  14. package/dist/chunks/index-6tm93gww.js +38 -0
  15. package/dist/chunks/index-6tm93gww.js.map +10 -0
  16. package/dist/chunks/index-cg10ezdx.js +2 -0
  17. package/dist/chunks/index-cg10ezdx.js.map +9 -0
  18. package/dist/chunks/index-mc01z7m9.js +48 -0
  19. package/dist/chunks/index-mc01z7m9.js.map +9 -0
  20. package/dist/chunks/index-rz8zh7g4.js +5015 -0
  21. package/dist/chunks/index-rz8zh7g4.js.map +113 -0
  22. package/dist/chunks/index-syjq3515.js +4893 -0
  23. package/dist/chunks/index-syjq3515.js.map +101 -0
  24. package/dist/chunks/index-w9ekv5h5.js +733 -0
  25. package/dist/chunks/index-w9ekv5h5.js.map +17 -0
  26. package/dist/code-highlight/extensions.d.ts +1 -0
  27. package/dist/code-highlight/index.d.ts +2 -0
  28. package/dist/code-highlight/index.js +1685 -0
  29. package/dist/code-highlight/index.js.map +25 -0
  30. package/dist/core/extensions.d.ts +2 -0
  31. package/dist/core/index.d.ts +2 -0
  32. package/dist/core/index.js +844 -0
  33. package/dist/core/index.js.map +9 -0
  34. package/dist/dates/extensions.d.ts +1 -0
  35. package/dist/dates/index.d.ts +2 -0
  36. package/dist/dates/index.js +107 -0
  37. package/dist/dates/index.js.map +9 -0
  38. package/dist/dropzone/extensions.d.ts +1 -0
  39. package/dist/dropzone/index.d.ts +2 -0
  40. package/dist/dropzone/index.js +2681 -0
  41. package/dist/dropzone/index.js.map +21 -0
  42. package/dist/form/extensions.d.ts +1 -0
  43. package/dist/form/index.d.ts +2 -0
  44. package/dist/form/index.js +1605 -0
  45. package/dist/form/index.js.map +51 -0
  46. package/dist/hooks/extensions.d.ts +1 -0
  47. package/dist/hooks/index.d.ts +2 -0
  48. package/dist/hooks/index.js +214 -0
  49. package/dist/hooks/index.js.map +9 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +1052 -0
  52. package/dist/index.js.map +9 -0
  53. package/dist/modals/extensions.d.ts +1 -0
  54. package/dist/modals/index.d.ts +2 -0
  55. package/dist/modals/index.js +387 -0
  56. package/dist/modals/index.js.map +15 -0
  57. package/dist/notifications/extensions.d.ts +1 -0
  58. package/dist/notifications/index.d.ts +2 -0
  59. package/dist/notifications/index.js +1122 -0
  60. package/dist/notifications/index.js.map +28 -0
  61. package/dist/nprogress/extensions.d.ts +1 -0
  62. package/dist/nprogress/index.d.ts +2 -0
  63. package/dist/nprogress/index.js +207 -0
  64. package/dist/nprogress/index.js.map +12 -0
  65. package/dist/schedule/extensions.d.ts +1 -0
  66. package/dist/schedule/index.d.ts +2 -0
  67. package/dist/schedule/index.js +8569 -0
  68. package/dist/schedule/index.js.map +135 -0
  69. package/dist/spotlight/extensions.d.ts +1 -0
  70. package/dist/spotlight/index.d.ts +2 -0
  71. package/dist/spotlight/index.js +666 -0
  72. package/dist/spotlight/index.js.map +24 -0
  73. package/dist/styles.css +1 -0
  74. package/dist/theme/index.d.ts +13 -0
  75. package/dist/theme/index.js +202 -0
  76. package/dist/theme/index.js.map +11 -0
  77. package/dist/theme/tokens.d.ts +65 -0
  78. package/dist/tiptap/extensions.d.ts +1 -0
  79. package/dist/tiptap/index.d.ts +2 -0
  80. package/dist/tiptap/index.js +1549 -0
  81. package/dist/tiptap/index.js.map +25 -0
  82. package/package.json +163 -0
@@ -0,0 +1,3499 @@
1
+ "use client";
2
+ import {
3
+ Box,
4
+ ColorSwatch,
5
+ Group,
6
+ Paper,
7
+ Text,
8
+ Tooltip,
9
+ createVarsResolver,
10
+ factory,
11
+ getAutoContrastValue,
12
+ getSpacing,
13
+ getThemeColor,
14
+ isLightColor,
15
+ parseThemeColor,
16
+ rem,
17
+ useMantineTheme,
18
+ useProps,
19
+ useResolvedStylesApi,
20
+ useStyles
21
+ } from "../chunks/index-3ffbn0gc.js";
22
+ import {
23
+ useId$1
24
+ } from "../chunks/index-syjq3515.js";
25
+ import"../chunks/index-mc01z7m9.js";
26
+
27
+ // node_modules/@mantine/charts/esm/utils/get-series-labels/get-series-labels.mjs
28
+
29
+ function getSeriesLabels(series) {
30
+ if (!series)
31
+ return {};
32
+ return series.reduce((acc, item) => {
33
+ const matchFound = item.name.search(/\./);
34
+ if (matchFound >= 0) {
35
+ const key = item.name.substring(matchFound + 1);
36
+ acc[key] = item.label;
37
+ return acc;
38
+ }
39
+ acc[item.name] = item.label;
40
+ return acc;
41
+ }, {});
42
+ }
43
+
44
+ // node_modules/@mantine/charts/esm/ChartTooltip/ChartTooltip.module.mjs
45
+
46
+ var ChartTooltip_module_default = {
47
+ tooltip: "m_e4d36c9b",
48
+ tooltipLabel: "m_7f4bcb19",
49
+ tooltipBody: "m_3de554dd",
50
+ tooltipItemColor: "m_b30369b5",
51
+ tooltipItem: "m_3de8964e",
52
+ tooltipItemBody: "m_50186d10",
53
+ tooltipItemName: "m_501dadf9",
54
+ tooltipItemData: "m_50192318"
55
+ };
56
+
57
+ // node_modules/@mantine/charts/esm/ChartTooltip/ChartTooltip.mjs
58
+ import { jsx, jsxs } from "react/jsx-runtime";
59
+
60
+ function updateChartTooltipPayload(payload) {
61
+ return payload.map((item) => {
62
+ if (!item.payload || item.payload[item.name])
63
+ return item;
64
+ const matchFound = item.name.search(/\./);
65
+ if (matchFound >= 0) {
66
+ const newDataKey = item.name.substring(0, matchFound);
67
+ const nestedPayload = { ...item.payload[newDataKey] };
68
+ const shallowPayload = Object.entries(item.payload).reduce((acc, current) => {
69
+ const [k, v] = current;
70
+ return k === newDataKey ? acc : {
71
+ ...acc,
72
+ [k]: v
73
+ };
74
+ }, {});
75
+ return {
76
+ ...item,
77
+ name: item.name.substring(matchFound + 1),
78
+ payload: {
79
+ ...shallowPayload,
80
+ ...nestedPayload
81
+ }
82
+ };
83
+ }
84
+ return item;
85
+ });
86
+ }
87
+ function getFilteredChartTooltipPayload(payload, segmentId) {
88
+ const duplicatesFilter = updateChartTooltipPayload(payload.filter((item) => item.fill !== "none" || !item.color));
89
+ if (!segmentId)
90
+ return duplicatesFilter;
91
+ return duplicatesFilter.filter((item) => item.name === segmentId);
92
+ }
93
+ function getData(item, type) {
94
+ if (type === "radial" || type === "scatter") {
95
+ if (Array.isArray(item.value))
96
+ return item.value[1] - item.value[0];
97
+ return item.value;
98
+ }
99
+ if (Array.isArray(item.payload[item.dataKey]))
100
+ return item.payload[item.dataKey][1] - item.payload[item.dataKey][0];
101
+ return item.payload[item.name];
102
+ }
103
+ var defaultProps = {
104
+ type: "area",
105
+ showColor: true
106
+ };
107
+ var ChartTooltip = factory((_props) => {
108
+ const props = useProps("ChartTooltip", defaultProps, _props);
109
+ const { classNames, className, style, styles, unstyled, vars, payload, label, unit, type, segmentId, mod, series, valueFormatter, showColor, attributes, ...others } = props;
110
+ const theme = useMantineTheme();
111
+ const getStyles = useStyles({
112
+ name: "ChartTooltip",
113
+ classes: ChartTooltip_module_default,
114
+ props,
115
+ className,
116
+ style,
117
+ classNames,
118
+ styles,
119
+ unstyled,
120
+ attributes
121
+ });
122
+ if (!payload)
123
+ return null;
124
+ const filteredPayload = getFilteredChartTooltipPayload(payload, segmentId);
125
+ const scatterLabel = type === "scatter" ? payload[0]?.payload?.name : null;
126
+ const labels = getSeriesLabels(series);
127
+ const _label = label || scatterLabel;
128
+ const items = filteredPayload.map((item) => /* @__PURE__ */ jsxs("div", {
129
+ "data-type": type,
130
+ ...getStyles("tooltipItem"),
131
+ children: [/* @__PURE__ */ jsxs("div", {
132
+ ...getStyles("tooltipItemBody"),
133
+ children: [showColor && /* @__PURE__ */ jsx("svg", {
134
+ ...getStyles("tooltipItemColor"),
135
+ children: /* @__PURE__ */ jsx("circle", {
136
+ r: 6,
137
+ fill: getThemeColor(item.color, theme),
138
+ width: 12,
139
+ height: 12,
140
+ cx: 6,
141
+ cy: 6
142
+ })
143
+ }), /* @__PURE__ */ jsx("div", {
144
+ ...getStyles("tooltipItemName"),
145
+ children: labels[item.name] || item.name
146
+ })]
147
+ }), /* @__PURE__ */ jsxs("div", {
148
+ ...getStyles("tooltipItemData"),
149
+ children: [typeof valueFormatter === "function" ? valueFormatter(getData(item, type)) : getData(item, type), unit || item.unit]
150
+ })]
151
+ }, item?.key ?? item.name));
152
+ return /* @__PURE__ */ jsxs(Box, {
153
+ ...getStyles("tooltip"),
154
+ mod: [{ type }, mod],
155
+ ...others,
156
+ children: [_label && /* @__PURE__ */ jsx("div", {
157
+ ...getStyles("tooltipLabel"),
158
+ children: _label
159
+ }), /* @__PURE__ */ jsx("div", {
160
+ ...getStyles("tooltipBody"),
161
+ children: items
162
+ })]
163
+ });
164
+ });
165
+ ChartTooltip.displayName = "@mantine/charts/ChartTooltip";
166
+
167
+ // node_modules/@mantine/charts/esm/ChartLegend/ChartLegend.module.mjs
168
+
169
+ var ChartLegend_module_default = {
170
+ legend: "m_847eaf",
171
+ legendItem: "m_17da7e62",
172
+ legendItemColor: "m_6e236e21",
173
+ legendItemName: "m_8ff56c0d"
174
+ };
175
+
176
+ // node_modules/@mantine/charts/esm/ChartLegend/ChartLegend.mjs
177
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
178
+
179
+ function updateChartLegendPayload(payload) {
180
+ return payload.map((item) => {
181
+ const newDataKey = item.dataKey?.split(".").pop();
182
+ return {
183
+ ...item,
184
+ dataKey: newDataKey,
185
+ payload: {
186
+ ...item.payload,
187
+ name: newDataKey,
188
+ dataKey: newDataKey
189
+ }
190
+ };
191
+ });
192
+ }
193
+ function getFilteredChartLegendPayload(payload) {
194
+ return updateChartLegendPayload(payload.filter((item) => item.color !== "none"));
195
+ }
196
+ var ChartLegend = factory((_props) => {
197
+ const props = useProps("ChartLegend", null, _props);
198
+ const { classNames, className, style, styles, unstyled, vars, payload, onHighlight, legendPosition, mod, series, showColor, centered, attributes, ...others } = props;
199
+ const getStyles = useStyles({
200
+ name: "ChartLegend",
201
+ classes: ChartLegend_module_default,
202
+ props,
203
+ className,
204
+ style,
205
+ classNames,
206
+ styles,
207
+ unstyled,
208
+ attributes,
209
+ rootSelector: "legend"
210
+ });
211
+ if (!payload)
212
+ return null;
213
+ const filteredPayload = getFilteredChartLegendPayload(payload);
214
+ const labels = getSeriesLabels(series);
215
+ const items = filteredPayload.map((item, index) => /* @__PURE__ */ jsxs2("div", {
216
+ ...getStyles("legendItem"),
217
+ onMouseEnter: () => onHighlight(item.dataKey),
218
+ "data-without-color": showColor === false || undefined,
219
+ children: [/* @__PURE__ */ jsx2(ColorSwatch, {
220
+ color: item.color,
221
+ size: 12,
222
+ ...getStyles("legendItemColor"),
223
+ withShadow: false
224
+ }), /* @__PURE__ */ jsx2("p", {
225
+ ...getStyles("legendItemName"),
226
+ children: labels[item.dataKey] || item.dataKey
227
+ })]
228
+ }, index));
229
+ return /* @__PURE__ */ jsx2(Box, {
230
+ mod: [{
231
+ position: legendPosition,
232
+ centered
233
+ }, mod],
234
+ ...getStyles("legend"),
235
+ ...others,
236
+ onMouseLeave: (event) => {
237
+ others.onMouseLeave?.(event);
238
+ onHighlight(null);
239
+ },
240
+ children: items
241
+ });
242
+ });
243
+ ChartLegend.displayName = "@mantine/charts/ChartLegend";
244
+ ChartLegend.classes = ChartLegend_module_default;
245
+
246
+ // node_modules/@mantine/charts/esm/AreaChart/AreaGradient.mjs
247
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
248
+
249
+ function AreaGradient({ color, id, withGradient, fillOpacity }) {
250
+ return /* @__PURE__ */ jsx3(Fragment, { children: withGradient ? /* @__PURE__ */ jsxs3("linearGradient", {
251
+ id,
252
+ x1: "0",
253
+ y1: "0",
254
+ x2: "0",
255
+ y2: "1",
256
+ children: [/* @__PURE__ */ jsx3("stop", {
257
+ offset: "0%",
258
+ stopColor: color,
259
+ stopOpacity: fillOpacity
260
+ }), /* @__PURE__ */ jsx3("stop", {
261
+ offset: "100%",
262
+ stopColor: color,
263
+ stopOpacity: 0.01
264
+ })]
265
+ }) : /* @__PURE__ */ jsx3("linearGradient", {
266
+ id,
267
+ x1: "0",
268
+ y1: "0",
269
+ x2: "0",
270
+ y2: "1",
271
+ children: /* @__PURE__ */ jsx3("stop", {
272
+ stopColor: color,
273
+ stopOpacity: fillOpacity ?? 0.2
274
+ })
275
+ }) });
276
+ }
277
+ AreaGradient.displayName = "@mantine/charts/AreaGradient";
278
+
279
+ // node_modules/@mantine/charts/esm/AreaChart/get-split-offset.mjs
280
+
281
+ function getSplitOffset({ data, dataKey }) {
282
+ const dataMax = Math.max(...data.map((item) => item[dataKey]));
283
+ const dataMin = Math.min(...data.map((item) => item[dataKey]));
284
+ if (dataMax <= 0)
285
+ return 0;
286
+ if (dataMin >= 0)
287
+ return 1;
288
+ return dataMax / (dataMax - dataMin);
289
+ }
290
+ function getDefaultSplitOffset({ data, series }) {
291
+ if (series.length === 1) {
292
+ const dataKey = series[0].name;
293
+ return getSplitOffset({
294
+ data,
295
+ dataKey
296
+ });
297
+ }
298
+ return 0.5;
299
+ }
300
+
301
+ // node_modules/@mantine/charts/esm/PointLabel/PointLabel.mjs
302
+ import { jsx as jsx4 } from "react/jsx-runtime";
303
+
304
+ function PointLabel({ x, y, value, valueFormatter }) {
305
+ return /* @__PURE__ */ jsx4("g", {
306
+ transform: `translate(${x},${y})`,
307
+ children: /* @__PURE__ */ jsx4("text", {
308
+ x: 0,
309
+ y: 0,
310
+ dy: -8,
311
+ dx: -10,
312
+ textAnchor: "start",
313
+ fill: "var(--chart-text-color, var(--mantine-color-dimmed))",
314
+ fontSize: 8,
315
+ children: valueFormatter ? valueFormatter(value) : value
316
+ })
317
+ });
318
+ }
319
+
320
+ // node_modules/@mantine/charts/esm/AreaChart/AreaSplit.mjs
321
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
322
+
323
+ function AreaSplit({ offset, id, colors, fillOpacity }) {
324
+ const theme = useMantineTheme();
325
+ return /* @__PURE__ */ jsxs4("linearGradient", {
326
+ id,
327
+ x1: "0",
328
+ y1: "0",
329
+ x2: "0",
330
+ y2: "1",
331
+ children: [/* @__PURE__ */ jsx5("stop", {
332
+ offset,
333
+ stopColor: getThemeColor(colors[0], theme),
334
+ stopOpacity: fillOpacity ?? 0.2
335
+ }), /* @__PURE__ */ jsx5("stop", {
336
+ offset,
337
+ stopColor: getThemeColor(colors[1], theme),
338
+ stopOpacity: fillOpacity ?? 0.2
339
+ })]
340
+ });
341
+ }
342
+ AreaSplit.displayName = "@mantine/charts/AreaSplit";
343
+
344
+ // node_modules/@mantine/charts/esm/grid-chart.module.mjs
345
+
346
+ var grid_chart_module_default = {
347
+ root: "m_a50f3e58",
348
+ container: "m_af9188cb",
349
+ grid: "m_a50a48bc",
350
+ axis: "m_a507a517",
351
+ axisLabel: "m_2293801d",
352
+ tooltip: "m_92b296cd"
353
+ };
354
+
355
+ // node_modules/@mantine/charts/esm/AreaChart/AreaChart.mjs
356
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
357
+ import { Fragment as Fragment$1, createElement, useId, useState } from "react";
358
+ import { Area, AreaChart, CartesianGrid, Label, Legend, ReferenceLine, ResponsiveContainer, Tooltip as Tooltip$1, XAxis, YAxis } from "recharts";
359
+
360
+ function valueToPercent(value) {
361
+ return `${(value * 100).toFixed(0)}%`;
362
+ }
363
+ var defaultProps2 = {
364
+ withXAxis: true,
365
+ withYAxis: true,
366
+ withDots: true,
367
+ withTooltip: true,
368
+ connectNulls: true,
369
+ strokeWidth: 2,
370
+ tooltipAnimationDuration: 0,
371
+ fillOpacity: 0.2,
372
+ tickLine: "y",
373
+ strokeDasharray: "5 5",
374
+ curveType: "monotone",
375
+ gridAxis: "x",
376
+ type: "default",
377
+ splitColors: ["green.7", "red.7"],
378
+ orientation: "horizontal"
379
+ };
380
+ var varsResolver = createVarsResolver((theme, { textColor, gridColor }) => ({ root: {
381
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
382
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined
383
+ } }));
384
+ var AreaChart$1 = factory((_props) => {
385
+ const props = useProps("AreaChart", defaultProps2, _props);
386
+ const { classNames, className, style, styles, unstyled, vars, data, series, withGradient, dataKey, withXAxis, withYAxis, curveType, gridProps, withDots, tickLine, strokeDasharray, gridAxis, unit, yAxisProps, xAxisProps, dotProps, activeDotProps, strokeWidth, tooltipAnimationDuration, type, legendProps, tooltipProps, withLegend, withTooltip, areaChartProps, fillOpacity, splitColors, splitOffset, connectNulls, onMouseLeave, orientation, referenceLines, dir, valueFormatter, children, areaProps, xAxisLabel, yAxisLabel, withRightYAxis, rightYAxisLabel, rightYAxisProps, withPointLabels, gridColor, textColor, attributes, ...others } = props;
387
+ const theme = useMantineTheme();
388
+ const baseId = useId();
389
+ const splitId = `${baseId}-split`;
390
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
391
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
392
+ const isAnimationActive = (tooltipAnimationDuration || 0) > 0;
393
+ const _withGradient = typeof withGradient === "boolean" ? withGradient : type === "default";
394
+ const stacked = type === "stacked" || type === "percent";
395
+ const [highlightedArea, setHighlightedArea] = useState(null);
396
+ const shouldHighlight = highlightedArea !== null;
397
+ const handleMouseLeave = (event) => {
398
+ setHighlightedArea(null);
399
+ onMouseLeave?.(event);
400
+ };
401
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
402
+ classNames,
403
+ styles,
404
+ props
405
+ });
406
+ const getStyles = useStyles({
407
+ name: "AreaChart",
408
+ classes: grid_chart_module_default,
409
+ props,
410
+ className,
411
+ style,
412
+ classNames,
413
+ styles,
414
+ unstyled,
415
+ attributes,
416
+ vars,
417
+ varsResolver
418
+ });
419
+ const dotsAreas = series.map((item) => {
420
+ const color = getThemeColor(item.color, theme);
421
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
422
+ return /* @__PURE__ */ createElement(Area, {
423
+ ...getStyles("area"),
424
+ activeDot: {
425
+ fill: theme.white,
426
+ stroke: color,
427
+ strokeWidth: 2,
428
+ r: 4,
429
+ ...activeDotProps
430
+ },
431
+ dot: {
432
+ fill: color,
433
+ fillOpacity: dimmed ? 0 : 1,
434
+ strokeWidth: 2,
435
+ r: 4,
436
+ ...dotProps
437
+ },
438
+ key: item.name,
439
+ name: item.name,
440
+ type: curveType,
441
+ dataKey: item.name,
442
+ fill: "none",
443
+ strokeWidth,
444
+ stroke: "none",
445
+ isAnimationActive: false,
446
+ connectNulls,
447
+ stackId: stacked ? "stack-dots" : undefined,
448
+ yAxisId: item.yAxisId || undefined,
449
+ ...typeof areaProps === "function" ? areaProps(item) : areaProps
450
+ });
451
+ });
452
+ const areas = series.map((item) => {
453
+ const id = `${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g, "")}`;
454
+ const color = getThemeColor(item.color, theme);
455
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
456
+ return /* @__PURE__ */ jsxs5(Fragment$1, { children: [/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6(AreaGradient, {
457
+ color,
458
+ withGradient: _withGradient,
459
+ id,
460
+ fillOpacity
461
+ }) }), /* @__PURE__ */ jsx6(Area, {
462
+ ...getStyles("area"),
463
+ activeDot: false,
464
+ dot: false,
465
+ name: item.name,
466
+ type: item.curveType ?? curveType,
467
+ dataKey: item.name,
468
+ fill: type === "split" ? `url(#${splitId})` : `url(#${id})`,
469
+ strokeWidth,
470
+ stroke: color,
471
+ isAnimationActive: false,
472
+ connectNulls,
473
+ stackId: stacked ? "stack" : undefined,
474
+ fillOpacity: dimmed ? 0 : 1,
475
+ strokeOpacity: dimmed ? 0.5 : 1,
476
+ strokeDasharray: item.strokeDasharray,
477
+ yAxisId: item.yAxisId || undefined,
478
+ label: withPointLabels ? /* @__PURE__ */ jsx6(PointLabel, { valueFormatter }) : undefined,
479
+ ...typeof areaProps === "function" ? areaProps(item) : areaProps
480
+ })] }, item.name);
481
+ });
482
+ const referenceLinesItems = referenceLines?.map((line, index) => {
483
+ const color = getThemeColor(line.color, theme);
484
+ return /* @__PURE__ */ jsx6(ReferenceLine, {
485
+ stroke: line.color ? color : "var(--chart-grid-color)",
486
+ strokeWidth: 1,
487
+ yAxisId: line.yAxisId || undefined,
488
+ ...line,
489
+ label: {
490
+ fill: line.color ? color : "currentColor",
491
+ fontSize: 12,
492
+ position: line.labelPosition ?? "insideBottomLeft",
493
+ ...typeof line.label === "object" ? line.label : { value: line.label }
494
+ },
495
+ ...getStyles("referenceLine")
496
+ }, index);
497
+ });
498
+ const tickFormatter = type === "percent" ? valueToPercent : valueFormatter;
499
+ const sharedYAxisProps = {
500
+ axisLine: false,
501
+ ...orientation === "vertical" ? {
502
+ dataKey,
503
+ type: "category"
504
+ } : { type: "number" },
505
+ tickLine: withYTickLine ? { stroke: "currentColor" } : false,
506
+ allowDecimals: true,
507
+ unit,
508
+ tickFormatter: orientation === "vertical" ? undefined : tickFormatter,
509
+ ...getStyles("axis")
510
+ };
511
+ return /* @__PURE__ */ jsx6(Box, {
512
+ ...getStyles("root"),
513
+ onMouseLeave: handleMouseLeave,
514
+ dir: dir || "ltr",
515
+ ...others,
516
+ children: /* @__PURE__ */ jsx6(ResponsiveContainer, {
517
+ ...getStyles("container"),
518
+ children: /* @__PURE__ */ jsxs5(AreaChart, {
519
+ data,
520
+ stackOffset: type === "percent" ? "expand" : undefined,
521
+ layout: orientation,
522
+ margin: {
523
+ bottom: xAxisLabel ? 30 : undefined,
524
+ left: yAxisLabel ? 10 : undefined,
525
+ right: yAxisLabel ? 5 : undefined
526
+ },
527
+ ...areaChartProps,
528
+ children: [
529
+ referenceLinesItems,
530
+ withLegend && /* @__PURE__ */ jsx6(Legend, {
531
+ verticalAlign: "top",
532
+ content: (payload) => /* @__PURE__ */ jsx6(ChartLegend, {
533
+ payload: payload.payload,
534
+ onHighlight: setHighlightedArea,
535
+ legendPosition: legendProps?.verticalAlign || "top",
536
+ classNames: resolvedClassNames,
537
+ styles: resolvedStyles,
538
+ series,
539
+ attributes
540
+ }),
541
+ ...legendProps
542
+ }),
543
+ /* @__PURE__ */ jsx6(CartesianGrid, {
544
+ strokeDasharray,
545
+ vertical: gridAxis === "y" || gridAxis === "xy",
546
+ horizontal: gridAxis === "x" || gridAxis === "xy",
547
+ ...getStyles("grid"),
548
+ ...gridProps
549
+ }),
550
+ /* @__PURE__ */ jsxs5(XAxis, {
551
+ hide: !withXAxis,
552
+ ...orientation === "vertical" ? { type: "number" } : { dataKey },
553
+ tick: {
554
+ transform: "translate(0, 10)",
555
+ fontSize: 12,
556
+ fill: "currentColor"
557
+ },
558
+ stroke: "",
559
+ interval: "preserveStartEnd",
560
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
561
+ minTickGap: 5,
562
+ tickFormatter: orientation === "vertical" ? tickFormatter : undefined,
563
+ ...getStyles("axis"),
564
+ ...xAxisProps,
565
+ children: [xAxisLabel && /* @__PURE__ */ jsx6(Label, {
566
+ position: "insideBottom",
567
+ offset: -20,
568
+ fontSize: 12,
569
+ ...getStyles("axisLabel"),
570
+ children: xAxisLabel
571
+ }), xAxisProps?.children]
572
+ }),
573
+ /* @__PURE__ */ jsxs5(YAxis, {
574
+ orientation: "left",
575
+ tick: {
576
+ transform: "translate(-10, 0)",
577
+ fontSize: 12,
578
+ fill: "currentColor"
579
+ },
580
+ hide: !withYAxis,
581
+ ...sharedYAxisProps,
582
+ ...yAxisProps,
583
+ children: [yAxisLabel && /* @__PURE__ */ jsx6(Label, {
584
+ position: "insideLeft",
585
+ angle: -90,
586
+ textAnchor: "middle",
587
+ fontSize: 12,
588
+ offset: -5,
589
+ ...getStyles("axisLabel"),
590
+ children: yAxisLabel
591
+ }), yAxisProps?.children]
592
+ }),
593
+ /* @__PURE__ */ jsxs5(YAxis, {
594
+ yAxisId: "right",
595
+ orientation: "right",
596
+ tick: {
597
+ transform: "translate(10, 0)",
598
+ fontSize: 12,
599
+ fill: "currentColor"
600
+ },
601
+ hide: !withRightYAxis,
602
+ ...sharedYAxisProps,
603
+ ...rightYAxisProps,
604
+ children: [rightYAxisLabel && /* @__PURE__ */ jsx6(Label, {
605
+ position: "insideRight",
606
+ angle: 90,
607
+ textAnchor: "middle",
608
+ fontSize: 12,
609
+ offset: -5,
610
+ ...getStyles("axisLabel"),
611
+ children: rightYAxisLabel
612
+ }), yAxisProps?.children]
613
+ }),
614
+ withTooltip && /* @__PURE__ */ jsx6(Tooltip$1, {
615
+ animationDuration: tooltipAnimationDuration,
616
+ isAnimationActive,
617
+ position: orientation === "vertical" ? {} : { y: 0 },
618
+ cursor: {
619
+ stroke: "var(--chart-grid-color)",
620
+ strokeWidth: 1,
621
+ strokeDasharray
622
+ },
623
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx6(ChartTooltip, {
624
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
625
+ payload,
626
+ unit,
627
+ classNames: resolvedClassNames,
628
+ styles: resolvedStyles,
629
+ series,
630
+ valueFormatter,
631
+ attributes
632
+ }),
633
+ ...tooltipProps
634
+ }),
635
+ type === "split" && /* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6(AreaSplit, {
636
+ colors: splitColors,
637
+ id: splitId,
638
+ offset: splitOffset ?? getDefaultSplitOffset({
639
+ data,
640
+ series
641
+ }),
642
+ fillOpacity
643
+ }) }),
644
+ areas,
645
+ withDots && dotsAreas,
646
+ children
647
+ ]
648
+ })
649
+ })
650
+ });
651
+ });
652
+ AreaChart$1.classes = grid_chart_module_default;
653
+ AreaChart$1.varsResolver = varsResolver;
654
+ AreaChart$1.displayName = "@mantine/charts/AreaChart";
655
+
656
+ // node_modules/@mantine/charts/esm/BarChart/BarChart.mjs
657
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
658
+ import React, { createElement as createElement2, useState as useState2 } from "react";
659
+ import { Bar, BarChart, CartesianGrid as CartesianGrid2, Label as Label2, LabelList, Legend as Legend2, Rectangle, ReferenceLine as ReferenceLine2, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip$12, XAxis as XAxis2, YAxis as YAxis2 } from "recharts";
660
+
661
+ function valueToPercent2(value) {
662
+ return `${(value * 100).toFixed(0)}%`;
663
+ }
664
+ var defaultProps3 = {
665
+ withXAxis: true,
666
+ withYAxis: true,
667
+ withTooltip: true,
668
+ tooltipAnimationDuration: 0,
669
+ fillOpacity: 1,
670
+ tickLine: "y",
671
+ strokeDasharray: "5 5",
672
+ gridAxis: "x",
673
+ type: "default"
674
+ };
675
+ var varsResolver2 = createVarsResolver((theme, { textColor, gridColor, cursorFill, barLabelColor }) => ({ root: {
676
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
677
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined,
678
+ "--chart-cursor-fill": cursorFill ? getThemeColor(cursorFill, theme) : undefined,
679
+ "--chart-bar-label-color": barLabelColor ? getThemeColor(barLabelColor, theme) : undefined
680
+ } }));
681
+ function calculateCumulativeTotal(waterfallData, dataKey) {
682
+ let start = 0;
683
+ let end = 0;
684
+ return waterfallData.map((item) => {
685
+ if (item.standalone) {
686
+ for (const prop in item)
687
+ if (typeof item[prop] === "number" && prop !== dataKey)
688
+ item[prop] = [0, item[prop]];
689
+ } else
690
+ for (const prop in item)
691
+ if (typeof item[prop] === "number" && prop !== dataKey) {
692
+ end += item[prop];
693
+ item[prop] = [start, end];
694
+ start = end;
695
+ }
696
+ return item;
697
+ });
698
+ }
699
+ function getBarFill(barProps, series) {
700
+ if (typeof barProps === "function")
701
+ return barProps(series).fill;
702
+ return barProps?.fill;
703
+ }
704
+ var BarChart$1 = factory((_props) => {
705
+ const props = useProps("BarChart", defaultProps3, _props);
706
+ const { classNames, className, style, styles, unstyled, vars, data, withLegend, legendProps, series, onMouseLeave, dataKey, withTooltip, withXAxis, withYAxis, gridAxis, tickLine, xAxisProps, yAxisProps, unit, tooltipAnimationDuration, strokeDasharray, gridProps, tooltipProps, referenceLines, fillOpacity, barChartProps, type, orientation, dir, valueFormatter, children, barProps, xAxisLabel, yAxisLabel, withBarValueLabel, valueLabelProps, withRightYAxis, rightYAxisLabel, rightYAxisProps, minBarSize, maxBarWidth, mod, getBarColor, gridColor, textColor, attributes, ...others } = props;
707
+ const theme = useMantineTheme();
708
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
709
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
710
+ const [highlightedArea, setHighlightedArea] = useState2(null);
711
+ const shouldHighlight = highlightedArea !== null;
712
+ const stacked = type === "stacked" || type === "percent";
713
+ const tickFormatter = type === "percent" ? valueToPercent2 : valueFormatter;
714
+ const handleMouseLeave = (event) => {
715
+ setHighlightedArea(null);
716
+ onMouseLeave?.(event);
717
+ };
718
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
719
+ classNames,
720
+ styles,
721
+ props
722
+ });
723
+ const inputData = type === "waterfall" ? calculateCumulativeTotal(data, dataKey) : data;
724
+ const getStyles = useStyles({
725
+ name: "BarChart",
726
+ classes: grid_chart_module_default,
727
+ props,
728
+ className,
729
+ style,
730
+ classNames,
731
+ styles,
732
+ unstyled,
733
+ attributes,
734
+ vars,
735
+ varsResolver: varsResolver2
736
+ });
737
+ const bars = series.map((item) => {
738
+ const color = getThemeColor(item.color, theme);
739
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
740
+ const resolvedBarProps = typeof barProps === "function" ? barProps(item) : barProps;
741
+ const userShape = resolvedBarProps?.shape;
742
+ return /* @__PURE__ */ createElement2(Bar, {
743
+ ...getStyles("bar"),
744
+ key: item.name,
745
+ name: item.name,
746
+ dataKey: item.name,
747
+ fill: color,
748
+ stroke: color,
749
+ isAnimationActive: false,
750
+ fillOpacity: dimmed ? 0.1 : fillOpacity,
751
+ strokeOpacity: dimmed ? 0.2 : 0,
752
+ stackId: stacked ? "stack" : item.stackId || undefined,
753
+ yAxisId: item.yAxisId || undefined,
754
+ minPointSize: minBarSize,
755
+ ...resolvedBarProps,
756
+ shape: (shapeProps) => {
757
+ const entry = shapeProps.payload;
758
+ const cellColor = entry?.color ? getThemeColor(entry.color, theme) : typeof getBarColor === "function" ? getThemeColor(getBarColor(entry?.[item.name], item), theme) : getBarFill(barProps, item) || color;
759
+ const coloredProps = {
760
+ ...shapeProps,
761
+ fill: cellColor
762
+ };
763
+ if (typeof userShape === "function")
764
+ return userShape(coloredProps);
765
+ if (React.isValidElement(userShape))
766
+ return React.cloneElement(userShape, coloredProps);
767
+ if (typeof userShape === "object" && userShape)
768
+ return /* @__PURE__ */ jsx7(Rectangle, {
769
+ ...coloredProps,
770
+ ...userShape
771
+ });
772
+ return /* @__PURE__ */ jsx7(Rectangle, { ...coloredProps });
773
+ }
774
+ }, withBarValueLabel && /* @__PURE__ */ jsx7(LabelList, {
775
+ position: orientation === "vertical" ? "right" : "top",
776
+ fontSize: 12,
777
+ fill: "var(--chart-bar-label-color, var(--mantine-color-dimmed))",
778
+ formatter: (val) => tickFormatter?.(val),
779
+ ...typeof valueLabelProps === "function" ? valueLabelProps(item) : valueLabelProps
780
+ }));
781
+ });
782
+ const referenceLinesItems = referenceLines?.map((line, index) => {
783
+ const color = getThemeColor(line.color, theme);
784
+ return /* @__PURE__ */ jsx7(ReferenceLine2, {
785
+ stroke: line.color ? color : "var(--chart-grid-color)",
786
+ strokeWidth: 1,
787
+ yAxisId: line.yAxisId || undefined,
788
+ ...line,
789
+ label: {
790
+ fill: line.color ? color : "currentColor",
791
+ fontSize: 12,
792
+ position: line.labelPosition ?? "insideBottomLeft",
793
+ ...typeof line.label === "object" ? line.label : { value: line.label }
794
+ },
795
+ ...getStyles("referenceLine")
796
+ }, index);
797
+ });
798
+ const sharedYAxisProps = {
799
+ axisLine: false,
800
+ ...orientation === "vertical" ? {
801
+ dataKey,
802
+ type: "category"
803
+ } : { type: "number" },
804
+ tickLine: withYTickLine ? { stroke: "currentColor" } : false,
805
+ allowDecimals: true,
806
+ unit,
807
+ tickFormatter: orientation === "vertical" ? undefined : tickFormatter,
808
+ ...getStyles("axis")
809
+ };
810
+ return /* @__PURE__ */ jsx7(Box, {
811
+ ...getStyles("root"),
812
+ onMouseLeave: handleMouseLeave,
813
+ dir: dir || "ltr",
814
+ mod: [{ orientation }, mod],
815
+ ...others,
816
+ children: /* @__PURE__ */ jsx7(ResponsiveContainer2, {
817
+ ...getStyles("container"),
818
+ children: /* @__PURE__ */ jsxs6(BarChart, {
819
+ data: inputData,
820
+ stackOffset: type === "percent" ? "expand" : undefined,
821
+ layout: orientation,
822
+ maxBarSize: maxBarWidth,
823
+ margin: {
824
+ bottom: xAxisLabel ? 30 : undefined,
825
+ left: yAxisLabel ? 10 : undefined,
826
+ right: yAxisLabel ? 5 : undefined
827
+ },
828
+ ...barChartProps,
829
+ children: [
830
+ withLegend && /* @__PURE__ */ jsx7(Legend2, {
831
+ verticalAlign: "top",
832
+ content: (payload) => /* @__PURE__ */ jsx7(ChartLegend, {
833
+ payload: payload.payload,
834
+ onHighlight: setHighlightedArea,
835
+ legendPosition: legendProps?.verticalAlign || "top",
836
+ classNames: resolvedClassNames,
837
+ styles: resolvedStyles,
838
+ series,
839
+ showColor: type !== "waterfall",
840
+ attributes
841
+ }),
842
+ ...legendProps
843
+ }),
844
+ /* @__PURE__ */ jsxs6(XAxis2, {
845
+ hide: !withXAxis,
846
+ ...orientation === "vertical" ? { type: "number" } : { dataKey },
847
+ tick: {
848
+ transform: "translate(0, 10)",
849
+ fontSize: 12,
850
+ fill: "currentColor"
851
+ },
852
+ stroke: "",
853
+ interval: "preserveStartEnd",
854
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
855
+ minTickGap: 5,
856
+ tickFormatter: orientation === "vertical" ? tickFormatter : undefined,
857
+ ...getStyles("axis"),
858
+ ...xAxisProps,
859
+ children: [xAxisLabel && /* @__PURE__ */ jsx7(Label2, {
860
+ position: "insideBottom",
861
+ offset: -20,
862
+ fontSize: 12,
863
+ ...getStyles("axisLabel"),
864
+ children: xAxisLabel
865
+ }), xAxisProps?.children]
866
+ }),
867
+ /* @__PURE__ */ jsxs6(YAxis2, {
868
+ orientation: "left",
869
+ tick: {
870
+ transform: "translate(-10, 0)",
871
+ fontSize: 12,
872
+ fill: "currentColor"
873
+ },
874
+ hide: !withYAxis,
875
+ ...sharedYAxisProps,
876
+ ...yAxisProps,
877
+ children: [yAxisLabel && /* @__PURE__ */ jsx7(Label2, {
878
+ position: "insideLeft",
879
+ angle: -90,
880
+ textAnchor: "middle",
881
+ fontSize: 12,
882
+ offset: -5,
883
+ ...getStyles("axisLabel"),
884
+ children: yAxisLabel
885
+ }), yAxisProps?.children]
886
+ }),
887
+ /* @__PURE__ */ jsxs6(YAxis2, {
888
+ yAxisId: "right",
889
+ orientation: "right",
890
+ tick: {
891
+ transform: "translate(10, 0)",
892
+ fontSize: 12,
893
+ fill: "currentColor"
894
+ },
895
+ hide: !withRightYAxis,
896
+ ...sharedYAxisProps,
897
+ ...rightYAxisProps,
898
+ children: [rightYAxisLabel && /* @__PURE__ */ jsx7(Label2, {
899
+ position: "insideRight",
900
+ angle: 90,
901
+ textAnchor: "middle",
902
+ fontSize: 12,
903
+ offset: -5,
904
+ ...getStyles("axisLabel"),
905
+ children: rightYAxisLabel
906
+ }), yAxisProps?.children]
907
+ }),
908
+ /* @__PURE__ */ jsx7(CartesianGrid2, {
909
+ strokeDasharray,
910
+ vertical: gridAxis === "y" || gridAxis === "xy",
911
+ horizontal: gridAxis === "x" || gridAxis === "xy",
912
+ ...getStyles("grid"),
913
+ ...gridProps
914
+ }),
915
+ withTooltip && /* @__PURE__ */ jsx7(Tooltip$12, {
916
+ animationDuration: tooltipAnimationDuration,
917
+ isAnimationActive: tooltipAnimationDuration !== 0,
918
+ position: orientation === "vertical" ? {} : { y: 0 },
919
+ cursor: {
920
+ stroke: "var(--chart-grid-color)",
921
+ strokeWidth: 1,
922
+ strokeDasharray,
923
+ fill: "var(--chart-cursor-fill)"
924
+ },
925
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx7(ChartTooltip, {
926
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
927
+ payload,
928
+ type: type === "waterfall" ? "scatter" : undefined,
929
+ unit,
930
+ classNames: resolvedClassNames,
931
+ styles: resolvedStyles,
932
+ series,
933
+ valueFormatter,
934
+ attributes
935
+ }),
936
+ ...tooltipProps
937
+ }),
938
+ bars,
939
+ referenceLinesItems,
940
+ children
941
+ ]
942
+ })
943
+ })
944
+ });
945
+ });
946
+ BarChart$1.displayName = "@mantine/charts/BarChart";
947
+ BarChart$1.classes = grid_chart_module_default;
948
+ BarChart$1.varsResolver = varsResolver2;
949
+
950
+ // node_modules/@mantine/charts/esm/LineChart/LineChart.mjs
951
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
952
+ import { createElement as createElement3, useState as useState3 } from "react";
953
+ import { CartesianGrid as CartesianGrid3, Label as Label3, Legend as Legend3, Line, LineChart, ReferenceLine as ReferenceLine3, ResponsiveContainer as ResponsiveContainer3, Tooltip as Tooltip$13, XAxis as XAxis3, YAxis as YAxis3 } from "recharts";
954
+
955
+ var defaultProps4 = {
956
+ withXAxis: true,
957
+ withYAxis: true,
958
+ withTooltip: true,
959
+ tooltipAnimationDuration: 0,
960
+ fillOpacity: 1,
961
+ tickLine: "y",
962
+ strokeDasharray: "5 5",
963
+ gridAxis: "x",
964
+ withDots: true,
965
+ connectNulls: true,
966
+ strokeWidth: 2,
967
+ curveType: "monotone",
968
+ gradientStops: [{
969
+ offset: 0,
970
+ color: "red"
971
+ }, {
972
+ offset: 100,
973
+ color: "blue"
974
+ }]
975
+ };
976
+ var varsResolver3 = createVarsResolver((theme, { textColor, gridColor }) => ({ root: {
977
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
978
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined
979
+ } }));
980
+ var LineChart$1 = factory((_props) => {
981
+ const props = useProps("LineChart", defaultProps4, _props);
982
+ const { classNames, className, style, styles, unstyled, vars, data, withLegend, legendProps, series, onMouseLeave, dataKey, withTooltip, withXAxis, withYAxis, gridAxis, tickLine, xAxisProps, yAxisProps, unit, tooltipAnimationDuration, strokeDasharray, gridProps, tooltipProps, referenceLines, withDots, dotProps, activeDotProps, strokeWidth, lineChartProps, connectNulls, fillOpacity, curveType, orientation, dir, valueFormatter, children, lineProps, xAxisLabel, yAxisLabel, type, gradientStops, withRightYAxis, rightYAxisLabel, rightYAxisProps, withPointLabels, attributes, gridColor, ...others } = props;
983
+ const theme = useMantineTheme();
984
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
985
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
986
+ const [highlightedArea, setHighlightedArea] = useState3(null);
987
+ const shouldHighlight = highlightedArea !== null;
988
+ const handleMouseLeave = (event) => {
989
+ setHighlightedArea(null);
990
+ onMouseLeave?.(event);
991
+ };
992
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
993
+ classNames,
994
+ styles,
995
+ props
996
+ });
997
+ const getStyles = useStyles({
998
+ name: "LineChart",
999
+ classes: grid_chart_module_default,
1000
+ props,
1001
+ className,
1002
+ style,
1003
+ classNames,
1004
+ styles,
1005
+ unstyled,
1006
+ attributes,
1007
+ vars,
1008
+ varsResolver: varsResolver3
1009
+ });
1010
+ const gradientId = `line-chart-gradient-${useId$1()}`;
1011
+ const stops = gradientStops?.map((stop) => /* @__PURE__ */ jsx8("stop", {
1012
+ offset: `${stop.offset}%`,
1013
+ stopColor: getThemeColor(stop.color, theme)
1014
+ }, stop.color));
1015
+ const lines = series.map((item) => {
1016
+ const color = getThemeColor(item.color, theme);
1017
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
1018
+ return /* @__PURE__ */ createElement3(Line, {
1019
+ ...getStyles("line"),
1020
+ key: item.name,
1021
+ name: item.name,
1022
+ dataKey: item.name,
1023
+ dot: withDots ? {
1024
+ fillOpacity: dimmed ? 0 : 1,
1025
+ strokeOpacity: dimmed ? 0 : 1,
1026
+ strokeWidth: 1,
1027
+ fill: type === "gradient" ? "var(--mantine-color-gray-7)" : color,
1028
+ stroke: type === "gradient" ? "white" : color,
1029
+ ...dotProps
1030
+ } : false,
1031
+ activeDot: withDots ? {
1032
+ fill: type === "gradient" ? "var(--mantine-color-gray-7)" : color,
1033
+ stroke: type === "gradient" ? "white" : color,
1034
+ ...activeDotProps
1035
+ } : false,
1036
+ fill: color,
1037
+ stroke: type === "gradient" ? `url(#${gradientId})` : color,
1038
+ strokeWidth,
1039
+ isAnimationActive: false,
1040
+ fillOpacity: dimmed ? 0 : fillOpacity,
1041
+ strokeOpacity: dimmed ? 0.5 : fillOpacity,
1042
+ connectNulls,
1043
+ type: item.curveType ?? curveType,
1044
+ strokeDasharray: item.strokeDasharray,
1045
+ yAxisId: item.yAxisId || undefined,
1046
+ label: withPointLabels ? /* @__PURE__ */ jsx8(PointLabel, { valueFormatter }) : undefined,
1047
+ ...typeof lineProps === "function" ? lineProps(item) : lineProps
1048
+ });
1049
+ });
1050
+ const referenceLinesItems = referenceLines?.map((line, index) => {
1051
+ const color = getThemeColor(line.color, theme);
1052
+ return /* @__PURE__ */ jsx8(ReferenceLine3, {
1053
+ stroke: line.color ? color : "var(--chart-grid-color)",
1054
+ strokeWidth: 1,
1055
+ yAxisId: line.yAxisId || undefined,
1056
+ ...line,
1057
+ label: {
1058
+ fill: line.color ? color : "currentColor",
1059
+ fontSize: 12,
1060
+ position: line.labelPosition ?? "insideBottomLeft",
1061
+ ...typeof line.label === "object" ? line.label : { value: line.label }
1062
+ },
1063
+ ...getStyles("referenceLine")
1064
+ }, index);
1065
+ });
1066
+ const sharedYAxisProps = {
1067
+ axisLine: false,
1068
+ ...orientation === "vertical" ? {
1069
+ dataKey,
1070
+ type: "category"
1071
+ } : { type: "number" },
1072
+ tickLine: withYTickLine ? { stroke: "currentColor" } : false,
1073
+ allowDecimals: true,
1074
+ unit,
1075
+ tickFormatter: orientation === "vertical" ? undefined : valueFormatter,
1076
+ ...getStyles("axis")
1077
+ };
1078
+ return /* @__PURE__ */ jsx8(Box, {
1079
+ ...getStyles("root"),
1080
+ onMouseLeave: handleMouseLeave,
1081
+ dir: dir || "ltr",
1082
+ ...others,
1083
+ children: /* @__PURE__ */ jsx8(ResponsiveContainer3, {
1084
+ ...getStyles("container"),
1085
+ children: /* @__PURE__ */ jsxs7(LineChart, {
1086
+ data,
1087
+ layout: orientation,
1088
+ margin: {
1089
+ bottom: xAxisLabel ? 30 : undefined,
1090
+ left: yAxisLabel ? 10 : undefined,
1091
+ right: yAxisLabel ? 5 : undefined
1092
+ },
1093
+ ...lineChartProps,
1094
+ children: [
1095
+ type === "gradient" && /* @__PURE__ */ jsx8("defs", { children: /* @__PURE__ */ jsx8("linearGradient", {
1096
+ id: gradientId,
1097
+ x1: "0",
1098
+ y1: "0",
1099
+ x2: "0",
1100
+ y2: "1",
1101
+ children: stops
1102
+ }) }),
1103
+ withLegend && /* @__PURE__ */ jsx8(Legend3, {
1104
+ verticalAlign: "top",
1105
+ content: (payload) => /* @__PURE__ */ jsx8(ChartLegend, {
1106
+ payload: payload.payload,
1107
+ onHighlight: setHighlightedArea,
1108
+ legendPosition: legendProps?.verticalAlign || "top",
1109
+ classNames: resolvedClassNames,
1110
+ styles: resolvedStyles,
1111
+ series,
1112
+ showColor: type !== "gradient",
1113
+ attributes
1114
+ }),
1115
+ ...legendProps
1116
+ }),
1117
+ /* @__PURE__ */ jsxs7(XAxis3, {
1118
+ hide: !withXAxis,
1119
+ ...orientation === "vertical" ? { type: "number" } : { dataKey },
1120
+ tick: {
1121
+ transform: "translate(0, 10)",
1122
+ fontSize: 12,
1123
+ fill: "currentColor"
1124
+ },
1125
+ stroke: "",
1126
+ interval: "preserveStartEnd",
1127
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
1128
+ minTickGap: 5,
1129
+ tickFormatter: orientation === "vertical" ? valueFormatter : undefined,
1130
+ ...getStyles("axis"),
1131
+ ...xAxisProps,
1132
+ children: [xAxisLabel && /* @__PURE__ */ jsx8(Label3, {
1133
+ position: "insideBottom",
1134
+ offset: -20,
1135
+ fontSize: 12,
1136
+ ...getStyles("axisLabel"),
1137
+ children: xAxisLabel
1138
+ }), xAxisProps?.children]
1139
+ }),
1140
+ /* @__PURE__ */ jsxs7(YAxis3, {
1141
+ tick: {
1142
+ transform: "translate(-10, 0)",
1143
+ fontSize: 12,
1144
+ fill: "currentColor"
1145
+ },
1146
+ hide: !withYAxis,
1147
+ ...sharedYAxisProps,
1148
+ ...yAxisProps,
1149
+ children: [yAxisLabel && /* @__PURE__ */ jsx8(Label3, {
1150
+ position: "insideLeft",
1151
+ angle: -90,
1152
+ textAnchor: "middle",
1153
+ fontSize: 12,
1154
+ offset: -5,
1155
+ ...getStyles("axisLabel"),
1156
+ children: yAxisLabel
1157
+ }), yAxisProps?.children]
1158
+ }),
1159
+ /* @__PURE__ */ jsxs7(YAxis3, {
1160
+ yAxisId: "right",
1161
+ orientation: "right",
1162
+ tick: {
1163
+ transform: "translate(10, 0)",
1164
+ fontSize: 12,
1165
+ fill: "currentColor"
1166
+ },
1167
+ hide: !withRightYAxis,
1168
+ ...sharedYAxisProps,
1169
+ ...rightYAxisProps,
1170
+ children: [rightYAxisLabel && /* @__PURE__ */ jsx8(Label3, {
1171
+ position: "insideRight",
1172
+ angle: 90,
1173
+ textAnchor: "middle",
1174
+ fontSize: 12,
1175
+ offset: -5,
1176
+ ...getStyles("axisLabel"),
1177
+ children: rightYAxisLabel
1178
+ }), yAxisProps?.children]
1179
+ }),
1180
+ /* @__PURE__ */ jsx8(CartesianGrid3, {
1181
+ strokeDasharray,
1182
+ vertical: gridAxis === "y" || gridAxis === "xy",
1183
+ horizontal: gridAxis === "x" || gridAxis === "xy",
1184
+ ...getStyles("grid"),
1185
+ ...gridProps
1186
+ }),
1187
+ withTooltip && /* @__PURE__ */ jsx8(Tooltip$13, {
1188
+ animationDuration: tooltipAnimationDuration,
1189
+ isAnimationActive: tooltipAnimationDuration !== 0,
1190
+ position: orientation === "vertical" ? {} : { y: 0 },
1191
+ cursor: {
1192
+ stroke: "var(--chart-grid-color)",
1193
+ strokeWidth: 1,
1194
+ strokeDasharray
1195
+ },
1196
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx8(ChartTooltip, {
1197
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
1198
+ payload,
1199
+ unit,
1200
+ classNames: resolvedClassNames,
1201
+ styles: resolvedStyles,
1202
+ series,
1203
+ valueFormatter,
1204
+ showColor: type !== "gradient",
1205
+ attributes
1206
+ }),
1207
+ ...tooltipProps
1208
+ }),
1209
+ lines,
1210
+ referenceLinesItems,
1211
+ children
1212
+ ]
1213
+ })
1214
+ })
1215
+ });
1216
+ });
1217
+ LineChart$1.displayName = "@mantine/charts/LineChart";
1218
+ LineChart$1.classes = grid_chart_module_default;
1219
+ LineChart$1.varsResolver = varsResolver3;
1220
+
1221
+ // node_modules/@mantine/charts/esm/Sparkline/Sparkline.module.mjs
1222
+
1223
+ var Sparkline_module_default = { root: "m_f9458cfe" };
1224
+
1225
+ // node_modules/@mantine/charts/esm/Sparkline/Sparkline.mjs
1226
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1227
+ import { useId as useId2, useMemo } from "react";
1228
+ import { Area as Area2, AreaChart as AreaChart2, ResponsiveContainer as ResponsiveContainer4 } from "recharts";
1229
+
1230
+ var defaultProps5 = {
1231
+ withGradient: true,
1232
+ connectNulls: true,
1233
+ fillOpacity: 0.6,
1234
+ strokeWidth: 2,
1235
+ curveType: "linear"
1236
+ };
1237
+ function getTrendColor(data, trendColors) {
1238
+ const first = data[0];
1239
+ const last = data[data.length - 1];
1240
+ if (first === null || last === null)
1241
+ return trendColors.neutral || trendColors.positive;
1242
+ if (first < last)
1243
+ return trendColors.positive;
1244
+ if (first > last)
1245
+ return trendColors.negative;
1246
+ return trendColors.neutral || trendColors.positive;
1247
+ }
1248
+ var varsResolver4 = createVarsResolver((theme, { color, data, trendColors }) => ({ root: { "--chart-color": trendColors ? getThemeColor(getTrendColor(data, trendColors), theme) : color ? getThemeColor(color, theme) : undefined } }));
1249
+ var Sparkline = factory((_props) => {
1250
+ const props = useProps("Sparkline", defaultProps5, _props);
1251
+ const { classNames, className, style, styles, unstyled, vars, data, withGradient, fillOpacity, curveType, strokeWidth, trendColors, connectNulls, areaProps, attributes, ...others } = props;
1252
+ const getStyles = useStyles({
1253
+ name: "Sparkline",
1254
+ classes: Sparkline_module_default,
1255
+ props,
1256
+ className,
1257
+ style,
1258
+ classNames,
1259
+ styles,
1260
+ unstyled,
1261
+ attributes,
1262
+ vars,
1263
+ varsResolver: varsResolver4
1264
+ });
1265
+ const id = useId2();
1266
+ const mappedData = useMemo(() => data.map((value, index) => ({
1267
+ value,
1268
+ index
1269
+ })), [data]);
1270
+ return /* @__PURE__ */ jsx9(Box, {
1271
+ ...getStyles("root"),
1272
+ ...others,
1273
+ dir: "ltr",
1274
+ children: /* @__PURE__ */ jsx9(ResponsiveContainer4, { children: /* @__PURE__ */ jsxs8(AreaChart2, {
1275
+ data: mappedData,
1276
+ children: [/* @__PURE__ */ jsx9(Area2, {
1277
+ dataKey: "value",
1278
+ type: curveType,
1279
+ fill: `url(#${id})`,
1280
+ stroke: "var(--chart-color, var(--mantine-color-blue-filled))",
1281
+ isAnimationActive: false,
1282
+ connectNulls,
1283
+ strokeWidth,
1284
+ fillOpacity: 1,
1285
+ activeDot: false,
1286
+ ...areaProps
1287
+ }), /* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsx9(AreaGradient, {
1288
+ id,
1289
+ color: "var(--chart-color, var(--mantine-color-blue-filled))",
1290
+ fillOpacity,
1291
+ withGradient
1292
+ }) })]
1293
+ }) })
1294
+ });
1295
+ });
1296
+ Sparkline.displayName = "@mantine/charts/Sparkline";
1297
+ Sparkline.classes = Sparkline_module_default;
1298
+ Sparkline.varsResolver = varsResolver4;
1299
+
1300
+ // node_modules/@mantine/charts/esm/DonutChart/DonutChart.module.mjs
1301
+
1302
+ var DonutChart_module_default = {
1303
+ root: "m_a410e613",
1304
+ label: "m_ddb0bfe3"
1305
+ };
1306
+
1307
+ // node_modules/@mantine/charts/esm/DonutChart/DonutChart.mjs
1308
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1309
+ import { Pie, PieChart, ResponsiveContainer as ResponsiveContainer5, Tooltip as Tooltip$14 } from "recharts";
1310
+
1311
+ var defaultProps6 = {
1312
+ withTooltip: true,
1313
+ withLabelsLine: true,
1314
+ paddingAngle: 0,
1315
+ thickness: 20,
1316
+ size: 160,
1317
+ strokeWidth: 1,
1318
+ startAngle: 0,
1319
+ endAngle: 360,
1320
+ labelsType: "value",
1321
+ tooltipDataSource: "all"
1322
+ };
1323
+ var varsResolver5 = createVarsResolver((theme, { strokeColor, labelColor, withLabels, size }) => ({ root: {
1324
+ "--chart-stroke-color": strokeColor ? getThemeColor(strokeColor, theme) : undefined,
1325
+ "--chart-labels-color": labelColor ? getThemeColor(labelColor, theme) : undefined,
1326
+ "--chart-size": withLabels ? rem(size + 80) : rem(size)
1327
+ } }));
1328
+ var getLabelValue = (labelsType, value, percent, valueFormatter) => {
1329
+ if (labelsType === "percent")
1330
+ return `${((percent || 0) * 100).toFixed(0)}%`;
1331
+ if (typeof valueFormatter === "function")
1332
+ return valueFormatter(value || 0);
1333
+ return value;
1334
+ };
1335
+ var getLabel = (labelsType, valueFormatter) => ({ x, y, cx, cy, percent, value }) => /* @__PURE__ */ jsx10("text", {
1336
+ x,
1337
+ y,
1338
+ cx,
1339
+ cy,
1340
+ textAnchor: x > Number(cx) ? "start" : "end",
1341
+ fill: "var(--chart-labels-color, var(--mantine-color-dimmed))",
1342
+ fontFamily: "var(--mantine-font-family)",
1343
+ fontSize: 12,
1344
+ children: /* @__PURE__ */ jsx10("tspan", {
1345
+ x,
1346
+ children: getLabelValue(labelsType, Number(value), Number(percent), valueFormatter)
1347
+ })
1348
+ });
1349
+ var DonutChart = factory((_props) => {
1350
+ const props = useProps("DonutChart", defaultProps6, _props);
1351
+ const { classNames, className, style, styles, unstyled, vars, data, withTooltip, tooltipAnimationDuration, tooltipProps, pieProps, paddingAngle, withLabels, withLabelsLine, size, thickness, strokeWidth, startAngle, endAngle, tooltipDataSource, chartLabel, children, pieChartProps, valueFormatter, strokeColor, labelsType, attributes, cellProps, ...others } = props;
1352
+ const theme = useMantineTheme();
1353
+ const getStyles = useStyles({
1354
+ name: "DonutChart",
1355
+ classes: DonutChart_module_default,
1356
+ props,
1357
+ className,
1358
+ style,
1359
+ classNames,
1360
+ styles,
1361
+ unstyled,
1362
+ attributes,
1363
+ vars,
1364
+ varsResolver: varsResolver5
1365
+ });
1366
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
1367
+ classNames,
1368
+ styles,
1369
+ props
1370
+ });
1371
+ const pieData = data.map((item) => ({
1372
+ ...item,
1373
+ fill: getThemeColor(item.color, theme),
1374
+ stroke: "var(--chart-stroke-color, var(--mantine-color-body))",
1375
+ strokeWidth,
1376
+ ...typeof cellProps === "function" ? cellProps(item) : cellProps
1377
+ }));
1378
+ return /* @__PURE__ */ jsx10(Box, {
1379
+ size,
1380
+ ...getStyles("root"),
1381
+ ...others,
1382
+ children: /* @__PURE__ */ jsx10(ResponsiveContainer5, { children: /* @__PURE__ */ jsxs9(PieChart, {
1383
+ ...pieChartProps,
1384
+ children: [
1385
+ /* @__PURE__ */ jsx10(Pie, {
1386
+ data: pieData,
1387
+ innerRadius: size / 2 - thickness,
1388
+ outerRadius: size / 2,
1389
+ dataKey: "value",
1390
+ isAnimationActive: false,
1391
+ paddingAngle,
1392
+ startAngle,
1393
+ endAngle,
1394
+ label: withLabels ? getLabel(labelsType || "value", valueFormatter) : false,
1395
+ labelLine: withLabelsLine ? {
1396
+ stroke: "var(--chart-label-color, var(--mantine-color-dimmed))",
1397
+ strokeWidth: 1
1398
+ } : false,
1399
+ ...pieProps
1400
+ }),
1401
+ chartLabel && /* @__PURE__ */ jsx10("text", {
1402
+ x: "50%",
1403
+ y: "50%",
1404
+ textAnchor: "middle",
1405
+ dominantBaseline: "middle",
1406
+ ...getStyles("label"),
1407
+ children: chartLabel
1408
+ }),
1409
+ withTooltip && /* @__PURE__ */ jsx10(Tooltip$14, {
1410
+ animationDuration: tooltipAnimationDuration,
1411
+ isAnimationActive: false,
1412
+ content: ({ payload }) => /* @__PURE__ */ jsx10(ChartTooltip, {
1413
+ payload: data,
1414
+ classNames: resolvedClassNames,
1415
+ styles: resolvedStyles,
1416
+ type: "radial",
1417
+ segmentId: tooltipDataSource === "segment" ? payload?.[0]?.name : undefined,
1418
+ valueFormatter,
1419
+ attributes
1420
+ }),
1421
+ ...tooltipProps
1422
+ }),
1423
+ children
1424
+ ]
1425
+ }) })
1426
+ });
1427
+ });
1428
+ DonutChart.displayName = "@mantine/charts/DonutChart";
1429
+ DonutChart.classes = DonutChart_module_default;
1430
+ DonutChart.varsResolver = varsResolver5;
1431
+
1432
+ // node_modules/@mantine/charts/esm/PieChart/PieChart.module.mjs
1433
+
1434
+ var PieChart_module_default = { root: "m_cd8943fd" };
1435
+
1436
+ // node_modules/@mantine/charts/esm/PieChart/PieChart.mjs
1437
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1438
+ import { Pie as Pie2, PieChart as PieChart2, ResponsiveContainer as ResponsiveContainer6, Tooltip as Tooltip$15 } from "recharts";
1439
+
1440
+ var defaultProps7 = {
1441
+ withTooltip: false,
1442
+ withLabelsLine: true,
1443
+ paddingAngle: 0,
1444
+ size: 160,
1445
+ strokeWidth: 1,
1446
+ startAngle: 0,
1447
+ endAngle: 360,
1448
+ tooltipDataSource: "all",
1449
+ labelsPosition: "outside",
1450
+ labelsType: "value"
1451
+ };
1452
+ var varsResolver6 = createVarsResolver((theme, { strokeColor, labelColor, withLabels, size, labelsPosition }) => ({ root: {
1453
+ "--chart-stroke-color": strokeColor ? getThemeColor(strokeColor, theme) : undefined,
1454
+ "--chart-labels-color": labelColor ? getThemeColor(labelColor, theme) : undefined,
1455
+ "--chart-size": withLabels && labelsPosition === "outside" ? rem(size + 80) : rem(size)
1456
+ } }));
1457
+ var getLabelValue2 = (labelsType, value, percent, valueFormatter) => {
1458
+ if (labelsType === "percent" && typeof percent === "number")
1459
+ return `${(percent * 100).toFixed(0)}%`;
1460
+ if (typeof valueFormatter === "function" && typeof value === "number")
1461
+ return valueFormatter(value);
1462
+ return value;
1463
+ };
1464
+ var getInsideLabel = (labelsType, valueFormatter) => ({ cx, cy, midAngle, innerRadius, outerRadius, value, percent }) => {
1465
+ const RADIAN = Math.PI / 180;
1466
+ const radius = Number(innerRadius) + (Number(outerRadius) - Number(innerRadius)) * 0.5;
1467
+ const x = Number(cx) + radius * Math.cos(-(midAngle || 0) * RADIAN);
1468
+ return /* @__PURE__ */ jsx11("text", {
1469
+ x,
1470
+ y: Number(cy) + radius * Math.sin(-(midAngle || 0) * RADIAN),
1471
+ textAnchor: x > Number(cx) ? "start" : "end",
1472
+ dominantBaseline: "central",
1473
+ className: PieChart_module_default.label,
1474
+ children: getLabelValue2(labelsType, Number(value), Number(percent), valueFormatter)
1475
+ });
1476
+ };
1477
+ var getOutsideLabel = (labelsType, valueFormatter) => ({ x, y, cx, cy, percent, value }) => /* @__PURE__ */ jsx11("text", {
1478
+ x,
1479
+ y,
1480
+ cx,
1481
+ cy,
1482
+ textAnchor: x > Number(cx) ? "start" : "end",
1483
+ fill: "var(--chart-labels-color, var(--mantine-color-dimmed))",
1484
+ fontFamily: "var(--mantine-font-family)",
1485
+ fontSize: 12,
1486
+ children: /* @__PURE__ */ jsx11("tspan", {
1487
+ x,
1488
+ children: getLabelValue2(labelsType, Number(value), Number(percent), valueFormatter)
1489
+ })
1490
+ });
1491
+ var PieChart$1 = factory((_props) => {
1492
+ const props = useProps("PieChart", defaultProps7, _props);
1493
+ const { classNames, className, style, styles, unstyled, vars, data, withTooltip, tooltipAnimationDuration, tooltipProps, pieProps, paddingAngle, withLabels, withLabelsLine, size, strokeWidth, startAngle, endAngle, tooltipDataSource, children, pieChartProps, labelsPosition, valueFormatter, labelsType, strokeColor, attributes, cellProps, ...others } = props;
1494
+ const theme = useMantineTheme();
1495
+ const getStyles = useStyles({
1496
+ name: "PieChart",
1497
+ classes: PieChart_module_default,
1498
+ props,
1499
+ className,
1500
+ style,
1501
+ classNames,
1502
+ styles,
1503
+ unstyled,
1504
+ attributes,
1505
+ vars,
1506
+ varsResolver: varsResolver6
1507
+ });
1508
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
1509
+ classNames,
1510
+ styles,
1511
+ props
1512
+ });
1513
+ const pieData = data.map((item) => ({
1514
+ ...item,
1515
+ fill: getThemeColor(item.color, theme),
1516
+ stroke: "var(--chart-stroke-color, var(--mantine-color-body))",
1517
+ strokeWidth,
1518
+ ...typeof cellProps === "function" ? cellProps(item) : cellProps
1519
+ }));
1520
+ return /* @__PURE__ */ jsx11(Box, {
1521
+ size,
1522
+ ...getStyles("root"),
1523
+ ...others,
1524
+ children: /* @__PURE__ */ jsx11(ResponsiveContainer6, { children: /* @__PURE__ */ jsxs10(PieChart2, {
1525
+ ...pieChartProps,
1526
+ children: [
1527
+ /* @__PURE__ */ jsx11(Pie2, {
1528
+ data: pieData,
1529
+ innerRadius: 0,
1530
+ outerRadius: size / 2,
1531
+ dataKey: "value",
1532
+ isAnimationActive: false,
1533
+ paddingAngle,
1534
+ startAngle,
1535
+ endAngle,
1536
+ label: withLabels ? labelsPosition === "inside" ? getInsideLabel(labelsType || "value", valueFormatter) : getOutsideLabel(labelsType || "value", valueFormatter) : false,
1537
+ labelLine: withLabelsLine && labelsPosition === "outside" ? {
1538
+ stroke: "var(--chart-label-color, var(--mantine-color-dimmed))",
1539
+ strokeWidth: 1
1540
+ } : false,
1541
+ ...pieProps
1542
+ }),
1543
+ withTooltip && /* @__PURE__ */ jsx11(Tooltip$15, {
1544
+ animationDuration: tooltipAnimationDuration,
1545
+ isAnimationActive: false,
1546
+ content: ({ payload }) => /* @__PURE__ */ jsx11(ChartTooltip, {
1547
+ payload: data,
1548
+ classNames: resolvedClassNames,
1549
+ styles: resolvedStyles,
1550
+ type: "radial",
1551
+ segmentId: tooltipDataSource === "segment" ? payload?.[0]?.name : undefined,
1552
+ valueFormatter,
1553
+ attributes
1554
+ }),
1555
+ ...tooltipProps
1556
+ }),
1557
+ children
1558
+ ]
1559
+ }) })
1560
+ });
1561
+ });
1562
+ PieChart$1.displayName = "@mantine/charts/PieChart";
1563
+ PieChart$1.classes = PieChart_module_default;
1564
+ PieChart$1.varsResolver = varsResolver6;
1565
+
1566
+ // node_modules/@mantine/charts/esm/RadarChart/RadarChart.module.mjs
1567
+
1568
+ var RadarChart_module_default = {
1569
+ root: "m_1f271cf7",
1570
+ container: "m_cf06f58c"
1571
+ };
1572
+
1573
+ // node_modules/@mantine/charts/esm/RadarChart/RadarChart.mjs
1574
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1575
+ import { useState as useState4 } from "react";
1576
+ import { Legend as Legend4, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, ResponsiveContainer as ResponsiveContainer7, Tooltip as Tooltip$16 } from "recharts";
1577
+
1578
+ var defaultProps8 = {
1579
+ withPolarGrid: true,
1580
+ withPolarAngleAxis: true,
1581
+ withPolarRadiusAxis: false,
1582
+ withTooltip: false,
1583
+ withDots: false,
1584
+ tooltipAnimationDuration: 0
1585
+ };
1586
+ var varsResolver7 = createVarsResolver((theme, { gridColor, textColor }) => ({ root: {
1587
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined,
1588
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined
1589
+ } }));
1590
+ var RadarChart$1 = factory((_props) => {
1591
+ const props = useProps("RadarChart", defaultProps8, _props);
1592
+ const { classNames, className, style, styles, unstyled, vars, data, series, dataKey, gridColor, textColor, radarProps, radarChartProps, polarGridProps, polarAngleAxisProps, polarRadiusAxisProps, tooltipProps, withPolarGrid, withPolarAngleAxis, withPolarRadiusAxis, withTooltip, tooltipAnimationDuration, children, withLegend, withDots, dotProps, activeDotProps, legendProps, attributes, ...others } = props;
1593
+ const theme = useMantineTheme();
1594
+ const getStyles = useStyles({
1595
+ name: "RadarChart",
1596
+ classes: RadarChart_module_default,
1597
+ props,
1598
+ className,
1599
+ style,
1600
+ classNames,
1601
+ styles,
1602
+ unstyled,
1603
+ attributes,
1604
+ vars,
1605
+ varsResolver: varsResolver7
1606
+ });
1607
+ const [highlightedArea, setHighlightedArea] = useState4(null);
1608
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
1609
+ classNames,
1610
+ styles,
1611
+ props
1612
+ });
1613
+ const radars = series.map((item, index) => /* @__PURE__ */ jsx12(Radar, {
1614
+ name: item.name,
1615
+ dataKey: item.name,
1616
+ stroke: getThemeColor(item.strokeColor || item.color, theme),
1617
+ fill: getThemeColor(item.color, theme),
1618
+ fillOpacity: highlightedArea ? highlightedArea === item.name ? item.opacity || 0.4 : 0.05 : item.opacity || 0.4,
1619
+ dot: withDots ? {
1620
+ fillOpacity: 1,
1621
+ strokeOpacity: 0,
1622
+ strokeWidth: 1,
1623
+ fill: getThemeColor(item.color, theme),
1624
+ stroke: getThemeColor(item.color, theme),
1625
+ ...dotProps
1626
+ } : false,
1627
+ activeDot: withDots ? {
1628
+ fill: getThemeColor(item.color, theme),
1629
+ stroke: getThemeColor(item.color, theme),
1630
+ ...activeDotProps
1631
+ } : false,
1632
+ strokeOpacity: highlightedArea ? highlightedArea === item.name ? 1 : 0.1 : 1,
1633
+ isAnimationActive: false,
1634
+ ...typeof radarProps === "function" ? radarProps(item) : radarProps
1635
+ }, index));
1636
+ return /* @__PURE__ */ jsx12(Box, {
1637
+ ...getStyles("root"),
1638
+ ...others,
1639
+ children: /* @__PURE__ */ jsx12(ResponsiveContainer7, {
1640
+ ...getStyles("container"),
1641
+ children: /* @__PURE__ */ jsxs11(RadarChart, {
1642
+ data,
1643
+ ...radarChartProps,
1644
+ children: [
1645
+ withPolarGrid && /* @__PURE__ */ jsx12(PolarGrid, {
1646
+ stroke: "var(--chart-grid-color)",
1647
+ ...polarGridProps
1648
+ }),
1649
+ withPolarAngleAxis && /* @__PURE__ */ jsx12(PolarAngleAxis, {
1650
+ dataKey,
1651
+ ...polarAngleAxisProps
1652
+ }),
1653
+ withPolarRadiusAxis && /* @__PURE__ */ jsx12(PolarRadiusAxis, {
1654
+ stroke: "var(--chart-grid-color)",
1655
+ ...polarRadiusAxisProps
1656
+ }),
1657
+ withTooltip && /* @__PURE__ */ jsx12(Tooltip$16, {
1658
+ animationDuration: tooltipAnimationDuration,
1659
+ isAnimationActive: tooltipAnimationDuration !== 0,
1660
+ cursor: {
1661
+ stroke: "var(--chart-grid-color)",
1662
+ strokeWidth: 1
1663
+ },
1664
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx12(ChartTooltip, {
1665
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
1666
+ payload,
1667
+ classNames: resolvedClassNames,
1668
+ styles: resolvedStyles,
1669
+ series,
1670
+ attributes
1671
+ }),
1672
+ ...tooltipProps
1673
+ }),
1674
+ radars,
1675
+ withLegend && /* @__PURE__ */ jsx12(Legend4, {
1676
+ verticalAlign: "bottom",
1677
+ content: (payload) => /* @__PURE__ */ jsx12(ChartLegend, {
1678
+ payload: payload.payload,
1679
+ onHighlight: setHighlightedArea,
1680
+ legendPosition: legendProps?.verticalAlign || "bottom",
1681
+ classNames: resolvedClassNames,
1682
+ styles: resolvedStyles,
1683
+ series,
1684
+ centered: true,
1685
+ attributes
1686
+ }),
1687
+ ...legendProps
1688
+ }),
1689
+ children
1690
+ ]
1691
+ })
1692
+ })
1693
+ });
1694
+ });
1695
+ RadarChart$1.displayName = "@mantine/charts/RadarChart";
1696
+ RadarChart$1.classes = RadarChart_module_default;
1697
+ RadarChart$1.varsResolver = varsResolver7;
1698
+
1699
+ // node_modules/@mantine/charts/esm/ScatterChart/ScatterChart.mjs
1700
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1701
+ import { useState as useState5 } from "react";
1702
+ import { CartesianGrid as CartesianGrid4, Label as Label4, LabelList as LabelList2, Legend as Legend5, ReferenceLine as ReferenceLine4, ResponsiveContainer as ResponsiveContainer8, Scatter, ScatterChart, Tooltip as Tooltip$17, XAxis as XAxis4, YAxis as YAxis4 } from "recharts";
1703
+
1704
+ function getAxis(key, dataKey) {
1705
+ return key === dataKey.x ? "x" : "y";
1706
+ }
1707
+ var defaultProps9 = {
1708
+ withXAxis: true,
1709
+ withYAxis: true,
1710
+ withTooltip: true,
1711
+ tooltipAnimationDuration: 0,
1712
+ tickLine: "y",
1713
+ strokeDasharray: "5 5",
1714
+ gridAxis: "x"
1715
+ };
1716
+ var varsResolver8 = createVarsResolver((theme, { textColor, gridColor }) => ({ root: {
1717
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
1718
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined
1719
+ } }));
1720
+ var ScatterChart$1 = factory((_props) => {
1721
+ const props = useProps("ScatterChart", defaultProps9, _props);
1722
+ const { classNames, className, style, styles, unstyled, vars, referenceLines, dir, withLegend, withTooltip, withXAxis, withYAxis, xAxisProps, yAxisProps, orientation, scatterChartProps, legendProps, data, gridAxis, tickLine, strokeDasharray, gridProps, tooltipAnimationDuration, tooltipProps, children, onMouseLeave, dataKey, textColor, gridColor, xAxisLabel, yAxisLabel, unit, labels, valueFormatter, scatterProps, pointLabels, attributes, ...others } = props;
1723
+ const getFormatter = (axis) => typeof valueFormatter === "function" ? valueFormatter : valueFormatter?.[axis];
1724
+ const xFormatter = getFormatter("x");
1725
+ const yFormatter = getFormatter("y");
1726
+ const theme = useMantineTheme();
1727
+ const mappedData = data.map((item) => ({
1728
+ ...item,
1729
+ data: item.data.map((point) => ({
1730
+ ...point,
1731
+ name: item.name
1732
+ }))
1733
+ }));
1734
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
1735
+ classNames,
1736
+ styles,
1737
+ props
1738
+ });
1739
+ const getStyles = useStyles({
1740
+ name: "ScatterChart",
1741
+ classes: grid_chart_module_default,
1742
+ props,
1743
+ className,
1744
+ style,
1745
+ classNames,
1746
+ styles,
1747
+ unstyled,
1748
+ attributes,
1749
+ vars,
1750
+ varsResolver: varsResolver8
1751
+ });
1752
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
1753
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
1754
+ const [highlightedArea, setHighlightedArea] = useState5(null);
1755
+ const shouldHighlight = highlightedArea !== null;
1756
+ const handleMouseLeave = (event) => {
1757
+ setHighlightedArea(null);
1758
+ onMouseLeave?.(event);
1759
+ };
1760
+ const referenceLinesItems = referenceLines?.map((line, index) => {
1761
+ const color = getThemeColor(line.color, theme);
1762
+ return /* @__PURE__ */ jsx13(ReferenceLine4, {
1763
+ stroke: line.color ? color : "var(--chart-grid-color)",
1764
+ strokeWidth: 1,
1765
+ ...line,
1766
+ label: {
1767
+ fill: line.color ? color : "currentColor",
1768
+ fontSize: 12,
1769
+ position: line.labelPosition ?? "insideBottomLeft",
1770
+ ...typeof line.label === "object" ? line.label : { value: line.label }
1771
+ },
1772
+ ...getStyles("referenceLine")
1773
+ }, index);
1774
+ });
1775
+ const scatters = mappedData.map((item, index) => {
1776
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
1777
+ return /* @__PURE__ */ jsxs12(Scatter, {
1778
+ data: item.data,
1779
+ fill: getThemeColor(item.color, theme),
1780
+ isAnimationActive: false,
1781
+ fillOpacity: dimmed ? 0.1 : 1,
1782
+ ...scatterProps,
1783
+ children: [pointLabels && /* @__PURE__ */ jsx13(LabelList2, {
1784
+ dataKey: dataKey[pointLabels],
1785
+ fontSize: 8,
1786
+ dy: 10
1787
+ }), scatterProps?.children]
1788
+ }, index);
1789
+ });
1790
+ return /* @__PURE__ */ jsx13(Box, {
1791
+ ...getStyles("root"),
1792
+ onMouseLeave: handleMouseLeave,
1793
+ dir: dir || "ltr",
1794
+ ...others,
1795
+ children: /* @__PURE__ */ jsx13(ResponsiveContainer8, {
1796
+ ...getStyles("container"),
1797
+ children: /* @__PURE__ */ jsxs12(ScatterChart, {
1798
+ margin: {
1799
+ bottom: xAxisLabel ? 30 : undefined,
1800
+ left: yAxisLabel ? 10 : undefined,
1801
+ right: yAxisLabel ? 5 : undefined
1802
+ },
1803
+ ...scatterChartProps,
1804
+ children: [
1805
+ /* @__PURE__ */ jsx13(CartesianGrid4, {
1806
+ strokeDasharray,
1807
+ vertical: gridAxis === "y" || gridAxis === "xy",
1808
+ horizontal: gridAxis === "x" || gridAxis === "xy",
1809
+ ...getStyles("grid"),
1810
+ ...gridProps
1811
+ }),
1812
+ /* @__PURE__ */ jsxs12(XAxis4, {
1813
+ type: "number",
1814
+ hide: !withXAxis,
1815
+ dataKey: dataKey.x,
1816
+ tick: {
1817
+ transform: "translate(0, 10)",
1818
+ fontSize: 12,
1819
+ fill: "currentColor"
1820
+ },
1821
+ stroke: "",
1822
+ interval: "preserveStartEnd",
1823
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
1824
+ minTickGap: 5,
1825
+ unit: unit?.x,
1826
+ tickFormatter: xFormatter,
1827
+ ...getStyles("axis"),
1828
+ ...xAxisProps,
1829
+ children: [xAxisLabel && /* @__PURE__ */ jsx13(Label4, {
1830
+ position: "insideBottom",
1831
+ offset: -20,
1832
+ fontSize: 12,
1833
+ ...getStyles("axisLabel"),
1834
+ children: xAxisLabel
1835
+ }), xAxisProps?.children]
1836
+ }),
1837
+ /* @__PURE__ */ jsxs12(YAxis4, {
1838
+ type: "number",
1839
+ hide: !withYAxis,
1840
+ axisLine: false,
1841
+ dataKey: dataKey.y,
1842
+ tickLine: withYTickLine ? { stroke: "currentColor" } : false,
1843
+ tick: {
1844
+ transform: "translate(-10, 0)",
1845
+ fontSize: 12,
1846
+ fill: "currentColor"
1847
+ },
1848
+ allowDecimals: true,
1849
+ unit: unit?.y,
1850
+ tickFormatter: yFormatter,
1851
+ ...getStyles("axis"),
1852
+ ...yAxisProps,
1853
+ children: [yAxisLabel && /* @__PURE__ */ jsx13(Label4, {
1854
+ position: "insideLeft",
1855
+ angle: -90,
1856
+ textAnchor: "middle",
1857
+ fontSize: 12,
1858
+ offset: -5,
1859
+ ...getStyles("axisLabel"),
1860
+ children: yAxisLabel
1861
+ }), yAxisProps?.children]
1862
+ }),
1863
+ withTooltip && /* @__PURE__ */ jsx13(Tooltip$17, {
1864
+ animationDuration: tooltipAnimationDuration,
1865
+ isAnimationActive: tooltipAnimationDuration !== 0,
1866
+ position: { y: 0 },
1867
+ cursor: {
1868
+ stroke: "var(--chart-grid-color)",
1869
+ strokeWidth: 1,
1870
+ strokeDasharray
1871
+ },
1872
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx13(ChartTooltip, {
1873
+ type: "scatter",
1874
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
1875
+ payload: labels ? payload?.map((item) => ({
1876
+ ...item,
1877
+ name: labels[getAxis(item.name, dataKey)] || item.name,
1878
+ value: getFormatter(getAxis(item.name, dataKey))?.(item.value) ?? item.value
1879
+ })) : payload?.map((item) => ({
1880
+ ...item,
1881
+ value: getFormatter(getAxis(item.name, dataKey))?.(item.value) ?? item.value
1882
+ })),
1883
+ classNames: resolvedClassNames,
1884
+ styles: resolvedStyles,
1885
+ series: data,
1886
+ attributes
1887
+ }),
1888
+ ...tooltipProps
1889
+ }),
1890
+ withLegend && /* @__PURE__ */ jsx13(Legend5, {
1891
+ verticalAlign: "top",
1892
+ content: (payload) => /* @__PURE__ */ jsx13(ChartLegend, {
1893
+ payload: payload.payload?.map((item, index) => ({
1894
+ ...item,
1895
+ dataKey: data[index].name
1896
+ })),
1897
+ onHighlight: setHighlightedArea,
1898
+ legendPosition: legendProps?.verticalAlign || "top",
1899
+ classNames: resolvedClassNames,
1900
+ styles: resolvedStyles,
1901
+ series: data,
1902
+ attributes
1903
+ }),
1904
+ height: 44,
1905
+ ...legendProps
1906
+ }),
1907
+ referenceLinesItems,
1908
+ scatters
1909
+ ]
1910
+ })
1911
+ })
1912
+ });
1913
+ });
1914
+ ScatterChart$1.displayName = "@mantine/charts/ScatterChart";
1915
+ ScatterChart$1.classes = grid_chart_module_default;
1916
+ ScatterChart$1.varsResolver = varsResolver8;
1917
+
1918
+ // node_modules/@mantine/charts/esm/BubbleChart/BubbleChart.mjs
1919
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1920
+ import { ResponsiveContainer as ResponsiveContainer9, Scatter as Scatter2, ScatterChart as ScatterChart2, Tooltip as Tooltip$18, XAxis as XAxis5, YAxis as YAxis5, ZAxis } from "recharts";
1921
+
1922
+ function getDomain(data, key) {
1923
+ const values = data.map((item) => item[key]);
1924
+ return [Math.min(...values), Math.max(...values)];
1925
+ }
1926
+ function BubbleChartTooltip({ active, payload, getStyles, dataKey, valueFormatter }) {
1927
+ if (active && payload && payload.length) {
1928
+ const data = payload[0] && payload[0].payload;
1929
+ return /* @__PURE__ */ jsx14("div", {
1930
+ ...getStyles("tooltip"),
1931
+ children: /* @__PURE__ */ jsxs13(Group, {
1932
+ justify: "space-between",
1933
+ children: [/* @__PURE__ */ jsx14(Text, {
1934
+ fz: "sm",
1935
+ children: data[dataKey.x]
1936
+ }), /* @__PURE__ */ jsx14(Text, {
1937
+ fz: "sm",
1938
+ children: valueFormatter ? valueFormatter(data[dataKey.z]) : data[dataKey.z]
1939
+ })]
1940
+ })
1941
+ });
1942
+ }
1943
+ return null;
1944
+ }
1945
+ var defaultProps10 = {
1946
+ color: "blue.6",
1947
+ withTooltip: true
1948
+ };
1949
+ var varsResolver9 = createVarsResolver((theme, { textColor, gridColor }) => ({ root: {
1950
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
1951
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined
1952
+ } }));
1953
+ var BubbleChart = factory((_props) => {
1954
+ const props = useProps("BubbleChart", defaultProps10, _props);
1955
+ const { classNames, className, style, styles, unstyled, vars, data, xAxisProps, yAxisProps, zAxisProps, tooltipProps, scatterProps, color, label, withTooltip, dataKey, range, valueFormatter, attributes, ...others } = props;
1956
+ const theme = useMantineTheme();
1957
+ const getStyles = useStyles({
1958
+ name: "BubbleChart",
1959
+ classes: grid_chart_module_default,
1960
+ props,
1961
+ className,
1962
+ style,
1963
+ classNames,
1964
+ styles,
1965
+ unstyled,
1966
+ attributes,
1967
+ vars,
1968
+ varsResolver: varsResolver9
1969
+ });
1970
+ const yAxisWidth = label ? undefined : { width: 0 };
1971
+ return /* @__PURE__ */ jsx14(Box, {
1972
+ ...getStyles("root"),
1973
+ ...others,
1974
+ children: /* @__PURE__ */ jsx14(ResponsiveContainer9, { children: /* @__PURE__ */ jsxs13(ScatterChart2, { children: [
1975
+ /* @__PURE__ */ jsx14(XAxis5, {
1976
+ type: "category",
1977
+ dataKey: dataKey.x,
1978
+ interval: 0,
1979
+ tick: {
1980
+ fontSize: 12,
1981
+ fill: "currentColor"
1982
+ },
1983
+ tickLine: {
1984
+ transform: "translate(0, -6)",
1985
+ stroke: "currentColor"
1986
+ },
1987
+ stroke: "currentColor",
1988
+ ...getStyles("axis"),
1989
+ ...xAxisProps
1990
+ }),
1991
+ /* @__PURE__ */ jsx14(YAxis5, {
1992
+ type: "number",
1993
+ dataKey: dataKey.y,
1994
+ height: 10,
1995
+ ...yAxisWidth,
1996
+ tick: false,
1997
+ tickLine: false,
1998
+ axisLine: false,
1999
+ label: {
2000
+ value: label,
2001
+ position: "insideRight",
2002
+ fontSize: 12,
2003
+ fill: "currentColor"
2004
+ },
2005
+ ...getStyles("axis"),
2006
+ ...yAxisProps
2007
+ }),
2008
+ /* @__PURE__ */ jsx14(ZAxis, {
2009
+ type: "number",
2010
+ dataKey: dataKey.z,
2011
+ domain: getDomain(data, dataKey.z),
2012
+ range,
2013
+ ...zAxisProps
2014
+ }),
2015
+ withTooltip && /* @__PURE__ */ jsx14(Tooltip$18, {
2016
+ animationDuration: 100,
2017
+ isAnimationActive: false,
2018
+ cursor: {
2019
+ stroke: "var(--chart-grid-color)",
2020
+ strokeWidth: 1,
2021
+ strokeDasharray: "3 3"
2022
+ },
2023
+ content: (payload) => /* @__PURE__ */ jsx14(BubbleChartTooltip, {
2024
+ dataKey,
2025
+ active: payload.active,
2026
+ payload: payload.payload,
2027
+ getStyles,
2028
+ valueFormatter
2029
+ }),
2030
+ ...tooltipProps
2031
+ }),
2032
+ /* @__PURE__ */ jsx14(Scatter2, {
2033
+ data,
2034
+ fill: getThemeColor(color, theme),
2035
+ isAnimationActive: false,
2036
+ ...scatterProps
2037
+ })
2038
+ ] }) })
2039
+ });
2040
+ });
2041
+ BubbleChart.displayName = "@mantine/charts/BubbleChart";
2042
+ BubbleChart.classes = grid_chart_module_default;
2043
+ BubbleChart.varsResolver = varsResolver9;
2044
+
2045
+ // node_modules/@mantine/charts/esm/CompositeChart/CompositeChart.mjs
2046
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
2047
+ import { createElement as createElement4, useState as useState6 } from "react";
2048
+ import { Area as Area3, Bar as Bar2, CartesianGrid as CartesianGrid5, ComposedChart, Label as Label5, LabelList as LabelList3, Legend as Legend6, Line as Line2, ReferenceLine as ReferenceLine5, ResponsiveContainer as ResponsiveContainer10, Tooltip as Tooltip$19, XAxis as XAxis6, YAxis as YAxis6 } from "recharts";
2049
+
2050
+ var defaultProps11 = {
2051
+ withXAxis: true,
2052
+ withYAxis: true,
2053
+ withTooltip: true,
2054
+ tooltipAnimationDuration: 0,
2055
+ tickLine: "y",
2056
+ strokeDasharray: "5 5",
2057
+ gridAxis: "x",
2058
+ withDots: true,
2059
+ connectNulls: true,
2060
+ strokeWidth: 2,
2061
+ curveType: "monotone"
2062
+ };
2063
+ var varsResolver10 = createVarsResolver((theme, { textColor, gridColor }) => ({ root: {
2064
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
2065
+ "--chart-grid-color": gridColor ? getThemeColor(gridColor, theme) : undefined
2066
+ } }));
2067
+ var CompositeChart = factory((_props) => {
2068
+ const props = useProps("CompositeChart", defaultProps11, _props);
2069
+ const { classNames, className, style, styles, unstyled, vars, data, withLegend, legendProps, series, onMouseLeave, dataKey, withTooltip, withXAxis, withYAxis, gridAxis, tickLine, xAxisProps, yAxisProps, unit, tooltipAnimationDuration, strokeDasharray, gridProps, tooltipProps, referenceLines, withDots, dotProps, activeDotProps, strokeWidth, connectNulls, curveType, dir, valueFormatter, children, lineProps, xAxisLabel, yAxisLabel, withRightYAxis, rightYAxisLabel, rightYAxisProps, withPointLabels, areaProps, barProps, withBarValueLabel, minBarSize, maxBarWidth, composedChartProps, attributes, ...others } = props;
2070
+ const theme = useMantineTheme();
2071
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
2072
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
2073
+ const [highlightedArea, setHighlightedArea] = useState6(null);
2074
+ const shouldHighlight = highlightedArea !== null;
2075
+ const handleMouseLeave = (event) => {
2076
+ setHighlightedArea(null);
2077
+ onMouseLeave?.(event);
2078
+ };
2079
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
2080
+ classNames,
2081
+ styles,
2082
+ props
2083
+ });
2084
+ const getStyles = useStyles({
2085
+ name: "CompositeChart",
2086
+ classes: grid_chart_module_default,
2087
+ props,
2088
+ className,
2089
+ style,
2090
+ classNames,
2091
+ styles,
2092
+ unstyled,
2093
+ attributes,
2094
+ vars,
2095
+ varsResolver: varsResolver10
2096
+ });
2097
+ const lines = series.map((item) => {
2098
+ const color = getThemeColor(item.color, theme);
2099
+ const dimmed = shouldHighlight && highlightedArea !== item.name;
2100
+ if (item.type === "line")
2101
+ return /* @__PURE__ */ createElement4(Line2, {
2102
+ ...getStyles("line"),
2103
+ key: item.name,
2104
+ name: item.name,
2105
+ dataKey: item.name,
2106
+ dot: withDots ? {
2107
+ fillOpacity: dimmed ? 0 : 1,
2108
+ strokeOpacity: dimmed ? 0 : 1,
2109
+ strokeWidth: 1,
2110
+ fill: color,
2111
+ stroke: color,
2112
+ ...dotProps
2113
+ } : false,
2114
+ activeDot: withDots ? {
2115
+ fill: "var(--mantine-color-white)",
2116
+ stroke: color,
2117
+ ...activeDotProps
2118
+ } : false,
2119
+ fill: color,
2120
+ stroke: color,
2121
+ strokeWidth,
2122
+ isAnimationActive: false,
2123
+ fillOpacity: dimmed ? 0 : 1,
2124
+ strokeOpacity: dimmed ? 0.5 : 1,
2125
+ connectNulls,
2126
+ type: curveType,
2127
+ strokeDasharray: item.strokeDasharray,
2128
+ yAxisId: item.yAxisId || undefined,
2129
+ label: withPointLabels ? /* @__PURE__ */ jsx15(PointLabel, { valueFormatter }) : undefined,
2130
+ ...typeof lineProps === "function" ? lineProps(item) : lineProps
2131
+ });
2132
+ if (item.type === "area")
2133
+ return /* @__PURE__ */ createElement4(Area3, {
2134
+ ...getStyles("area"),
2135
+ key: item.name,
2136
+ name: item.name,
2137
+ type: curveType,
2138
+ dataKey: item.name,
2139
+ fill: color,
2140
+ strokeWidth,
2141
+ stroke: color,
2142
+ isAnimationActive: false,
2143
+ connectNulls,
2144
+ dot: withDots ? {
2145
+ fillOpacity: dimmed ? 0 : 1,
2146
+ strokeOpacity: dimmed ? 0 : 1,
2147
+ strokeWidth: 1,
2148
+ fill: color,
2149
+ stroke: color,
2150
+ ...dotProps
2151
+ } : false,
2152
+ activeDot: withDots ? {
2153
+ fill: theme.white,
2154
+ stroke: color,
2155
+ strokeWidth: 2,
2156
+ r: 4,
2157
+ ...activeDotProps
2158
+ } : false,
2159
+ fillOpacity: dimmed ? 0 : 0.2,
2160
+ strokeOpacity: dimmed ? 0.5 : 1,
2161
+ strokeDasharray: item.strokeDasharray,
2162
+ yAxisId: item.yAxisId || undefined,
2163
+ label: withPointLabels ? /* @__PURE__ */ jsx15(PointLabel, { valueFormatter }) : undefined,
2164
+ ...typeof areaProps === "function" ? areaProps(item) : areaProps
2165
+ });
2166
+ if (item.type === "bar")
2167
+ return /* @__PURE__ */ createElement4(Bar2, {
2168
+ ...getStyles("bar"),
2169
+ key: item.name,
2170
+ name: item.name,
2171
+ dataKey: item.name,
2172
+ fill: color,
2173
+ stroke: color,
2174
+ isAnimationActive: false,
2175
+ fillOpacity: dimmed ? 0.1 : 1,
2176
+ strokeOpacity: dimmed ? 0.2 : 0,
2177
+ yAxisId: item.yAxisId || undefined,
2178
+ minPointSize: minBarSize,
2179
+ ...typeof barProps === "function" ? barProps(item) : barProps
2180
+ }, withBarValueLabel && /* @__PURE__ */ jsx15(LabelList3, {
2181
+ position: "top",
2182
+ fontSize: 12,
2183
+ fill: "var(--chart-bar-label-color, var(--mantine-color-dimmed))",
2184
+ formatter: (val) => valueFormatter?.(val)
2185
+ }));
2186
+ return null;
2187
+ });
2188
+ const referenceLinesItems = referenceLines?.map((line, index) => {
2189
+ const color = getThemeColor(line.color, theme);
2190
+ return /* @__PURE__ */ jsx15(ReferenceLine5, {
2191
+ stroke: line.color ? color : "var(--chart-grid-color)",
2192
+ strokeWidth: 1,
2193
+ yAxisId: line.yAxisId || undefined,
2194
+ ...line,
2195
+ label: {
2196
+ fill: line.color ? color : "currentColor",
2197
+ fontSize: 12,
2198
+ position: line.labelPosition ?? "insideBottomLeft",
2199
+ ...typeof line.label === "object" ? line.label : { value: line.label }
2200
+ },
2201
+ ...getStyles("referenceLine")
2202
+ }, index);
2203
+ });
2204
+ const sharedYAxisProps = {
2205
+ axisLine: false,
2206
+ type: "number",
2207
+ tickLine: withYTickLine ? { stroke: "currentColor" } : false,
2208
+ allowDecimals: true,
2209
+ unit,
2210
+ tickFormatter: valueFormatter,
2211
+ ...getStyles("axis")
2212
+ };
2213
+ return /* @__PURE__ */ jsx15(Box, {
2214
+ ...getStyles("root"),
2215
+ onMouseLeave: handleMouseLeave,
2216
+ dir: dir || "ltr",
2217
+ ...others,
2218
+ children: /* @__PURE__ */ jsx15(ResponsiveContainer10, {
2219
+ ...getStyles("container"),
2220
+ children: /* @__PURE__ */ jsxs14(ComposedChart, {
2221
+ data,
2222
+ maxBarSize: maxBarWidth,
2223
+ margin: {
2224
+ bottom: xAxisLabel ? 30 : undefined,
2225
+ left: yAxisLabel ? 10 : undefined,
2226
+ right: yAxisLabel ? 5 : undefined
2227
+ },
2228
+ ...composedChartProps,
2229
+ children: [
2230
+ withLegend && /* @__PURE__ */ jsx15(Legend6, {
2231
+ verticalAlign: "top",
2232
+ content: (payload) => /* @__PURE__ */ jsx15(ChartLegend, {
2233
+ payload: payload.payload,
2234
+ onHighlight: setHighlightedArea,
2235
+ legendPosition: legendProps?.verticalAlign || "top",
2236
+ classNames: resolvedClassNames,
2237
+ styles: resolvedStyles,
2238
+ series,
2239
+ attributes
2240
+ }),
2241
+ ...legendProps
2242
+ }),
2243
+ /* @__PURE__ */ jsxs14(XAxis6, {
2244
+ hide: !withXAxis,
2245
+ dataKey,
2246
+ tick: {
2247
+ transform: "translate(0, 10)",
2248
+ fontSize: 12,
2249
+ fill: "currentColor"
2250
+ },
2251
+ stroke: "",
2252
+ interval: "preserveStartEnd",
2253
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
2254
+ minTickGap: 5,
2255
+ ...getStyles("axis"),
2256
+ ...xAxisProps,
2257
+ children: [xAxisLabel && /* @__PURE__ */ jsx15(Label5, {
2258
+ position: "insideBottom",
2259
+ offset: -20,
2260
+ fontSize: 12,
2261
+ ...getStyles("axisLabel"),
2262
+ children: xAxisLabel
2263
+ }), xAxisProps?.children]
2264
+ }),
2265
+ /* @__PURE__ */ jsxs14(YAxis6, {
2266
+ orientation: "left",
2267
+ tick: {
2268
+ transform: "translate(-10, 0)",
2269
+ fontSize: 12,
2270
+ fill: "currentColor"
2271
+ },
2272
+ hide: !withYAxis,
2273
+ ...sharedYAxisProps,
2274
+ ...yAxisProps,
2275
+ children: [yAxisLabel && /* @__PURE__ */ jsx15(Label5, {
2276
+ position: "insideLeft",
2277
+ angle: -90,
2278
+ textAnchor: "middle",
2279
+ fontSize: 12,
2280
+ offset: -5,
2281
+ ...getStyles("axisLabel"),
2282
+ children: yAxisLabel
2283
+ }), yAxisProps?.children]
2284
+ }),
2285
+ /* @__PURE__ */ jsxs14(YAxis6, {
2286
+ yAxisId: "right",
2287
+ orientation: "right",
2288
+ tick: {
2289
+ transform: "translate(10, 0)",
2290
+ fontSize: 12,
2291
+ fill: "currentColor"
2292
+ },
2293
+ hide: !withRightYAxis,
2294
+ ...sharedYAxisProps,
2295
+ ...rightYAxisProps,
2296
+ children: [rightYAxisLabel && /* @__PURE__ */ jsx15(Label5, {
2297
+ position: "insideRight",
2298
+ angle: 90,
2299
+ textAnchor: "middle",
2300
+ fontSize: 12,
2301
+ offset: -5,
2302
+ ...getStyles("axisLabel"),
2303
+ children: rightYAxisLabel
2304
+ }), yAxisProps?.children]
2305
+ }),
2306
+ /* @__PURE__ */ jsx15(CartesianGrid5, {
2307
+ strokeDasharray,
2308
+ vertical: gridAxis === "y" || gridAxis === "xy",
2309
+ horizontal: gridAxis === "x" || gridAxis === "xy",
2310
+ ...getStyles("grid"),
2311
+ ...gridProps
2312
+ }),
2313
+ withTooltip && /* @__PURE__ */ jsx15(Tooltip$19, {
2314
+ animationDuration: tooltipAnimationDuration,
2315
+ isAnimationActive: tooltipAnimationDuration !== 0,
2316
+ position: { y: 0 },
2317
+ cursor: {
2318
+ stroke: "var(--chart-grid-color)",
2319
+ strokeWidth: 1,
2320
+ strokeDasharray
2321
+ },
2322
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsx15(ChartTooltip, {
2323
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
2324
+ payload,
2325
+ unit,
2326
+ classNames: resolvedClassNames,
2327
+ styles: resolvedStyles,
2328
+ series,
2329
+ valueFormatter,
2330
+ attributes
2331
+ }),
2332
+ ...tooltipProps
2333
+ }),
2334
+ lines,
2335
+ referenceLinesItems,
2336
+ children
2337
+ ]
2338
+ })
2339
+ })
2340
+ });
2341
+ });
2342
+ CompositeChart.displayName = "@mantine/charts/CompositeChart";
2343
+ CompositeChart.classes = grid_chart_module_default;
2344
+ CompositeChart.varsResolver = varsResolver10;
2345
+
2346
+ // node_modules/@mantine/charts/esm/RadialBarChart/RadialBarChart.module.mjs
2347
+
2348
+ var RadialBarChart_module_default = {
2349
+ root: "m_cd2bd9e5",
2350
+ tooltip: "m_6bcc3420"
2351
+ };
2352
+
2353
+ // node_modules/@mantine/charts/esm/RadialBarChart/RadialBarChart.mjs
2354
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2355
+ import { useState as useState7 } from "react";
2356
+ import { Legend as Legend7, RadialBar, RadialBarChart, ResponsiveContainer as ResponsiveContainer11, Tooltip as Tooltip$110 } from "recharts";
2357
+
2358
+ var defaultProps12 = {
2359
+ barSize: 20,
2360
+ startAngle: 90,
2361
+ endAngle: -270,
2362
+ withBackground: true,
2363
+ withTooltip: true
2364
+ };
2365
+ var varsResolver11 = createVarsResolver((theme, { emptyBackgroundColor }) => ({ root: { "--chart-empty-background": emptyBackgroundColor ? getThemeColor(emptyBackgroundColor, theme) : undefined } }));
2366
+ var RadialBarChart$1 = factory((_props) => {
2367
+ const props = useProps("RadialBarChart", defaultProps12, _props);
2368
+ const { classNames, className, style, styles, unstyled, vars, data, barSize, withBackground, dataKey, radialBarProps, radialBarChartProps, withLabels, withLegend, legendProps, withTooltip, tooltipProps, startAngle, endAngle, attributes, ...others } = props;
2369
+ const [highlightedArea, setHighlightedArea] = useState7(null);
2370
+ const getStyles = useStyles({
2371
+ name: "RadialBarChart",
2372
+ classes: RadialBarChart_module_default,
2373
+ props,
2374
+ className,
2375
+ style,
2376
+ classNames,
2377
+ styles,
2378
+ unstyled,
2379
+ attributes,
2380
+ vars,
2381
+ varsResolver: varsResolver11
2382
+ });
2383
+ const theme = useMantineTheme();
2384
+ const dataWithResolvedColor = data.map(({ color, ...item }) => {
2385
+ const resolvedColor = getThemeColor(color, theme);
2386
+ return {
2387
+ ...item,
2388
+ fill: resolvedColor,
2389
+ fillOpacity: highlightedArea ? highlightedArea === item.name ? item.opacity || 1 : 0.05 : item.opacity || 1
2390
+ };
2391
+ });
2392
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
2393
+ classNames,
2394
+ styles,
2395
+ props
2396
+ });
2397
+ return /* @__PURE__ */ jsx16(Box, {
2398
+ ...getStyles("root"),
2399
+ ...others,
2400
+ children: /* @__PURE__ */ jsx16(ResponsiveContainer11, { children: /* @__PURE__ */ jsxs15(RadialBarChart, {
2401
+ margin: {
2402
+ top: 0,
2403
+ bottom: 0,
2404
+ left: 0,
2405
+ right: 0
2406
+ },
2407
+ innerRadius: "10%",
2408
+ outerRadius: "100%",
2409
+ cx: "50%",
2410
+ cy: "50%",
2411
+ barSize,
2412
+ startAngle,
2413
+ endAngle,
2414
+ data: dataWithResolvedColor,
2415
+ ...radialBarChartProps,
2416
+ children: [
2417
+ /* @__PURE__ */ jsx16(RadialBar, {
2418
+ label: withLabels ? {
2419
+ position: "insideStart",
2420
+ fill: "var(--mantine-color-white)",
2421
+ fontSize: 12
2422
+ } : undefined,
2423
+ background: withBackground ? { fill: "var(--chart-empty-background)" } : undefined,
2424
+ dataKey,
2425
+ isAnimationActive: false,
2426
+ ...radialBarProps
2427
+ }),
2428
+ withLegend && /* @__PURE__ */ jsx16(Legend7, {
2429
+ verticalAlign: "bottom",
2430
+ content: (payload) => /* @__PURE__ */ jsx16(ChartLegend, {
2431
+ payload: payload.payload?.map((item) => ({
2432
+ ...item,
2433
+ dataKey: item.payload?.name
2434
+ })),
2435
+ onHighlight: setHighlightedArea,
2436
+ legendPosition: legendProps?.verticalAlign || "bottom",
2437
+ classNames: resolvedClassNames,
2438
+ styles: resolvedStyles,
2439
+ centered: true,
2440
+ attributes
2441
+ }),
2442
+ ...legendProps
2443
+ }),
2444
+ withTooltip && /* @__PURE__ */ jsx16(Tooltip$110, {
2445
+ animationDuration: 0,
2446
+ isAnimationActive: false,
2447
+ cursor: { stroke: "var(--chart-cursor-color)" },
2448
+ content: ({ payload }) => /* @__PURE__ */ jsxs15(Paper, {
2449
+ ...getStyles("tooltip"),
2450
+ children: [/* @__PURE__ */ jsxs15(Group, {
2451
+ gap: "sm",
2452
+ children: [/* @__PURE__ */ jsx16(ColorSwatch, {
2453
+ color: payload?.[0]?.payload.fill,
2454
+ size: 12,
2455
+ withShadow: false
2456
+ }), /* @__PURE__ */ jsx16("span", { children: payload?.[0]?.payload.name })]
2457
+ }), /* @__PURE__ */ jsx16("span", { children: payload?.[0]?.payload[dataKey] })]
2458
+ }),
2459
+ ...tooltipProps
2460
+ })
2461
+ ]
2462
+ }) })
2463
+ });
2464
+ });
2465
+ RadialBarChart$1.displayName = "@mantine/core/RadialBarChart";
2466
+ RadialBarChart$1.classes = RadialBarChart_module_default;
2467
+ RadialBarChart$1.varsResolver = varsResolver11;
2468
+
2469
+ // node_modules/@mantine/charts/esm/FunnelChart/FunnelChart.module.mjs
2470
+
2471
+ var FunnelChart_module_default = { root: "m_80d531e7" };
2472
+
2473
+ // node_modules/@mantine/charts/esm/FunnelChart/FunnelChart.mjs
2474
+ import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2475
+ import { Funnel, FunnelChart, LabelList as LabelList4, ResponsiveContainer as ResponsiveContainer12, Tooltip as Tooltip$111 } from "recharts";
2476
+
2477
+ var defaultProps13 = {
2478
+ withTooltip: true,
2479
+ size: 300,
2480
+ strokeWidth: 1,
2481
+ withLabels: false,
2482
+ labelsPosition: "right",
2483
+ tooltipDataSource: "all"
2484
+ };
2485
+ var varsResolver12 = createVarsResolver((theme, { strokeColor, labelColor, size }) => ({ root: {
2486
+ "--chart-stroke-color": strokeColor ? getThemeColor(strokeColor, theme) : undefined,
2487
+ "--chart-labels-color": labelColor ? getThemeColor(labelColor, theme) : undefined,
2488
+ "--chart-size": rem(size)
2489
+ } }));
2490
+ var FunnelChart$1 = factory((_props) => {
2491
+ const props = useProps("FunnelChart", defaultProps13, _props);
2492
+ const { classNames, className, style, styles, unstyled, vars, data, withTooltip, tooltipAnimationDuration, tooltipProps, strokeWidth, withLabels, size, valueFormatter, children, funnelChartProps, funnelProps, labelsPosition, tooltipDataSource, strokeColor, labelColor, attributes, ...others } = props;
2493
+ const theme = useMantineTheme();
2494
+ const getStyles = useStyles({
2495
+ name: "FunnelChart",
2496
+ classes: FunnelChart_module_default,
2497
+ props,
2498
+ className,
2499
+ style,
2500
+ classNames,
2501
+ styles,
2502
+ unstyled,
2503
+ attributes,
2504
+ vars,
2505
+ varsResolver: varsResolver12
2506
+ });
2507
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
2508
+ classNames,
2509
+ styles,
2510
+ props
2511
+ });
2512
+ return /* @__PURE__ */ jsx17(Box, {
2513
+ size,
2514
+ ...getStyles("root"),
2515
+ ...others,
2516
+ children: /* @__PURE__ */ jsx17(ResponsiveContainer12, { children: /* @__PURE__ */ jsxs16(FunnelChart, {
2517
+ ...funnelChartProps,
2518
+ children: [
2519
+ /* @__PURE__ */ jsx17(Funnel, {
2520
+ data: data.map((entry) => ({
2521
+ ...entry,
2522
+ fill: getThemeColor(entry.color, theme)
2523
+ })),
2524
+ dataKey: "value",
2525
+ isAnimationActive: false,
2526
+ stroke: "var(--chart-stroke-color, var(--mantine-color-body))",
2527
+ strokeWidth,
2528
+ ...funnelProps,
2529
+ children: withLabels && /* @__PURE__ */ jsx17(LabelList4, {
2530
+ position: labelsPosition,
2531
+ fill: labelsPosition === "inside" ? "var(--chart-labels-color, var(--mantine-color-white))" : "var(--chart-labels-color, var(--mantine-color-dimmed))",
2532
+ stroke: "none",
2533
+ fontFamily: "var(--mantine-font-family)",
2534
+ fontSize: 12,
2535
+ dataKey: (entry) => {
2536
+ return typeof valueFormatter === "function" ? valueFormatter(entry.value) : entry.value;
2537
+ }
2538
+ })
2539
+ }),
2540
+ withTooltip && /* @__PURE__ */ jsx17(Tooltip$111, {
2541
+ animationDuration: tooltipAnimationDuration,
2542
+ isAnimationActive: false,
2543
+ content: ({ payload }) => /* @__PURE__ */ jsx17(ChartTooltip, {
2544
+ payload: data,
2545
+ classNames: resolvedClassNames,
2546
+ styles: resolvedStyles,
2547
+ type: "radial",
2548
+ segmentId: tooltipDataSource === "segment" ? payload?.[0]?.name : undefined,
2549
+ valueFormatter,
2550
+ attributes
2551
+ }),
2552
+ ...tooltipProps
2553
+ }),
2554
+ children
2555
+ ]
2556
+ }) })
2557
+ });
2558
+ });
2559
+ FunnelChart$1.displayName = "@mantine/charts/FunnelChart";
2560
+ FunnelChart$1.classes = FunnelChart_module_default;
2561
+ FunnelChart$1.varsResolver = varsResolver12;
2562
+
2563
+ // node_modules/@mantine/charts/esm/Heatmap/get-boundaries/get-boundaries.mjs
2564
+
2565
+ function getBoundaries({ data, domain }) {
2566
+ if (Array.isArray(domain))
2567
+ return domain;
2568
+ const values = Object.values(data);
2569
+ return [Math.min(...values), Math.max(...values)];
2570
+ }
2571
+
2572
+ // node_modules/@mantine/charts/esm/Heatmap/get-columns/get-columns.mjs
2573
+
2574
+ function getColumns(datesRange, splitMonths) {
2575
+ if (!splitMonths)
2576
+ return datesRange.map((week, weekIndex) => {
2577
+ const firstDay = week.find((d) => d !== null);
2578
+ return {
2579
+ type: "column",
2580
+ month: new Date(firstDay).getUTCMonth(),
2581
+ weekIndex
2582
+ };
2583
+ });
2584
+ const tmp = [];
2585
+ datesRange.forEach((week, weekIndex) => {
2586
+ const months = week.map((d) => d ? new Date(d).getUTCMonth() : null);
2587
+ let firstMonth = null;
2588
+ let boundaryIndex = null;
2589
+ for (let i = 0;i < months.length; i += 1) {
2590
+ if (months[i] === null)
2591
+ continue;
2592
+ if (firstMonth === null)
2593
+ firstMonth = months[i];
2594
+ else if (months[i] !== firstMonth) {
2595
+ boundaryIndex = i;
2596
+ break;
2597
+ }
2598
+ }
2599
+ if (firstMonth === null)
2600
+ return;
2601
+ if (boundaryIndex === null)
2602
+ tmp.push({
2603
+ type: "column",
2604
+ month: firstMonth,
2605
+ weekIndex
2606
+ });
2607
+ else {
2608
+ let nextMonth = null;
2609
+ for (let i = boundaryIndex;i < months.length; i += 1)
2610
+ if (months[i] !== null) {
2611
+ nextMonth = months[i];
2612
+ break;
2613
+ }
2614
+ if (nextMonth === null)
2615
+ tmp.push({
2616
+ type: "column",
2617
+ month: firstMonth,
2618
+ weekIndex
2619
+ });
2620
+ else {
2621
+ tmp.push({
2622
+ type: "column",
2623
+ month: firstMonth,
2624
+ weekIndex
2625
+ });
2626
+ tmp.push({
2627
+ type: "column",
2628
+ month: nextMonth,
2629
+ weekIndex
2630
+ });
2631
+ }
2632
+ }
2633
+ });
2634
+ const columns = [];
2635
+ for (let i = 0;i < tmp.length; i += 1) {
2636
+ if (i > 0 && tmp[i].month !== tmp[i - 1].month)
2637
+ columns.push({ type: "spacer" });
2638
+ columns.push(tmp[i]);
2639
+ }
2640
+ return columns;
2641
+ }
2642
+ function getFirstMonthColumnIndex(columns, month) {
2643
+ for (let i = 0;i < columns.length; i += 1) {
2644
+ const c = columns[i];
2645
+ if (c.type === "column" && c.month === month)
2646
+ return i;
2647
+ }
2648
+ return -1;
2649
+ }
2650
+
2651
+ // node_modules/@mantine/charts/esm/Heatmap/get-dates-range/get-dates-range.mjs
2652
+
2653
+ function formatDate(date) {
2654
+ return `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, "0")}-${String(date.getUTCDate()).padStart(2, "0")}`;
2655
+ }
2656
+ function addDays(date, days) {
2657
+ return new Date(date.getTime() + days * 86400000);
2658
+ }
2659
+ function toUtcMidnight(input) {
2660
+ if (typeof input === "string") {
2661
+ const m = input.match(/^(\d{4})-(\d{2})-(\d{2})$/);
2662
+ if (m) {
2663
+ const year = Number(m[1]);
2664
+ const month = Number(m[2]) - 1;
2665
+ const day = Number(m[3]);
2666
+ return new Date(Date.UTC(year, month, day));
2667
+ }
2668
+ const d = new Date(input);
2669
+ return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));
2670
+ }
2671
+ return new Date(Date.UTC(input.getFullYear(), input.getMonth(), input.getDate()));
2672
+ }
2673
+ function startOfWeekUtc(date, firstDayOfWeek) {
2674
+ let value = new Date(date);
2675
+ while (value.getUTCDay() !== firstDayOfWeek)
2676
+ value = addDays(value, -1);
2677
+ return value;
2678
+ }
2679
+ function endOfWeekUtc(date, firstDayOfWeek) {
2680
+ const day = date.getUTCDay();
2681
+ return addDays(date, 6 - ((day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek));
2682
+ }
2683
+ function getDatesRange({ startDate, endDate, withOutsideDates = true, firstDayOfWeek = 1 } = {}) {
2684
+ const now = /* @__PURE__ */ new Date;
2685
+ const defaultStartLocal = new Date(now.getFullYear() - 1, now.getMonth(), now.getDate());
2686
+ const defaultEndLocal = now;
2687
+ const start = startDate ? toUtcMidnight(startDate) : toUtcMidnight(defaultStartLocal);
2688
+ const end = endDate ? toUtcMidnight(endDate) : toUtcMidnight(defaultEndLocal);
2689
+ const startWeek = startOfWeekUtc(start, firstDayOfWeek);
2690
+ const endWeek = endOfWeekUtc(end, firstDayOfWeek);
2691
+ const dates = [];
2692
+ let current = startWeek;
2693
+ while (current <= endWeek) {
2694
+ const week = Array.from({ length: 7 }, (_, i) => {
2695
+ const day = addDays(current, i);
2696
+ return withOutsideDates || day >= start && day <= end ? formatDate(day) : null;
2697
+ });
2698
+ dates.push(week);
2699
+ current = addDays(current, 7);
2700
+ }
2701
+ return dates;
2702
+ }
2703
+
2704
+ // node_modules/@mantine/charts/esm/Heatmap/get-months-range/get-months-range.mjs
2705
+
2706
+ function getMonthsRange(weeksData) {
2707
+ let position = 0;
2708
+ let current = null;
2709
+ const result = [];
2710
+ weeksData.forEach((week) => {
2711
+ const day = week[0] === null ? week[week.length - 1] : week[0];
2712
+ const month = new Date(day).getUTCMonth();
2713
+ if (current !== month) {
2714
+ current = month;
2715
+ result.push({
2716
+ month: current,
2717
+ position,
2718
+ size: 0
2719
+ });
2720
+ }
2721
+ result[result.length - 1].size += 1;
2722
+ position += 1;
2723
+ });
2724
+ return result;
2725
+ }
2726
+
2727
+ // node_modules/@mantine/charts/esm/Heatmap/get-heat-color/get-heat-color.mjs
2728
+
2729
+ function getHeatColor({ value, min, max, colors }) {
2730
+ const percent = max === min ? 1 : (value - min) / (max - min);
2731
+ return colors[Math.round((colors.length - 1) * percent)];
2732
+ }
2733
+
2734
+ // node_modules/@mantine/charts/esm/Heatmap/HeatmapSplitWeeks.mjs
2735
+ import { Fragment as Fragment2, jsx as jsx18 } from "react/jsx-runtime";
2736
+
2737
+ function HeatmapSplitWeeks({ data, datesRange, rectSize, gap, rectRadius, min, max, colors, withTooltip, setHoveredRect, getRectProps, getStyles }) {
2738
+ const rectSizeWithGap = rectSize + gap;
2739
+ return /* @__PURE__ */ jsx18(Fragment2, { children: getColumns(datesRange, true).map((col, columnIndex) => {
2740
+ if (col.type === "spacer")
2741
+ return /* @__PURE__ */ jsx18("g", { transform: `translate(${columnIndex * rectSizeWithGap}, 0)` }, `spacer-${columnIndex}`);
2742
+ const days = datesRange[col.weekIndex].map((date, dayIndex) => {
2743
+ if (!date)
2744
+ return null;
2745
+ if (new Date(date).getUTCMonth() !== col.month)
2746
+ return null;
2747
+ const hasValue = date in data && data[date] !== null;
2748
+ const rectValue = hasValue ? data[date] : null;
2749
+ return /* @__PURE__ */ jsx18("rect", {
2750
+ width: rectSize,
2751
+ height: rectSize,
2752
+ x: gap,
2753
+ y: dayIndex * rectSizeWithGap + gap,
2754
+ rx: rectRadius,
2755
+ "data-empty": !hasValue || undefined,
2756
+ fill: hasValue ? getHeatColor({
2757
+ value: data[date],
2758
+ min,
2759
+ max,
2760
+ colors
2761
+ }) : undefined,
2762
+ onPointerEnter: withTooltip ? () => setHoveredRect({
2763
+ date,
2764
+ value: rectValue
2765
+ }) : undefined,
2766
+ ...getRectProps?.({
2767
+ date,
2768
+ value: rectValue
2769
+ }),
2770
+ ...getStyles("rect")
2771
+ }, `${date}-${col.month}`);
2772
+ });
2773
+ return /* @__PURE__ */ jsx18("g", {
2774
+ transform: `translate(${columnIndex * rectSizeWithGap}, 0)`,
2775
+ "data-id": "week",
2776
+ children: days
2777
+ }, `col-${col.weekIndex}-${col.month}-${columnIndex}`);
2778
+ }) });
2779
+ }
2780
+
2781
+ // node_modules/@mantine/charts/esm/Heatmap/HeatmapWeeks.mjs
2782
+ import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
2783
+
2784
+ function HeatmapWeeks({ data, datesRange, rectSize, gap, rectRadius, min, max, colors, withTooltip, setHoveredRect, getRectProps, getStyles }) {
2785
+ const rectSizeWithGap = rectSize + gap;
2786
+ return /* @__PURE__ */ jsx19(Fragment3, { children: datesRange.map((week, weekIndex) => {
2787
+ const days = week.map((date, dayIndex) => {
2788
+ if (!date)
2789
+ return null;
2790
+ const hasValue = date in data && data[date] !== null;
2791
+ const rectValue = hasValue ? data[date] : null;
2792
+ return /* @__PURE__ */ jsx19("rect", {
2793
+ width: rectSize,
2794
+ height: rectSize,
2795
+ x: gap,
2796
+ y: dayIndex * rectSizeWithGap + gap,
2797
+ rx: rectRadius,
2798
+ "data-empty": !hasValue || undefined,
2799
+ fill: hasValue ? getHeatColor({
2800
+ value: data[date],
2801
+ min,
2802
+ max,
2803
+ colors
2804
+ }) : undefined,
2805
+ onPointerEnter: withTooltip ? () => setHoveredRect({
2806
+ date,
2807
+ value: rectValue
2808
+ }) : undefined,
2809
+ ...getRectProps?.({
2810
+ date,
2811
+ value: rectValue
2812
+ }),
2813
+ ...getStyles("rect")
2814
+ }, date);
2815
+ });
2816
+ return /* @__PURE__ */ jsx19("g", {
2817
+ transform: `translate(${weekIndex * rectSizeWithGap}, 0)`,
2818
+ "data-id": "week",
2819
+ children: days
2820
+ }, weekIndex);
2821
+ }) });
2822
+ }
2823
+
2824
+ // node_modules/@mantine/charts/esm/Heatmap/rotate-weekdays-names/rotate-weekdays-names.mjs
2825
+
2826
+ function rotateWeekdaysNames(weekdayNames, firstDayOfWeek) {
2827
+ const rotated = [...weekdayNames];
2828
+ for (let i = 0;i < firstDayOfWeek; i += 1)
2829
+ rotated.push(rotated.shift());
2830
+ return rotated;
2831
+ }
2832
+
2833
+ // node_modules/@mantine/charts/esm/Heatmap/Heatmap.module.mjs
2834
+
2835
+ var Heatmap_module_default = {
2836
+ root: "m_2ef228c3",
2837
+ rect: "m_2ef201c5",
2838
+ monthLabel: "m_7e977775",
2839
+ weekdayLabel: "m_c4b68f8d",
2840
+ legendLabel: "m_75b4f3e6",
2841
+ legendRect: "m_da847eb2"
2842
+ };
2843
+
2844
+ // node_modules/@mantine/charts/esm/Heatmap/Heatmap.mjs
2845
+ import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
2846
+ import { useMemo as useMemo2, useState as useState8 } from "react";
2847
+
2848
+ var defaultProps14 = {
2849
+ monthLabels: [
2850
+ "Jan",
2851
+ "Feb",
2852
+ "Mar",
2853
+ "Apr",
2854
+ "May",
2855
+ "Jun",
2856
+ "Jul",
2857
+ "Aug",
2858
+ "Sep",
2859
+ "Oct",
2860
+ "Nov",
2861
+ "Dec"
2862
+ ],
2863
+ weekdayLabels: [
2864
+ "Sun",
2865
+ "Mon",
2866
+ "",
2867
+ "Wed",
2868
+ "",
2869
+ "Fri",
2870
+ ""
2871
+ ],
2872
+ withOutsideDates: true,
2873
+ firstDayOfWeek: 1,
2874
+ rectSize: 10,
2875
+ weekdaysLabelsWidth: 30,
2876
+ monthsLabelsHeight: 14,
2877
+ gap: 1,
2878
+ rectRadius: 2,
2879
+ fontSize: 12,
2880
+ colors: [
2881
+ "var(--heatmap-level-1)",
2882
+ "var(--heatmap-level-2)",
2883
+ "var(--heatmap-level-3)",
2884
+ "var(--heatmap-level-4)"
2885
+ ],
2886
+ legendLabels: ["Less", "More"]
2887
+ };
2888
+ var Heatmap = factory((_props) => {
2889
+ const props = useProps("Heatmap", defaultProps14, _props);
2890
+ const { classNames, className, style, styles, unstyled, vars, data, startDate, endDate, withMonthLabels, withWeekdayLabels, weekdayLabels, withOutsideDates, monthLabels, firstDayOfWeek, rectSize = 10, gap = 1, rectRadius, domain, colors, weekdaysLabelsWidth, monthsLabelsHeight, fontSize, getTooltipLabel, withTooltip, tooltipProps, getRectProps, splitMonths, withLegend, legendLabels, attributes, ...others } = props;
2891
+ const getStyles = useStyles({
2892
+ name: "Heatmap",
2893
+ classes: Heatmap_module_default,
2894
+ props,
2895
+ className,
2896
+ style,
2897
+ classNames,
2898
+ styles,
2899
+ unstyled,
2900
+ attributes,
2901
+ vars
2902
+ });
2903
+ const [hoveredRect, setHoveredRect] = useState8(null);
2904
+ const rectSizeWithGap = rectSize + gap;
2905
+ const weekdaysOffset = withWeekdayLabels ? weekdaysLabelsWidth : 0;
2906
+ const monthsOffset = withMonthLabels ? monthsLabelsHeight : 0;
2907
+ const [min, max] = getBoundaries({
2908
+ data,
2909
+ domain
2910
+ });
2911
+ const rotatedWeekdayLabels = useMemo2(() => rotateWeekdaysNames(weekdayLabels, firstDayOfWeek), [weekdayLabels, firstDayOfWeek]);
2912
+ const datesRange = getDatesRange({
2913
+ startDate,
2914
+ endDate,
2915
+ withOutsideDates,
2916
+ firstDayOfWeek
2917
+ });
2918
+ const monthsRange = withMonthLabels || splitMonths ? getMonthsRange(datesRange) : [];
2919
+ const weeksProps = {
2920
+ data,
2921
+ datesRange,
2922
+ rectSize,
2923
+ gap,
2924
+ rectRadius,
2925
+ min,
2926
+ max,
2927
+ colors,
2928
+ withTooltip,
2929
+ setHoveredRect,
2930
+ getRectProps,
2931
+ getStyles
2932
+ };
2933
+ const weeks = splitMonths ? /* @__PURE__ */ jsx20(HeatmapSplitWeeks, { ...weeksProps }) : /* @__PURE__ */ jsx20(HeatmapWeeks, { ...weeksProps });
2934
+ const totalColumns = splitMonths ? getColumns(datesRange, splitMonths).length : datesRange.length;
2935
+ const computeMonthLabelX = (monthPosition, monthIndex) => {
2936
+ if (!splitMonths)
2937
+ return monthPosition * rectSizeWithGap + gap + weekdaysOffset;
2938
+ const firstMonth = monthsRange[monthIndex];
2939
+ const i = getFirstMonthColumnIndex(getColumns(datesRange, splitMonths), firstMonth.month);
2940
+ return ((i >= 0 ? i : monthPosition) + 1) * rectSizeWithGap + gap + weekdaysOffset;
2941
+ };
2942
+ const monthsLabelsNodes = withMonthLabels && monthLabels ? monthsRange.map((month, monthIndex) => {
2943
+ const minSize = splitMonths ? 2 : 3;
2944
+ if (month.size < minSize)
2945
+ return null;
2946
+ const monthLabel = monthLabels[month.month];
2947
+ return /* @__PURE__ */ jsx20("text", {
2948
+ x: computeMonthLabelX(month.position, monthIndex),
2949
+ y: monthsLabelsHeight - 4,
2950
+ width: month.size * rectSizeWithGap,
2951
+ fontSize,
2952
+ ...getStyles("monthLabel"),
2953
+ children: monthLabel
2954
+ }, monthIndex);
2955
+ }) : null;
2956
+ const weekdayLabelsNodes = withWeekdayLabels && weekdayLabels ? rotatedWeekdayLabels.map((weekdayLabel, dayIndex) => /* @__PURE__ */ jsx20("text", {
2957
+ x: 0,
2958
+ y: (dayIndex + 1) * rectSizeWithGap - gap + monthsOffset,
2959
+ width: weekdaysLabelsWidth,
2960
+ fontSize,
2961
+ ...getStyles("weekdayLabel"),
2962
+ children: weekdayLabel
2963
+ }, dayIndex)) : null;
2964
+ const label = getTooltipLabel && hoveredRect && withTooltip ? getTooltipLabel(hoveredRect) : null;
2965
+ const legendPadding = 10;
2966
+ const legendHeight = withLegend ? legendPadding + rectSize : 0;
2967
+ const svgWidth = rectSizeWithGap * totalColumns + gap + weekdaysOffset;
2968
+ const legendNode = withLegend ? (() => {
2969
+ const lessLabel = legendLabels[0];
2970
+ const moreLabel = legendLabels[1];
2971
+ const textGap = 6;
2972
+ const charWidth = fontSize * 0.6;
2973
+ const lessWidth = lessLabel.length * charWidth;
2974
+ const allColors = [undefined, ...colors || []];
2975
+ const rectsWidth = allColors.length * rectSize + (allColors.length - 1) * gap;
2976
+ const moreWidth = moreLabel.length * charWidth;
2977
+ return /* @__PURE__ */ jsxs17("g", {
2978
+ transform: `translate(${svgWidth - (lessWidth + textGap + rectsWidth + textGap + moreWidth)}, ${rectSizeWithGap * 7 + gap + monthsOffset + legendPadding})`,
2979
+ "data-id": "legend",
2980
+ ...getStyles("legend"),
2981
+ children: [
2982
+ /* @__PURE__ */ jsx20("text", {
2983
+ x: 0,
2984
+ y: rectSize / 2,
2985
+ fontSize,
2986
+ dominantBaseline: "central",
2987
+ ...getStyles("legendLabel"),
2988
+ children: lessLabel
2989
+ }),
2990
+ allColors.map((color, i) => /* @__PURE__ */ jsx20("rect", {
2991
+ x: lessWidth + textGap + i * (rectSize + gap),
2992
+ y: 0,
2993
+ width: rectSize,
2994
+ height: rectSize,
2995
+ rx: rectRadius,
2996
+ fill: color,
2997
+ "data-empty": color === undefined || undefined,
2998
+ ...getStyles("legendRect")
2999
+ }, i)),
3000
+ /* @__PURE__ */ jsx20("text", {
3001
+ x: lessWidth + textGap + rectsWidth + textGap,
3002
+ y: rectSize / 2,
3003
+ fontSize,
3004
+ dominantBaseline: "central",
3005
+ ...getStyles("legendLabel"),
3006
+ children: moreLabel
3007
+ })
3008
+ ]
3009
+ });
3010
+ })() : null;
3011
+ return /* @__PURE__ */ jsxs17(Box, {
3012
+ component: "svg",
3013
+ width: svgWidth,
3014
+ height: rectSizeWithGap * 7 + gap + monthsOffset + legendHeight,
3015
+ ...getStyles("root"),
3016
+ ...others,
3017
+ children: [
3018
+ /* @__PURE__ */ jsx20(Tooltip.Floating, {
3019
+ label,
3020
+ disabled: !withTooltip || !label,
3021
+ position: "top",
3022
+ ...tooltipProps,
3023
+ children: /* @__PURE__ */ jsxs17("g", {
3024
+ transform: `translate(${weekdaysOffset}, ${monthsOffset})`,
3025
+ "data-id": "all-weeks",
3026
+ children: [withTooltip && /* @__PURE__ */ jsx20("rect", {
3027
+ fill: "transparent",
3028
+ width: rectSizeWithGap * totalColumns + gap,
3029
+ height: rectSizeWithGap * 7 + gap
3030
+ }), weeks]
3031
+ })
3032
+ }),
3033
+ weekdayLabelsNodes,
3034
+ monthsLabelsNodes,
3035
+ legendNode
3036
+ ]
3037
+ });
3038
+ });
3039
+ Heatmap.displayName = "@mantine/charts/Heatmap";
3040
+ Heatmap.classes = Heatmap_module_default;
3041
+
3042
+ // node_modules/@mantine/charts/esm/BarsList/BarsList.module.mjs
3043
+
3044
+ var BarsList_module_default = {
3045
+ root: "m_1ea785b1",
3046
+ labelsRow: "m_294011ec",
3047
+ bar: "m_9de42164",
3048
+ barLabel: "m_6f89abf0",
3049
+ barValue: "m_7016be6d"
3050
+ };
3051
+
3052
+ // node_modules/@mantine/charts/esm/BarsList/BarsList.mjs
3053
+ import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
3054
+ import { useMemo as useMemo3 } from "react";
3055
+
3056
+ var defaultProps15 = {
3057
+ barGap: 5,
3058
+ minBarSize: 0,
3059
+ barHeight: 32
3060
+ };
3061
+ var varsResolver13 = createVarsResolver((_theme, { barGap, minBarSize, barHeight }) => ({ root: {
3062
+ "--bars-list-gap": getSpacing(barGap),
3063
+ "--bars-list-min-bar-size": rem(minBarSize),
3064
+ "--bars-list-bar-height": rem(barHeight)
3065
+ } }));
3066
+ var BarsList = factory((_props) => {
3067
+ const props = useProps("BarsList", defaultProps15, _props);
3068
+ const { classNames, className, style, styles, unstyled, vars, attributes, data, valueFormatter, barsLabel, valueLabel, getBarProps, renderBar, barGap, minBarSize, barHeight, barColor, barTextColor, autoContrast, variant, ...others } = props;
3069
+ const theme = useMantineTheme();
3070
+ const getStyles = useStyles({
3071
+ name: "BarsList",
3072
+ classes: BarsList_module_default,
3073
+ props,
3074
+ className,
3075
+ style,
3076
+ classNames,
3077
+ styles,
3078
+ unstyled,
3079
+ attributes,
3080
+ vars,
3081
+ varsResolver: varsResolver13
3082
+ });
3083
+ const maxValue = useMemo3(() => Math.max(...data.map((item) => item.value), 0), [data]);
3084
+ const formatValue = (value) => {
3085
+ if (valueFormatter)
3086
+ return valueFormatter(value);
3087
+ return value.toString();
3088
+ };
3089
+ const bars = data.map((item, index) => {
3090
+ const percentage = maxValue > 0 ? item.value / maxValue * 100 : 0;
3091
+ const { style: barPropsStyle, className: barPropsClassName, ...restBarProps } = getBarProps ? getBarProps(item) : {};
3092
+ const itemBarColor = item.color || barColor || theme.primaryColor;
3093
+ const colors = theme.variantColorResolver({
3094
+ color: itemBarColor,
3095
+ theme,
3096
+ variant: item.variant || variant || "light",
3097
+ autoContrast
3098
+ });
3099
+ const backgroundColor = colors.background;
3100
+ const textColor = item.textColor || barTextColor ? getThemeColor(item.textColor || barTextColor, theme) : colors.color;
3101
+ const defaultBar = /* @__PURE__ */ jsxs18("div", {
3102
+ ...getStyles("bar"),
3103
+ children: [/* @__PURE__ */ jsx21("div", {
3104
+ ...getStyles("barLabel", {
3105
+ className: barPropsClassName,
3106
+ style: {
3107
+ width: `${percentage}%`,
3108
+ backgroundColor,
3109
+ color: textColor,
3110
+ padding: percentage === 0 ? 0 : undefined,
3111
+ ...barPropsStyle
3112
+ }
3113
+ }),
3114
+ ...restBarProps,
3115
+ children: item.name
3116
+ }), /* @__PURE__ */ jsx21("div", {
3117
+ ...getStyles("barValue"),
3118
+ children: formatValue(item.value)
3119
+ })]
3120
+ }, index);
3121
+ if (renderBar)
3122
+ return /* @__PURE__ */ jsx21("div", { children: renderBar(item, defaultBar) }, index);
3123
+ return defaultBar;
3124
+ });
3125
+ const labelsRow = barsLabel || valueLabel ? /* @__PURE__ */ jsxs18("div", {
3126
+ ...getStyles("labelsRow"),
3127
+ children: [/* @__PURE__ */ jsx21("div", { children: barsLabel }), /* @__PURE__ */ jsx21("div", { children: valueLabel })]
3128
+ }) : null;
3129
+ return /* @__PURE__ */ jsxs18(Box, {
3130
+ ...getStyles("root"),
3131
+ variant,
3132
+ ...others,
3133
+ children: [labelsRow, bars]
3134
+ });
3135
+ });
3136
+ BarsList.displayName = "@mantine/charts/BarsList";
3137
+ BarsList.classes = BarsList_module_default;
3138
+ BarsList.varsResolver = varsResolver13;
3139
+
3140
+ // node_modules/@mantine/charts/esm/Treemap/Treemap.module.mjs
3141
+
3142
+ var Treemap_module_default = { root: "m_3c064071" };
3143
+
3144
+ // node_modules/@mantine/charts/esm/Treemap/Treemap.mjs
3145
+ import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
3146
+ import"react";
3147
+ import { ResponsiveContainer as ResponsiveContainer13, Tooltip as Tooltip$112, Treemap } from "recharts";
3148
+
3149
+ var defaultProps16 = {
3150
+ dataKey: "value",
3151
+ withTooltip: true,
3152
+ tooltipAnimationDuration: 0,
3153
+ height: 300,
3154
+ strokeWidth: 1,
3155
+ aspectRatio: 0.5 * (1 + Math.sqrt(5))
3156
+ };
3157
+ var varsResolver14 = createVarsResolver((theme, { strokeColor, height }) => ({ root: {
3158
+ "--chart-stroke-color": strokeColor ? getThemeColor(strokeColor, theme) : undefined,
3159
+ "--chart-height": rem(height)
3160
+ } }));
3161
+ function TreemapContent({ x, y, width, height, depth, name, resolvedColors, resolvedLabelColors, index, strokeWidth }) {
3162
+ const fill = resolvedColors[name] || `var(--mantine-color-blue-${index % 9 + 1})`;
3163
+ const labelColor = resolvedLabelColors[name] || "var(--mantine-color-white)";
3164
+ return /* @__PURE__ */ jsxs19("g", { children: [/* @__PURE__ */ jsx22("rect", {
3165
+ x,
3166
+ y,
3167
+ width,
3168
+ height,
3169
+ fill: depth >= 1 ? fill : "transparent",
3170
+ stroke: "var(--chart-stroke-color, var(--mantine-color-body))",
3171
+ strokeWidth: depth >= 1 ? strokeWidth : 0
3172
+ }), depth >= 1 && width > 30 && height > 20 && /* @__PURE__ */ jsx22("text", {
3173
+ x: x + width / 2,
3174
+ y: y + height / 2,
3175
+ textAnchor: "middle",
3176
+ dominantBaseline: "central",
3177
+ fill: labelColor,
3178
+ fontSize: 12,
3179
+ fontFamily: "var(--mantine-font-family)",
3180
+ children: name
3181
+ })] });
3182
+ }
3183
+ function resolveColors(data, theme, parentColor) {
3184
+ const result = {};
3185
+ for (const item of data) {
3186
+ const color = item.color || parentColor;
3187
+ if (color)
3188
+ result[item.name] = parseThemeColor({
3189
+ color,
3190
+ theme
3191
+ }).value;
3192
+ if (item.children)
3193
+ Object.assign(result, resolveColors(item.children, theme, color));
3194
+ }
3195
+ return result;
3196
+ }
3197
+ function resolveLabelColors(resolvedColors, autoContrast, luminanceThreshold, textColor) {
3198
+ const result = {};
3199
+ for (const [name, color] of Object.entries(resolvedColors))
3200
+ if (textColor)
3201
+ result[name] = textColor;
3202
+ else if (autoContrast)
3203
+ result[name] = isLightColor(color, luminanceThreshold) ? "var(--mantine-color-black)" : "var(--mantine-color-white)";
3204
+ return result;
3205
+ }
3206
+ var Treemap$1 = factory((_props) => {
3207
+ const props = useProps("Treemap", defaultProps16, _props);
3208
+ const { classNames, className, style, styles, unstyled, vars, data, dataKey, aspectRatio, withTooltip, tooltipAnimationDuration, tooltipProps, treemapProps, strokeColor, textColor, height: chartHeight, strokeWidth, valueFormatter, autoContrast, children, attributes, ...others } = props;
3209
+ const theme = useMantineTheme();
3210
+ const resolvedColors = resolveColors(data, theme);
3211
+ const _autoContrast = getAutoContrastValue(autoContrast, theme);
3212
+ const _textColor = textColor ? getThemeColor(textColor, theme) : undefined;
3213
+ const resolvedLabelColors = resolveLabelColors(resolvedColors, _autoContrast, theme.luminanceThreshold, _textColor);
3214
+ const getStyles = useStyles({
3215
+ name: "Treemap",
3216
+ classes: Treemap_module_default,
3217
+ props,
3218
+ className,
3219
+ style,
3220
+ classNames,
3221
+ styles,
3222
+ unstyled,
3223
+ attributes,
3224
+ vars,
3225
+ varsResolver: varsResolver14
3226
+ });
3227
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
3228
+ classNames,
3229
+ styles,
3230
+ props
3231
+ });
3232
+ return /* @__PURE__ */ jsx22(Box, {
3233
+ ...getStyles("root"),
3234
+ ...others,
3235
+ children: /* @__PURE__ */ jsx22(ResponsiveContainer13, {
3236
+ height: chartHeight,
3237
+ children: /* @__PURE__ */ jsxs19(Treemap, {
3238
+ data,
3239
+ dataKey,
3240
+ aspectRatio,
3241
+ isAnimationActive: false,
3242
+ content: (nodeProps) => /* @__PURE__ */ jsx22(TreemapContent, {
3243
+ ...nodeProps,
3244
+ resolvedColors,
3245
+ resolvedLabelColors,
3246
+ strokeWidth
3247
+ }),
3248
+ ...treemapProps,
3249
+ children: [withTooltip && /* @__PURE__ */ jsx22(Tooltip$112, {
3250
+ animationDuration: tooltipAnimationDuration,
3251
+ isAnimationActive: false,
3252
+ content: ({ payload }) => /* @__PURE__ */ jsx22(ChartTooltip, {
3253
+ payload: payload?.map((item) => ({
3254
+ name: item.name,
3255
+ value: item.value,
3256
+ color: resolvedColors[item.name] || "var(--mantine-color-blue-6)"
3257
+ })) || [],
3258
+ classNames: resolvedClassNames,
3259
+ styles: resolvedStyles,
3260
+ type: "radial",
3261
+ valueFormatter,
3262
+ attributes
3263
+ }),
3264
+ ...tooltipProps
3265
+ }), children]
3266
+ })
3267
+ })
3268
+ });
3269
+ });
3270
+ Treemap$1.displayName = "@mantine/charts/Treemap";
3271
+ Treemap$1.classes = Treemap_module_default;
3272
+ Treemap$1.varsResolver = varsResolver14;
3273
+
3274
+ // node_modules/@mantine/charts/esm/SankeyChart/SankeyChart.module.mjs
3275
+
3276
+ var SankeyChart_module_default = { root: "m_b42d2970" };
3277
+
3278
+ // node_modules/@mantine/charts/esm/SankeyChart/SankeyChart.mjs
3279
+ import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
3280
+ import"react";
3281
+ import { ResponsiveContainer as ResponsiveContainer14, Sankey, Tooltip as Tooltip$113 } from "recharts";
3282
+
3283
+ var defaultProps17 = {
3284
+ height: 300,
3285
+ nodeWidth: 10,
3286
+ nodePadding: 10,
3287
+ linkCurvature: 0.5,
3288
+ iterations: 32,
3289
+ linkOpacity: 0.4,
3290
+ withTooltip: true,
3291
+ tooltipAnimationDuration: 0
3292
+ };
3293
+ var varsResolver15 = createVarsResolver((theme, { nodeColor, linkColor, textColor, height }) => ({ root: {
3294
+ "--chart-node-color": nodeColor ? getThemeColor(nodeColor, theme) : undefined,
3295
+ "--chart-link-color": linkColor ? getThemeColor(linkColor, theme) : undefined,
3296
+ "--chart-text-color": textColor ? getThemeColor(textColor, theme) : undefined,
3297
+ "--chart-height": rem(height)
3298
+ } }));
3299
+ var DEFAULT_COLORS = [
3300
+ "var(--mantine-color-blue-filled)",
3301
+ "var(--mantine-color-cyan-filled)",
3302
+ "var(--mantine-color-teal-filled)",
3303
+ "var(--mantine-color-green-filled)",
3304
+ "var(--mantine-color-lime-filled)",
3305
+ "var(--mantine-color-yellow-filled)",
3306
+ "var(--mantine-color-orange-filled)",
3307
+ "var(--mantine-color-red-filled)",
3308
+ "var(--mantine-color-pink-filled)",
3309
+ "var(--mantine-color-grape-filled)",
3310
+ "var(--mantine-color-violet-filled)",
3311
+ "var(--mantine-color-indigo-filled)"
3312
+ ];
3313
+ function SankeyNodeContent({ x, y, width, height, index, payload, resolvedNodeColors, resolvedDefaultColors, valueFormatter }) {
3314
+ const fill = resolvedNodeColors[index] || `var(--chart-node-color, ${resolvedDefaultColors[index % resolvedDefaultColors.length]})`;
3315
+ const isLeaf = !payload.targetNodes || payload.targetNodes.length === 0;
3316
+ const labelX = isLeaf ? x - 6 : x + width + 6;
3317
+ const textAnchor = isLeaf ? "end" : "start";
3318
+ const formattedValue = valueFormatter ? valueFormatter(payload.value) : payload.value;
3319
+ return /* @__PURE__ */ jsxs20("g", { children: [/* @__PURE__ */ jsx23("rect", {
3320
+ x,
3321
+ y,
3322
+ width,
3323
+ height,
3324
+ fill,
3325
+ stroke: "none"
3326
+ }), height >= 28 ? /* @__PURE__ */ jsxs20(Fragment4, { children: [/* @__PURE__ */ jsx23("text", {
3327
+ x: labelX,
3328
+ y: y + height / 2 - 7,
3329
+ textAnchor,
3330
+ dominantBaseline: "central",
3331
+ fill: "var(--chart-text-color, var(--mantine-color-text))",
3332
+ fontSize: 12,
3333
+ fontFamily: "var(--mantine-font-family)",
3334
+ children: payload.name
3335
+ }), /* @__PURE__ */ jsx23("text", {
3336
+ x: labelX,
3337
+ y: y + height / 2 + 7,
3338
+ textAnchor,
3339
+ dominantBaseline: "central",
3340
+ fill: "var(--chart-text-color, var(--mantine-color-text))",
3341
+ fontSize: 12,
3342
+ fontFamily: "var(--mantine-font-family)",
3343
+ opacity: 0.8,
3344
+ children: formattedValue
3345
+ })] }) : /* @__PURE__ */ jsxs20("text", {
3346
+ x: labelX,
3347
+ y: y + height / 2,
3348
+ textAnchor,
3349
+ dominantBaseline: "central",
3350
+ fill: "var(--chart-text-color, var(--mantine-color-text))",
3351
+ fontSize: 12,
3352
+ fontFamily: "var(--mantine-font-family)",
3353
+ children: [
3354
+ payload.name,
3355
+ " ",
3356
+ /* @__PURE__ */ jsx23("tspan", {
3357
+ opacity: 0.8,
3358
+ children: formattedValue
3359
+ })
3360
+ ]
3361
+ })] });
3362
+ }
3363
+ function SankeyLinkContent({ sourceX, targetX, sourceY, targetY, sourceControlX, targetControlX, linkWidth, sourceResolvedColor, linkOpacity }) {
3364
+ const fill = sourceResolvedColor || "var(--chart-link-color, var(--mantine-color-gray-4))";
3365
+ return /* @__PURE__ */ jsx23("path", {
3366
+ d: `
3367
+ M${sourceX},${sourceY + linkWidth / 2}
3368
+ C${sourceControlX},${sourceY + linkWidth / 2}
3369
+ ${targetControlX},${targetY + linkWidth / 2}
3370
+ ${targetX},${targetY + linkWidth / 2}
3371
+ L${targetX},${targetY - linkWidth / 2}
3372
+ C${targetControlX},${targetY - linkWidth / 2}
3373
+ ${sourceControlX},${sourceY - linkWidth / 2}
3374
+ ${sourceX},${sourceY - linkWidth / 2}
3375
+ Z
3376
+ `,
3377
+ fill,
3378
+ opacity: linkOpacity,
3379
+ stroke: "none"
3380
+ });
3381
+ }
3382
+ var SankeyChart = factory((_props) => {
3383
+ const props = useProps("SankeyChart", defaultProps17, _props);
3384
+ const { classNames, className, style, styles, unstyled, vars, data, height: chartHeight, nodeWidth, nodePadding, linkCurvature, iterations, nodeColor, colors, linkColor, linkOpacity, textColor, withTooltip, tooltipAnimationDuration, tooltipProps, sankeyProps, valueFormatter, children, attributes, ...others } = props;
3385
+ const theme = useMantineTheme();
3386
+ const resolvedNodeColors = {};
3387
+ data.nodes.forEach((node, index) => {
3388
+ if (node.color)
3389
+ resolvedNodeColors[index] = getThemeColor(node.color, theme);
3390
+ });
3391
+ const resolvedDefaultColors = colors ? colors.map((color) => getThemeColor(color, theme)) : DEFAULT_COLORS;
3392
+ const getStyles = useStyles({
3393
+ name: "SankeyChart",
3394
+ classes: SankeyChart_module_default,
3395
+ props,
3396
+ className,
3397
+ style,
3398
+ classNames,
3399
+ styles,
3400
+ unstyled,
3401
+ attributes,
3402
+ vars,
3403
+ varsResolver: varsResolver15
3404
+ });
3405
+ const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
3406
+ classNames,
3407
+ styles,
3408
+ props
3409
+ });
3410
+ return /* @__PURE__ */ jsx23(Box, {
3411
+ ...getStyles("root"),
3412
+ ...others,
3413
+ children: /* @__PURE__ */ jsx23(ResponsiveContainer14, {
3414
+ height: chartHeight,
3415
+ children: /* @__PURE__ */ jsxs20(Sankey, {
3416
+ data,
3417
+ nodeWidth,
3418
+ nodePadding,
3419
+ linkCurvature,
3420
+ iterations,
3421
+ node: (nodeProps) => /* @__PURE__ */ jsx23(SankeyNodeContent, {
3422
+ ...nodeProps,
3423
+ resolvedNodeColors,
3424
+ resolvedDefaultColors,
3425
+ valueFormatter
3426
+ }),
3427
+ link: (linkProps) => {
3428
+ const sourceIndex = linkProps.index >= 0 && linkProps.index < data.links.length ? data.links[linkProps.index].source : -1;
3429
+ return /* @__PURE__ */ jsx23(SankeyLinkContent, {
3430
+ ...linkProps,
3431
+ sourceResolvedColor: resolvedNodeColors[sourceIndex],
3432
+ linkOpacity
3433
+ });
3434
+ },
3435
+ ...sankeyProps,
3436
+ children: [withTooltip && /* @__PURE__ */ jsx23(Tooltip$113, {
3437
+ animationDuration: tooltipAnimationDuration,
3438
+ isAnimationActive: false,
3439
+ content: ({ payload }) => {
3440
+ const resolveColor = (item) => {
3441
+ const nodeIndex = data.nodes.findIndex((n) => n.name === item.name);
3442
+ if (nodeIndex !== -1)
3443
+ return resolvedNodeColors[nodeIndex] || resolvedDefaultColors[nodeIndex % resolvedDefaultColors.length];
3444
+ const sourceNode = item.payload?.source;
3445
+ if (sourceNode) {
3446
+ const sourceIndex = data.nodes.findIndex((n) => n.name === sourceNode.name);
3447
+ if (sourceIndex !== -1)
3448
+ return resolvedNodeColors[sourceIndex] || resolvedDefaultColors[sourceIndex % resolvedDefaultColors.length];
3449
+ }
3450
+ return "var(--mantine-color-blue-6)";
3451
+ };
3452
+ return /* @__PURE__ */ jsx23(ChartTooltip, {
3453
+ payload: payload?.map((item) => ({
3454
+ name: item.name,
3455
+ value: item.value,
3456
+ color: resolveColor(item)
3457
+ })) || [],
3458
+ classNames: resolvedClassNames,
3459
+ styles: resolvedStyles,
3460
+ type: "radial",
3461
+ valueFormatter,
3462
+ attributes
3463
+ });
3464
+ },
3465
+ ...tooltipProps
3466
+ }), children]
3467
+ })
3468
+ })
3469
+ });
3470
+ });
3471
+ SankeyChart.displayName = "@mantine/charts/SankeyChart";
3472
+ SankeyChart.classes = SankeyChart_module_default;
3473
+ SankeyChart.varsResolver = varsResolver15;
3474
+ export {
3475
+ getSplitOffset,
3476
+ getFilteredChartTooltipPayload,
3477
+ getFilteredChartLegendPayload,
3478
+ Treemap$1 as Treemap,
3479
+ Sparkline,
3480
+ ScatterChart$1 as ScatterChart,
3481
+ SankeyChart,
3482
+ RadialBarChart$1 as RadialBarChart,
3483
+ RadarChart$1 as RadarChart,
3484
+ PieChart$1 as PieChart,
3485
+ LineChart$1 as LineChart,
3486
+ Heatmap,
3487
+ FunnelChart$1 as FunnelChart,
3488
+ DonutChart,
3489
+ CompositeChart,
3490
+ ChartTooltip,
3491
+ ChartLegend,
3492
+ BubbleChart,
3493
+ BarsList,
3494
+ BarChart$1 as BarChart,
3495
+ AreaGradient,
3496
+ AreaChart$1 as AreaChart
3497
+ };
3498
+
3499
+ //# debugId=0118A727390D092864756E2164756E21