@carto/ps-react-ui 4.18.0 → 4.20.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.
@@ -0,0 +1,1186 @@
1
+ import { jsx as A, jsxs as q, Fragment as de } from "react/jsx-runtime";
2
+ import { c as B } from "react/compiler-runtime";
3
+ import { useRef as xe, useState as J, useEffect as re, useLayoutEffect as ze } from "react";
4
+ import { IconButton as U, InputAdornment as ge, TextField as we, useTheme as Oe, CircularProgress as Fe, MenuItem as _e, ListItemIcon as Pe, ListItemText as Ee, Menu as Le, Box as Re, Typography as $e, DialogTitle as Be, DialogContent as Me, Dialog as He, SvgIcon as Ne, ListSubheader as Ue } from "@mui/material";
5
+ import { Search as Ce, Clear as Ge, StackedBarChart as je, Close as Ie, ZoomIn as We, HighlightAlt as Ve, Percent as Ze, FileDownload as Ke, FullscreenExit as Xe, Fullscreen as Ye, LockOpen as qe, Lock as Je, DragIndicator as Qe } from "@mui/icons-material";
6
+ import { debounce as et } from "@carto/ps-utils";
7
+ import { u as j } from "./widget-context-DTGO0Yta.js";
8
+ import { v as ie, i as le, h as tt } from "./widget-store-registry-_W4Z4xp-.js";
9
+ import "zustand";
10
+ import "./lasso-tool-YLFRgb-S.js";
11
+ import "./cjs-D4KH3azB.js";
12
+ import { T as W } from "./tooltip-BDnrRKrp.js";
13
+ import { a as ae, u as lt, b as ot } from "./use-transform-DXPN3nY7.js";
14
+ import "zustand/vanilla";
15
+ import "zustand/middleware";
16
+ import "zustand/react/shallow";
17
+ import { c as nt } from "./transforms-Cdx4fkU5.js";
18
+ import { b as st } from "./exports-Cx-f6m6U.js";
19
+ import { createPortal as it } from "react-dom";
20
+ import { useSensors as rt, useSensor as ue, PointerSensor as at, KeyboardSensor as ct, DndContext as ft, closestCenter as dt } from "@dnd-kit/core";
21
+ import { useSortable as gt, sortableKeyboardCoordinates as ut, arrayMove as mt, SortableContext as ht, verticalListSortingStrategy as pt } from "@dnd-kit/sortable";
22
+ import { CSS as bt } from "@dnd-kit/utilities";
23
+ function St(t, e) {
24
+ if (!e) return t;
25
+ const l = e.toLowerCase();
26
+ return Array.isArray(t) ? t.map((a) => Array.isArray(a) ? a.filter((c) => {
27
+ if (c == null) return !1;
28
+ if (typeof c == "object" && "name" in c) {
29
+ const r = c.name;
30
+ return (r == null ? "" : me(r)).toLowerCase().includes(l);
31
+ }
32
+ return me(c).toLowerCase().includes(l);
33
+ }) : a) : t;
34
+ }
35
+ function me(t) {
36
+ return typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
37
+ }
38
+ const Te = {
39
+ toggle: "Search",
40
+ placeholder: "Search…",
41
+ clearAriaLabel: "Clear search",
42
+ noResults: "No matches."
43
+ }, fe = {
44
+ toggle: {
45
+ p: 0.5,
46
+ "& .MuiSvgIcon-root": {
47
+ fontSize: 20
48
+ }
49
+ },
50
+ toggleActive: {
51
+ background: (t) => t.palette.primary.relatedLight
52
+ },
53
+ input: {
54
+ width: "100%",
55
+ mb: 1
56
+ }
57
+ }, yt = {
58
+ id: "searcher",
59
+ type: "data",
60
+ order: 20,
61
+ disables: ["lock-selection"]
62
+ };
63
+ function Cl(t) {
64
+ const e = B(20), {
65
+ labels: l,
66
+ icon: a,
67
+ iconProps: c,
68
+ initialEnabled: r
69
+ } = t, m = a === void 0 ? Ce : a, v = r === void 0 ? !1 : r, y = j();
70
+ let b;
71
+ e[0] !== l ? (b = {
72
+ ...Te,
73
+ ...l
74
+ }, e[0] = l, e[1] = b) : b = e[1];
75
+ const i = b, n = ie(y, vt);
76
+ let p;
77
+ e[2] !== n ? (p = (x) => St(x, n), e[2] = n, e[3] = p) : p = e[3];
78
+ const _ = p;
79
+ let f;
80
+ e[4] !== v ? (f = {
81
+ initialEnabled: v
82
+ }, e[4] = v, e[5] = f) : f = e[5];
83
+ const {
84
+ enabled: S,
85
+ toggle: o
86
+ } = ae(y, yt, _, f), d = S && fe.toggleActive;
87
+ let h;
88
+ e[6] !== d ? (h = {
89
+ ...fe.toggle,
90
+ ...d
91
+ }, e[6] = d, e[7] = h) : h = e[7];
92
+ let s;
93
+ e[8] !== m || e[9] !== c ? (s = /* @__PURE__ */ A(m, { fontSize: "small", ...c }), e[8] = m, e[9] = c, e[10] = s) : s = e[10];
94
+ let g;
95
+ e[11] !== S || e[12] !== i.toggle || e[13] !== h || e[14] !== s || e[15] !== o ? (g = /* @__PURE__ */ A(U, { size: "small", "aria-label": i.toggle, "aria-pressed": S, onClick: o, sx: h, children: s }), e[11] = S, e[12] = i.toggle, e[13] = h, e[14] = s, e[15] = o, e[16] = g) : g = e[16];
96
+ let u;
97
+ return e[17] !== i.toggle || e[18] !== g ? (u = /* @__PURE__ */ A(W, { title: i.toggle, children: g }), e[17] = i.toggle, e[18] = g, e[19] = u) : u = e[19], u;
98
+ }
99
+ function vt(t) {
100
+ return t.transformStates.searcher?.searchText ?? "";
101
+ }
102
+ function he(t, e) {
103
+ le(t).setState((l) => ({
104
+ transformStates: {
105
+ ...l.transformStates,
106
+ searcher: {
107
+ enabled: l.transformStates.searcher?.enabled ?? !1,
108
+ ...l.transformStates.searcher,
109
+ searchText: e
110
+ }
111
+ }
112
+ }));
113
+ }
114
+ const At = 300;
115
+ function Il(t) {
116
+ const e = B(26), {
117
+ labels: l,
118
+ debounceMs: a
119
+ } = t, c = a === void 0 ? At : a, r = j();
120
+ let m;
121
+ e[0] !== l ? (m = {
122
+ ...Te,
123
+ ...l
124
+ }, e[0] = l, e[1] = m) : m = e[1];
125
+ const v = m, y = ie(r, xt), b = xe(null);
126
+ let i;
127
+ e[2] !== r ? (i = () => le(r).getState().transformStates.searcher?.searchText ?? "", e[2] = r, e[3] = i) : i = e[3];
128
+ const [n, p] = J(i);
129
+ let _;
130
+ e[4] !== r ? (_ = (E) => he(r, E), e[4] = r, e[5] = _) : _ = e[5];
131
+ let f;
132
+ e[6] !== c || e[7] !== _ ? (f = et(_, c), e[6] = c, e[7] = _, e[8] = f) : f = e[8];
133
+ const S = f;
134
+ let o;
135
+ e[9] !== S ? (o = (E) => {
136
+ const D = E.target.value;
137
+ p(D), S(D);
138
+ }, e[9] = S, e[10] = o) : o = e[10];
139
+ const d = o;
140
+ let h;
141
+ e[11] !== S || e[12] !== r ? (h = () => {
142
+ p(""), he(r, ""), S(""), b.current?.focus();
143
+ }, e[11] = S, e[12] = r, e[13] = h) : h = e[13];
144
+ const s = h;
145
+ if (!y)
146
+ return null;
147
+ let g;
148
+ e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ A(ge, { position: "start", children: /* @__PURE__ */ A(Ce, { fontSize: "small" }) }), e[14] = g) : g = e[14];
149
+ let u;
150
+ e[15] !== s || e[16] !== n || e[17] !== v.clearAriaLabel ? (u = n ? /* @__PURE__ */ A(ge, { position: "end", children: /* @__PURE__ */ A(U, { size: "small", edge: "end", "aria-label": v.clearAriaLabel, onClick: s, children: /* @__PURE__ */ A(Ge, { fontSize: "small" }) }) }) : null, e[15] = s, e[16] = n, e[17] = v.clearAriaLabel, e[18] = u) : u = e[18];
151
+ let x;
152
+ e[19] !== u ? (x = {
153
+ startAdornment: g,
154
+ endAdornment: u
155
+ }, e[19] = u, e[20] = x) : x = e[20];
156
+ let C;
157
+ return e[21] !== d || e[22] !== n || e[23] !== v.placeholder || e[24] !== x ? (C = /* @__PURE__ */ A(we, { inputRef: b, size: "small", fullWidth: !0, variant: "filled", placeholder: v.placeholder, value: n, onChange: d, autoFocus: !0, "aria-label": v.placeholder, sx: fe.input, InputProps: x }), e[21] = d, e[22] = n, e[23] = v.placeholder, e[24] = x, e[25] = C) : C = e[25], C;
158
+ }
159
+ function xt(t) {
160
+ return t.transformStates.searcher?.enabled ?? !1;
161
+ }
162
+ const _t = (t) => {
163
+ if (t == null || typeof t != "object") return t;
164
+ const e = t, l = Array.isArray(e.series) ? e.series : [], a = l.length === 0 ? [{
165
+ stack: "total"
166
+ }] : l.map((c) => c == null || typeof c != "object" ? c : {
167
+ ...c,
168
+ stack: "total"
169
+ });
170
+ return {
171
+ ...e,
172
+ series: a
173
+ };
174
+ }, Et = {
175
+ on: "Unstack series",
176
+ off: "Stack series"
177
+ }, pe = {
178
+ toggle: {
179
+ p: 0.5,
180
+ "& .MuiSvgIcon-root": {
181
+ fontSize: 20
182
+ }
183
+ },
184
+ toggleActive: {
185
+ background: (t) => t.palette.primary.relatedLight
186
+ }
187
+ }, Lt = {
188
+ id: "stack-toggle",
189
+ type: "config",
190
+ order: 30
191
+ };
192
+ function Tl(t) {
193
+ const e = B(18), {
194
+ initialEnabled: l,
195
+ labels: a,
196
+ icon: c,
197
+ iconProps: r
198
+ } = t, m = l === void 0 ? !1 : l, v = c === void 0 ? je : c, y = j();
199
+ let b;
200
+ e[0] !== a ? (b = {
201
+ ...Et,
202
+ ...a
203
+ }, e[0] = a, e[1] = b) : b = e[1];
204
+ const i = b;
205
+ let n;
206
+ e[2] !== m ? (n = {
207
+ initialEnabled: m
208
+ }, e[2] = m, e[3] = n) : n = e[3];
209
+ const {
210
+ enabled: p,
211
+ toggle: _
212
+ } = ae(y, Lt, _t, n), f = p ? i.on : i.off, S = p && pe.toggleActive;
213
+ let o;
214
+ e[4] !== S ? (o = {
215
+ ...pe.toggle,
216
+ ...S
217
+ }, e[4] = S, e[5] = o) : o = e[5];
218
+ let d;
219
+ e[6] !== v || e[7] !== r ? (d = /* @__PURE__ */ A(v, { fontSize: "small", ...r }), e[6] = v, e[7] = r, e[8] = d) : d = e[8];
220
+ let h;
221
+ e[9] !== p || e[10] !== o || e[11] !== d || e[12] !== _ || e[13] !== f ? (h = /* @__PURE__ */ A(U, { size: "small", "aria-label": f, "aria-pressed": p, onClick: _, sx: o, children: d }), e[9] = p, e[10] = o, e[11] = d, e[12] = _, e[13] = f, e[14] = h) : h = e[14];
222
+ let s;
223
+ return e[15] !== h || e[16] !== f ? (s = /* @__PURE__ */ A(W, { title: f, children: h }), e[15] = h, e[16] = f, e[17] = s) : s = e[17], s;
224
+ }
225
+ const Ct = {
226
+ toggle: "Show less"
227
+ }, It = {
228
+ toggle: {
229
+ p: 0.5,
230
+ "& .MuiSvgIcon-root": {
231
+ fontSize: 20
232
+ }
233
+ }
234
+ }, be = "show-all";
235
+ function kl(t) {
236
+ const e = B(14), {
237
+ labels: l,
238
+ icon: a,
239
+ iconProps: c
240
+ } = t, r = a === void 0 ? Ie : a, m = j();
241
+ let v;
242
+ e[0] !== l ? (v = {
243
+ ...Ct,
244
+ ...l
245
+ }, e[0] = l, e[1] = v) : v = e[1];
246
+ const y = v;
247
+ let b;
248
+ e[2] !== m ? (b = () => Tt(m, !1), e[2] = m, e[3] = b) : b = e[3];
249
+ let i;
250
+ e[4] !== r || e[5] !== c ? (i = /* @__PURE__ */ A(r, { fontSize: "small", ...c }), e[4] = r, e[5] = c, e[6] = i) : i = e[6];
251
+ let n;
252
+ e[7] !== y.toggle || e[8] !== b || e[9] !== i ? (n = /* @__PURE__ */ A(U, { size: "small", "aria-label": y.toggle, "aria-pressed": !0, onClick: b, sx: It.toggle, children: i }), e[7] = y.toggle, e[8] = b, e[9] = i, e[10] = n) : n = e[10];
253
+ let p;
254
+ return e[11] !== y.toggle || e[12] !== n ? (p = /* @__PURE__ */ A(W, { title: y.toggle, children: n }), e[11] = y.toggle, e[12] = n, e[13] = p) : p = e[13], p;
255
+ }
256
+ function Tt(t, e) {
257
+ le(t).setState((l) => ({
258
+ transformStates: {
259
+ ...l.transformStates,
260
+ [be]: {
261
+ ...l.transformStates[be],
262
+ enabled: e
263
+ }
264
+ }
265
+ }));
266
+ }
267
+ const kt = {
268
+ on: "Disable zoom",
269
+ off: "Enable zoom"
270
+ }, Se = {
271
+ toggle: {
272
+ p: 0.5,
273
+ "& .MuiSvgIcon-root": {
274
+ fontSize: 20
275
+ }
276
+ },
277
+ toggleActive: {
278
+ background: (t) => t.palette.primary.relatedLight
279
+ }
280
+ }, Dt = {
281
+ id: "zoom-toggle",
282
+ type: "config",
283
+ order: 20
284
+ };
285
+ function Dl(t) {
286
+ const e = B(31), {
287
+ initialEnabled: l,
288
+ labels: a,
289
+ icon: c,
290
+ iconProps: r,
291
+ axes: m
292
+ } = t, v = l === void 0 ? !1 : l, y = c === void 0 ? We : c, b = j(), i = Oe();
293
+ let n;
294
+ e[0] !== a ? (n = {
295
+ ...kt,
296
+ ...a
297
+ }, e[0] = a, e[1] = n) : n = e[1];
298
+ const p = n;
299
+ let _;
300
+ e[2] !== m ? (_ = m ? m.includes("x") : !0, e[2] = m, e[3] = _) : _ = e[3];
301
+ const f = _;
302
+ let S;
303
+ e[4] !== m ? (S = m ? m.includes("y") : !1, e[4] = m, e[5] = S) : S = e[5];
304
+ const o = S;
305
+ let d;
306
+ if (e[6] !== f || e[7] !== o || e[8] !== i) {
307
+ const w = [];
308
+ f && w.push("x"), o && w.push("y"), d = nt(i, {
309
+ axes: w
310
+ }), e[6] = f, e[7] = o, e[8] = i, e[9] = d;
311
+ } else
312
+ d = e[9];
313
+ const h = d;
314
+ let s;
315
+ e[10] !== v ? (s = {
316
+ initialEnabled: v
317
+ }, e[10] = v, e[11] = s) : s = e[11];
318
+ const {
319
+ enabled: g,
320
+ toggle: u
321
+ } = ae(b, Dt, h, s);
322
+ let x;
323
+ e[12] !== g || e[13] !== b || e[14] !== u ? (x = () => {
324
+ g && tt(b)?.setOption({}, {
325
+ replaceMerge: ["dataZoom"]
326
+ }), u();
327
+ }, e[12] = g, e[13] = b, e[14] = u, e[15] = x) : x = e[15];
328
+ const C = x, E = g ? p.on : p.off, D = g ? "active" : void 0, I = g && Se.toggleActive;
329
+ let z;
330
+ e[16] !== I ? (z = {
331
+ ...Se.toggle,
332
+ ...I
333
+ }, e[16] = I, e[17] = z) : z = e[17];
334
+ let L;
335
+ e[18] !== y || e[19] !== r ? (L = /* @__PURE__ */ A(y, { fontSize: "small", ...r }), e[18] = y, e[19] = r, e[20] = L) : L = e[20];
336
+ let T;
337
+ e[21] !== g || e[22] !== C || e[23] !== z || e[24] !== L || e[25] !== D || e[26] !== E ? (T = /* @__PURE__ */ A(U, { size: "small", "aria-label": E, "aria-pressed": g, onClick: C, className: D, sx: z, children: L }), e[21] = g, e[22] = C, e[23] = z, e[24] = L, e[25] = D, e[26] = E, e[27] = T) : T = e[27];
338
+ let k;
339
+ return e[28] !== T || e[29] !== E ? (k = /* @__PURE__ */ A(W, { title: E, children: T }), e[28] = T, e[29] = E, e[30] = k) : k = e[30], k;
340
+ }
341
+ const zt = (t) => {
342
+ if (t == null || typeof t != "object") return t;
343
+ const e = t;
344
+ return {
345
+ ...e,
346
+ brush: {
347
+ toolbox: ["rect", "clear"],
348
+ xAxisIndex: "all",
349
+ brushLink: "all",
350
+ outOfBrush: {
351
+ colorAlpha: 0.15
352
+ }
353
+ },
354
+ toolbox: {
355
+ ...e.toolbox ?? {},
356
+ show: !1,
357
+ feature: {
358
+ ...e.toolbox?.feature ?? {},
359
+ brush: {
360
+ type: ["rect", "clear"]
361
+ }
362
+ }
363
+ }
364
+ };
365
+ }, wt = {
366
+ on: "Disable brush selection",
367
+ off: "Enable brush selection"
368
+ }, ye = {
369
+ toggle: {
370
+ p: 0.5,
371
+ "& .MuiSvgIcon-root": {
372
+ fontSize: 20
373
+ }
374
+ },
375
+ toggleActive: {
376
+ background: (t) => t.palette.primary.relatedLight
377
+ }
378
+ }, Ot = {
379
+ id: "brush-toggle",
380
+ type: "config",
381
+ order: 25
382
+ };
383
+ function zl(t) {
384
+ const e = B(33), {
385
+ initialEnabled: l,
386
+ brushType: a,
387
+ brushMode: c,
388
+ selection: r,
389
+ labels: m,
390
+ icon: v,
391
+ iconProps: y
392
+ } = t, b = l === void 0 ? !1 : l, i = a === void 0 ? "lineX" : a, n = c === void 0 ? "multiple" : c, p = v === void 0 ? Ve : v, _ = j();
393
+ let f;
394
+ e[0] !== m ? (f = {
395
+ ...wt,
396
+ ...m
397
+ }, e[0] = m, e[1] = f) : f = e[1];
398
+ const S = f;
399
+ let o;
400
+ e[2] !== b ? (o = {
401
+ initialEnabled: b
402
+ }, e[2] = b, e[3] = o) : o = e[3];
403
+ const {
404
+ enabled: d,
405
+ toggle: h
406
+ } = ae(_, Ot, zt, o), s = lt(_);
407
+ let g, u;
408
+ e[4] !== n || e[5] !== i || e[6] !== s || e[7] !== d ? (g = () => {
409
+ if (!s)
410
+ return;
411
+ if (!d) {
412
+ s.dispatchAction({
413
+ type: "takeGlobalCursor"
414
+ }), s.dispatchAction({
415
+ type: "brush",
416
+ areas: []
417
+ });
418
+ return;
419
+ }
420
+ const w = () => {
421
+ s.dispatchAction({
422
+ type: "takeGlobalCursor",
423
+ key: "brush",
424
+ brushOption: {
425
+ brushType: i,
426
+ brushMode: n
427
+ }
428
+ });
429
+ }, O = () => w();
430
+ return s.on("finished", O), w(), () => {
431
+ s.off("finished", O);
432
+ };
433
+ }, u = [s, d, i, n], e[4] = n, e[5] = i, e[6] = s, e[7] = d, e[8] = g, e[9] = u) : (g = e[8], u = e[9]), re(g, u);
434
+ let x;
435
+ e[10] !== s || e[11] !== d || e[12] !== r?.length ? (x = () => {
436
+ !s || !d || r?.length === 0 && s.dispatchAction({
437
+ type: "brush",
438
+ areas: []
439
+ });
440
+ }, e[10] = s, e[11] = d, e[12] = r?.length, e[13] = x) : x = e[13];
441
+ let C;
442
+ e[14] !== s || e[15] !== d || e[16] !== r ? (C = [s, d, r], e[14] = s, e[15] = d, e[16] = r, e[17] = C) : C = e[17], re(x, C);
443
+ const E = d ? S.on : S.off, D = d ? "active" : void 0, I = d && ye.toggleActive;
444
+ let z;
445
+ e[18] !== I ? (z = {
446
+ ...ye.toggle,
447
+ ...I
448
+ }, e[18] = I, e[19] = z) : z = e[19];
449
+ let L;
450
+ e[20] !== p || e[21] !== y ? (L = /* @__PURE__ */ A(p, { fontSize: "small", ...y }), e[20] = p, e[21] = y, e[22] = L) : L = e[22];
451
+ let T;
452
+ e[23] !== d || e[24] !== D || e[25] !== z || e[26] !== L || e[27] !== h || e[28] !== E ? (T = /* @__PURE__ */ A(U, { size: "small", "aria-label": E, "aria-pressed": d, onClick: h, className: D, sx: z, children: L }), e[23] = d, e[24] = D, e[25] = z, e[26] = L, e[27] = h, e[28] = E, e[29] = T) : T = e[29];
453
+ let k;
454
+ return e[30] !== T || e[31] !== E ? (k = /* @__PURE__ */ A(W, { title: E, children: T }), e[30] = T, e[31] = E, e[32] = k) : k = e[32], k;
455
+ }
456
+ function Ft(t) {
457
+ return Array.isArray(t) ? t.every((e) => e != null && typeof e == "object" && "value" in e && typeof e.value == "number") : !1;
458
+ }
459
+ const Pt = (t) => Array.isArray(t) ? t.map((e) => {
460
+ if (!Ft(e)) return e;
461
+ const l = e.reduce((a, c) => a + Math.abs(c.value), 0);
462
+ return l <= 0 ? e : e.map((a) => ({
463
+ ...a,
464
+ value: a.value / l * 100
465
+ }));
466
+ }) : t;
467
+ function Rt(t) {
468
+ const e = new Intl.NumberFormat(t, {
469
+ style: "percent",
470
+ minimumFractionDigits: 0,
471
+ maximumFractionDigits: 2
472
+ });
473
+ return (l) => typeof l != "number" || !Number.isFinite(l) ? String(l) : e.format(l / 100);
474
+ }
475
+ const $t = {
476
+ on: "Show absolute values",
477
+ off: "Show relative values"
478
+ }, ve = {
479
+ toggle: {
480
+ p: 0.5,
481
+ "& .MuiSvgIcon-root": {
482
+ fontSize: 20
483
+ }
484
+ },
485
+ toggleActive: {
486
+ background: (t) => t.palette.primary.relatedLight
487
+ }
488
+ }, Bt = {
489
+ id: "relative-data",
490
+ type: "data",
491
+ order: 15
492
+ };
493
+ function wl(t) {
494
+ const e = B(26), {
495
+ initialEnabled: l,
496
+ locale: a,
497
+ labels: c,
498
+ icon: r,
499
+ iconProps: m,
500
+ transform: v
501
+ } = t, y = l === void 0 ? !1 : l, b = r === void 0 ? Ze : r, i = j();
502
+ let n;
503
+ e[0] !== c ? (n = {
504
+ ...$t,
505
+ ...c
506
+ }, e[0] = c, e[1] = n) : n = e[1];
507
+ const p = n;
508
+ let _;
509
+ e[2] !== y ? (_ = {
510
+ initialEnabled: y
511
+ }, e[2] = y, e[3] = _) : _ = e[3];
512
+ const {
513
+ enabled: f,
514
+ toggle: S
515
+ } = ae(i, Bt, v ?? Pt, _);
516
+ let o;
517
+ e[4] !== a ? (o = Rt(a), e[4] = a, e[5] = o) : o = e[5];
518
+ const d = o, h = ie(i, Mt);
519
+ let s, g;
520
+ e[6] !== f || e[7] !== i || e[8] !== d || e[9] !== h ? (s = () => {
521
+ le(i).setState({
522
+ formatter: f ? d : h
523
+ });
524
+ }, g = [i, f, d, h], e[6] = f, e[7] = i, e[8] = d, e[9] = h, e[10] = s, e[11] = g) : (s = e[10], g = e[11]), re(s, g);
525
+ const u = f ? p.on : p.off, x = f && ve.toggleActive;
526
+ let C;
527
+ e[12] !== x ? (C = {
528
+ ...ve.toggle,
529
+ ...x
530
+ }, e[12] = x, e[13] = C) : C = e[13];
531
+ let E;
532
+ e[14] !== b || e[15] !== m ? (E = /* @__PURE__ */ A(b, { fontSize: "small", ...m }), e[14] = b, e[15] = m, e[16] = E) : E = e[16];
533
+ let D;
534
+ e[17] !== f || e[18] !== E || e[19] !== C || e[20] !== S || e[21] !== u ? (D = /* @__PURE__ */ A(U, { size: "small", "aria-label": u, "aria-pressed": f, onClick: S, sx: C, children: E }), e[17] = f, e[18] = E, e[19] = C, e[20] = S, e[21] = u, e[22] = D) : D = e[22];
535
+ let I;
536
+ return e[23] !== D || e[24] !== u ? (I = /* @__PURE__ */ A(W, { title: u, children: D }), e[23] = D, e[24] = u, e[25] = I) : I = e[25], I;
537
+ }
538
+ function Mt(t) {
539
+ return t.rawFormatter;
540
+ }
541
+ const Ht = {
542
+ trigger: "Download",
543
+ loading: "Downloading…",
544
+ error: "Download failed"
545
+ };
546
+ function Ol(t) {
547
+ const e = B(36), {
548
+ items: l,
549
+ labels: a,
550
+ icon: c,
551
+ iconProps: r,
552
+ onError: m
553
+ } = t, v = c === void 0 ? Ke : c;
554
+ let y;
555
+ e[0] !== a ? (y = {
556
+ ...Ht,
557
+ ...a
558
+ }, e[0] = a, e[1] = y) : y = e[1];
559
+ const b = y, [i, n] = J(null), [p, _] = J(!1), [f, S] = J(null);
560
+ let o;
561
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = ($) => {
562
+ S(null), n($.currentTarget);
563
+ }, e[2] = o) : o = e[2];
564
+ const d = o;
565
+ let h;
566
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => n(null), e[3] = h) : h = e[3];
567
+ const s = h;
568
+ let g;
569
+ e[4] !== p || e[5] !== m ? (g = ($) => {
570
+ $.disabled || p || (s(), _(!0), S(null), $.resolve().then((R) => {
571
+ const {
572
+ url: G,
573
+ filename: X,
574
+ revoke: K
575
+ } = R;
576
+ st({
577
+ url: G,
578
+ filename: $.filename ?? X
579
+ }), K && setTimeout(K, 0);
580
+ }).catch((R) => {
581
+ const G = R instanceof Error ? R : new Error(String(R));
582
+ S(G), m?.(G);
583
+ }).finally(() => {
584
+ _(!1);
585
+ }));
586
+ }, e[4] = p, e[5] = m, e[6] = g) : g = e[6];
587
+ const u = g, x = p ? b.loading : f ? b.error : b.trigger, C = !!i || p, E = i ? "true" : void 0, D = p || void 0, I = f ? "true" : void 0, z = p || l.length === 0, L = C ? "active" : void 0;
588
+ let T;
589
+ e[7] !== v || e[8] !== r || e[9] !== p ? (T = p ? /* @__PURE__ */ A(Fe, { size: 18, color: "inherit" }) : /* @__PURE__ */ A(v, { fontSize: "small", ...r }), e[7] = v, e[8] = r, e[9] = p, e[10] = T) : T = e[10];
590
+ let k;
591
+ e[11] !== L || e[12] !== T || e[13] !== E || e[14] !== D || e[15] !== I || e[16] !== z || e[17] !== x ? (k = /* @__PURE__ */ A(U, { size: "small", "aria-label": x, "aria-haspopup": "true", "aria-expanded": E, "aria-busy": D, "data-error": I, disabled: z, onClick: d, className: L, children: T }), e[11] = L, e[12] = T, e[13] = E, e[14] = D, e[15] = I, e[16] = z, e[17] = x, e[18] = k) : k = e[18];
592
+ let w;
593
+ e[19] !== k || e[20] !== x ? (w = /* @__PURE__ */ A(W, { title: x, children: k }), e[19] = k, e[20] = x, e[21] = w) : w = e[21];
594
+ const O = !!i;
595
+ let F, P;
596
+ e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = {
597
+ vertical: "bottom",
598
+ horizontal: "right"
599
+ }, P = {
600
+ vertical: "top",
601
+ horizontal: "right"
602
+ }, e[22] = F, e[23] = P) : (F = e[22], P = e[23]);
603
+ let H;
604
+ if (e[24] !== l || e[25] !== u) {
605
+ let $;
606
+ e[27] !== u ? ($ = (R) => /* @__PURE__ */ q(_e, { disabled: R.disabled, onClick: () => {
607
+ u(R);
608
+ }, children: [
609
+ R.icon && /* @__PURE__ */ A(Pe, { sx: {
610
+ color: "text.primary"
611
+ }, children: R.icon }),
612
+ /* @__PURE__ */ A(Ee, { children: R.label })
613
+ ] }, R.id), e[27] = u, e[28] = $) : $ = e[28], H = l.map($), e[24] = l, e[25] = u, e[26] = H;
614
+ } else
615
+ H = e[26];
616
+ let N;
617
+ e[29] !== i || e[30] !== O || e[31] !== H ? (N = /* @__PURE__ */ A(Le, { anchorEl: i, open: O, onClose: s, variant: "menu", elevation: 8, anchorOrigin: F, transformOrigin: P, children: H }), e[29] = i, e[30] = O, e[31] = H, e[32] = N) : N = e[32];
618
+ let Z;
619
+ return e[33] !== w || e[34] !== N ? (Z = /* @__PURE__ */ q(de, { children: [
620
+ w,
621
+ N
622
+ ] }), e[33] = w, e[34] = N, e[35] = Z) : Z = e[35], Z;
623
+ }
624
+ const ke = {
625
+ open: "Open in full screen",
626
+ close: "Exit full screen"
627
+ }, te = {
628
+ // Inline shell where the portaled body lives when fullscreen is closed.
629
+ // Real flex-column box (not `display: contents`) so that:
630
+ // 1. when the body is moved into the modal, we can pin a `min-height`
631
+ // to keep the widget card from collapsing — the inline shell is
632
+ // empty for that interval, and a layout-less wrapper would make
633
+ // the card squish a frame before the modal covers it (visible
634
+ // blink).
635
+ // 2. nested `flex: 1` (e.g. Widget.State's CaptureBox) still grows —
636
+ // this shell preserves the column-flex inheritance it would have
637
+ // had directly under `Widget.Content`.
638
+ // `gap: 1` mirrors `Widget.Content`'s gap so the body's siblings
639
+ // (Subheader / capture box / note) keep their spacing.
640
+ inlineSlot: {
641
+ display: "flex",
642
+ flexDirection: "column",
643
+ flex: 1,
644
+ minHeight: 0,
645
+ gap: 1
646
+ },
647
+ trigger: {
648
+ p: 0.5,
649
+ "& .MuiSvgIcon-root": {
650
+ fontSize: 20
651
+ }
652
+ },
653
+ triggerActive: {
654
+ background: (t) => t.palette.primary.relatedLight
655
+ },
656
+ dialogPaper: {
657
+ width: "90vw",
658
+ height: "90vh",
659
+ maxWidth: "none",
660
+ maxHeight: "none"
661
+ },
662
+ dialogTitle: {
663
+ display: "flex",
664
+ alignItems: "center",
665
+ justifyContent: "space-between",
666
+ gap: 1,
667
+ py: 3,
668
+ pr: 3,
669
+ pb: 2
670
+ },
671
+ titleText: {
672
+ minWidth: 0,
673
+ overflow: "hidden",
674
+ textOverflow: "ellipsis",
675
+ whiteSpace: "nowrap"
676
+ },
677
+ dialogContent: {
678
+ display: "flex",
679
+ flexDirection: "column",
680
+ gap: 1,
681
+ py: 3,
682
+ px: 2.5,
683
+ overflow: "auto"
684
+ }
685
+ };
686
+ function Nt(t) {
687
+ const e = B(20), {
688
+ labels: l,
689
+ enterIcon: a,
690
+ exitIcon: c,
691
+ iconProps: r
692
+ } = t, m = a === void 0 ? Ye : a, v = c === void 0 ? Xe : c, y = j();
693
+ let b;
694
+ e[0] !== l ? (b = {
695
+ ...ke,
696
+ ...l
697
+ }, e[0] = l, e[1] = b) : b = e[1];
698
+ const i = b, n = ie(y, Ut);
699
+ let p;
700
+ e[2] !== y || e[3] !== n ? (p = () => {
701
+ le(y).setState({
702
+ isFullScreen: !n
703
+ });
704
+ }, e[2] = y, e[3] = n, e[4] = p) : p = e[4];
705
+ const _ = p, f = n ? i.close : i.open, S = n ? v : m, o = n ? "active" : void 0, d = n && te.triggerActive;
706
+ let h;
707
+ e[5] !== d ? (h = {
708
+ ...te.trigger,
709
+ ...d
710
+ }, e[5] = d, e[6] = h) : h = e[6];
711
+ let s;
712
+ e[7] !== S || e[8] !== r ? (s = /* @__PURE__ */ A(S, { fontSize: "small", ...r }), e[7] = S, e[8] = r, e[9] = s) : s = e[9];
713
+ let g;
714
+ e[10] !== _ || e[11] !== n || e[12] !== o || e[13] !== h || e[14] !== s || e[15] !== f ? (g = /* @__PURE__ */ A(U, { size: "small", "aria-label": f, "aria-pressed": n, onClick: _, className: o, sx: h, children: s }), e[10] = _, e[11] = n, e[12] = o, e[13] = h, e[14] = s, e[15] = f, e[16] = g) : g = e[16];
715
+ let u;
716
+ return e[17] !== g || e[18] !== f ? (u = /* @__PURE__ */ A(W, { title: f, children: g }), e[17] = g, e[18] = f, e[19] = u) : u = e[19], u;
717
+ }
718
+ function Ut(t) {
719
+ return t.isFullScreen ?? !1;
720
+ }
721
+ function Gt(t) {
722
+ const e = B(44), {
723
+ children: l,
724
+ title: a,
725
+ labels: c,
726
+ closeIcon: r,
727
+ iconProps: m
728
+ } = t, v = r === void 0 ? Ie : r, y = j();
729
+ let b;
730
+ e[0] !== c ? (b = {
731
+ ...ke,
732
+ ...c
733
+ }, e[0] = c, e[1] = b) : b = e[1];
734
+ const i = b, n = ie(y, Vt), [p, _] = J(null), [f, S] = J(null), [o] = J(Wt);
735
+ let d;
736
+ e[2] !== y ? (d = () => {
737
+ le(y).setState({
738
+ isFullScreen: !1
739
+ });
740
+ }, e[2] = y, e[3] = d) : d = e[3];
741
+ const h = d;
742
+ let s, g;
743
+ e[4] !== f || e[5] !== p || e[6] !== n || e[7] !== o ? (s = () => {
744
+ if (!o || !p)
745
+ return;
746
+ const P = n ? f : p;
747
+ P && o.parentNode !== P && P.appendChild(o), n || Zt(p);
748
+ }, g = [n, p, f, o], e[4] = f, e[5] = p, e[6] = n, e[7] = o, e[8] = s, e[9] = g) : (s = e[8], g = e[9]), ze(s, g);
749
+ const u = `widget-fullscreen-title-${y}`;
750
+ let x, C;
751
+ if (e[10] !== l || e[11] !== n || e[12] !== o) {
752
+ const P = l(n);
753
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ A(Re, { ref: _, sx: te.inlineSlot }), e[15] = x) : x = e[15], C = o ? it(P, o) : null, e[10] = l, e[11] = n, e[12] = o, e[13] = x, e[14] = C;
754
+ } else
755
+ x = e[13], C = e[14];
756
+ let E;
757
+ e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
758
+ sx: te.dialogPaper
759
+ }, e[16] = E) : E = e[16];
760
+ let D;
761
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = {
762
+ zIndex: jt
763
+ }, e[17] = D) : D = e[17];
764
+ let I;
765
+ e[18] !== a ? (I = /* @__PURE__ */ A($e, { variant: "subtitle1", component: "span", sx: te.titleText, children: a }), e[18] = a, e[19] = I) : I = e[19];
766
+ let z;
767
+ e[20] !== v || e[21] !== m ? (z = /* @__PURE__ */ A(v, { fontSize: "small", ...m }), e[20] = v, e[21] = m, e[22] = z) : z = e[22];
768
+ let L;
769
+ e[23] !== i.close || e[24] !== h || e[25] !== z ? (L = /* @__PURE__ */ A(U, { size: "medium", "aria-label": i.close, onClick: h, children: z }), e[23] = i.close, e[24] = h, e[25] = z, e[26] = L) : L = e[26];
770
+ let T;
771
+ e[27] !== i.close || e[28] !== L ? (T = /* @__PURE__ */ A(W, { title: i.close, children: L }), e[27] = i.close, e[28] = L, e[29] = T) : T = e[29];
772
+ let k;
773
+ e[30] !== I || e[31] !== T || e[32] !== u ? (k = /* @__PURE__ */ q(Be, { id: u, component: "div", sx: te.dialogTitle, children: [
774
+ I,
775
+ T
776
+ ] }), e[30] = I, e[31] = T, e[32] = u, e[33] = k) : k = e[33];
777
+ let w;
778
+ e[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ A(Me, { ref: S, sx: te.dialogContent }), e[34] = w) : w = e[34];
779
+ let O;
780
+ e[35] !== h || e[36] !== n || e[37] !== k || e[38] !== u ? (O = /* @__PURE__ */ q(He, { open: n, onClose: h, PaperProps: E, "aria-labelledby": u, sx: D, children: [
781
+ k,
782
+ w
783
+ ] }), e[35] = h, e[36] = n, e[37] = k, e[38] = u, e[39] = O) : O = e[39];
784
+ let F;
785
+ return e[40] !== O || e[41] !== x || e[42] !== C ? (F = /* @__PURE__ */ q(de, { children: [
786
+ x,
787
+ C,
788
+ O
789
+ ] }), e[40] = O, e[41] = x, e[42] = C, e[43] = F) : F = e[43], F;
790
+ }
791
+ function jt(t) {
792
+ return t.zIndex.tooltip + 1;
793
+ }
794
+ function Wt() {
795
+ if (typeof document > "u")
796
+ return null;
797
+ const t = document.createElement("div");
798
+ return t.style.display = "contents", t;
799
+ }
800
+ function Vt(t) {
801
+ return t.isFullScreen ?? !1;
802
+ }
803
+ function Zt(t) {
804
+ t.style.minHeight = "";
805
+ const e = t.getBoundingClientRect().height;
806
+ e > 0 && (t.style.minHeight = `${e}px`);
807
+ }
808
+ const Fl = {
809
+ Trigger: Nt,
810
+ Slot: Gt
811
+ };
812
+ function Kt(t, e) {
813
+ if (e.length === 0 || !Array.isArray(t)) return t;
814
+ const l = new Set(e);
815
+ return t.map((a) => Array.isArray(a) ? a.filter((c) => {
816
+ if (c == null) return !1;
817
+ if (typeof c == "object" && "name" in c) {
818
+ const r = c.name;
819
+ return typeof r == "string" || typeof r == "number" ? l.has(r) : !1;
820
+ }
821
+ return !1;
822
+ }) : a);
823
+ }
824
+ const Xt = {
825
+ lock: "Lock selection",
826
+ unlock: "Unlock selection",
827
+ disabled: "Select rows to lock"
828
+ }, Ae = {
829
+ toggle: {
830
+ p: 0.5,
831
+ "& .MuiSvgIcon-root": {
832
+ fontSize: 20
833
+ }
834
+ },
835
+ toggleActive: {
836
+ background: (t) => t.palette.primary.relatedLight
837
+ }
838
+ }, Yt = {
839
+ id: "lock-selection",
840
+ type: "data",
841
+ order: 30
842
+ };
843
+ function Pl(t) {
844
+ const e = B(28), {
845
+ selection: l,
846
+ lockedItems: a,
847
+ onLockChange: c,
848
+ labels: r,
849
+ lockIcon: m,
850
+ unlockIcon: v,
851
+ iconProps: y,
852
+ filterFn: b
853
+ } = t, i = m === void 0 ? Je : m, n = v === void 0 ? qe : v, p = b === void 0 ? Kt : b, _ = j();
854
+ let f;
855
+ e[0] !== r ? (f = {
856
+ ...Xt,
857
+ ...r
858
+ }, e[0] = r, e[1] = f) : f = e[1];
859
+ const S = f, o = a.length > 0, d = o || l.length > 0, h = qt(a, p);
860
+ let s;
861
+ e[2] !== o ? (s = {
862
+ initialEnabled: o
863
+ }, e[2] = o, e[3] = s) : s = e[3];
864
+ const {
865
+ enabled: g,
866
+ setEnabled: u
867
+ } = ot(_, h, s);
868
+ let x, C;
869
+ e[4] !== g || e[5] !== o || e[6] !== u ? (x = () => {
870
+ g !== o && u(o);
871
+ }, C = [g, o, u], e[4] = g, e[5] = o, e[6] = u, e[7] = x, e[8] = C) : (x = e[7], C = e[8]), re(x, C);
872
+ let E;
873
+ e[9] !== o || e[10] !== c || e[11] !== l ? (E = () => {
874
+ c(o ? [] : [...l]);
875
+ }, e[9] = o, e[10] = c, e[11] = l, e[12] = E) : E = e[12];
876
+ const D = E, I = d ? o ? S.unlock : S.lock : S.disabled, z = o ? n : i, L = !d, T = o && Ae.toggleActive;
877
+ let k;
878
+ e[13] !== T ? (k = {
879
+ ...Ae.toggle,
880
+ ...T
881
+ }, e[13] = T, e[14] = k) : k = e[14];
882
+ let w;
883
+ e[15] !== z || e[16] !== y ? (w = /* @__PURE__ */ A(z, { fontSize: "small", ...y }), e[15] = z, e[16] = y, e[17] = w) : w = e[17];
884
+ let O;
885
+ e[18] !== D || e[19] !== o || e[20] !== k || e[21] !== w || e[22] !== L || e[23] !== I ? (O = /* @__PURE__ */ A("span", { children: /* @__PURE__ */ A(U, { size: "small", "aria-label": I, "aria-pressed": o, disabled: L, onClick: D, sx: k, children: w }) }), e[18] = D, e[19] = o, e[20] = k, e[21] = w, e[22] = L, e[23] = I, e[24] = O) : O = e[24];
886
+ let F;
887
+ return e[25] !== O || e[26] !== I ? (F = /* @__PURE__ */ A(W, { title: I, children: O }), e[25] = O, e[26] = I, e[27] = F) : F = e[27], F;
888
+ }
889
+ function qt(t, e) {
890
+ const l = B(6), a = xe(e);
891
+ let c;
892
+ l[0] !== e ? (c = () => {
893
+ a.current = e;
894
+ }, l[0] = e, l[1] = c) : c = l[1], re(c);
895
+ let r;
896
+ l[2] !== t ? (r = (y) => a.current(y, t), l[2] = t, l[3] = r) : r = l[3];
897
+ const m = r;
898
+ let v;
899
+ return l[4] !== m ? (v = [{
900
+ descriptor: Yt,
901
+ fn: m
902
+ }], l[4] = m, l[5] = v) : v = l[5], v;
903
+ }
904
+ function Jt(t) {
905
+ const e = B(3);
906
+ let l;
907
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ A("path", { fill: "currentColor", fillRule: "evenodd", d: "M14.25 2.25H3.75c-.825 0-1.5.675-1.5 1.5v10.5c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5V3.75c0-.825-.675-1.5-1.5-1.5m-3.75 12h-3V3.75h3zM3.75 3.75H6v10.5H3.75zM12 14.25V3.75h2.25v10.5z", clipRule: "evenodd" }), e[0] = l) : l = e[0];
908
+ let a;
909
+ return e[1] !== t ? (a = /* @__PURE__ */ A(Ne, { viewBox: "0 0 18 18", ...t, children: l }), e[1] = t, e[2] = a) : a = e[2], a;
910
+ }
911
+ const Qt = {
912
+ trigger: "Change column order",
913
+ title: "Column reorder",
914
+ reset: "Reset to default"
915
+ }, Y = {
916
+ toggle: {
917
+ p: 0.5,
918
+ "& .MuiSvgIcon-root": {
919
+ fontSize: 20
920
+ }
921
+ },
922
+ toggleActive: {
923
+ background: (t) => t.palette.primary.relatedLight
924
+ },
925
+ menuPaper: {
926
+ overflow: "hidden"
927
+ },
928
+ header: {
929
+ color: "text.secondary",
930
+ backgroundColor: "transparent",
931
+ typography: "caption",
932
+ px: 2,
933
+ py: 0.75
934
+ },
935
+ item: {
936
+ position: "relative",
937
+ cursor: "grab",
938
+ px: 2,
939
+ touchAction: "none",
940
+ "&:hover .change-column-drag-handle": {
941
+ opacity: 1
942
+ },
943
+ "&:focus-visible": {
944
+ outline: "2px solid",
945
+ outlineColor: "primary.main",
946
+ outlineOffset: -2
947
+ },
948
+ "&:focus-visible .change-column-drag-handle": {
949
+ opacity: 1
950
+ }
951
+ },
952
+ itemDragging: {
953
+ opacity: 0.5,
954
+ cursor: "grabbing"
955
+ },
956
+ dragHandle: {
957
+ position: "absolute",
958
+ left: 0,
959
+ top: "50%",
960
+ transform: "translateY(-50%)",
961
+ color: "text.secondary",
962
+ fontSize: 18,
963
+ opacity: 0,
964
+ transition: "opacity 0.1s",
965
+ "@media (hover: none)": {
966
+ opacity: 1
967
+ }
968
+ },
969
+ dragHandleVisible: {
970
+ opacity: 1
971
+ }
972
+ };
973
+ function el(t) {
974
+ const e = B(24), {
975
+ id: l,
976
+ label: a,
977
+ dragHandleIcon: c
978
+ } = t, r = c === void 0 ? Qe : c;
979
+ let m;
980
+ e[0] !== l ? (m = {
981
+ id: l
982
+ }, e[0] = l, e[1] = m) : m = e[1];
983
+ const {
984
+ attributes: v,
985
+ listeners: y,
986
+ setNodeRef: b,
987
+ transform: i,
988
+ transition: n,
989
+ isDragging: p
990
+ } = gt(m);
991
+ let _;
992
+ e[2] !== i ? (_ = bt.Transform.toString(i ? {
993
+ ...i,
994
+ x: 0
995
+ } : null), e[2] = i, e[3] = _) : _ = e[3];
996
+ let f;
997
+ e[4] !== _ || e[5] !== n ? (f = {
998
+ transform: _,
999
+ transition: n
1000
+ }, e[4] = _, e[5] = n, e[6] = f) : f = e[6];
1001
+ const S = f, o = p && Y.itemDragging;
1002
+ let d;
1003
+ e[7] !== o ? (d = {
1004
+ ...Y.item,
1005
+ ...o
1006
+ }, e[7] = o, e[8] = d) : d = e[8];
1007
+ const h = p && Y.dragHandleVisible;
1008
+ let s;
1009
+ e[9] !== h ? (s = {
1010
+ ...Y.dragHandle,
1011
+ ...h
1012
+ }, e[9] = h, e[10] = s) : s = e[10];
1013
+ let g;
1014
+ e[11] !== r || e[12] !== s ? (g = /* @__PURE__ */ A(r, { className: "change-column-drag-handle", sx: s }), e[11] = r, e[12] = s, e[13] = g) : g = e[13];
1015
+ let u;
1016
+ e[14] !== a ? (u = /* @__PURE__ */ A(Ee, { children: a }), e[14] = a, e[15] = u) : u = e[15];
1017
+ let x;
1018
+ return e[16] !== v || e[17] !== y || e[18] !== b || e[19] !== u || e[20] !== d || e[21] !== g || e[22] !== S ? (x = /* @__PURE__ */ q(_e, { ref: b, style: S, ...v, ...y, disableGutters: !0, role: "menuitem", tabIndex: 0, sx: d, children: [
1019
+ g,
1020
+ u
1021
+ ] }), e[16] = v, e[17] = y, e[18] = b, e[19] = u, e[20] = d, e[21] = g, e[22] = S, e[23] = x) : x = e[23], x;
1022
+ }
1023
+ function Rl(t) {
1024
+ const e = B(55), {
1025
+ columns: l,
1026
+ labels: a,
1027
+ icon: c,
1028
+ iconProps: r,
1029
+ dragHandleIcon: m
1030
+ } = t, v = c === void 0 ? Jt : c, y = j();
1031
+ let b;
1032
+ e[0] !== a ? (b = {
1033
+ ...Qt,
1034
+ ...a
1035
+ }, e[0] = a, e[1] = b) : b = e[1];
1036
+ const i = b, [n, p] = J(null), _ = ie(y, ol);
1037
+ let f;
1038
+ if (e[2] !== _ || e[3] !== l) {
1039
+ e: {
1040
+ const M = l.map(ll);
1041
+ if (!_ || _.length === 0) {
1042
+ f = M;
1043
+ break e;
1044
+ }
1045
+ const Q = new Set(M), ee = /* @__PURE__ */ new Set(), se = [];
1046
+ for (const V of _)
1047
+ Q.has(V) && !ee.has(V) && (se.push(V), ee.add(V));
1048
+ for (const V of M)
1049
+ ee.has(V) || se.push(V);
1050
+ f = se;
1051
+ }
1052
+ e[2] = _, e[3] = l, e[4] = f;
1053
+ } else
1054
+ f = e[4];
1055
+ const S = f;
1056
+ let o;
1057
+ e[5] !== l ? (o = new Map(l.map(tl)), e[5] = l, e[6] = o) : o = e[6];
1058
+ const d = o;
1059
+ let h;
1060
+ if (e[7] !== d || e[8] !== S) {
1061
+ h = [];
1062
+ for (const M of S) {
1063
+ const Q = d.get(M);
1064
+ Q != null && h.push(Q);
1065
+ }
1066
+ e[7] = d, e[8] = S, e[9] = h;
1067
+ } else
1068
+ h = e[9];
1069
+ const s = h;
1070
+ let g;
1071
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
1072
+ coordinateGetter: ut
1073
+ }, e[10] = g) : g = e[10];
1074
+ const u = rt(ue(at), ue(ct, g));
1075
+ let x;
1076
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = (M) => {
1077
+ M.stopPropagation(), p(M.currentTarget);
1078
+ }, e[11] = x) : x = e[11];
1079
+ const C = x;
1080
+ let E;
1081
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = () => p(null), e[12] = E) : E = e[12];
1082
+ const D = E;
1083
+ let I;
1084
+ e[13] !== y || e[14] !== S ? (I = (M) => {
1085
+ const {
1086
+ active: Q,
1087
+ over: ee
1088
+ } = M;
1089
+ if (!ee || Q.id === ee.id)
1090
+ return;
1091
+ const se = S.indexOf(String(Q.id)), V = S.indexOf(String(ee.id));
1092
+ if (se === -1 || V === -1)
1093
+ return;
1094
+ const De = mt([...S], se, V);
1095
+ le(y).setState({
1096
+ columnOrder: De
1097
+ });
1098
+ }, e[13] = y, e[14] = S, e[15] = I) : I = e[15];
1099
+ const z = I;
1100
+ if (l.length < 2)
1101
+ return null;
1102
+ const L = !!n, T = L ? "change-column-menu" : void 0, k = L ? "true" : void 0, w = L ? "active" : void 0, O = L && Y.toggleActive;
1103
+ let F;
1104
+ e[16] !== O ? (F = {
1105
+ ...Y.toggle,
1106
+ ...O
1107
+ }, e[16] = O, e[17] = F) : F = e[17];
1108
+ let P;
1109
+ e[18] !== v || e[19] !== r ? (P = /* @__PURE__ */ A(v, { fontSize: "small", ...r }), e[18] = v, e[19] = r, e[20] = P) : P = e[20];
1110
+ let H;
1111
+ e[21] !== i.trigger || e[22] !== L || e[23] !== k || e[24] !== w || e[25] !== F || e[26] !== P || e[27] !== T ? (H = /* @__PURE__ */ A(U, { size: "small", "aria-label": i.trigger, "aria-pressed": L, "aria-haspopup": "true", "aria-controls": T, "aria-expanded": k, onClick: C, className: w, sx: F, children: P }), e[21] = i.trigger, e[22] = L, e[23] = k, e[24] = w, e[25] = F, e[26] = P, e[27] = T, e[28] = H) : H = e[28];
1112
+ let N;
1113
+ e[29] !== i.trigger || e[30] !== H ? (N = /* @__PURE__ */ A(W, { title: i.trigger, children: H }), e[29] = i.trigger, e[30] = H, e[31] = N) : N = e[31];
1114
+ let Z, $, R;
1115
+ e[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Z = {
1116
+ vertical: "bottom",
1117
+ horizontal: "right"
1118
+ }, $ = {
1119
+ vertical: "top",
1120
+ horizontal: "right"
1121
+ }, R = {
1122
+ paper: {
1123
+ sx: Y.menuPaper
1124
+ }
1125
+ }, e[32] = Z, e[33] = $, e[34] = R) : (Z = e[32], $ = e[33], R = e[34]);
1126
+ let G;
1127
+ e[35] !== i.title ? (G = /* @__PURE__ */ A(Ue, { disableSticky: !0, role: "presentation", sx: Y.header, children: i.title }), e[35] = i.title, e[36] = G) : G = e[36];
1128
+ let X;
1129
+ e[37] !== m || e[38] !== s ? (X = s.map((M) => /* @__PURE__ */ A(el, { id: M.id, label: M.label, dragHandleIcon: m }, M.id)), e[37] = m, e[38] = s, e[39] = X) : X = e[39];
1130
+ let K;
1131
+ e[40] !== S || e[41] !== X ? (K = /* @__PURE__ */ A(ht, { items: S, strategy: pt, children: X }), e[40] = S, e[41] = X, e[42] = K) : K = e[42];
1132
+ let oe;
1133
+ e[43] !== n || e[44] !== L || e[45] !== G || e[46] !== K ? (oe = /* @__PURE__ */ q(Le, { id: "change-column-menu", anchorEl: n, open: L, onClose: D, anchorOrigin: Z, transformOrigin: $, slotProps: R, children: [
1134
+ G,
1135
+ K
1136
+ ] }), e[43] = n, e[44] = L, e[45] = G, e[46] = K, e[47] = oe) : oe = e[47];
1137
+ let ne;
1138
+ e[48] !== z || e[49] !== u || e[50] !== oe ? (ne = /* @__PURE__ */ A(ft, { sensors: u, collisionDetection: dt, onDragEnd: z, autoScroll: !1, children: oe }), e[48] = z, e[49] = u, e[50] = oe, e[51] = ne) : ne = e[51];
1139
+ let ce;
1140
+ return e[52] !== N || e[53] !== ne ? (ce = /* @__PURE__ */ q(de, { children: [
1141
+ N,
1142
+ ne
1143
+ ] }), e[52] = N, e[53] = ne, e[54] = ce) : ce = e[54], ce;
1144
+ }
1145
+ function tl(t) {
1146
+ return [t.id, t];
1147
+ }
1148
+ function ll(t) {
1149
+ return t.id;
1150
+ }
1151
+ function ol(t) {
1152
+ return t.columnOrder;
1153
+ }
1154
+ export {
1155
+ zl as B,
1156
+ Rl as C,
1157
+ wt as D,
1158
+ Fl as F,
1159
+ Pl as L,
1160
+ wl as R,
1161
+ be as S,
1162
+ Dl as Z,
1163
+ Qt as a,
1164
+ Ht as b,
1165
+ ke as c,
1166
+ Xt as d,
1167
+ $t as e,
1168
+ Te as f,
1169
+ Ct as g,
1170
+ Et as h,
1171
+ kt as i,
1172
+ Ol as j,
1173
+ Il as k,
1174
+ Cl as l,
1175
+ kl as m,
1176
+ Tl as n,
1177
+ zt as o,
1178
+ _t as p,
1179
+ Rt as q,
1180
+ Kt as r,
1181
+ St as s,
1182
+ he as t,
1183
+ Tt as u,
1184
+ Pt as v
1185
+ };
1186
+ //# sourceMappingURL=change-column-Fu1DCYQ3.js.map