@carto/ps-react-ui 6.1.1 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/{actions-BWlS5tpP.js → actions-CueYrfVr.js} +2 -2
  2. package/dist/actions-CueYrfVr.js.map +1 -0
  3. package/dist/category-DULnoxvk.js +933 -0
  4. package/dist/category-DULnoxvk.js.map +1 -0
  5. package/dist/chat.js +1 -1
  6. package/dist/chat.js.map +1 -1
  7. package/dist/components-CTUpdQuj.js.map +1 -1
  8. package/dist/download-B4sykOFm.js.map +1 -1
  9. package/dist/{echart-CV8F50gn.js → echart-ysYFLa_T.js} +2 -2
  10. package/dist/echart-ysYFLa_T.js.map +1 -0
  11. package/dist/formula-DJS-JLpk.js.map +1 -1
  12. package/dist/legend.js.map +1 -1
  13. package/dist/{markdown-Bn2nKCbn.js → markdown-DmvLi3vx.js} +2 -2
  14. package/dist/markdown-DmvLi3vx.js.map +1 -0
  15. package/dist/{markdown-content-kYNLOX0T.js → markdown-content-BpAH_V6S.js} +5 -4
  16. package/dist/markdown-content-BpAH_V6S.js.map +1 -0
  17. package/dist/option-builders-DQivvvbb.js.map +1 -1
  18. package/dist/range-BpU2zBmq.js.map +1 -1
  19. package/dist/smart-tooltip-Dc_rHhyI.js.map +1 -1
  20. package/dist/spread-CQwFIwuz.js.map +1 -1
  21. package/dist/stores-DcBOZlU3.js.map +1 -1
  22. package/dist/stores-mad-9yFn.js.map +1 -1
  23. package/dist/styles-BCEBm7xh.js.map +1 -1
  24. package/dist/table-DEdW_fDj.js.map +1 -1
  25. package/dist/types/widgets/category/category-ui.d.ts +10 -2
  26. package/dist/types/widgets/category/category.d.ts +7 -1
  27. package/dist/types/widgets/category/components/category-bar-stacked.d.ts +8 -1
  28. package/dist/types/widgets/category/components/category-bar.d.ts +24 -2
  29. package/dist/types/widgets/category/components/category-row-multi.d.ts +3 -1
  30. package/dist/types/widgets/category/components/category-row-single.d.ts +3 -1
  31. package/dist/types/widgets/category/components/category-row-stacked.d.ts +10 -1
  32. package/dist/types/widgets/category/style.d.ts +33 -6
  33. package/dist/utils-C-eWwOhE.js.map +1 -1
  34. package/dist/widgets/actions.js +1 -1
  35. package/dist/widgets/bar.js.map +1 -1
  36. package/dist/widgets/category.js +1 -1
  37. package/dist/widgets/echart.js +1 -1
  38. package/dist/widgets/histogram.js.map +1 -1
  39. package/dist/widgets/markdown.js +2 -2
  40. package/dist/widgets/pie.js +2 -2
  41. package/dist/widgets/pie.js.map +1 -1
  42. package/dist/widgets/scatterplot.js.map +1 -1
  43. package/dist/widgets/timeseries.js.map +1 -1
  44. package/dist/widgets.js +5 -5
  45. package/dist/widgets.js.map +1 -1
  46. package/dist/zoom-toggle-MmLjMTEw.js.map +1 -1
  47. package/package.json +2 -2
  48. package/src/widgets/category/category-ui.test.tsx +139 -0
  49. package/src/widgets/category/category-ui.tsx +64 -11
  50. package/src/widgets/category/category.test.tsx +67 -0
  51. package/src/widgets/category/category.tsx +32 -15
  52. package/src/widgets/category/components/category-bar-stacked.test.tsx +18 -0
  53. package/src/widgets/category/components/category-bar-stacked.tsx +42 -29
  54. package/src/widgets/category/components/category-bar.test.tsx +66 -0
  55. package/src/widgets/category/components/category-bar.tsx +65 -9
  56. package/src/widgets/category/components/category-row-multi.tsx +21 -0
  57. package/src/widgets/category/components/category-row-single.tsx +4 -0
  58. package/src/widgets/category/components/category-row-stacked.tsx +24 -1
  59. package/src/widgets/category/style.ts +58 -14
  60. package/dist/actions-BWlS5tpP.js.map +0 -1
  61. package/dist/category-alzjKzvQ.js +0 -839
  62. package/dist/category-alzjKzvQ.js.map +0 -1
  63. package/dist/echart-CV8F50gn.js.map +0 -1
  64. package/dist/markdown-Bn2nKCbn.js.map +0 -1
  65. package/dist/markdown-content-kYNLOX0T.js.map +0 -1
@@ -0,0 +1,933 @@
1
+ import "./components-CTUpdQuj.js";
2
+ import { n as e } from "./smart-tooltip-Dc_rHhyI.js";
3
+ import { C as t, D as n, S as r, p as i } from "./stores-DcBOZlU3.js";
4
+ import { n as a, t as o } from "./download-B4sykOFm.js";
5
+ import { t as s } from "./utils-C-eWwOhE.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { useRef as l, useState as u } from "react";
8
+ import { Box as d, Skeleton as f, Typography as p, useTheme as m } from "@mui/material";
9
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
+ var _ = {
11
+ root: {
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ position: "relative",
15
+ width: "100%"
16
+ },
17
+ list: {
18
+ position: "relative",
19
+ display: "grid",
20
+ gridTemplateColumns: "minmax(0, 1fr)",
21
+ gap: 1,
22
+ py: .5
23
+ },
24
+ listMulti: { gridTemplateColumns: "minmax(0, 1fr) max-content" },
25
+ barWrap: { position: "relative" },
26
+ multiZeroArea: {
27
+ position: "absolute",
28
+ inset: 0,
29
+ gridColumn: "1 / 2",
30
+ pointerEvents: "none"
31
+ },
32
+ zeroTick: {
33
+ position: "absolute",
34
+ top: -6,
35
+ bottom: -6,
36
+ width: "1px",
37
+ transform: "translateX(-50%)",
38
+ bgcolor: "text.disabled",
39
+ pointerEvents: "none"
40
+ },
41
+ listScroll: { pr: 1 },
42
+ rowSingle: {
43
+ gridColumn: "1 / -1",
44
+ display: "flex",
45
+ flexDirection: "column",
46
+ gap: .5,
47
+ cursor: "pointer",
48
+ userSelect: "none",
49
+ transition: "background-color 80ms ease",
50
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
51
+ "&:focus-visible": {
52
+ outline: "2px solid",
53
+ outlineColor: "primary.main",
54
+ outlineOffset: -2
55
+ }
56
+ },
57
+ rowHeader: {
58
+ display: "flex",
59
+ justifyContent: "space-between",
60
+ alignItems: "center",
61
+ gap: 1
62
+ },
63
+ rowMulti: {
64
+ position: "relative",
65
+ gridColumn: "1 / -1",
66
+ display: "grid",
67
+ gridTemplateColumns: "subgrid",
68
+ rowGap: .5,
69
+ cursor: "pointer",
70
+ userSelect: "none",
71
+ transition: "background-color 80ms ease",
72
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
73
+ "&:focus-visible": {
74
+ outline: "2px solid",
75
+ outlineColor: "primary.main",
76
+ outlineOffset: -2
77
+ }
78
+ },
79
+ name: {
80
+ overflow: "hidden",
81
+ whiteSpace: "nowrap",
82
+ textOverflow: "ellipsis",
83
+ color: "text.primary",
84
+ fontWeight: "medium"
85
+ },
86
+ multiName: {
87
+ gridColumn: "1 / -1",
88
+ overflow: "hidden",
89
+ whiteSpace: "nowrap",
90
+ textOverflow: "ellipsis",
91
+ color: "text.primary",
92
+ fontWeight: "medium"
93
+ },
94
+ value: {
95
+ color: "text.secondary",
96
+ fontVariantNumeric: "tabular-nums",
97
+ minWidth: 48,
98
+ textAlign: "right",
99
+ alignSelf: "center"
100
+ },
101
+ bar: {
102
+ small: {
103
+ position: "relative",
104
+ height: 4,
105
+ bgcolor: "action.hover",
106
+ borderRadius: 1,
107
+ overflow: "hidden",
108
+ transition: "background-color 150ms ease"
109
+ },
110
+ medium: {
111
+ position: "relative",
112
+ height: 12,
113
+ bgcolor: "action.hover",
114
+ borderRadius: .25,
115
+ overflow: "hidden",
116
+ transition: "background-color 150ms ease"
117
+ }
118
+ },
119
+ barFill: {
120
+ small: {
121
+ position: "absolute",
122
+ top: 0,
123
+ bottom: 0,
124
+ borderRadius: 1,
125
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
126
+ },
127
+ medium: {
128
+ position: "absolute",
129
+ top: 0,
130
+ bottom: 0,
131
+ borderRadius: .25,
132
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
133
+ }
134
+ },
135
+ stackedSegment: {
136
+ small: {
137
+ position: "absolute",
138
+ top: 0,
139
+ bottom: 0,
140
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
141
+ },
142
+ medium: {
143
+ position: "absolute",
144
+ top: 0,
145
+ bottom: 0,
146
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
147
+ }
148
+ },
149
+ multiBarRow: { display: "contents" },
150
+ multiBarContainer: { alignSelf: "center" },
151
+ rowStacked: {
152
+ gridColumn: "1 / -1",
153
+ display: "flex",
154
+ flexDirection: "column",
155
+ gap: .5,
156
+ cursor: "pointer",
157
+ userSelect: "none",
158
+ transition: "background-color 80ms ease",
159
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
160
+ "&:focus-visible": {
161
+ outline: "2px solid",
162
+ outlineColor: "primary.main",
163
+ outlineOffset: -2
164
+ }
165
+ },
166
+ stackedHeader: {
167
+ display: "flex",
168
+ justifyContent: "space-between",
169
+ alignItems: "center",
170
+ gap: 1
171
+ },
172
+ stackedTotal: {
173
+ color: "text.primary",
174
+ fontWeight: "medium",
175
+ fontVariantNumeric: "tabular-nums",
176
+ minWidth: 48,
177
+ textAlign: "right"
178
+ },
179
+ stackedBreakdown: {
180
+ display: "flex",
181
+ flexWrap: "wrap",
182
+ columnGap: 2,
183
+ rowGap: .25
184
+ },
185
+ stackedBreakdownItem: {
186
+ color: "text.secondary",
187
+ fontVariantNumeric: "tabular-nums"
188
+ },
189
+ legend: {
190
+ display: "flex",
191
+ alignItems: "center",
192
+ gap: 2,
193
+ flexWrap: "wrap",
194
+ pt: 2,
195
+ mt: 2,
196
+ position: "sticky",
197
+ bottom: 0,
198
+ bgcolor: "background.paper",
199
+ borderTop: (e) => `1px solid ${e.palette.divider}`
200
+ },
201
+ legendItem: {
202
+ display: "flex",
203
+ alignItems: "center",
204
+ gap: 1,
205
+ cursor: "pointer"
206
+ },
207
+ legendItemHidden: {
208
+ display: "flex",
209
+ alignItems: "center",
210
+ gap: 1,
211
+ cursor: "pointer",
212
+ opacity: .5
213
+ },
214
+ legendDot: {
215
+ width: 14,
216
+ height: 14,
217
+ borderRadius: "50%"
218
+ },
219
+ legendLabel: {
220
+ color: "text.secondary",
221
+ textTransform: "uppercase",
222
+ fontWeight: "medium"
223
+ },
224
+ otherRow: {
225
+ gridColumn: "1 / -1",
226
+ display: "flex",
227
+ alignItems: "center",
228
+ gap: 1,
229
+ py: .5,
230
+ px: .5
231
+ },
232
+ otherLabelButton: {
233
+ cursor: "pointer",
234
+ userSelect: "none",
235
+ borderRadius: 1,
236
+ px: .5,
237
+ ml: -.5,
238
+ transition: "background-color 80ms ease",
239
+ "&:hover": { bgcolor: "action.hover" },
240
+ "&:focus-visible": {
241
+ outline: "2px solid",
242
+ outlineColor: "primary.main",
243
+ outlineOffset: 2
244
+ }
245
+ },
246
+ otherLabel: {
247
+ color: "text.primary",
248
+ fontWeight: "medium"
249
+ },
250
+ otherCount: {
251
+ color: "text.secondary",
252
+ fontVariantNumeric: "tabular-nums"
253
+ }
254
+ };
255
+ //#endregion
256
+ //#region src/widgets/category/components/category-bar.tsx
257
+ function v(e) {
258
+ let t = c(17), { value: n, maxValue: r, minValue: i, color: a, size: o, zeroTick: s } = e, l = i === void 0 ? 0 : i, u = o === void 0 ? "small" : o, f = s === void 0 || s, p = r - l, m = p > 0 ? (Math.min(0, n) - l) / p * 100 : 0, g = p > 0 ? Math.abs(n) / p * 100 : 0, v = f && l < 0 && r > 0 ? -l / p * 100 : void 0, b = _.bar[u], x = _.barFill[u], S = `${m}%`, C = `${g}%`, w;
259
+ t[0] === n ? w = t[1] : (w = n < 0 ? {
260
+ borderTopRightRadius: 0,
261
+ borderBottomRightRadius: 0
262
+ } : {
263
+ borderTopLeftRadius: 0,
264
+ borderBottomLeftRadius: 0
265
+ }, t[0] = n, t[1] = w);
266
+ let T;
267
+ t[2] !== a || t[3] !== S || t[4] !== C || t[5] !== w ? (T = {
268
+ left: S,
269
+ width: C,
270
+ backgroundColor: a,
271
+ ...w
272
+ }, t[2] = a, t[3] = S, t[4] = C, t[5] = w, t[6] = T) : T = t[6];
273
+ let E;
274
+ t[7] !== T || t[8] !== x ? (E = /* @__PURE__ */ h(d, {
275
+ sx: x,
276
+ style: T,
277
+ "data-bar-fill": "true"
278
+ }), t[7] = T, t[8] = x, t[9] = E) : E = t[9];
279
+ let D;
280
+ t[10] !== u || t[11] !== E || t[12] !== b ? (D = /* @__PURE__ */ h(d, {
281
+ sx: b,
282
+ "data-size": u,
283
+ children: E
284
+ }), t[10] = u, t[11] = E, t[12] = b, t[13] = D) : D = t[13];
285
+ let O;
286
+ return t[14] !== D || t[15] !== v ? (O = /* @__PURE__ */ h(y, {
287
+ zeroPct: v,
288
+ children: D
289
+ }), t[14] = D, t[15] = v, t[16] = O) : O = t[16], O;
290
+ }
291
+ function y(e) {
292
+ let t = c(5), { zeroPct: n, children: r } = e;
293
+ if (n === void 0) return r;
294
+ let i = `${n}%`, a;
295
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ h(d, {
296
+ "aria-hidden": !0,
297
+ "data-zero-tick": "true",
298
+ sx: _.zeroTick,
299
+ style: { left: i }
300
+ }), t[0] = i, t[1] = a);
301
+ let o;
302
+ return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ g(d, {
303
+ sx: _.barWrap,
304
+ children: [a, r]
305
+ }), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
306
+ }
307
+ //#endregion
308
+ //#region src/widgets/category/components/category-row-single.tsx
309
+ function b(e) {
310
+ let t = c(28), { name: n, displayName: r, value: i, maxValue: a, minValue: o, color: s, formatter: l, selected: u, onToggle: f, size: m } = e, y;
311
+ t[0] !== n || t[1] !== f ? (y = (e) => {
312
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f(n));
313
+ }, t[0] = n, t[1] = f, t[2] = y) : y = t[2];
314
+ let b = y, x;
315
+ t[3] !== n || t[4] !== f ? (x = () => f(n), t[3] = n, t[4] = f, t[5] = x) : x = t[5];
316
+ let S = r ?? n, C;
317
+ t[6] === S ? C = t[7] : (C = /* @__PURE__ */ h(p, {
318
+ variant: "body2",
319
+ sx: _.name,
320
+ children: S
321
+ }), t[6] = S, t[7] = C);
322
+ let w;
323
+ t[8] !== l || t[9] !== i ? (w = l(i), t[8] = l, t[9] = i, t[10] = w) : w = t[10];
324
+ let T;
325
+ t[11] === w ? T = t[12] : (T = /* @__PURE__ */ h(p, {
326
+ variant: "body2",
327
+ sx: _.value,
328
+ children: w
329
+ }), t[11] = w, t[12] = T);
330
+ let E;
331
+ t[13] !== C || t[14] !== T ? (E = /* @__PURE__ */ g(d, {
332
+ sx: _.rowHeader,
333
+ children: [C, T]
334
+ }), t[13] = C, t[14] = T, t[15] = E) : E = t[15];
335
+ let D;
336
+ t[16] !== s || t[17] !== a || t[18] !== o || t[19] !== m || t[20] !== i ? (D = /* @__PURE__ */ h(v, {
337
+ value: i,
338
+ maxValue: a,
339
+ minValue: o,
340
+ color: s,
341
+ size: m
342
+ }), t[16] = s, t[17] = a, t[18] = o, t[19] = m, t[20] = i, t[21] = D) : D = t[21];
343
+ let O;
344
+ return t[22] !== b || t[23] !== u || t[24] !== x || t[25] !== E || t[26] !== D ? (O = /* @__PURE__ */ g(d, {
345
+ role: "button",
346
+ "aria-pressed": u,
347
+ tabIndex: 0,
348
+ onClick: x,
349
+ onKeyDown: b,
350
+ sx: _.rowSingle,
351
+ children: [E, D]
352
+ }), t[22] = b, t[23] = u, t[24] = x, t[25] = E, t[26] = D, t[27] = O) : O = t[27], O;
353
+ }
354
+ //#endregion
355
+ //#region src/widgets/category/components/category-row-multi.tsx
356
+ function x(e) {
357
+ let t = c(34), { name: n, displayName: r, values: i, colors: a, maxValue: o, minValue: s, formatter: l, selected: u, onToggle: f, size: m } = e, y = s ?? 0, b;
358
+ t[0] !== n || t[1] !== f ? (b = (e) => {
359
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f(n));
360
+ }, t[0] = n, t[1] = f, t[2] = b) : b = t[2];
361
+ let x = b, S;
362
+ t[3] !== n || t[4] !== f ? (S = () => f(n), t[3] = n, t[4] = f, t[5] = S) : S = t[5];
363
+ let C = r ?? n, w;
364
+ t[6] === C ? w = t[7] : (w = /* @__PURE__ */ h(p, {
365
+ variant: "body2",
366
+ sx: _.multiName,
367
+ children: C
368
+ }), t[6] = C, t[7] = w);
369
+ let T;
370
+ t[8] !== o || t[9] !== y || t[10] !== i.length ? (T = y < 0 && o > 0 && /* @__PURE__ */ h(d, {
371
+ "aria-hidden": !0,
372
+ sx: _.multiZeroArea,
373
+ style: { gridRow: `2 / span ${i.length}` },
374
+ children: /* @__PURE__ */ h(d, {
375
+ "data-zero-tick": "true",
376
+ sx: _.zeroTick,
377
+ style: { left: `${-y / (o - y) * 100}%` }
378
+ })
379
+ }), t[8] = o, t[9] = y, t[10] = i.length, t[11] = T) : T = t[11];
380
+ let E;
381
+ if (t[12] !== a || t[13] !== l || t[14] !== o || t[15] !== s || t[16] !== n || t[17] !== m || t[18] !== i) {
382
+ let e;
383
+ t[20] !== a || t[21] !== l || t[22] !== o || t[23] !== s || t[24] !== n || t[25] !== m ? (e = (e, t) => /* @__PURE__ */ g(d, {
384
+ sx: _.multiBarRow,
385
+ children: [/* @__PURE__ */ h(d, {
386
+ sx: _.multiBarContainer,
387
+ children: /* @__PURE__ */ h(v, {
388
+ value: e,
389
+ maxValue: o,
390
+ minValue: s,
391
+ color: a[t] ?? "",
392
+ size: m,
393
+ zeroTick: !1
394
+ })
395
+ }), /* @__PURE__ */ h(p, {
396
+ variant: "body2",
397
+ sx: _.value,
398
+ children: l(e)
399
+ })]
400
+ }, `${n}-series-${t}`), t[20] = a, t[21] = l, t[22] = o, t[23] = s, t[24] = n, t[25] = m, t[26] = e) : e = t[26], E = i.map(e), t[12] = a, t[13] = l, t[14] = o, t[15] = s, t[16] = n, t[17] = m, t[18] = i, t[19] = E;
401
+ } else E = t[19];
402
+ let D;
403
+ return t[27] !== x || t[28] !== u || t[29] !== S || t[30] !== w || t[31] !== T || t[32] !== E ? (D = /* @__PURE__ */ g(d, {
404
+ role: "button",
405
+ "aria-pressed": u,
406
+ tabIndex: 0,
407
+ onClick: S,
408
+ onKeyDown: x,
409
+ sx: _.rowMulti,
410
+ children: [
411
+ w,
412
+ T,
413
+ E
414
+ ]
415
+ }), t[27] = x, t[28] = u, t[29] = S, t[30] = w, t[31] = T, t[32] = E, t[33] = D) : D = t[33], D;
416
+ }
417
+ //#endregion
418
+ //#region src/widgets/category/components/category-bar-stacked.tsx
419
+ function S(e) {
420
+ let t = c(22), { values: n, colors: r, maxValue: i, zeroPct: a, size: o } = e, s = a === void 0 ? 0 : a, l = o === void 0 ? "small" : o, u;
421
+ if (t[0] !== n) {
422
+ u = [];
423
+ let e = 0, r = 0;
424
+ for (let t of n) t < 0 && (r -= t), u.push(t < 0 ? -r : e), t > 0 && (e += t);
425
+ t[0] = n, t[1] = u;
426
+ } else u = t[1];
427
+ let f = s > 0 && s < 100 ? s : void 0, p = _.bar[l], m;
428
+ if (t[2] !== r || t[3] !== u || t[4] !== i || t[5] !== l || t[6] !== n || t[7] !== s) {
429
+ let e;
430
+ t[9] !== r || t[10] !== u || t[11] !== i || t[12] !== l || t[13] !== s ? (e = (e, t) => {
431
+ if (e === 0 || i <= 0) return null;
432
+ let n = s + u[t] / i * 100, a = Math.abs(e) / i * 100;
433
+ return /* @__PURE__ */ h(d, {
434
+ sx: _.stackedSegment[l],
435
+ style: {
436
+ left: `${n}%`,
437
+ width: `${a}%`,
438
+ backgroundColor: r[t] ?? ""
439
+ },
440
+ "data-bar-fill": "true"
441
+ }, `seg-${r[t] ?? "none"}-${t}`);
442
+ }, t[9] = r, t[10] = u, t[11] = i, t[12] = l, t[13] = s, t[14] = e) : e = t[14], m = n.map(e), t[2] = r, t[3] = u, t[4] = i, t[5] = l, t[6] = n, t[7] = s, t[8] = m;
443
+ } else m = t[8];
444
+ let g;
445
+ t[15] !== l || t[16] !== p || t[17] !== m ? (g = /* @__PURE__ */ h(d, {
446
+ sx: p,
447
+ "data-size": l,
448
+ children: m
449
+ }), t[15] = l, t[16] = p, t[17] = m, t[18] = g) : g = t[18];
450
+ let v;
451
+ return t[19] !== f || t[20] !== g ? (v = /* @__PURE__ */ h(y, {
452
+ zeroPct: f,
453
+ children: g
454
+ }), t[19] = f, t[20] = g, t[21] = v) : v = t[21], v;
455
+ }
456
+ //#endregion
457
+ //#region src/widgets/category/components/category-row-stacked.tsx
458
+ function C(e) {
459
+ let t = c(67), { name: n, displayName: r, values: i, colors: a, seriesNames: o, formatter: s, selected: l, onToggle: u, size: f, zeroPct: m } = e, v = m === void 0 ? 0 : m, y;
460
+ t[0] !== n || t[1] !== u ? (y = (e) => {
461
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u(n));
462
+ }, t[0] = n, t[1] = u, t[2] = y) : y = t[2];
463
+ let b = y, x, C, T, E, D, O, k, A, j, M, N, P, F, I, L;
464
+ if (t[3] !== r || t[4] !== s || t[5] !== b || t[6] !== n || t[7] !== u || t[8] !== l || t[9] !== i || t[10] !== v) {
465
+ let e = i.reduce(w, 0), a = 0, o = 0;
466
+ for (let e of i) e > 0 ? a += e : o -= e;
467
+ E = Math.max(v < 100 ? a * 100 / (100 - v) : 0, v > 0 ? o * 100 / v : 0), T = d, I = "button", L = l, D = 0, t[26] !== n || t[27] !== u ? (O = () => u(n), t[26] = n, t[27] = u, t[28] = O) : O = t[28], k = b, A = _.rowStacked, C = d, P = _.stackedHeader;
468
+ let c = r ?? n;
469
+ t[29] === c ? F = t[30] : (F = /* @__PURE__ */ h(p, {
470
+ variant: "body2",
471
+ sx: _.multiName,
472
+ children: c
473
+ }), t[29] = c, t[30] = F), x = p, j = "body2", M = _.stackedTotal, N = s(e), t[3] = r, t[4] = s, t[5] = b, t[6] = n, t[7] = u, t[8] = l, t[9] = i, t[10] = v, t[11] = x, t[12] = C, t[13] = T, t[14] = E, t[15] = D, t[16] = O, t[17] = k, t[18] = A, t[19] = j, t[20] = M, t[21] = N, t[22] = P, t[23] = F, t[24] = I, t[25] = L;
474
+ } else x = t[11], C = t[12], T = t[13], E = t[14], D = t[15], O = t[16], k = t[17], A = t[18], j = t[19], M = t[20], N = t[21], P = t[22], F = t[23], I = t[24], L = t[25];
475
+ let R;
476
+ t[31] !== x || t[32] !== j || t[33] !== M || t[34] !== N ? (R = /* @__PURE__ */ h(x, {
477
+ variant: j,
478
+ sx: M,
479
+ children: N
480
+ }), t[31] = x, t[32] = j, t[33] = M, t[34] = N, t[35] = R) : R = t[35];
481
+ let z;
482
+ t[36] !== C || t[37] !== R || t[38] !== P || t[39] !== F ? (z = /* @__PURE__ */ g(C, {
483
+ sx: P,
484
+ children: [F, R]
485
+ }), t[36] = C, t[37] = R, t[38] = P, t[39] = F, t[40] = z) : z = t[40];
486
+ let B;
487
+ t[41] !== a || t[42] !== E || t[43] !== f || t[44] !== i || t[45] !== v ? (B = /* @__PURE__ */ h(S, {
488
+ values: i,
489
+ colors: a,
490
+ maxValue: E,
491
+ zeroPct: v,
492
+ size: f
493
+ }), t[41] = a, t[42] = E, t[43] = f, t[44] = i, t[45] = v, t[46] = B) : B = t[46];
494
+ let V;
495
+ if (t[47] !== s || t[48] !== o || t[49] !== i) {
496
+ let e;
497
+ t[51] !== s || t[52] !== o ? (e = (e, t) => /* @__PURE__ */ h(p, {
498
+ variant: "body2",
499
+ sx: _.stackedBreakdownItem,
500
+ children: `${o[t]}: ${s(e)}`
501
+ }, `breakdown-${o[t]}`), t[51] = s, t[52] = o, t[53] = e) : e = t[53], V = i.map(e), t[47] = s, t[48] = o, t[49] = i, t[50] = V;
502
+ } else V = t[50];
503
+ let H;
504
+ t[54] === V ? H = t[55] : (H = /* @__PURE__ */ h(d, {
505
+ sx: _.stackedBreakdown,
506
+ children: V
507
+ }), t[54] = V, t[55] = H);
508
+ let U;
509
+ return t[56] !== T || t[57] !== D || t[58] !== O || t[59] !== k || t[60] !== A || t[61] !== z || t[62] !== B || t[63] !== H || t[64] !== I || t[65] !== L ? (U = /* @__PURE__ */ g(T, {
510
+ role: I,
511
+ "aria-pressed": L,
512
+ tabIndex: D,
513
+ onClick: O,
514
+ onKeyDown: k,
515
+ sx: A,
516
+ children: [
517
+ z,
518
+ B,
519
+ H
520
+ ]
521
+ }), t[56] = T, t[57] = D, t[58] = O, t[59] = k, t[60] = A, t[61] = z, t[62] = B, t[63] = H, t[64] = I, t[65] = L, t[66] = U) : U = t[66], U;
522
+ }
523
+ function w(e, t) {
524
+ return e + t;
525
+ }
526
+ //#endregion
527
+ //#region src/widgets/category/components/category-row-other.tsx
528
+ function T(t) {
529
+ let n = c(23), { hiddenCount: r, otherLabel: i, otherCountLabel: a, onShowAll: o, showAllLabel: s } = t, l = i === void 0 ? "Others" : i, u = a === void 0 ? "{count}" : a, f = s === void 0 ? "Show all" : s, m;
530
+ n[0] !== r || n[1] !== u ? (m = u.replace("{count}", String(r)), n[0] = r, n[1] = u, n[2] = m) : m = n[2];
531
+ let v = m, y;
532
+ n[3] === v ? y = n[4] : (y = /* @__PURE__ */ h(p, {
533
+ variant: "body2",
534
+ sx: _.otherCount,
535
+ children: v
536
+ }), n[3] = v, n[4] = y);
537
+ let b = y;
538
+ if (!o) {
539
+ let e;
540
+ n[5] === l ? e = n[6] : (e = /* @__PURE__ */ h(p, {
541
+ variant: "body2",
542
+ sx: _.otherLabel,
543
+ children: l
544
+ }), n[5] = l, n[6] = e);
545
+ let t;
546
+ return n[7] !== b || n[8] !== e ? (t = /* @__PURE__ */ g(d, {
547
+ sx: _.otherRow,
548
+ children: [e, b]
549
+ }), n[7] = b, n[8] = e, n[9] = t) : t = n[9], t;
550
+ }
551
+ let x;
552
+ n[10] === o ? x = n[11] : (x = (e) => {
553
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
554
+ }, n[10] = o, n[11] = x);
555
+ let S = x, C;
556
+ n[12] === Symbol.for("react.memo_cache_sentinel") ? (C = {
557
+ ..._.otherLabel,
558
+ ..._.otherLabelButton
559
+ }, n[12] = C) : C = n[12];
560
+ let w;
561
+ n[13] !== S || n[14] !== o || n[15] !== l ? (w = /* @__PURE__ */ h(p, {
562
+ variant: "body2",
563
+ component: "span",
564
+ role: "button",
565
+ tabIndex: 0,
566
+ onClick: o,
567
+ onKeyDown: S,
568
+ sx: C,
569
+ children: l
570
+ }), n[13] = S, n[14] = o, n[15] = l, n[16] = w) : w = n[16];
571
+ let T;
572
+ n[17] !== f || n[18] !== w ? (T = /* @__PURE__ */ h(e, {
573
+ title: f,
574
+ children: w
575
+ }), n[17] = f, n[18] = w, n[19] = T) : T = n[19];
576
+ let E;
577
+ return n[20] !== b || n[21] !== T ? (E = /* @__PURE__ */ g(d, {
578
+ sx: _.otherRow,
579
+ children: [T, b]
580
+ }), n[20] = b, n[21] = T, n[22] = E) : E = n[22], E;
581
+ }
582
+ //#endregion
583
+ //#region src/widgets/category/helpers.ts
584
+ var E = /* @__PURE__ */ new Set();
585
+ function D(e) {
586
+ return JSON.stringify(e?.map((e) => e.name) ?? []);
587
+ }
588
+ //#endregion
589
+ //#region src/widgets/category/components/category-legend.tsx
590
+ function O(e) {
591
+ let t = c(11), { series: n, colorAt: r, hiddenSeries: i, onToggle: a } = e, o = i === void 0 ? E : i;
592
+ if (n.length === 0) return null;
593
+ let s;
594
+ if (t[0] !== r || t[1] !== o || t[2] !== a || t[3] !== n) {
595
+ let e;
596
+ t[5] !== r || t[6] !== o || t[7] !== a ? (e = (e, t) => {
597
+ let n = o.has(t);
598
+ return /* @__PURE__ */ g(d, {
599
+ role: "checkbox",
600
+ "aria-checked": !n,
601
+ tabIndex: 0,
602
+ onClick: () => a?.(t),
603
+ onKeyDown: (e) => {
604
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a?.(t));
605
+ },
606
+ sx: n ? _.legendItemHidden : _.legendItem,
607
+ children: [/* @__PURE__ */ h(d, {
608
+ sx: _.legendDot,
609
+ style: { backgroundColor: r(t) }
610
+ }), /* @__PURE__ */ h(p, {
611
+ variant: "caption",
612
+ sx: _.legendLabel,
613
+ children: e.name
614
+ })]
615
+ }, e.name);
616
+ }, t[5] = r, t[6] = o, t[7] = a, t[8] = e) : e = t[8], s = n.map(e), t[0] = r, t[1] = o, t[2] = a, t[3] = n, t[4] = s;
617
+ } else s = t[4];
618
+ let l;
619
+ return t[9] === s ? l = t[10] : (l = /* @__PURE__ */ h(d, {
620
+ sx: _.legend,
621
+ children: s
622
+ }), t[9] = s, t[10] = l), l;
623
+ }
624
+ //#endregion
625
+ //#region src/widgets/category/category-ui.tsx
626
+ var k = 20, A = {
627
+ small: 36,
628
+ medium: 44
629
+ }, j = 8;
630
+ function M(e, t) {
631
+ let n = new Set([...e].filter((e) => e < t));
632
+ return n.size >= t ? /* @__PURE__ */ new Set() : n;
633
+ }
634
+ function N(e) {
635
+ if (!e || e.length === 0) return [];
636
+ let t = Math.max(e.length, 1), n = /* @__PURE__ */ new Map(), r = [];
637
+ for (let i = 0; i < e.length; i++) {
638
+ let a = e[i] ?? [];
639
+ for (let e of a) {
640
+ let a = n.get(e.name);
641
+ a || (a = {
642
+ name: e.name,
643
+ values: Array(t).fill(0),
644
+ rowColors: Array(t).fill(void 0)
645
+ }, n.set(e.name, a), r.push(e.name)), a.values[i] = e.value, a.rowColors[i] = e.color;
646
+ }
647
+ }
648
+ return r.map((e) => n.get(e));
649
+ }
650
+ function P(e, t, n) {
651
+ let r = 0, i = 0;
652
+ for (let t of e) for (let e of t.values) e < r && (r = e), e > i && (i = e);
653
+ if (typeof t == "number" && t < 0 && (r = t), typeof n == "number" && n > 0 && (i = n), r < 0 && i > 0) {
654
+ let e = Math.max(-r, i);
655
+ return [-e, e];
656
+ }
657
+ return [r, i];
658
+ }
659
+ function F(e, t) {
660
+ return (t < 0 ? "−" : "") + e(Math.abs(t));
661
+ }
662
+ function I(e) {
663
+ let t = c(96), { data: n, selection: r, onSelectionChange: i, formatter: a, labelFormatter: o, series: f, maxItems: p, labels: v, onShowAll: y, maxOverride: S, minOverride: w, size: E, stacked: I, hiddenSeries: B, onHiddenSeriesChange: V } = e, H = p === void 0 ? k : p, U = E === void 0 ? "small" : E, W = I !== void 0 && I, G = m(), ee = a ?? z, te;
664
+ t[0] === ee ? te = t[1] : (te = (e) => F(ee, e), t[0] = ee, t[1] = te);
665
+ let K = te, ne = !!r && r.length > 0, re;
666
+ t[2] === r ? re = t[3] : (re = r ?? [], t[2] = r, t[3] = re);
667
+ let ie;
668
+ t[4] === re ? ie = t[5] : (ie = new Set(re), t[4] = re, t[5] = ie);
669
+ let ae = ie, oe;
670
+ t[6] !== i || t[7] !== r ? (oe = (e) => {
671
+ if (!i) return;
672
+ let t = r ?? [], n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
673
+ i(n);
674
+ }, t[6] = i, t[7] = r, t[8] = oe) : oe = t[8];
675
+ let se = oe, ce = G.palette.secondary.main, le;
676
+ t[9] === G.palette ? le = t[10] : (le = Object.values(G.palette.qualitative?.bold ?? {}), t[9] = G.palette, t[10] = le);
677
+ let ue;
678
+ t[11] !== le || t[12] !== G.palette.secondary.main ? (ue = [ce, ...le], t[11] = le, t[12] = G.palette.secondary.main, t[13] = ue) : ue = t[13];
679
+ let de = ue, fe;
680
+ t[14] !== de || t[15] !== f || t[16] !== G ? (fe = (e, t) => {
681
+ let n = t ?? f?.[e]?.color;
682
+ return n ? s(G, n) ?? n : de[e % de.length] ?? G.palette.secondary.main;
683
+ }, t[14] = de, t[15] = f, t[16] = G, t[17] = fe) : fe = t[17];
684
+ let pe = fe, me = G.palette.action.disabled, he;
685
+ t[18] === n ? he = t[19] : (he = N(n), t[18] = n, t[19] = he);
686
+ let q = he, ge;
687
+ t[20] !== q || t[21] !== S || t[22] !== w ? (ge = P(q, w, S), t[20] = q, t[21] = S, t[22] = w, t[23] = ge) : ge = t[23];
688
+ let [J, _e] = ge, ve = _e > J ? -J / (_e - J) * 100 : 0, Y = H === 0, ye = l(!1), [be, xe] = u(null), Se;
689
+ t[24] === Y ? Se = t[25] : (Se = (e) => {
690
+ if (!e || ye.current || Y) return;
691
+ let t = e.clientHeight;
692
+ t > 0 && (ye.current = !0, xe(t));
693
+ }, t[24] = Y, t[25] = Se);
694
+ let Ce = Se, [we, Te] = u(R), Ee = B ?? we, De;
695
+ t[26] === f ? De = t[27] : (De = D(f), t[26] = f, t[27] = De);
696
+ let Oe = De, [ke, Ae] = u(Oe);
697
+ Oe !== ke && (Ae(Oe), Te(/* @__PURE__ */ new Set()));
698
+ let X = Math.max(n.length, 1), je;
699
+ t[28] !== Ee || t[29] !== V || t[30] !== X ? (je = (e) => {
700
+ let t = M(Ee, X);
701
+ t.has(e) ? t.delete(e) : t.add(e), (V ?? Te)(t.size >= X ? /* @__PURE__ */ new Set() : t);
702
+ }, t[28] = Ee, t[29] = V, t[30] = X, t[31] = je) : je = t[31];
703
+ let Me = je;
704
+ if (q.length === 0) return null;
705
+ let Ne;
706
+ t[32] === H ? Ne = t[33] : (Ne = typeof H == "number" && Number.isFinite(H) && H > 0, t[32] = H, t[33] = Ne);
707
+ let Pe = Ne, Fe;
708
+ t[34] !== q || t[35] !== Pe || t[36] !== H ? (Fe = Pe ? q.slice(0, H) : q, t[34] = q, t[35] = Pe, t[36] = H, t[37] = Fe) : Fe = t[37];
709
+ let Ie = Fe, Le = Pe ? q.length - Ie.length : 0, Re = n.length > 1, ze = Re && !!f && f.length > 0, Be, Ve, Z, He, Q, $, Ue, We;
710
+ if (t[38] !== pe || t[39] !== me || t[40] !== K || t[41] !== ne || t[42] !== Ee || t[43] !== Re || t[44] !== o || t[45] !== Ce || t[46] !== _e || t[47] !== J || t[48] !== be || t[49] !== Y || t[50] !== ae || t[51] !== f || t[52] !== X || t[53] !== U || t[54] !== W || t[55] !== se || t[56] !== Ie || t[57] !== ve) {
711
+ Z = M(Ee, X);
712
+ let e = Array.from({ length: X }, L).filter((e) => !Z.has(e)), n = Y ? be ?? A[U] * j : void 0;
713
+ Ve = d, We = _.root, Be = d, He = Ce;
714
+ let r = Re && !W && _.listMulti, i = Y && _.listScroll;
715
+ t[66] !== r || t[67] !== i ? (Q = {
716
+ ..._.list,
717
+ ...r,
718
+ ...i
719
+ }, t[66] = r, t[67] = i, t[68] = Q) : Q = t[68], t[69] === n ? $ = t[70] : ($ = n === void 0 ? void 0 : {
720
+ maxHeight: n,
721
+ overflowY: "auto"
722
+ }, t[69] = n, t[70] = $), Ue = Ie.map((t) => {
723
+ let n = ae.has(t.name), r = ne && !n, i = o ? o(t.name) : void 0, a = (e) => r ? me : pe(e, t.rowColors[e]);
724
+ return Re ? W ? /* @__PURE__ */ h(C, {
725
+ name: t.name,
726
+ displayName: i,
727
+ values: e.map((e) => t.values[e]),
728
+ colors: e.map((e) => a(e)),
729
+ seriesNames: e.map((e) => f?.[e]?.name ?? `Series ${e + 1}`),
730
+ formatter: K,
731
+ selected: n,
732
+ onToggle: se,
733
+ size: U,
734
+ zeroPct: ve
735
+ }, String(t.name)) : /* @__PURE__ */ h(x, {
736
+ name: t.name,
737
+ displayName: i,
738
+ values: e.map((e) => t.values[e]),
739
+ colors: e.map((e) => a(e)),
740
+ maxValue: _e,
741
+ minValue: J,
742
+ formatter: K,
743
+ selected: n,
744
+ onToggle: se,
745
+ size: U
746
+ }, String(t.name)) : /* @__PURE__ */ h(b, {
747
+ name: t.name,
748
+ displayName: i,
749
+ value: t.values[0] ?? 0,
750
+ maxValue: _e,
751
+ minValue: J,
752
+ color: a(0),
753
+ formatter: K,
754
+ selected: n,
755
+ onToggle: se,
756
+ size: U
757
+ }, String(t.name));
758
+ }), t[38] = pe, t[39] = me, t[40] = K, t[41] = ne, t[42] = Ee, t[43] = Re, t[44] = o, t[45] = Ce, t[46] = _e, t[47] = J, t[48] = be, t[49] = Y, t[50] = ae, t[51] = f, t[52] = X, t[53] = U, t[54] = W, t[55] = se, t[56] = Ie, t[57] = ve, t[58] = Be, t[59] = Ve, t[60] = Z, t[61] = He, t[62] = Q, t[63] = $, t[64] = Ue, t[65] = We;
759
+ } else Be = t[58], Ve = t[59], Z = t[60], He = t[61], Q = t[62], $ = t[63], Ue = t[64], We = t[65];
760
+ let Ge;
761
+ t[71] !== Le || t[72] !== v?.other || t[73] !== v?.otherCount || t[74] !== v?.showAll || t[75] !== y ? (Ge = Le > 0 && /* @__PURE__ */ h(T, {
762
+ hiddenCount: Le,
763
+ otherLabel: v?.other,
764
+ otherCountLabel: v?.otherCount,
765
+ showAllLabel: v?.showAll,
766
+ onShowAll: y
767
+ }), t[71] = Le, t[72] = v?.other, t[73] = v?.otherCount, t[74] = v?.showAll, t[75] = y, t[76] = Ge) : Ge = t[76];
768
+ let Ke;
769
+ t[77] !== Be || t[78] !== He || t[79] !== Q || t[80] !== $ || t[81] !== Ue || t[82] !== Ge ? (Ke = /* @__PURE__ */ g(Be, {
770
+ ref: He,
771
+ sx: Q,
772
+ style: $,
773
+ children: [Ue, Ge]
774
+ }), t[77] = Be, t[78] = He, t[79] = Q, t[80] = $, t[81] = Ue, t[82] = Ge, t[83] = Ke) : Ke = t[83];
775
+ let qe;
776
+ t[84] !== Z || t[85] !== pe || t[86] !== ze || t[87] !== f || t[88] !== X || t[89] !== Me ? (qe = ze && f && /* @__PURE__ */ h(O, {
777
+ series: f.slice(0, X),
778
+ colorAt: (e) => pe(e),
779
+ hiddenSeries: Z,
780
+ onToggle: Me
781
+ }), t[84] = Z, t[85] = pe, t[86] = ze, t[87] = f, t[88] = X, t[89] = Me, t[90] = qe) : qe = t[90];
782
+ let Je;
783
+ return t[91] !== Ve || t[92] !== We || t[93] !== Ke || t[94] !== qe ? (Je = /* @__PURE__ */ g(Ve, {
784
+ sx: We,
785
+ children: [Ke, qe]
786
+ }), t[91] = Ve, t[92] = We, t[93] = Ke, t[94] = qe, t[95] = Je) : Je = t[95], Je;
787
+ }
788
+ function L(e, t) {
789
+ return t;
790
+ }
791
+ function R() {
792
+ return /* @__PURE__ */ new Set();
793
+ }
794
+ function z(e) {
795
+ return String(e);
796
+ }
797
+ //#endregion
798
+ //#region src/widgets/category/category.tsx
799
+ var B = (e) => ({
800
+ data: e.data ?? [],
801
+ rawData: e.rawData ?? void 0,
802
+ formatter: e.formatter,
803
+ labelFormatter: e.labelFormatter
804
+ });
805
+ function V(e) {
806
+ let t = 0, n = 0;
807
+ for (let r of e ?? []) for (let e of r) e.value < t && (t = e.value), e.value > n && (n = e.value);
808
+ return [t, n];
809
+ }
810
+ function H(e) {
811
+ let a = c(23), { selection: o, onSelectionChange: s, series: l, maxItems: u, labels: d, onShowAll: f, maxOverride: p, minOverride: m, size: g, stacked: _ } = e, v = n(), y = t(v, B), b;
812
+ a[0] === y.rawData ? b = a[1] : (b = V(y.rawData), a[0] = y.rawData, a[1] = b);
813
+ let [x, S] = b, C = S > 0 ? p ?? S : void 0, w = x < 0 ? m ?? x : void 0, T;
814
+ a[2] === l ? T = a[3] : (T = D(l), a[2] = l, a[3] = T);
815
+ let O = T, k = r(v, U), A = k?.key === O ? k.indices : E, j;
816
+ a[4] !== v || a[5] !== O ? (j = (e) => i(v).setState({ categoryHiddenSeries: {
817
+ key: O,
818
+ indices: e
819
+ } }), a[4] = v, a[5] = O, a[6] = j) : j = a[6];
820
+ let M = j, N;
821
+ return a[7] !== C || a[8] !== w || a[9] !== A || a[10] !== d || a[11] !== u || a[12] !== M || a[13] !== s || a[14] !== f || a[15] !== o || a[16] !== l || a[17] !== g || a[18] !== y.data || a[19] !== y.formatter || a[20] !== y.labelFormatter || a[21] !== _ ? (N = /* @__PURE__ */ h(I, {
822
+ data: y.data,
823
+ formatter: y.formatter,
824
+ labelFormatter: y.labelFormatter,
825
+ selection: o,
826
+ onSelectionChange: s,
827
+ series: l,
828
+ maxItems: u,
829
+ labels: d,
830
+ onShowAll: f,
831
+ maxOverride: C,
832
+ minOverride: w,
833
+ size: g,
834
+ stacked: _,
835
+ hiddenSeries: A,
836
+ onHiddenSeriesChange: M
837
+ }), a[7] = C, a[8] = w, a[9] = A, a[10] = d, a[11] = u, a[12] = M, a[13] = s, a[14] = f, a[15] = o, a[16] = l, a[17] = g, a[18] = y.data, a[19] = y.formatter, a[20] = y.labelFormatter, a[21] = _, a[22] = N) : N = a[22], N;
838
+ }
839
+ function U(e) {
840
+ return e.categoryHiddenSeries;
841
+ }
842
+ //#endregion
843
+ //#region src/widgets/category/skeleton.tsx
844
+ var W = {
845
+ root: {
846
+ display: "flex",
847
+ flexDirection: "column",
848
+ gap: 1,
849
+ py: .5
850
+ },
851
+ row: {
852
+ display: "flex",
853
+ flexDirection: "column",
854
+ gap: .5
855
+ },
856
+ rowHeader: {
857
+ display: "flex",
858
+ justifyContent: "space-between",
859
+ alignItems: "center",
860
+ gap: 1
861
+ },
862
+ name: {
863
+ height: 14,
864
+ width: 80
865
+ },
866
+ value: {
867
+ height: 14,
868
+ width: 48
869
+ }
870
+ }, G = {
871
+ small: 4,
872
+ medium: 12
873
+ }, ee = [
874
+ "95%",
875
+ "80%",
876
+ "55%",
877
+ "75%",
878
+ "60%"
879
+ ];
880
+ function te(e) {
881
+ let t = c(5), { rows: n, size: r } = e, i = n === void 0 ? 5 : n, a = r === void 0 ? "small" : r, o;
882
+ t[0] === i ? o = t[1] : (o = Array.from({ length: i }), t[0] = i, t[1] = o);
883
+ let s;
884
+ return t[2] !== a || t[3] !== o ? (s = /* @__PURE__ */ h(d, {
885
+ sx: W.root,
886
+ children: o.map((e, t) => /* @__PURE__ */ g(d, {
887
+ sx: W.row,
888
+ children: [/* @__PURE__ */ g(d, {
889
+ sx: W.rowHeader,
890
+ children: [/* @__PURE__ */ h(f, {
891
+ variant: "rectangular",
892
+ sx: W.name
893
+ }), /* @__PURE__ */ h(f, {
894
+ variant: "rectangular",
895
+ sx: W.value
896
+ })]
897
+ }), /* @__PURE__ */ h(f, {
898
+ variant: "rectangular",
899
+ sx: {
900
+ height: G[a],
901
+ width: ee[t % ee.length]
902
+ }
903
+ })]
904
+ }, `row-${t}`))
905
+ }), t[2] = a, t[3] = o, t[4] = s) : s = t[4], s;
906
+ }
907
+ //#endregion
908
+ //#region src/widgets/category/download.ts
909
+ function K(e) {
910
+ return o(e, a({
911
+ filename: e.filename,
912
+ getRows: (t) => {
913
+ let n = e.getData(t), r = [[
914
+ "series",
915
+ "name",
916
+ "value"
917
+ ]];
918
+ for (let [t, i] of n.entries()) {
919
+ let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
920
+ for (let e of i) r.push([
921
+ n,
922
+ e.name,
923
+ e.value
924
+ ]);
925
+ }
926
+ return r;
927
+ }
928
+ }));
929
+ }
930
+ //#endregion
931
+ export { O as a, b as c, I as i, v as l, te as n, T as o, H as r, x as s, K as t };
932
+
933
+ //# sourceMappingURL=category-DULnoxvk.js.map