@mdspl/mds-shared-ui 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,4221 @@
1
+ import F, { useLayoutEffect as kr, useEffect as L, useRef as M, useMemo as A, useCallback as G, useState as re, createContext as st, memo as Nr, useReducer as Lr, useContext as Ae, forwardRef as on, createElement as Kt } from "react";
2
+ import { Menu as at, Checkbox as ke, IconButton as Ve, Portal as sn, Table as ve, HStack as ge, createListCollection as Mr, Select as le, Pagination as Ct, Box as Qe, Text as we, ButtonGroup as Pr, Slider as lt, VStack as et, Drawer as be, Tabs as It, Button as $t, CloseButton as zr } from "@chakra-ui/react";
3
+ import { unstable_batchedUpdates as gt, createPortal as $r } from "react-dom";
4
+ var pt = { exports: {} }, Ke = {};
5
+ var Cn;
6
+ function Vr() {
7
+ if (Cn) return Ke;
8
+ Cn = 1;
9
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
10
+ function n(r, o, i) {
11
+ var s = null;
12
+ if (i !== void 0 && (s = "" + i), o.key !== void 0 && (s = "" + o.key), "key" in o) {
13
+ i = {};
14
+ for (var a in o)
15
+ a !== "key" && (i[a] = o[a]);
16
+ } else i = o;
17
+ return o = i.ref, {
18
+ $$typeof: e,
19
+ type: r,
20
+ key: s,
21
+ ref: o !== void 0 ? o : null,
22
+ props: i
23
+ };
24
+ }
25
+ return Ke.Fragment = t, Ke.jsx = n, Ke.jsxs = n, Ke;
26
+ }
27
+ var Ze = {};
28
+ var En;
29
+ function Fr() {
30
+ return En || (En = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ function e(v) {
32
+ if (v == null) return null;
33
+ if (typeof v == "function")
34
+ return v.$$typeof === N ? null : v.displayName || v.name || null;
35
+ if (typeof v == "string") return v;
36
+ switch (v) {
37
+ case b:
38
+ return "Fragment";
39
+ case w:
40
+ return "Profiler";
41
+ case x:
42
+ return "StrictMode";
43
+ case S:
44
+ return "Suspense";
45
+ case R:
46
+ return "SuspenseList";
47
+ case $:
48
+ return "Activity";
49
+ }
50
+ if (typeof v == "object")
51
+ switch (typeof v.tag == "number" && console.error(
52
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
53
+ ), v.$$typeof) {
54
+ case g:
55
+ return "Portal";
56
+ case E:
57
+ return v.displayName || "Context";
58
+ case C:
59
+ return (v._context.displayName || "Context") + ".Consumer";
60
+ case O:
61
+ var y = v.render;
62
+ return v = v.displayName, v || (v = y.displayName || y.name || "", v = v !== "" ? "ForwardRef(" + v + ")" : "ForwardRef"), v;
63
+ case D:
64
+ return y = v.displayName || null, y !== null ? y : e(v.type) || "Memo";
65
+ case P:
66
+ y = v._payload, v = v._init;
67
+ try {
68
+ return e(v(y));
69
+ } catch {
70
+ }
71
+ }
72
+ return null;
73
+ }
74
+ function t(v) {
75
+ return "" + v;
76
+ }
77
+ function n(v) {
78
+ try {
79
+ t(v);
80
+ var y = !1;
81
+ } catch {
82
+ y = !0;
83
+ }
84
+ if (y) {
85
+ y = console;
86
+ var T = y.error, k = typeof Symbol == "function" && Symbol.toStringTag && v[Symbol.toStringTag] || v.constructor.name || "Object";
87
+ return T.call(
88
+ y,
89
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
90
+ k
91
+ ), t(v);
92
+ }
93
+ }
94
+ function r(v) {
95
+ if (v === b) return "<>";
96
+ if (typeof v == "object" && v !== null && v.$$typeof === P)
97
+ return "<...>";
98
+ try {
99
+ var y = e(v);
100
+ return y ? "<" + y + ">" : "<...>";
101
+ } catch {
102
+ return "<...>";
103
+ }
104
+ }
105
+ function o() {
106
+ var v = q.A;
107
+ return v === null ? null : v.getOwner();
108
+ }
109
+ function i() {
110
+ return Error("react-stack-top-frame");
111
+ }
112
+ function s(v) {
113
+ if (J.call(v, "key")) {
114
+ var y = Object.getOwnPropertyDescriptor(v, "key").get;
115
+ if (y && y.isReactWarning) return !1;
116
+ }
117
+ return v.key !== void 0;
118
+ }
119
+ function a(v, y) {
120
+ function T() {
121
+ je || (je = !0, console.error(
122
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
123
+ y
124
+ ));
125
+ }
126
+ T.isReactWarning = !0, Object.defineProperty(v, "key", {
127
+ get: T,
128
+ configurable: !0
129
+ });
130
+ }
131
+ function c() {
132
+ var v = e(this.type);
133
+ return H[v] || (H[v] = !0, console.error(
134
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
135
+ )), v = this.props.ref, v !== void 0 ? v : null;
136
+ }
137
+ function l(v, y, T, k, ue, Y) {
138
+ var z = T.ref;
139
+ return v = {
140
+ $$typeof: m,
141
+ type: v,
142
+ key: y,
143
+ props: T,
144
+ _owner: k
145
+ }, (z !== void 0 ? z : null) !== null ? Object.defineProperty(v, "ref", {
146
+ enumerable: !1,
147
+ get: c
148
+ }) : Object.defineProperty(v, "ref", { enumerable: !1, value: null }), v._store = {}, Object.defineProperty(v._store, "validated", {
149
+ configurable: !1,
150
+ enumerable: !1,
151
+ writable: !0,
152
+ value: 0
153
+ }), Object.defineProperty(v, "_debugInfo", {
154
+ configurable: !1,
155
+ enumerable: !1,
156
+ writable: !0,
157
+ value: null
158
+ }), Object.defineProperty(v, "_debugStack", {
159
+ configurable: !1,
160
+ enumerable: !1,
161
+ writable: !0,
162
+ value: ue
163
+ }), Object.defineProperty(v, "_debugTask", {
164
+ configurable: !1,
165
+ enumerable: !1,
166
+ writable: !0,
167
+ value: Y
168
+ }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
169
+ }
170
+ function h(v, y, T, k, ue, Y) {
171
+ var z = y.children;
172
+ if (z !== void 0)
173
+ if (k)
174
+ if (oe(z)) {
175
+ for (k = 0; k < z.length; k++)
176
+ f(z[k]);
177
+ Object.freeze && Object.freeze(z);
178
+ } else
179
+ console.error(
180
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
181
+ );
182
+ else f(z);
183
+ if (J.call(y, "key")) {
184
+ z = e(v);
185
+ var X = Object.keys(y).filter(function(I) {
186
+ return I !== "key";
187
+ });
188
+ k = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", Se[z + k] || (X = 0 < X.length ? "{" + X.join(": ..., ") + ": ...}" : "{}", console.error(
189
+ `A props object containing a "key" prop is being spread into JSX:
190
+ let props = %s;
191
+ <%s {...props} />
192
+ React keys must be passed directly to JSX without using spread:
193
+ let props = %s;
194
+ <%s key={someKey} {...props} />`,
195
+ k,
196
+ z,
197
+ X,
198
+ z
199
+ ), Se[z + k] = !0);
200
+ }
201
+ if (z = null, T !== void 0 && (n(T), z = "" + T), s(y) && (n(y.key), z = "" + y.key), "key" in y) {
202
+ T = {};
203
+ for (var Q in y)
204
+ Q !== "key" && (T[Q] = y[Q]);
205
+ } else T = y;
206
+ return z && a(
207
+ T,
208
+ typeof v == "function" ? v.displayName || v.name || "Unknown" : v
209
+ ), l(
210
+ v,
211
+ z,
212
+ T,
213
+ o(),
214
+ ue,
215
+ Y
216
+ );
217
+ }
218
+ function f(v) {
219
+ p(v) ? v._store && (v._store.validated = 1) : typeof v == "object" && v !== null && v.$$typeof === P && (v._payload.status === "fulfilled" ? p(v._payload.value) && v._payload.value._store && (v._payload.value._store.validated = 1) : v._store && (v._store.validated = 1));
220
+ }
221
+ function p(v) {
222
+ return typeof v == "object" && v !== null && v.$$typeof === m;
223
+ }
224
+ var d = F, m = /* @__PURE__ */ Symbol.for("react.transitional.element"), g = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), x = /* @__PURE__ */ Symbol.for("react.strict_mode"), w = /* @__PURE__ */ Symbol.for("react.profiler"), C = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), S = /* @__PURE__ */ Symbol.for("react.suspense"), R = /* @__PURE__ */ Symbol.for("react.suspense_list"), D = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), $ = /* @__PURE__ */ Symbol.for("react.activity"), N = /* @__PURE__ */ Symbol.for("react.client.reference"), q = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, oe = Array.isArray, me = console.createTask ? console.createTask : function() {
225
+ return null;
226
+ };
227
+ d = {
228
+ react_stack_bottom_frame: function(v) {
229
+ return v();
230
+ }
231
+ };
232
+ var je, H = {}, Ie = d.react_stack_bottom_frame.bind(
233
+ d,
234
+ i
235
+ )(), ie = me(r(i)), Se = {};
236
+ Ze.Fragment = b, Ze.jsx = function(v, y, T) {
237
+ var k = 1e4 > q.recentlyCreatedOwnerStacks++;
238
+ return h(
239
+ v,
240
+ y,
241
+ T,
242
+ !1,
243
+ k ? Error("react-stack-top-frame") : Ie,
244
+ k ? me(r(v)) : ie
245
+ );
246
+ }, Ze.jsxs = function(v, y, T) {
247
+ var k = 1e4 > q.recentlyCreatedOwnerStacks++;
248
+ return h(
249
+ v,
250
+ y,
251
+ T,
252
+ !0,
253
+ k ? Error("react-stack-top-frame") : Ie,
254
+ k ? me(r(v)) : ie
255
+ );
256
+ };
257
+ })()), Ze;
258
+ }
259
+ var Dn;
260
+ function Br() {
261
+ return Dn || (Dn = 1, process.env.NODE_ENV === "production" ? pt.exports = Vr() : pt.exports = Fr()), pt.exports;
262
+ }
263
+ var u = Br(), bt = { exports: {} }, Vt = {}, mt = { exports: {} }, Ft = {};
264
+ var _n;
265
+ function Wr() {
266
+ if (_n) return Ft;
267
+ _n = 1;
268
+ var e = F;
269
+ function t(f, p) {
270
+ return f === p && (f !== 0 || 1 / f === 1 / p) || f !== f && p !== p;
271
+ }
272
+ var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, i = e.useLayoutEffect, s = e.useDebugValue;
273
+ function a(f, p) {
274
+ var d = p(), m = r({ inst: { value: d, getSnapshot: p } }), g = m[0].inst, b = m[1];
275
+ return i(
276
+ function() {
277
+ g.value = d, g.getSnapshot = p, c(g) && b({ inst: g });
278
+ },
279
+ [f, d, p]
280
+ ), o(
281
+ function() {
282
+ return c(g) && b({ inst: g }), f(function() {
283
+ c(g) && b({ inst: g });
284
+ });
285
+ },
286
+ [f]
287
+ ), s(d), d;
288
+ }
289
+ function c(f) {
290
+ var p = f.getSnapshot;
291
+ f = f.value;
292
+ try {
293
+ var d = p();
294
+ return !n(f, d);
295
+ } catch {
296
+ return !0;
297
+ }
298
+ }
299
+ function l(f, p) {
300
+ return p();
301
+ }
302
+ var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : a;
303
+ return Ft.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, Ft;
304
+ }
305
+ var Bt = {};
306
+ var On;
307
+ function Hr() {
308
+ return On || (On = 1, process.env.NODE_ENV !== "production" && (function() {
309
+ function e(d, m) {
310
+ return d === m && (d !== 0 || 1 / d === 1 / m) || d !== d && m !== m;
311
+ }
312
+ function t(d, m) {
313
+ h || o.startTransition === void 0 || (h = !0, console.error(
314
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
315
+ ));
316
+ var g = m();
317
+ if (!f) {
318
+ var b = m();
319
+ i(g, b) || (console.error(
320
+ "The result of getSnapshot should be cached to avoid an infinite loop"
321
+ ), f = !0);
322
+ }
323
+ b = s({
324
+ inst: { value: g, getSnapshot: m }
325
+ });
326
+ var x = b[0].inst, w = b[1];
327
+ return c(
328
+ function() {
329
+ x.value = g, x.getSnapshot = m, n(x) && w({ inst: x });
330
+ },
331
+ [d, g, m]
332
+ ), a(
333
+ function() {
334
+ return n(x) && w({ inst: x }), d(function() {
335
+ n(x) && w({ inst: x });
336
+ });
337
+ },
338
+ [d]
339
+ ), l(g), g;
340
+ }
341
+ function n(d) {
342
+ var m = d.getSnapshot;
343
+ d = d.value;
344
+ try {
345
+ var g = m();
346
+ return !i(d, g);
347
+ } catch {
348
+ return !0;
349
+ }
350
+ }
351
+ function r(d, m) {
352
+ return m();
353
+ }
354
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
355
+ var o = F, i = typeof Object.is == "function" ? Object.is : e, s = o.useState, a = o.useEffect, c = o.useLayoutEffect, l = o.useDebugValue, h = !1, f = !1, p = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : t;
356
+ Bt.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : p, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
357
+ })()), Bt;
358
+ }
359
+ var Tn;
360
+ function Xn() {
361
+ return Tn || (Tn = 1, process.env.NODE_ENV === "production" ? mt.exports = Wr() : mt.exports = Hr()), mt.exports;
362
+ }
363
+ var jn;
364
+ function Yr() {
365
+ if (jn) return Vt;
366
+ jn = 1;
367
+ var e = F, t = Xn();
368
+ function n(l, h) {
369
+ return l === h && (l !== 0 || 1 / l === 1 / h) || l !== l && h !== h;
370
+ }
371
+ var r = typeof Object.is == "function" ? Object.is : n, o = t.useSyncExternalStore, i = e.useRef, s = e.useEffect, a = e.useMemo, c = e.useDebugValue;
372
+ return Vt.useSyncExternalStoreWithSelector = function(l, h, f, p, d) {
373
+ var m = i(null);
374
+ if (m.current === null) {
375
+ var g = { hasValue: !1, value: null };
376
+ m.current = g;
377
+ } else g = m.current;
378
+ m = a(
379
+ function() {
380
+ function x(S) {
381
+ if (!w) {
382
+ if (w = !0, C = S, S = p(S), d !== void 0 && g.hasValue) {
383
+ var R = g.value;
384
+ if (d(R, S))
385
+ return E = R;
386
+ }
387
+ return E = S;
388
+ }
389
+ if (R = E, r(C, S)) return R;
390
+ var D = p(S);
391
+ return d !== void 0 && d(R, D) ? (C = S, R) : (C = S, E = D);
392
+ }
393
+ var w = !1, C, E, O = f === void 0 ? null : f;
394
+ return [
395
+ function() {
396
+ return x(h());
397
+ },
398
+ O === null ? void 0 : function() {
399
+ return x(O());
400
+ }
401
+ ];
402
+ },
403
+ [h, f, p, d]
404
+ );
405
+ var b = o(l, m[0], m[1]);
406
+ return s(
407
+ function() {
408
+ g.hasValue = !0, g.value = b;
409
+ },
410
+ [b]
411
+ ), c(b), b;
412
+ }, Vt;
413
+ }
414
+ var Wt = {};
415
+ var In;
416
+ function Ur() {
417
+ return In || (In = 1, process.env.NODE_ENV !== "production" && (function() {
418
+ function e(l, h) {
419
+ return l === h && (l !== 0 || 1 / l === 1 / h) || l !== l && h !== h;
420
+ }
421
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
422
+ var t = F, n = Xn(), r = typeof Object.is == "function" ? Object.is : e, o = n.useSyncExternalStore, i = t.useRef, s = t.useEffect, a = t.useMemo, c = t.useDebugValue;
423
+ Wt.useSyncExternalStoreWithSelector = function(l, h, f, p, d) {
424
+ var m = i(null);
425
+ if (m.current === null) {
426
+ var g = { hasValue: !1, value: null };
427
+ m.current = g;
428
+ } else g = m.current;
429
+ m = a(
430
+ function() {
431
+ function x(S) {
432
+ if (!w) {
433
+ if (w = !0, C = S, S = p(S), d !== void 0 && g.hasValue) {
434
+ var R = g.value;
435
+ if (d(R, S))
436
+ return E = R;
437
+ }
438
+ return E = S;
439
+ }
440
+ if (R = E, r(C, S))
441
+ return R;
442
+ var D = p(S);
443
+ return d !== void 0 && d(R, D) ? (C = S, R) : (C = S, E = D);
444
+ }
445
+ var w = !1, C, E, O = f === void 0 ? null : f;
446
+ return [
447
+ function() {
448
+ return x(h());
449
+ },
450
+ O === null ? void 0 : function() {
451
+ return x(O());
452
+ }
453
+ ];
454
+ },
455
+ [h, f, p, d]
456
+ );
457
+ var b = o(l, m[0], m[1]);
458
+ return s(
459
+ function() {
460
+ g.hasValue = !0, g.value = b;
461
+ },
462
+ [b]
463
+ ), c(b), b;
464
+ }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
465
+ })()), Wt;
466
+ }
467
+ var An;
468
+ function Gr() {
469
+ return An || (An = 1, process.env.NODE_ENV === "production" ? bt.exports = Yr() : bt.exports = Ur()), bt.exports;
470
+ }
471
+ var qr = Gr();
472
+ const Zt = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), Et = {
473
+ current: []
474
+ };
475
+ let Ht = !1;
476
+ const xt = /* @__PURE__ */ new Set(), kn = /* @__PURE__ */ new Map();
477
+ function Jn(e) {
478
+ for (const t of e) {
479
+ if (Et.current.includes(t))
480
+ continue;
481
+ Et.current.push(t), t.recompute();
482
+ const n = Xr.get(t);
483
+ if (n)
484
+ for (const r of n) {
485
+ const o = Zt.get(r);
486
+ o?.length && Jn(o);
487
+ }
488
+ }
489
+ }
490
+ function Jr(e) {
491
+ const t = {
492
+ prevVal: e.prevState,
493
+ currentVal: e.state
494
+ };
495
+ for (const n of e.listeners)
496
+ n(t);
497
+ }
498
+ function Kr(e) {
499
+ const t = {
500
+ prevVal: e.prevState,
501
+ currentVal: e.state
502
+ };
503
+ for (const n of e.listeners)
504
+ n(t);
505
+ }
506
+ function Zr(e) {
507
+ if (xt.add(e), !Ht)
508
+ try {
509
+ for (Ht = !0; xt.size > 0; ) {
510
+ const t = Array.from(xt);
511
+ xt.clear();
512
+ for (const n of t) {
513
+ const r = kn.get(n) ?? n.prevState;
514
+ n.prevState = r, Jr(n);
515
+ }
516
+ for (const n of t) {
517
+ const r = Zt.get(n);
518
+ r && (Et.current.push(n), Jn(r));
519
+ }
520
+ for (const n of t) {
521
+ const r = Zt.get(n);
522
+ if (r)
523
+ for (const o of r)
524
+ Kr(o);
525
+ }
526
+ }
527
+ } finally {
528
+ Ht = !1, Et.current = [], kn.clear();
529
+ }
530
+ }
531
+ function Qr(e) {
532
+ return typeof e == "function";
533
+ }
534
+ class Kn {
535
+ constructor(t, n) {
536
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = (r) => {
537
+ var o, i;
538
+ this.listeners.add(r);
539
+ const s = (i = (o = this.options) == null ? void 0 : o.onSubscribe) == null ? void 0 : i.call(o, r, this);
540
+ return () => {
541
+ this.listeners.delete(r), s?.();
542
+ };
543
+ }, this.prevState = t, this.state = t, this.options = n;
544
+ }
545
+ setState(t) {
546
+ var n, r, o;
547
+ this.prevState = this.state, (n = this.options) != null && n.updateFn ? this.state = this.options.updateFn(this.prevState)(t) : Qr(t) ? this.state = t(this.prevState) : this.state = t, (o = (r = this.options) == null ? void 0 : r.onUpdate) == null || o.call(r), Zr(this);
548
+ }
549
+ }
550
+ function ct(e, t = (r) => r, n = {}) {
551
+ const r = n.equal ?? eo;
552
+ return qr.useSyncExternalStoreWithSelector(
553
+ e.subscribe,
554
+ () => e.state,
555
+ () => e.state,
556
+ t,
557
+ r
558
+ );
559
+ }
560
+ function eo(e, t) {
561
+ if (Object.is(e, t))
562
+ return !0;
563
+ if (typeof e != "object" || e === null || typeof t != "object" || t === null)
564
+ return !1;
565
+ if (e instanceof Map && t instanceof Map) {
566
+ if (e.size !== t.size) return !1;
567
+ for (const [r, o] of e)
568
+ if (!t.has(r) || !Object.is(o, t.get(r))) return !1;
569
+ return !0;
570
+ }
571
+ if (e instanceof Set && t instanceof Set) {
572
+ if (e.size !== t.size) return !1;
573
+ for (const r of e)
574
+ if (!t.has(r)) return !1;
575
+ return !0;
576
+ }
577
+ if (e instanceof Date && t instanceof Date)
578
+ return e.getTime() === t.getTime();
579
+ const n = Nn(e);
580
+ if (n.length !== Nn(t).length)
581
+ return !1;
582
+ for (let r = 0; r < n.length; r++)
583
+ if (!Object.prototype.hasOwnProperty.call(t, n[r]) || !Object.is(e[n[r]], t[n[r]]))
584
+ return !1;
585
+ return !0;
586
+ }
587
+ function Nn(e) {
588
+ return Object.keys(e).concat(
589
+ Object.getOwnPropertySymbols(e)
590
+ );
591
+ }
592
+ function to() {
593
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
594
+ t[n] = arguments[n];
595
+ return A(
596
+ () => (r) => {
597
+ t.forEach((o) => o(r));
598
+ },
599
+ // eslint-disable-next-line react-hooks/exhaustive-deps
600
+ t
601
+ );
602
+ }
603
+ const At = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
604
+ function We(e) {
605
+ const t = Object.prototype.toString.call(e);
606
+ return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
607
+ t === "[object global]";
608
+ }
609
+ function an(e) {
610
+ return "nodeType" in e;
611
+ }
612
+ function K(e) {
613
+ var t, n;
614
+ return e ? We(e) ? e : an(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
615
+ }
616
+ function ln(e) {
617
+ const {
618
+ Document: t
619
+ } = K(e);
620
+ return e instanceof t;
621
+ }
622
+ function ut(e) {
623
+ return We(e) ? !1 : e instanceof K(e).HTMLElement;
624
+ }
625
+ function Zn(e) {
626
+ return e instanceof K(e).SVGElement;
627
+ }
628
+ function He(e) {
629
+ return e ? We(e) ? e.document : an(e) ? ln(e) ? e : ut(e) || Zn(e) ? e.ownerDocument : document : document : document;
630
+ }
631
+ const pe = At ? kr : L;
632
+ function cn(e) {
633
+ const t = M(e);
634
+ return pe(() => {
635
+ t.current = e;
636
+ }), G(function() {
637
+ for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
638
+ r[o] = arguments[o];
639
+ return t.current == null ? void 0 : t.current(...r);
640
+ }, []);
641
+ }
642
+ function no() {
643
+ const e = M(null), t = G((r, o) => {
644
+ e.current = setInterval(r, o);
645
+ }, []), n = G(() => {
646
+ e.current !== null && (clearInterval(e.current), e.current = null);
647
+ }, []);
648
+ return [t, n];
649
+ }
650
+ function ot(e, t) {
651
+ t === void 0 && (t = [e]);
652
+ const n = M(e);
653
+ return pe(() => {
654
+ n.current !== e && (n.current = e);
655
+ }, t), n;
656
+ }
657
+ function dt(e, t) {
658
+ const n = M();
659
+ return A(
660
+ () => {
661
+ const r = e(n.current);
662
+ return n.current = r, r;
663
+ },
664
+ // eslint-disable-next-line react-hooks/exhaustive-deps
665
+ [...t]
666
+ );
667
+ }
668
+ function Dt(e) {
669
+ const t = cn(e), n = M(null), r = G(
670
+ (o) => {
671
+ o !== n.current && t?.(o, n.current), n.current = o;
672
+ },
673
+ //eslint-disable-next-line
674
+ []
675
+ );
676
+ return [n, r];
677
+ }
678
+ function Qt(e) {
679
+ const t = M();
680
+ return L(() => {
681
+ t.current = e;
682
+ }, [e]), t.current;
683
+ }
684
+ let Yt = {};
685
+ function ft(e, t) {
686
+ return A(() => {
687
+ if (t)
688
+ return t;
689
+ const n = Yt[e] == null ? 0 : Yt[e] + 1;
690
+ return Yt[e] = n, e + "-" + n;
691
+ }, [e, t]);
692
+ }
693
+ function Qn(e) {
694
+ return function(t) {
695
+ for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
696
+ r[o - 1] = arguments[o];
697
+ return r.reduce((i, s) => {
698
+ const a = Object.entries(s);
699
+ for (const [c, l] of a) {
700
+ const h = i[c];
701
+ h != null && (i[c] = h + e * l);
702
+ }
703
+ return i;
704
+ }, {
705
+ ...t
706
+ });
707
+ };
708
+ }
709
+ const Fe = /* @__PURE__ */ Qn(1), _t = /* @__PURE__ */ Qn(-1);
710
+ function ro(e) {
711
+ return "clientX" in e && "clientY" in e;
712
+ }
713
+ function un(e) {
714
+ if (!e)
715
+ return !1;
716
+ const {
717
+ KeyboardEvent: t
718
+ } = K(e.target);
719
+ return t && e instanceof t;
720
+ }
721
+ function oo(e) {
722
+ if (!e)
723
+ return !1;
724
+ const {
725
+ TouchEvent: t
726
+ } = K(e.target);
727
+ return t && e instanceof t;
728
+ }
729
+ function en(e) {
730
+ if (oo(e)) {
731
+ if (e.touches && e.touches.length) {
732
+ const {
733
+ clientX: t,
734
+ clientY: n
735
+ } = e.touches[0];
736
+ return {
737
+ x: t,
738
+ y: n
739
+ };
740
+ } else if (e.changedTouches && e.changedTouches.length) {
741
+ const {
742
+ clientX: t,
743
+ clientY: n
744
+ } = e.changedTouches[0];
745
+ return {
746
+ x: t,
747
+ y: n
748
+ };
749
+ }
750
+ }
751
+ return ro(e) ? {
752
+ x: e.clientX,
753
+ y: e.clientY
754
+ } : null;
755
+ }
756
+ const Be = /* @__PURE__ */ Object.freeze({
757
+ Translate: {
758
+ toString(e) {
759
+ if (!e)
760
+ return;
761
+ const {
762
+ x: t,
763
+ y: n
764
+ } = e;
765
+ return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
766
+ }
767
+ },
768
+ Scale: {
769
+ toString(e) {
770
+ if (!e)
771
+ return;
772
+ const {
773
+ scaleX: t,
774
+ scaleY: n
775
+ } = e;
776
+ return "scaleX(" + t + ") scaleY(" + n + ")";
777
+ }
778
+ },
779
+ Transform: {
780
+ toString(e) {
781
+ if (e)
782
+ return [Be.Translate.toString(e), Be.Scale.toString(e)].join(" ");
783
+ }
784
+ },
785
+ Transition: {
786
+ toString(e) {
787
+ let {
788
+ property: t,
789
+ duration: n,
790
+ easing: r
791
+ } = e;
792
+ return t + " " + n + "ms " + r;
793
+ }
794
+ }
795
+ }), Ln = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
796
+ function io(e) {
797
+ return e.matches(Ln) ? e : e.querySelector(Ln);
798
+ }
799
+ const so = {
800
+ display: "none"
801
+ };
802
+ function ao(e) {
803
+ let {
804
+ id: t,
805
+ value: n
806
+ } = e;
807
+ return F.createElement("div", {
808
+ id: t,
809
+ style: so
810
+ }, n);
811
+ }
812
+ function lo(e) {
813
+ let {
814
+ id: t,
815
+ announcement: n,
816
+ ariaLiveType: r = "assertive"
817
+ } = e;
818
+ const o = {
819
+ position: "fixed",
820
+ top: 0,
821
+ left: 0,
822
+ width: 1,
823
+ height: 1,
824
+ margin: -1,
825
+ border: 0,
826
+ padding: 0,
827
+ overflow: "hidden",
828
+ clip: "rect(0 0 0 0)",
829
+ clipPath: "inset(100%)",
830
+ whiteSpace: "nowrap"
831
+ };
832
+ return F.createElement("div", {
833
+ id: t,
834
+ style: o,
835
+ role: "status",
836
+ "aria-live": r,
837
+ "aria-atomic": !0
838
+ }, n);
839
+ }
840
+ function co() {
841
+ const [e, t] = re("");
842
+ return {
843
+ announce: G((r) => {
844
+ r != null && t(r);
845
+ }, []),
846
+ announcement: e
847
+ };
848
+ }
849
+ const er = /* @__PURE__ */ st(null);
850
+ function uo(e) {
851
+ const t = Ae(er);
852
+ L(() => {
853
+ if (!t)
854
+ throw new Error("useDndMonitor must be used within a children of <DndContext>");
855
+ return t(e);
856
+ }, [e, t]);
857
+ }
858
+ function fo() {
859
+ const [e] = re(() => /* @__PURE__ */ new Set()), t = G((r) => (e.add(r), () => e.delete(r)), [e]);
860
+ return [G((r) => {
861
+ let {
862
+ type: o,
863
+ event: i
864
+ } = r;
865
+ e.forEach((s) => {
866
+ var a;
867
+ return (a = s[o]) == null ? void 0 : a.call(s, i);
868
+ });
869
+ }, [e]), t];
870
+ }
871
+ const ho = {
872
+ draggable: `
873
+ To pick up a draggable item, press the space bar.
874
+ While dragging, use the arrow keys to move the item.
875
+ Press space again to drop the item in its new position, or press escape to cancel.
876
+ `
877
+ }, vo = {
878
+ onDragStart(e) {
879
+ let {
880
+ active: t
881
+ } = e;
882
+ return "Picked up draggable item " + t.id + ".";
883
+ },
884
+ onDragOver(e) {
885
+ let {
886
+ active: t,
887
+ over: n
888
+ } = e;
889
+ return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
890
+ },
891
+ onDragEnd(e) {
892
+ let {
893
+ active: t,
894
+ over: n
895
+ } = e;
896
+ return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
897
+ },
898
+ onDragCancel(e) {
899
+ let {
900
+ active: t
901
+ } = e;
902
+ return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
903
+ }
904
+ };
905
+ function go(e) {
906
+ let {
907
+ announcements: t = vo,
908
+ container: n,
909
+ hiddenTextDescribedById: r,
910
+ screenReaderInstructions: o = ho
911
+ } = e;
912
+ const {
913
+ announce: i,
914
+ announcement: s
915
+ } = co(), a = ft("DndLiveRegion"), [c, l] = re(!1);
916
+ if (L(() => {
917
+ l(!0);
918
+ }, []), uo(A(() => ({
919
+ onDragStart(f) {
920
+ let {
921
+ active: p
922
+ } = f;
923
+ i(t.onDragStart({
924
+ active: p
925
+ }));
926
+ },
927
+ onDragMove(f) {
928
+ let {
929
+ active: p,
930
+ over: d
931
+ } = f;
932
+ t.onDragMove && i(t.onDragMove({
933
+ active: p,
934
+ over: d
935
+ }));
936
+ },
937
+ onDragOver(f) {
938
+ let {
939
+ active: p,
940
+ over: d
941
+ } = f;
942
+ i(t.onDragOver({
943
+ active: p,
944
+ over: d
945
+ }));
946
+ },
947
+ onDragEnd(f) {
948
+ let {
949
+ active: p,
950
+ over: d
951
+ } = f;
952
+ i(t.onDragEnd({
953
+ active: p,
954
+ over: d
955
+ }));
956
+ },
957
+ onDragCancel(f) {
958
+ let {
959
+ active: p,
960
+ over: d
961
+ } = f;
962
+ i(t.onDragCancel({
963
+ active: p,
964
+ over: d
965
+ }));
966
+ }
967
+ }), [i, t])), !c)
968
+ return null;
969
+ const h = F.createElement(F.Fragment, null, F.createElement(ao, {
970
+ id: r,
971
+ value: o.draggable
972
+ }), F.createElement(lo, {
973
+ id: a,
974
+ announcement: s
975
+ }));
976
+ return n ? $r(h, n) : h;
977
+ }
978
+ var V;
979
+ (function(e) {
980
+ e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
981
+ })(V || (V = {}));
982
+ function Ot() {
983
+ }
984
+ function po(e, t) {
985
+ return A(
986
+ () => ({
987
+ sensor: e,
988
+ options: {}
989
+ }),
990
+ // eslint-disable-next-line react-hooks/exhaustive-deps
991
+ [e, t]
992
+ );
993
+ }
994
+ function bo() {
995
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
996
+ t[n] = arguments[n];
997
+ return A(
998
+ () => [...t].filter((r) => r != null),
999
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1000
+ [...t]
1001
+ );
1002
+ }
1003
+ const ce = /* @__PURE__ */ Object.freeze({
1004
+ x: 0,
1005
+ y: 0
1006
+ });
1007
+ function mo(e, t) {
1008
+ return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
1009
+ }
1010
+ function xo(e, t) {
1011
+ let {
1012
+ data: {
1013
+ value: n
1014
+ }
1015
+ } = e, {
1016
+ data: {
1017
+ value: r
1018
+ }
1019
+ } = t;
1020
+ return n - r;
1021
+ }
1022
+ function yo(e, t) {
1023
+ let {
1024
+ data: {
1025
+ value: n
1026
+ }
1027
+ } = e, {
1028
+ data: {
1029
+ value: r
1030
+ }
1031
+ } = t;
1032
+ return r - n;
1033
+ }
1034
+ function wo(e, t) {
1035
+ if (!e || e.length === 0)
1036
+ return null;
1037
+ const [n] = e;
1038
+ return n[t];
1039
+ }
1040
+ function Mn(e, t, n) {
1041
+ return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
1042
+ x: t + e.width * 0.5,
1043
+ y: n + e.height * 0.5
1044
+ };
1045
+ }
1046
+ const tr = (e) => {
1047
+ let {
1048
+ collisionRect: t,
1049
+ droppableRects: n,
1050
+ droppableContainers: r
1051
+ } = e;
1052
+ const o = Mn(t, t.left, t.top), i = [];
1053
+ for (const s of r) {
1054
+ const {
1055
+ id: a
1056
+ } = s, c = n.get(a);
1057
+ if (c) {
1058
+ const l = mo(Mn(c), o);
1059
+ i.push({
1060
+ id: a,
1061
+ data: {
1062
+ droppableContainer: s,
1063
+ value: l
1064
+ }
1065
+ });
1066
+ }
1067
+ }
1068
+ return i.sort(xo);
1069
+ };
1070
+ function So(e, t) {
1071
+ const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), i = Math.min(t.top + t.height, e.top + e.height), s = o - r, a = i - n;
1072
+ if (r < o && n < i) {
1073
+ const c = t.width * t.height, l = e.width * e.height, h = s * a, f = h / (c + l - h);
1074
+ return Number(f.toFixed(4));
1075
+ }
1076
+ return 0;
1077
+ }
1078
+ const Ro = (e) => {
1079
+ let {
1080
+ collisionRect: t,
1081
+ droppableRects: n,
1082
+ droppableContainers: r
1083
+ } = e;
1084
+ const o = [];
1085
+ for (const i of r) {
1086
+ const {
1087
+ id: s
1088
+ } = i, a = n.get(s);
1089
+ if (a) {
1090
+ const c = So(a, t);
1091
+ c > 0 && o.push({
1092
+ id: s,
1093
+ data: {
1094
+ droppableContainer: i,
1095
+ value: c
1096
+ }
1097
+ });
1098
+ }
1099
+ }
1100
+ return o.sort(yo);
1101
+ };
1102
+ function Co(e, t, n) {
1103
+ return {
1104
+ ...e,
1105
+ scaleX: t && n ? t.width / n.width : 1,
1106
+ scaleY: t && n ? t.height / n.height : 1
1107
+ };
1108
+ }
1109
+ function nr(e, t) {
1110
+ return e && t ? {
1111
+ x: e.left - t.left,
1112
+ y: e.top - t.top
1113
+ } : ce;
1114
+ }
1115
+ function Eo(e) {
1116
+ return function(n) {
1117
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
1118
+ o[i - 1] = arguments[i];
1119
+ return o.reduce((s, a) => ({
1120
+ ...s,
1121
+ top: s.top + e * a.y,
1122
+ bottom: s.bottom + e * a.y,
1123
+ left: s.left + e * a.x,
1124
+ right: s.right + e * a.x
1125
+ }), {
1126
+ ...n
1127
+ });
1128
+ };
1129
+ }
1130
+ const Do = /* @__PURE__ */ Eo(1);
1131
+ function _o(e) {
1132
+ if (e.startsWith("matrix3d(")) {
1133
+ const t = e.slice(9, -1).split(/, /);
1134
+ return {
1135
+ x: +t[12],
1136
+ y: +t[13],
1137
+ scaleX: +t[0],
1138
+ scaleY: +t[5]
1139
+ };
1140
+ } else if (e.startsWith("matrix(")) {
1141
+ const t = e.slice(7, -1).split(/, /);
1142
+ return {
1143
+ x: +t[4],
1144
+ y: +t[5],
1145
+ scaleX: +t[0],
1146
+ scaleY: +t[3]
1147
+ };
1148
+ }
1149
+ return null;
1150
+ }
1151
+ function Oo(e, t, n) {
1152
+ const r = _o(t);
1153
+ if (!r)
1154
+ return e;
1155
+ const {
1156
+ scaleX: o,
1157
+ scaleY: i,
1158
+ x: s,
1159
+ y: a
1160
+ } = r, c = e.left - s - (1 - o) * parseFloat(n), l = e.top - a - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), h = o ? e.width / o : e.width, f = i ? e.height / i : e.height;
1161
+ return {
1162
+ width: h,
1163
+ height: f,
1164
+ top: l,
1165
+ right: c + h,
1166
+ bottom: l + f,
1167
+ left: c
1168
+ };
1169
+ }
1170
+ const To = {
1171
+ ignoreTransform: !1
1172
+ };
1173
+ function Ye(e, t) {
1174
+ t === void 0 && (t = To);
1175
+ let n = e.getBoundingClientRect();
1176
+ if (t.ignoreTransform) {
1177
+ const {
1178
+ transform: l,
1179
+ transformOrigin: h
1180
+ } = K(e).getComputedStyle(e);
1181
+ l && (n = Oo(n, l, h));
1182
+ }
1183
+ const {
1184
+ top: r,
1185
+ left: o,
1186
+ width: i,
1187
+ height: s,
1188
+ bottom: a,
1189
+ right: c
1190
+ } = n;
1191
+ return {
1192
+ top: r,
1193
+ left: o,
1194
+ width: i,
1195
+ height: s,
1196
+ bottom: a,
1197
+ right: c
1198
+ };
1199
+ }
1200
+ function Pn(e) {
1201
+ return Ye(e, {
1202
+ ignoreTransform: !0
1203
+ });
1204
+ }
1205
+ function jo(e) {
1206
+ const t = e.innerWidth, n = e.innerHeight;
1207
+ return {
1208
+ top: 0,
1209
+ left: 0,
1210
+ right: t,
1211
+ bottom: n,
1212
+ width: t,
1213
+ height: n
1214
+ };
1215
+ }
1216
+ function Io(e, t) {
1217
+ return t === void 0 && (t = K(e).getComputedStyle(e)), t.position === "fixed";
1218
+ }
1219
+ function Ao(e, t) {
1220
+ t === void 0 && (t = K(e).getComputedStyle(e));
1221
+ const n = /(auto|scroll|overlay)/;
1222
+ return ["overflow", "overflowX", "overflowY"].some((o) => {
1223
+ const i = t[o];
1224
+ return typeof i == "string" ? n.test(i) : !1;
1225
+ });
1226
+ }
1227
+ function dn(e, t) {
1228
+ const n = [];
1229
+ function r(o) {
1230
+ if (t != null && n.length >= t || !o)
1231
+ return n;
1232
+ if (ln(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
1233
+ return n.push(o.scrollingElement), n;
1234
+ if (!ut(o) || Zn(o) || n.includes(o))
1235
+ return n;
1236
+ const i = K(e).getComputedStyle(o);
1237
+ return o !== e && Ao(o, i) && n.push(o), Io(o, i) ? n : r(o.parentNode);
1238
+ }
1239
+ return e ? r(e) : n;
1240
+ }
1241
+ function rr(e) {
1242
+ const [t] = dn(e, 1);
1243
+ return t ?? null;
1244
+ }
1245
+ function Ut(e) {
1246
+ return !At || !e ? null : We(e) ? e : an(e) ? ln(e) || e === He(e).scrollingElement ? window : ut(e) ? e : null : null;
1247
+ }
1248
+ function or(e) {
1249
+ return We(e) ? e.scrollX : e.scrollLeft;
1250
+ }
1251
+ function ir(e) {
1252
+ return We(e) ? e.scrollY : e.scrollTop;
1253
+ }
1254
+ function tn(e) {
1255
+ return {
1256
+ x: or(e),
1257
+ y: ir(e)
1258
+ };
1259
+ }
1260
+ var B;
1261
+ (function(e) {
1262
+ e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
1263
+ })(B || (B = {}));
1264
+ function sr(e) {
1265
+ return !At || !e ? !1 : e === document.scrollingElement;
1266
+ }
1267
+ function ar(e) {
1268
+ const t = {
1269
+ x: 0,
1270
+ y: 0
1271
+ }, n = sr(e) ? {
1272
+ height: window.innerHeight,
1273
+ width: window.innerWidth
1274
+ } : {
1275
+ height: e.clientHeight,
1276
+ width: e.clientWidth
1277
+ }, r = {
1278
+ x: e.scrollWidth - n.width,
1279
+ y: e.scrollHeight - n.height
1280
+ }, o = e.scrollTop <= t.y, i = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, a = e.scrollLeft >= r.x;
1281
+ return {
1282
+ isTop: o,
1283
+ isLeft: i,
1284
+ isBottom: s,
1285
+ isRight: a,
1286
+ maxScroll: r,
1287
+ minScroll: t
1288
+ };
1289
+ }
1290
+ const ko = {
1291
+ x: 0.2,
1292
+ y: 0.2
1293
+ };
1294
+ function No(e, t, n, r, o) {
1295
+ let {
1296
+ top: i,
1297
+ left: s,
1298
+ right: a,
1299
+ bottom: c
1300
+ } = n;
1301
+ r === void 0 && (r = 10), o === void 0 && (o = ko);
1302
+ const {
1303
+ isTop: l,
1304
+ isBottom: h,
1305
+ isLeft: f,
1306
+ isRight: p
1307
+ } = ar(e), d = {
1308
+ x: 0,
1309
+ y: 0
1310
+ }, m = {
1311
+ x: 0,
1312
+ y: 0
1313
+ }, g = {
1314
+ height: t.height * o.y,
1315
+ width: t.width * o.x
1316
+ };
1317
+ return !l && i <= t.top + g.height ? (d.y = B.Backward, m.y = r * Math.abs((t.top + g.height - i) / g.height)) : !h && c >= t.bottom - g.height && (d.y = B.Forward, m.y = r * Math.abs((t.bottom - g.height - c) / g.height)), !p && a >= t.right - g.width ? (d.x = B.Forward, m.x = r * Math.abs((t.right - g.width - a) / g.width)) : !f && s <= t.left + g.width && (d.x = B.Backward, m.x = r * Math.abs((t.left + g.width - s) / g.width)), {
1318
+ direction: d,
1319
+ speed: m
1320
+ };
1321
+ }
1322
+ function Lo(e) {
1323
+ if (e === document.scrollingElement) {
1324
+ const {
1325
+ innerWidth: i,
1326
+ innerHeight: s
1327
+ } = window;
1328
+ return {
1329
+ top: 0,
1330
+ left: 0,
1331
+ right: i,
1332
+ bottom: s,
1333
+ width: i,
1334
+ height: s
1335
+ };
1336
+ }
1337
+ const {
1338
+ top: t,
1339
+ left: n,
1340
+ right: r,
1341
+ bottom: o
1342
+ } = e.getBoundingClientRect();
1343
+ return {
1344
+ top: t,
1345
+ left: n,
1346
+ right: r,
1347
+ bottom: o,
1348
+ width: e.clientWidth,
1349
+ height: e.clientHeight
1350
+ };
1351
+ }
1352
+ function lr(e) {
1353
+ return e.reduce((t, n) => Fe(t, tn(n)), ce);
1354
+ }
1355
+ function Mo(e) {
1356
+ return e.reduce((t, n) => t + or(n), 0);
1357
+ }
1358
+ function Po(e) {
1359
+ return e.reduce((t, n) => t + ir(n), 0);
1360
+ }
1361
+ function zo(e, t) {
1362
+ if (t === void 0 && (t = Ye), !e)
1363
+ return;
1364
+ const {
1365
+ top: n,
1366
+ left: r,
1367
+ bottom: o,
1368
+ right: i
1369
+ } = t(e);
1370
+ rr(e) && (o <= 0 || i <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
1371
+ block: "center",
1372
+ inline: "center"
1373
+ });
1374
+ }
1375
+ const $o = [["x", ["left", "right"], Mo], ["y", ["top", "bottom"], Po]];
1376
+ class fn {
1377
+ constructor(t, n) {
1378
+ this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
1379
+ const r = dn(n), o = lr(r);
1380
+ this.rect = {
1381
+ ...t
1382
+ }, this.width = t.width, this.height = t.height;
1383
+ for (const [i, s, a] of $o)
1384
+ for (const c of s)
1385
+ Object.defineProperty(this, c, {
1386
+ get: () => {
1387
+ const l = a(r), h = o[i] - l;
1388
+ return this.rect[c] + h;
1389
+ },
1390
+ enumerable: !0
1391
+ });
1392
+ Object.defineProperty(this, "rect", {
1393
+ enumerable: !1
1394
+ });
1395
+ }
1396
+ }
1397
+ class tt {
1398
+ constructor(t) {
1399
+ this.target = void 0, this.listeners = [], this.removeAll = () => {
1400
+ this.listeners.forEach((n) => {
1401
+ var r;
1402
+ return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
1403
+ });
1404
+ }, this.target = t;
1405
+ }
1406
+ add(t, n, r) {
1407
+ var o;
1408
+ (o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
1409
+ }
1410
+ }
1411
+ function Vo(e) {
1412
+ const {
1413
+ EventTarget: t
1414
+ } = K(e);
1415
+ return e instanceof t ? e : He(e);
1416
+ }
1417
+ function Gt(e, t) {
1418
+ const n = Math.abs(e.x), r = Math.abs(e.y);
1419
+ return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
1420
+ }
1421
+ var ae;
1422
+ (function(e) {
1423
+ e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
1424
+ })(ae || (ae = {}));
1425
+ function zn(e) {
1426
+ e.preventDefault();
1427
+ }
1428
+ function Fo(e) {
1429
+ e.stopPropagation();
1430
+ }
1431
+ var j;
1432
+ (function(e) {
1433
+ e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
1434
+ })(j || (j = {}));
1435
+ const cr = {
1436
+ start: [j.Space, j.Enter],
1437
+ cancel: [j.Esc],
1438
+ end: [j.Space, j.Enter, j.Tab]
1439
+ }, Bo = (e, t) => {
1440
+ let {
1441
+ currentCoordinates: n
1442
+ } = t;
1443
+ switch (e.code) {
1444
+ case j.Right:
1445
+ return {
1446
+ ...n,
1447
+ x: n.x + 25
1448
+ };
1449
+ case j.Left:
1450
+ return {
1451
+ ...n,
1452
+ x: n.x - 25
1453
+ };
1454
+ case j.Down:
1455
+ return {
1456
+ ...n,
1457
+ y: n.y + 25
1458
+ };
1459
+ case j.Up:
1460
+ return {
1461
+ ...n,
1462
+ y: n.y - 25
1463
+ };
1464
+ }
1465
+ };
1466
+ class ur {
1467
+ constructor(t) {
1468
+ this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
1469
+ const {
1470
+ event: {
1471
+ target: n
1472
+ }
1473
+ } = t;
1474
+ this.props = t, this.listeners = new tt(He(n)), this.windowListeners = new tt(K(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
1475
+ }
1476
+ attach() {
1477
+ this.handleStart(), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(ae.Keydown, this.handleKeyDown));
1478
+ }
1479
+ handleStart() {
1480
+ const {
1481
+ activeNode: t,
1482
+ onStart: n
1483
+ } = this.props, r = t.node.current;
1484
+ r && zo(r), n(ce);
1485
+ }
1486
+ handleKeyDown(t) {
1487
+ if (un(t)) {
1488
+ const {
1489
+ active: n,
1490
+ context: r,
1491
+ options: o
1492
+ } = this.props, {
1493
+ keyboardCodes: i = cr,
1494
+ coordinateGetter: s = Bo,
1495
+ scrollBehavior: a = "smooth"
1496
+ } = o, {
1497
+ code: c
1498
+ } = t;
1499
+ if (i.end.includes(c)) {
1500
+ this.handleEnd(t);
1501
+ return;
1502
+ }
1503
+ if (i.cancel.includes(c)) {
1504
+ this.handleCancel(t);
1505
+ return;
1506
+ }
1507
+ const {
1508
+ collisionRect: l
1509
+ } = r.current, h = l ? {
1510
+ x: l.left,
1511
+ y: l.top
1512
+ } : ce;
1513
+ this.referenceCoordinates || (this.referenceCoordinates = h);
1514
+ const f = s(t, {
1515
+ active: n,
1516
+ context: r.current,
1517
+ currentCoordinates: h
1518
+ });
1519
+ if (f) {
1520
+ const p = _t(f, h), d = {
1521
+ x: 0,
1522
+ y: 0
1523
+ }, {
1524
+ scrollableAncestors: m
1525
+ } = r.current;
1526
+ for (const g of m) {
1527
+ const b = t.code, {
1528
+ isTop: x,
1529
+ isRight: w,
1530
+ isLeft: C,
1531
+ isBottom: E,
1532
+ maxScroll: O,
1533
+ minScroll: S
1534
+ } = ar(g), R = Lo(g), D = {
1535
+ x: Math.min(b === j.Right ? R.right - R.width / 2 : R.right, Math.max(b === j.Right ? R.left : R.left + R.width / 2, f.x)),
1536
+ y: Math.min(b === j.Down ? R.bottom - R.height / 2 : R.bottom, Math.max(b === j.Down ? R.top : R.top + R.height / 2, f.y))
1537
+ }, P = b === j.Right && !w || b === j.Left && !C, $ = b === j.Down && !E || b === j.Up && !x;
1538
+ if (P && D.x !== f.x) {
1539
+ const N = g.scrollLeft + p.x, q = b === j.Right && N <= O.x || b === j.Left && N >= S.x;
1540
+ if (q && !p.y) {
1541
+ g.scrollTo({
1542
+ left: N,
1543
+ behavior: a
1544
+ });
1545
+ return;
1546
+ }
1547
+ q ? d.x = g.scrollLeft - N : d.x = b === j.Right ? g.scrollLeft - O.x : g.scrollLeft - S.x, d.x && g.scrollBy({
1548
+ left: -d.x,
1549
+ behavior: a
1550
+ });
1551
+ break;
1552
+ } else if ($ && D.y !== f.y) {
1553
+ const N = g.scrollTop + p.y, q = b === j.Down && N <= O.y || b === j.Up && N >= S.y;
1554
+ if (q && !p.x) {
1555
+ g.scrollTo({
1556
+ top: N,
1557
+ behavior: a
1558
+ });
1559
+ return;
1560
+ }
1561
+ q ? d.y = g.scrollTop - N : d.y = b === j.Down ? g.scrollTop - O.y : g.scrollTop - S.y, d.y && g.scrollBy({
1562
+ top: -d.y,
1563
+ behavior: a
1564
+ });
1565
+ break;
1566
+ }
1567
+ }
1568
+ this.handleMove(t, Fe(_t(f, this.referenceCoordinates), d));
1569
+ }
1570
+ }
1571
+ }
1572
+ handleMove(t, n) {
1573
+ const {
1574
+ onMove: r
1575
+ } = this.props;
1576
+ t.preventDefault(), r(n);
1577
+ }
1578
+ handleEnd(t) {
1579
+ const {
1580
+ onEnd: n
1581
+ } = this.props;
1582
+ t.preventDefault(), this.detach(), n();
1583
+ }
1584
+ handleCancel(t) {
1585
+ const {
1586
+ onCancel: n
1587
+ } = this.props;
1588
+ t.preventDefault(), this.detach(), n();
1589
+ }
1590
+ detach() {
1591
+ this.listeners.removeAll(), this.windowListeners.removeAll();
1592
+ }
1593
+ }
1594
+ ur.activators = [{
1595
+ eventName: "onKeyDown",
1596
+ handler: (e, t, n) => {
1597
+ let {
1598
+ keyboardCodes: r = cr,
1599
+ onActivation: o
1600
+ } = t, {
1601
+ active: i
1602
+ } = n;
1603
+ const {
1604
+ code: s
1605
+ } = e.nativeEvent;
1606
+ if (r.start.includes(s)) {
1607
+ const a = i.activatorNode.current;
1608
+ return a && e.target !== a ? !1 : (e.preventDefault(), o?.({
1609
+ event: e.nativeEvent
1610
+ }), !0);
1611
+ }
1612
+ return !1;
1613
+ }
1614
+ }];
1615
+ function $n(e) {
1616
+ return !!(e && "distance" in e);
1617
+ }
1618
+ function Vn(e) {
1619
+ return !!(e && "delay" in e);
1620
+ }
1621
+ class hn {
1622
+ constructor(t, n, r) {
1623
+ var o;
1624
+ r === void 0 && (r = Vo(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
1625
+ const {
1626
+ event: i
1627
+ } = t, {
1628
+ target: s
1629
+ } = i;
1630
+ this.props = t, this.events = n, this.document = He(s), this.documentListeners = new tt(this.document), this.listeners = new tt(r), this.windowListeners = new tt(K(s)), this.initialCoordinates = (o = en(i)) != null ? o : ce, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
1631
+ }
1632
+ attach() {
1633
+ const {
1634
+ events: t,
1635
+ props: {
1636
+ options: {
1637
+ activationConstraint: n,
1638
+ bypassActivationConstraint: r
1639
+ }
1640
+ }
1641
+ } = this;
1642
+ if (this.listeners.add(t.move.name, this.handleMove, {
1643
+ passive: !1
1644
+ }), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.DragStart, zn), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), this.windowListeners.add(ae.ContextMenu, zn), this.documentListeners.add(ae.Keydown, this.handleKeydown), n) {
1645
+ if (r != null && r({
1646
+ event: this.props.event,
1647
+ activeNode: this.props.activeNode,
1648
+ options: this.props.options
1649
+ }))
1650
+ return this.handleStart();
1651
+ if (Vn(n)) {
1652
+ this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
1653
+ return;
1654
+ }
1655
+ if ($n(n)) {
1656
+ this.handlePending(n);
1657
+ return;
1658
+ }
1659
+ }
1660
+ this.handleStart();
1661
+ }
1662
+ detach() {
1663
+ this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
1664
+ }
1665
+ handlePending(t, n) {
1666
+ const {
1667
+ active: r,
1668
+ onPending: o
1669
+ } = this.props;
1670
+ o(r, t, this.initialCoordinates, n);
1671
+ }
1672
+ handleStart() {
1673
+ const {
1674
+ initialCoordinates: t
1675
+ } = this, {
1676
+ onStart: n
1677
+ } = this.props;
1678
+ t && (this.activated = !0, this.documentListeners.add(ae.Click, Fo, {
1679
+ capture: !0
1680
+ }), this.removeTextSelection(), this.documentListeners.add(ae.SelectionChange, this.removeTextSelection), n(t));
1681
+ }
1682
+ handleMove(t) {
1683
+ var n;
1684
+ const {
1685
+ activated: r,
1686
+ initialCoordinates: o,
1687
+ props: i
1688
+ } = this, {
1689
+ onMove: s,
1690
+ options: {
1691
+ activationConstraint: a
1692
+ }
1693
+ } = i;
1694
+ if (!o)
1695
+ return;
1696
+ const c = (n = en(t)) != null ? n : ce, l = _t(o, c);
1697
+ if (!r && a) {
1698
+ if ($n(a)) {
1699
+ if (a.tolerance != null && Gt(l, a.tolerance))
1700
+ return this.handleCancel();
1701
+ if (Gt(l, a.distance))
1702
+ return this.handleStart();
1703
+ }
1704
+ if (Vn(a) && Gt(l, a.tolerance))
1705
+ return this.handleCancel();
1706
+ this.handlePending(a, l);
1707
+ return;
1708
+ }
1709
+ t.cancelable && t.preventDefault(), s(c);
1710
+ }
1711
+ handleEnd() {
1712
+ const {
1713
+ onAbort: t,
1714
+ onEnd: n
1715
+ } = this.props;
1716
+ this.detach(), this.activated || t(this.props.active), n();
1717
+ }
1718
+ handleCancel() {
1719
+ const {
1720
+ onAbort: t,
1721
+ onCancel: n
1722
+ } = this.props;
1723
+ this.detach(), this.activated || t(this.props.active), n();
1724
+ }
1725
+ handleKeydown(t) {
1726
+ t.code === j.Esc && this.handleCancel();
1727
+ }
1728
+ removeTextSelection() {
1729
+ var t;
1730
+ (t = this.document.getSelection()) == null || t.removeAllRanges();
1731
+ }
1732
+ }
1733
+ const Wo = {
1734
+ cancel: {
1735
+ name: "pointercancel"
1736
+ },
1737
+ move: {
1738
+ name: "pointermove"
1739
+ },
1740
+ end: {
1741
+ name: "pointerup"
1742
+ }
1743
+ };
1744
+ class vn extends hn {
1745
+ constructor(t) {
1746
+ const {
1747
+ event: n
1748
+ } = t, r = He(n.target);
1749
+ super(t, Wo, r);
1750
+ }
1751
+ }
1752
+ vn.activators = [{
1753
+ eventName: "onPointerDown",
1754
+ handler: (e, t) => {
1755
+ let {
1756
+ nativeEvent: n
1757
+ } = e, {
1758
+ onActivation: r
1759
+ } = t;
1760
+ return !n.isPrimary || n.button !== 0 ? !1 : (r?.({
1761
+ event: n
1762
+ }), !0);
1763
+ }
1764
+ }];
1765
+ const Ho = {
1766
+ move: {
1767
+ name: "mousemove"
1768
+ },
1769
+ end: {
1770
+ name: "mouseup"
1771
+ }
1772
+ };
1773
+ var nn;
1774
+ (function(e) {
1775
+ e[e.RightClick = 2] = "RightClick";
1776
+ })(nn || (nn = {}));
1777
+ class Yo extends hn {
1778
+ constructor(t) {
1779
+ super(t, Ho, He(t.event.target));
1780
+ }
1781
+ }
1782
+ Yo.activators = [{
1783
+ eventName: "onMouseDown",
1784
+ handler: (e, t) => {
1785
+ let {
1786
+ nativeEvent: n
1787
+ } = e, {
1788
+ onActivation: r
1789
+ } = t;
1790
+ return n.button === nn.RightClick ? !1 : (r?.({
1791
+ event: n
1792
+ }), !0);
1793
+ }
1794
+ }];
1795
+ const qt = {
1796
+ cancel: {
1797
+ name: "touchcancel"
1798
+ },
1799
+ move: {
1800
+ name: "touchmove"
1801
+ },
1802
+ end: {
1803
+ name: "touchend"
1804
+ }
1805
+ };
1806
+ class Uo extends hn {
1807
+ constructor(t) {
1808
+ super(t, qt);
1809
+ }
1810
+ static setup() {
1811
+ return window.addEventListener(qt.move.name, t, {
1812
+ capture: !1,
1813
+ passive: !1
1814
+ }), function() {
1815
+ window.removeEventListener(qt.move.name, t);
1816
+ };
1817
+ function t() {
1818
+ }
1819
+ }
1820
+ }
1821
+ Uo.activators = [{
1822
+ eventName: "onTouchStart",
1823
+ handler: (e, t) => {
1824
+ let {
1825
+ nativeEvent: n
1826
+ } = e, {
1827
+ onActivation: r
1828
+ } = t;
1829
+ const {
1830
+ touches: o
1831
+ } = n;
1832
+ return o.length > 1 ? !1 : (r?.({
1833
+ event: n
1834
+ }), !0);
1835
+ }
1836
+ }];
1837
+ var nt;
1838
+ (function(e) {
1839
+ e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
1840
+ })(nt || (nt = {}));
1841
+ var Tt;
1842
+ (function(e) {
1843
+ e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
1844
+ })(Tt || (Tt = {}));
1845
+ function Go(e) {
1846
+ let {
1847
+ acceleration: t,
1848
+ activator: n = nt.Pointer,
1849
+ canScroll: r,
1850
+ draggingRect: o,
1851
+ enabled: i,
1852
+ interval: s = 5,
1853
+ order: a = Tt.TreeOrder,
1854
+ pointerCoordinates: c,
1855
+ scrollableAncestors: l,
1856
+ scrollableAncestorRects: h,
1857
+ delta: f,
1858
+ threshold: p
1859
+ } = e;
1860
+ const d = Xo({
1861
+ delta: f,
1862
+ disabled: !i
1863
+ }), [m, g] = no(), b = M({
1864
+ x: 0,
1865
+ y: 0
1866
+ }), x = M({
1867
+ x: 0,
1868
+ y: 0
1869
+ }), w = A(() => {
1870
+ switch (n) {
1871
+ case nt.Pointer:
1872
+ return c ? {
1873
+ top: c.y,
1874
+ bottom: c.y,
1875
+ left: c.x,
1876
+ right: c.x
1877
+ } : null;
1878
+ case nt.DraggableRect:
1879
+ return o;
1880
+ }
1881
+ }, [n, o, c]), C = M(null), E = G(() => {
1882
+ const S = C.current;
1883
+ if (!S)
1884
+ return;
1885
+ const R = b.current.x * x.current.x, D = b.current.y * x.current.y;
1886
+ S.scrollBy(R, D);
1887
+ }, []), O = A(() => a === Tt.TreeOrder ? [...l].reverse() : l, [a, l]);
1888
+ L(
1889
+ () => {
1890
+ if (!i || !l.length || !w) {
1891
+ g();
1892
+ return;
1893
+ }
1894
+ for (const S of O) {
1895
+ if (r?.(S) === !1)
1896
+ continue;
1897
+ const R = l.indexOf(S), D = h[R];
1898
+ if (!D)
1899
+ continue;
1900
+ const {
1901
+ direction: P,
1902
+ speed: $
1903
+ } = No(S, D, w, t, p);
1904
+ for (const N of ["x", "y"])
1905
+ d[N][P[N]] || ($[N] = 0, P[N] = 0);
1906
+ if ($.x > 0 || $.y > 0) {
1907
+ g(), C.current = S, m(E, s), b.current = $, x.current = P;
1908
+ return;
1909
+ }
1910
+ }
1911
+ b.current = {
1912
+ x: 0,
1913
+ y: 0
1914
+ }, x.current = {
1915
+ x: 0,
1916
+ y: 0
1917
+ }, g();
1918
+ },
1919
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1920
+ [
1921
+ t,
1922
+ E,
1923
+ r,
1924
+ g,
1925
+ i,
1926
+ s,
1927
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1928
+ JSON.stringify(w),
1929
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1930
+ JSON.stringify(d),
1931
+ m,
1932
+ l,
1933
+ O,
1934
+ h,
1935
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1936
+ JSON.stringify(p)
1937
+ ]
1938
+ );
1939
+ }
1940
+ const qo = {
1941
+ x: {
1942
+ [B.Backward]: !1,
1943
+ [B.Forward]: !1
1944
+ },
1945
+ y: {
1946
+ [B.Backward]: !1,
1947
+ [B.Forward]: !1
1948
+ }
1949
+ };
1950
+ function Xo(e) {
1951
+ let {
1952
+ delta: t,
1953
+ disabled: n
1954
+ } = e;
1955
+ const r = Qt(t);
1956
+ return dt((o) => {
1957
+ if (n || !r || !o)
1958
+ return qo;
1959
+ const i = {
1960
+ x: Math.sign(t.x - r.x),
1961
+ y: Math.sign(t.y - r.y)
1962
+ };
1963
+ return {
1964
+ x: {
1965
+ [B.Backward]: o.x[B.Backward] || i.x === -1,
1966
+ [B.Forward]: o.x[B.Forward] || i.x === 1
1967
+ },
1968
+ y: {
1969
+ [B.Backward]: o.y[B.Backward] || i.y === -1,
1970
+ [B.Forward]: o.y[B.Forward] || i.y === 1
1971
+ }
1972
+ };
1973
+ }, [n, t, r]);
1974
+ }
1975
+ function Jo(e, t) {
1976
+ const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
1977
+ return dt((o) => {
1978
+ var i;
1979
+ return t == null ? null : (i = r ?? o) != null ? i : null;
1980
+ }, [r, t]);
1981
+ }
1982
+ function Ko(e, t) {
1983
+ return A(() => e.reduce((n, r) => {
1984
+ const {
1985
+ sensor: o
1986
+ } = r, i = o.activators.map((s) => ({
1987
+ eventName: s.eventName,
1988
+ handler: t(s.handler, r)
1989
+ }));
1990
+ return [...n, ...i];
1991
+ }, []), [e, t]);
1992
+ }
1993
+ var it;
1994
+ (function(e) {
1995
+ e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1996
+ })(it || (it = {}));
1997
+ var rn;
1998
+ (function(e) {
1999
+ e.Optimized = "optimized";
2000
+ })(rn || (rn = {}));
2001
+ const Fn = /* @__PURE__ */ new Map();
2002
+ function Zo(e, t) {
2003
+ let {
2004
+ dragging: n,
2005
+ dependencies: r,
2006
+ config: o
2007
+ } = t;
2008
+ const [i, s] = re(null), {
2009
+ frequency: a,
2010
+ measure: c,
2011
+ strategy: l
2012
+ } = o, h = M(e), f = b(), p = ot(f), d = G(function(x) {
2013
+ x === void 0 && (x = []), !p.current && s((w) => w === null ? x : w.concat(x.filter((C) => !w.includes(C))));
2014
+ }, [p]), m = M(null), g = dt((x) => {
2015
+ if (f && !n)
2016
+ return Fn;
2017
+ if (!x || x === Fn || h.current !== e || i != null) {
2018
+ const w = /* @__PURE__ */ new Map();
2019
+ for (let C of e) {
2020
+ if (!C)
2021
+ continue;
2022
+ if (i && i.length > 0 && !i.includes(C.id) && C.rect.current) {
2023
+ w.set(C.id, C.rect.current);
2024
+ continue;
2025
+ }
2026
+ const E = C.node.current, O = E ? new fn(c(E), E) : null;
2027
+ C.rect.current = O, O && w.set(C.id, O);
2028
+ }
2029
+ return w;
2030
+ }
2031
+ return x;
2032
+ }, [e, i, n, f, c]);
2033
+ return L(() => {
2034
+ h.current = e;
2035
+ }, [e]), L(
2036
+ () => {
2037
+ f || d();
2038
+ },
2039
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2040
+ [n, f]
2041
+ ), L(
2042
+ () => {
2043
+ i && i.length > 0 && s(null);
2044
+ },
2045
+ //eslint-disable-next-line react-hooks/exhaustive-deps
2046
+ [JSON.stringify(i)]
2047
+ ), L(
2048
+ () => {
2049
+ f || typeof a != "number" || m.current !== null || (m.current = setTimeout(() => {
2050
+ d(), m.current = null;
2051
+ }, a));
2052
+ },
2053
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2054
+ [a, f, d, ...r]
2055
+ ), {
2056
+ droppableRects: g,
2057
+ measureDroppableContainers: d,
2058
+ measuringScheduled: i != null
2059
+ };
2060
+ function b() {
2061
+ switch (l) {
2062
+ case it.Always:
2063
+ return !1;
2064
+ case it.BeforeDragging:
2065
+ return n;
2066
+ default:
2067
+ return !n;
2068
+ }
2069
+ }
2070
+ }
2071
+ function dr(e, t) {
2072
+ return dt((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
2073
+ }
2074
+ function Qo(e, t) {
2075
+ return dr(e, t);
2076
+ }
2077
+ function ei(e) {
2078
+ let {
2079
+ callback: t,
2080
+ disabled: n
2081
+ } = e;
2082
+ const r = cn(t), o = A(() => {
2083
+ if (n || typeof window > "u" || typeof window.MutationObserver > "u")
2084
+ return;
2085
+ const {
2086
+ MutationObserver: i
2087
+ } = window;
2088
+ return new i(r);
2089
+ }, [r, n]);
2090
+ return L(() => () => o?.disconnect(), [o]), o;
2091
+ }
2092
+ function kt(e) {
2093
+ let {
2094
+ callback: t,
2095
+ disabled: n
2096
+ } = e;
2097
+ const r = cn(t), o = A(
2098
+ () => {
2099
+ if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
2100
+ return;
2101
+ const {
2102
+ ResizeObserver: i
2103
+ } = window;
2104
+ return new i(r);
2105
+ },
2106
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2107
+ [n]
2108
+ );
2109
+ return L(() => () => o?.disconnect(), [o]), o;
2110
+ }
2111
+ function ti(e) {
2112
+ return new fn(Ye(e), e);
2113
+ }
2114
+ function Bn(e, t, n) {
2115
+ t === void 0 && (t = ti);
2116
+ const [r, o] = re(null);
2117
+ function i() {
2118
+ o((c) => {
2119
+ if (!e)
2120
+ return null;
2121
+ if (e.isConnected === !1) {
2122
+ var l;
2123
+ return (l = c ?? n) != null ? l : null;
2124
+ }
2125
+ const h = t(e);
2126
+ return JSON.stringify(c) === JSON.stringify(h) ? c : h;
2127
+ });
2128
+ }
2129
+ const s = ei({
2130
+ callback(c) {
2131
+ if (e)
2132
+ for (const l of c) {
2133
+ const {
2134
+ type: h,
2135
+ target: f
2136
+ } = l;
2137
+ if (h === "childList" && f instanceof HTMLElement && f.contains(e)) {
2138
+ i();
2139
+ break;
2140
+ }
2141
+ }
2142
+ }
2143
+ }), a = kt({
2144
+ callback: i
2145
+ });
2146
+ return pe(() => {
2147
+ i(), e ? (a?.observe(e), s?.observe(document.body, {
2148
+ childList: !0,
2149
+ subtree: !0
2150
+ })) : (a?.disconnect(), s?.disconnect());
2151
+ }, [e]), r;
2152
+ }
2153
+ function ni(e) {
2154
+ const t = dr(e);
2155
+ return nr(e, t);
2156
+ }
2157
+ const Wn = [];
2158
+ function ri(e) {
2159
+ const t = M(e), n = dt((r) => e ? r && r !== Wn && e && t.current && e.parentNode === t.current.parentNode ? r : dn(e) : Wn, [e]);
2160
+ return L(() => {
2161
+ t.current = e;
2162
+ }, [e]), n;
2163
+ }
2164
+ function oi(e) {
2165
+ const [t, n] = re(null), r = M(e), o = G((i) => {
2166
+ const s = Ut(i.target);
2167
+ s && n((a) => a ? (a.set(s, tn(s)), new Map(a)) : null);
2168
+ }, []);
2169
+ return L(() => {
2170
+ const i = r.current;
2171
+ if (e !== i) {
2172
+ s(i);
2173
+ const a = e.map((c) => {
2174
+ const l = Ut(c);
2175
+ return l ? (l.addEventListener("scroll", o, {
2176
+ passive: !0
2177
+ }), [l, tn(l)]) : null;
2178
+ }).filter((c) => c != null);
2179
+ n(a.length ? new Map(a) : null), r.current = e;
2180
+ }
2181
+ return () => {
2182
+ s(e), s(i);
2183
+ };
2184
+ function s(a) {
2185
+ a.forEach((c) => {
2186
+ const l = Ut(c);
2187
+ l?.removeEventListener("scroll", o);
2188
+ });
2189
+ }
2190
+ }, [o, e]), A(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => Fe(i, s), ce) : lr(e) : ce, [e, t]);
2191
+ }
2192
+ function Hn(e, t) {
2193
+ t === void 0 && (t = []);
2194
+ const n = M(null);
2195
+ return L(
2196
+ () => {
2197
+ n.current = null;
2198
+ },
2199
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2200
+ t
2201
+ ), L(() => {
2202
+ const r = e !== ce;
2203
+ r && !n.current && (n.current = e), !r && n.current && (n.current = null);
2204
+ }, [e]), n.current ? _t(e, n.current) : ce;
2205
+ }
2206
+ function ii(e) {
2207
+ L(
2208
+ () => {
2209
+ if (!At)
2210
+ return;
2211
+ const t = e.map((n) => {
2212
+ let {
2213
+ sensor: r
2214
+ } = n;
2215
+ return r.setup == null ? void 0 : r.setup();
2216
+ });
2217
+ return () => {
2218
+ for (const n of t)
2219
+ n?.();
2220
+ };
2221
+ },
2222
+ // TO-DO: Sensors length could theoretically change which would not be a valid dependency
2223
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2224
+ e.map((t) => {
2225
+ let {
2226
+ sensor: n
2227
+ } = t;
2228
+ return n;
2229
+ })
2230
+ );
2231
+ }
2232
+ function si(e, t) {
2233
+ return A(() => e.reduce((n, r) => {
2234
+ let {
2235
+ eventName: o,
2236
+ handler: i
2237
+ } = r;
2238
+ return n[o] = (s) => {
2239
+ i(s, t);
2240
+ }, n;
2241
+ }, {}), [e, t]);
2242
+ }
2243
+ function fr(e) {
2244
+ return A(() => e ? jo(e) : null, [e]);
2245
+ }
2246
+ const Yn = [];
2247
+ function ai(e, t) {
2248
+ t === void 0 && (t = Ye);
2249
+ const [n] = e, r = fr(n ? K(n) : null), [o, i] = re(Yn);
2250
+ function s() {
2251
+ i(() => e.length ? e.map((c) => sr(c) ? r : new fn(t(c), c)) : Yn);
2252
+ }
2253
+ const a = kt({
2254
+ callback: s
2255
+ });
2256
+ return pe(() => {
2257
+ a?.disconnect(), s(), e.forEach((c) => a?.observe(c));
2258
+ }, [e]), o;
2259
+ }
2260
+ function li(e) {
2261
+ if (!e)
2262
+ return null;
2263
+ if (e.children.length > 1)
2264
+ return e;
2265
+ const t = e.children[0];
2266
+ return ut(t) ? t : e;
2267
+ }
2268
+ function ci(e) {
2269
+ let {
2270
+ measure: t
2271
+ } = e;
2272
+ const [n, r] = re(null), o = G((l) => {
2273
+ for (const {
2274
+ target: h
2275
+ } of l)
2276
+ if (ut(h)) {
2277
+ r((f) => {
2278
+ const p = t(h);
2279
+ return f ? {
2280
+ ...f,
2281
+ width: p.width,
2282
+ height: p.height
2283
+ } : p;
2284
+ });
2285
+ break;
2286
+ }
2287
+ }, [t]), i = kt({
2288
+ callback: o
2289
+ }), s = G((l) => {
2290
+ const h = li(l);
2291
+ i?.disconnect(), h && i?.observe(h), r(h ? t(h) : null);
2292
+ }, [t, i]), [a, c] = Dt(s);
2293
+ return A(() => ({
2294
+ nodeRef: a,
2295
+ rect: n,
2296
+ setRef: c
2297
+ }), [n, a, c]);
2298
+ }
2299
+ const ui = [{
2300
+ sensor: vn,
2301
+ options: {}
2302
+ }, {
2303
+ sensor: ur,
2304
+ options: {}
2305
+ }], di = {
2306
+ current: {}
2307
+ }, Rt = {
2308
+ draggable: {
2309
+ measure: Pn
2310
+ },
2311
+ droppable: {
2312
+ measure: Pn,
2313
+ strategy: it.WhileDragging,
2314
+ frequency: rn.Optimized
2315
+ },
2316
+ dragOverlay: {
2317
+ measure: Ye
2318
+ }
2319
+ };
2320
+ class rt extends Map {
2321
+ get(t) {
2322
+ var n;
2323
+ return t != null && (n = super.get(t)) != null ? n : void 0;
2324
+ }
2325
+ toArray() {
2326
+ return Array.from(this.values());
2327
+ }
2328
+ getEnabled() {
2329
+ return this.toArray().filter((t) => {
2330
+ let {
2331
+ disabled: n
2332
+ } = t;
2333
+ return !n;
2334
+ });
2335
+ }
2336
+ getNodeFor(t) {
2337
+ var n, r;
2338
+ return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
2339
+ }
2340
+ }
2341
+ const fi = {
2342
+ activatorEvent: null,
2343
+ active: null,
2344
+ activeNode: null,
2345
+ activeNodeRect: null,
2346
+ collisions: null,
2347
+ containerNodeRect: null,
2348
+ draggableNodes: /* @__PURE__ */ new Map(),
2349
+ droppableRects: /* @__PURE__ */ new Map(),
2350
+ droppableContainers: /* @__PURE__ */ new rt(),
2351
+ over: null,
2352
+ dragOverlay: {
2353
+ nodeRef: {
2354
+ current: null
2355
+ },
2356
+ rect: null,
2357
+ setRef: Ot
2358
+ },
2359
+ scrollableAncestors: [],
2360
+ scrollableAncestorRects: [],
2361
+ measuringConfiguration: Rt,
2362
+ measureDroppableContainers: Ot,
2363
+ windowRect: null,
2364
+ measuringScheduled: !1
2365
+ }, hi = {
2366
+ activatorEvent: null,
2367
+ activators: [],
2368
+ active: null,
2369
+ activeNodeRect: null,
2370
+ ariaDescribedById: {
2371
+ draggable: ""
2372
+ },
2373
+ dispatch: Ot,
2374
+ draggableNodes: /* @__PURE__ */ new Map(),
2375
+ over: null,
2376
+ measureDroppableContainers: Ot
2377
+ }, Nt = /* @__PURE__ */ st(hi), hr = /* @__PURE__ */ st(fi);
2378
+ function vi() {
2379
+ return {
2380
+ draggable: {
2381
+ active: null,
2382
+ initialCoordinates: {
2383
+ x: 0,
2384
+ y: 0
2385
+ },
2386
+ nodes: /* @__PURE__ */ new Map(),
2387
+ translate: {
2388
+ x: 0,
2389
+ y: 0
2390
+ }
2391
+ },
2392
+ droppable: {
2393
+ containers: new rt()
2394
+ }
2395
+ };
2396
+ }
2397
+ function gi(e, t) {
2398
+ switch (t.type) {
2399
+ case V.DragStart:
2400
+ return {
2401
+ ...e,
2402
+ draggable: {
2403
+ ...e.draggable,
2404
+ initialCoordinates: t.initialCoordinates,
2405
+ active: t.active
2406
+ }
2407
+ };
2408
+ case V.DragMove:
2409
+ return e.draggable.active == null ? e : {
2410
+ ...e,
2411
+ draggable: {
2412
+ ...e.draggable,
2413
+ translate: {
2414
+ x: t.coordinates.x - e.draggable.initialCoordinates.x,
2415
+ y: t.coordinates.y - e.draggable.initialCoordinates.y
2416
+ }
2417
+ }
2418
+ };
2419
+ case V.DragEnd:
2420
+ case V.DragCancel:
2421
+ return {
2422
+ ...e,
2423
+ draggable: {
2424
+ ...e.draggable,
2425
+ active: null,
2426
+ initialCoordinates: {
2427
+ x: 0,
2428
+ y: 0
2429
+ },
2430
+ translate: {
2431
+ x: 0,
2432
+ y: 0
2433
+ }
2434
+ }
2435
+ };
2436
+ case V.RegisterDroppable: {
2437
+ const {
2438
+ element: n
2439
+ } = t, {
2440
+ id: r
2441
+ } = n, o = new rt(e.droppable.containers);
2442
+ return o.set(r, n), {
2443
+ ...e,
2444
+ droppable: {
2445
+ ...e.droppable,
2446
+ containers: o
2447
+ }
2448
+ };
2449
+ }
2450
+ case V.SetDroppableDisabled: {
2451
+ const {
2452
+ id: n,
2453
+ key: r,
2454
+ disabled: o
2455
+ } = t, i = e.droppable.containers.get(n);
2456
+ if (!i || r !== i.key)
2457
+ return e;
2458
+ const s = new rt(e.droppable.containers);
2459
+ return s.set(n, {
2460
+ ...i,
2461
+ disabled: o
2462
+ }), {
2463
+ ...e,
2464
+ droppable: {
2465
+ ...e.droppable,
2466
+ containers: s
2467
+ }
2468
+ };
2469
+ }
2470
+ case V.UnregisterDroppable: {
2471
+ const {
2472
+ id: n,
2473
+ key: r
2474
+ } = t, o = e.droppable.containers.get(n);
2475
+ if (!o || r !== o.key)
2476
+ return e;
2477
+ const i = new rt(e.droppable.containers);
2478
+ return i.delete(n), {
2479
+ ...e,
2480
+ droppable: {
2481
+ ...e.droppable,
2482
+ containers: i
2483
+ }
2484
+ };
2485
+ }
2486
+ default:
2487
+ return e;
2488
+ }
2489
+ }
2490
+ function pi(e) {
2491
+ let {
2492
+ disabled: t
2493
+ } = e;
2494
+ const {
2495
+ active: n,
2496
+ activatorEvent: r,
2497
+ draggableNodes: o
2498
+ } = Ae(Nt), i = Qt(r), s = Qt(n?.id);
2499
+ return L(() => {
2500
+ if (!t && !r && i && s != null) {
2501
+ if (!un(i) || document.activeElement === i.target)
2502
+ return;
2503
+ const a = o.get(s);
2504
+ if (!a)
2505
+ return;
2506
+ const {
2507
+ activatorNode: c,
2508
+ node: l
2509
+ } = a;
2510
+ if (!c.current && !l.current)
2511
+ return;
2512
+ requestAnimationFrame(() => {
2513
+ for (const h of [c.current, l.current]) {
2514
+ if (!h)
2515
+ continue;
2516
+ const f = io(h);
2517
+ if (f) {
2518
+ f.focus();
2519
+ break;
2520
+ }
2521
+ }
2522
+ });
2523
+ }
2524
+ }, [r, t, o, s, i]), null;
2525
+ }
2526
+ function bi(e, t) {
2527
+ let {
2528
+ transform: n,
2529
+ ...r
2530
+ } = t;
2531
+ return e != null && e.length ? e.reduce((o, i) => i({
2532
+ transform: o,
2533
+ ...r
2534
+ }), n) : n;
2535
+ }
2536
+ function mi(e) {
2537
+ return A(
2538
+ () => ({
2539
+ draggable: {
2540
+ ...Rt.draggable,
2541
+ ...e?.draggable
2542
+ },
2543
+ droppable: {
2544
+ ...Rt.droppable,
2545
+ ...e?.droppable
2546
+ },
2547
+ dragOverlay: {
2548
+ ...Rt.dragOverlay,
2549
+ ...e?.dragOverlay
2550
+ }
2551
+ }),
2552
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2553
+ [e?.draggable, e?.droppable, e?.dragOverlay]
2554
+ );
2555
+ }
2556
+ function xi(e) {
2557
+ let {
2558
+ activeNode: t,
2559
+ measure: n,
2560
+ initialRect: r,
2561
+ config: o = !0
2562
+ } = e;
2563
+ const i = M(!1), {
2564
+ x: s,
2565
+ y: a
2566
+ } = typeof o == "boolean" ? {
2567
+ x: o,
2568
+ y: o
2569
+ } : o;
2570
+ pe(() => {
2571
+ if (!s && !a || !t) {
2572
+ i.current = !1;
2573
+ return;
2574
+ }
2575
+ if (i.current || !r)
2576
+ return;
2577
+ const l = t?.node.current;
2578
+ if (!l || l.isConnected === !1)
2579
+ return;
2580
+ const h = n(l), f = nr(h, r);
2581
+ if (s || (f.x = 0), a || (f.y = 0), i.current = !0, Math.abs(f.x) > 0 || Math.abs(f.y) > 0) {
2582
+ const p = rr(l);
2583
+ p && p.scrollBy({
2584
+ top: f.y,
2585
+ left: f.x
2586
+ });
2587
+ }
2588
+ }, [t, s, a, r, n]);
2589
+ }
2590
+ const vr = /* @__PURE__ */ st({
2591
+ ...ce,
2592
+ scaleX: 1,
2593
+ scaleY: 1
2594
+ });
2595
+ var Oe;
2596
+ (function(e) {
2597
+ e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
2598
+ })(Oe || (Oe = {}));
2599
+ const gr = /* @__PURE__ */ Nr(function(t) {
2600
+ var n, r, o, i;
2601
+ let {
2602
+ id: s,
2603
+ accessibility: a,
2604
+ autoScroll: c = !0,
2605
+ children: l,
2606
+ sensors: h = ui,
2607
+ collisionDetection: f = Ro,
2608
+ measuring: p,
2609
+ modifiers: d,
2610
+ ...m
2611
+ } = t;
2612
+ const g = Lr(gi, void 0, vi), [b, x] = g, [w, C] = fo(), [E, O] = re(Oe.Uninitialized), S = E === Oe.Initialized, {
2613
+ draggable: {
2614
+ active: R,
2615
+ nodes: D,
2616
+ translate: P
2617
+ },
2618
+ droppable: {
2619
+ containers: $
2620
+ }
2621
+ } = b, N = R != null ? D.get(R) : null, q = M({
2622
+ initial: null,
2623
+ translated: null
2624
+ }), J = A(() => {
2625
+ var U;
2626
+ return R != null ? {
2627
+ id: R,
2628
+ // It's possible for the active node to unmount while dragging
2629
+ data: (U = N?.data) != null ? U : di,
2630
+ rect: q
2631
+ } : null;
2632
+ }, [R, N]), oe = M(null), [me, je] = re(null), [H, Ie] = re(null), ie = ot(m, Object.values(m)), Se = ft("DndDescribedBy", s), v = A(() => $.getEnabled(), [$]), y = mi(p), {
2633
+ droppableRects: T,
2634
+ measureDroppableContainers: k,
2635
+ measuringScheduled: ue
2636
+ } = Zo(v, {
2637
+ dragging: S,
2638
+ dependencies: [P.x, P.y],
2639
+ config: y.droppable
2640
+ }), Y = Jo(D, R), z = A(() => H ? en(H) : null, [H]), X = Ar(), Q = Qo(Y, y.draggable.measure);
2641
+ xi({
2642
+ activeNode: R != null ? D.get(R) : null,
2643
+ config: X.layoutShiftCompensation,
2644
+ initialRect: Q,
2645
+ measure: y.draggable.measure
2646
+ });
2647
+ const I = Bn(Y, y.draggable.measure, Q), Ue = Bn(Y ? Y.parentElement : null), de = M({
2648
+ activatorEvent: null,
2649
+ active: null,
2650
+ activeNode: Y,
2651
+ collisionRect: null,
2652
+ collisions: null,
2653
+ droppableRects: T,
2654
+ draggableNodes: D,
2655
+ draggingNode: null,
2656
+ draggingNodeRect: null,
2657
+ droppableContainers: $,
2658
+ over: null,
2659
+ scrollableAncestors: [],
2660
+ scrollAdjustedTranslate: null
2661
+ }), Ne = $.getNodeFor((n = de.current.over) == null ? void 0 : n.id), xe = ci({
2662
+ measure: y.dragOverlay.measure
2663
+ }), Le = (r = xe.nodeRef.current) != null ? r : Y, Me = S ? (o = xe.rect) != null ? o : I : null, pn = !!(xe.nodeRef.current && xe.rect), bn = ni(pn ? null : I), Mt = fr(Le ? K(Le) : null), Re = ri(S ? Ne ?? Y : null), ht = ai(Re), vt = bi(d, {
2664
+ transform: {
2665
+ x: P.x - bn.x,
2666
+ y: P.y - bn.y,
2667
+ scaleX: 1,
2668
+ scaleY: 1
2669
+ },
2670
+ activatorEvent: H,
2671
+ active: J,
2672
+ activeNodeRect: I,
2673
+ containerNodeRect: Ue,
2674
+ draggingNodeRect: Me,
2675
+ over: de.current.over,
2676
+ overlayNodeRect: xe.rect,
2677
+ scrollableAncestors: Re,
2678
+ scrollableAncestorRects: ht,
2679
+ windowRect: Mt
2680
+ }), mn = z ? Fe(z, P) : null, xn = oi(Re), Er = Hn(xn), Dr = Hn(xn, [I]), Pe = Fe(vt, Er), ze = Me ? Do(Me, vt) : null, Ge = J && ze ? f({
2681
+ active: J,
2682
+ collisionRect: ze,
2683
+ droppableRects: T,
2684
+ droppableContainers: v,
2685
+ pointerCoordinates: mn
2686
+ }) : null, yn = wo(Ge, "id"), [Ce, wn] = re(null), _r = pn ? vt : Fe(vt, Dr), Or = Co(_r, (i = Ce?.rect) != null ? i : null, I), Pt = M(null), Sn = G(
2687
+ (U, ee) => {
2688
+ let {
2689
+ sensor: te,
2690
+ options: Ee
2691
+ } = ee;
2692
+ if (oe.current == null)
2693
+ return;
2694
+ const se = D.get(oe.current);
2695
+ if (!se)
2696
+ return;
2697
+ const ne = U.nativeEvent, fe = new te({
2698
+ active: oe.current,
2699
+ activeNode: se,
2700
+ event: ne,
2701
+ options: Ee,
2702
+ // Sensors need to be instantiated with refs for arguments that change over time
2703
+ // otherwise they are frozen in time with the stale arguments
2704
+ context: de,
2705
+ onAbort(W) {
2706
+ if (!D.get(W))
2707
+ return;
2708
+ const {
2709
+ onDragAbort: he
2710
+ } = ie.current, ye = {
2711
+ id: W
2712
+ };
2713
+ he?.(ye), w({
2714
+ type: "onDragAbort",
2715
+ event: ye
2716
+ });
2717
+ },
2718
+ onPending(W, De, he, ye) {
2719
+ if (!D.get(W))
2720
+ return;
2721
+ const {
2722
+ onDragPending: Xe
2723
+ } = ie.current, _e = {
2724
+ id: W,
2725
+ constraint: De,
2726
+ initialCoordinates: he,
2727
+ offset: ye
2728
+ };
2729
+ Xe?.(_e), w({
2730
+ type: "onDragPending",
2731
+ event: _e
2732
+ });
2733
+ },
2734
+ onStart(W) {
2735
+ const De = oe.current;
2736
+ if (De == null)
2737
+ return;
2738
+ const he = D.get(De);
2739
+ if (!he)
2740
+ return;
2741
+ const {
2742
+ onDragStart: ye
2743
+ } = ie.current, qe = {
2744
+ activatorEvent: ne,
2745
+ active: {
2746
+ id: De,
2747
+ data: he.data,
2748
+ rect: q
2749
+ }
2750
+ };
2751
+ gt(() => {
2752
+ ye?.(qe), O(Oe.Initializing), x({
2753
+ type: V.DragStart,
2754
+ initialCoordinates: W,
2755
+ active: De
2756
+ }), w({
2757
+ type: "onDragStart",
2758
+ event: qe
2759
+ }), je(Pt.current), Ie(ne);
2760
+ });
2761
+ },
2762
+ onMove(W) {
2763
+ x({
2764
+ type: V.DragMove,
2765
+ coordinates: W
2766
+ });
2767
+ },
2768
+ onEnd: $e(V.DragEnd),
2769
+ onCancel: $e(V.DragCancel)
2770
+ });
2771
+ Pt.current = fe;
2772
+ function $e(W) {
2773
+ return async function() {
2774
+ const {
2775
+ active: he,
2776
+ collisions: ye,
2777
+ over: qe,
2778
+ scrollAdjustedTranslate: Xe
2779
+ } = de.current;
2780
+ let _e = null;
2781
+ if (he && Xe) {
2782
+ const {
2783
+ cancelDrop: Je
2784
+ } = ie.current;
2785
+ _e = {
2786
+ activatorEvent: ne,
2787
+ active: he,
2788
+ collisions: ye,
2789
+ delta: Xe,
2790
+ over: qe
2791
+ }, W === V.DragEnd && typeof Je == "function" && await Promise.resolve(Je(_e)) && (W = V.DragCancel);
2792
+ }
2793
+ oe.current = null, gt(() => {
2794
+ x({
2795
+ type: W
2796
+ }), O(Oe.Uninitialized), wn(null), je(null), Ie(null), Pt.current = null;
2797
+ const Je = W === V.DragEnd ? "onDragEnd" : "onDragCancel";
2798
+ if (_e) {
2799
+ const zt = ie.current[Je];
2800
+ zt?.(_e), w({
2801
+ type: Je,
2802
+ event: _e
2803
+ });
2804
+ }
2805
+ });
2806
+ };
2807
+ }
2808
+ },
2809
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2810
+ [D]
2811
+ ), Tr = G((U, ee) => (te, Ee) => {
2812
+ const se = te.nativeEvent, ne = D.get(Ee);
2813
+ if (
2814
+ // Another sensor is already instantiating
2815
+ oe.current !== null || // No active draggable
2816
+ !ne || // Event has already been captured
2817
+ se.dndKit || se.defaultPrevented
2818
+ )
2819
+ return;
2820
+ const fe = {
2821
+ active: ne
2822
+ };
2823
+ U(te, ee.options, fe) === !0 && (se.dndKit = {
2824
+ capturedBy: ee.sensor
2825
+ }, oe.current = Ee, Sn(te, ee));
2826
+ }, [D, Sn]), Rn = Ko(h, Tr);
2827
+ ii(h), pe(() => {
2828
+ I && E === Oe.Initializing && O(Oe.Initialized);
2829
+ }, [I, E]), L(
2830
+ () => {
2831
+ const {
2832
+ onDragMove: U
2833
+ } = ie.current, {
2834
+ active: ee,
2835
+ activatorEvent: te,
2836
+ collisions: Ee,
2837
+ over: se
2838
+ } = de.current;
2839
+ if (!ee || !te)
2840
+ return;
2841
+ const ne = {
2842
+ active: ee,
2843
+ activatorEvent: te,
2844
+ collisions: Ee,
2845
+ delta: {
2846
+ x: Pe.x,
2847
+ y: Pe.y
2848
+ },
2849
+ over: se
2850
+ };
2851
+ gt(() => {
2852
+ U?.(ne), w({
2853
+ type: "onDragMove",
2854
+ event: ne
2855
+ });
2856
+ });
2857
+ },
2858
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2859
+ [Pe.x, Pe.y]
2860
+ ), L(
2861
+ () => {
2862
+ const {
2863
+ active: U,
2864
+ activatorEvent: ee,
2865
+ collisions: te,
2866
+ droppableContainers: Ee,
2867
+ scrollAdjustedTranslate: se
2868
+ } = de.current;
2869
+ if (!U || oe.current == null || !ee || !se)
2870
+ return;
2871
+ const {
2872
+ onDragOver: ne
2873
+ } = ie.current, fe = Ee.get(yn), $e = fe && fe.rect.current ? {
2874
+ id: fe.id,
2875
+ rect: fe.rect.current,
2876
+ data: fe.data,
2877
+ disabled: fe.disabled
2878
+ } : null, W = {
2879
+ active: U,
2880
+ activatorEvent: ee,
2881
+ collisions: te,
2882
+ delta: {
2883
+ x: se.x,
2884
+ y: se.y
2885
+ },
2886
+ over: $e
2887
+ };
2888
+ gt(() => {
2889
+ wn($e), ne?.(W), w({
2890
+ type: "onDragOver",
2891
+ event: W
2892
+ });
2893
+ });
2894
+ },
2895
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2896
+ [yn]
2897
+ ), pe(() => {
2898
+ de.current = {
2899
+ activatorEvent: H,
2900
+ active: J,
2901
+ activeNode: Y,
2902
+ collisionRect: ze,
2903
+ collisions: Ge,
2904
+ droppableRects: T,
2905
+ draggableNodes: D,
2906
+ draggingNode: Le,
2907
+ draggingNodeRect: Me,
2908
+ droppableContainers: $,
2909
+ over: Ce,
2910
+ scrollableAncestors: Re,
2911
+ scrollAdjustedTranslate: Pe
2912
+ }, q.current = {
2913
+ initial: Me,
2914
+ translated: ze
2915
+ };
2916
+ }, [J, Y, Ge, ze, D, Le, Me, T, $, Ce, Re, Pe]), Go({
2917
+ ...X,
2918
+ delta: P,
2919
+ draggingRect: ze,
2920
+ pointerCoordinates: mn,
2921
+ scrollableAncestors: Re,
2922
+ scrollableAncestorRects: ht
2923
+ });
2924
+ const jr = A(() => ({
2925
+ active: J,
2926
+ activeNode: Y,
2927
+ activeNodeRect: I,
2928
+ activatorEvent: H,
2929
+ collisions: Ge,
2930
+ containerNodeRect: Ue,
2931
+ dragOverlay: xe,
2932
+ draggableNodes: D,
2933
+ droppableContainers: $,
2934
+ droppableRects: T,
2935
+ over: Ce,
2936
+ measureDroppableContainers: k,
2937
+ scrollableAncestors: Re,
2938
+ scrollableAncestorRects: ht,
2939
+ measuringConfiguration: y,
2940
+ measuringScheduled: ue,
2941
+ windowRect: Mt
2942
+ }), [J, Y, I, H, Ge, Ue, xe, D, $, T, Ce, k, Re, ht, y, ue, Mt]), Ir = A(() => ({
2943
+ activatorEvent: H,
2944
+ activators: Rn,
2945
+ active: J,
2946
+ activeNodeRect: I,
2947
+ ariaDescribedById: {
2948
+ draggable: Se
2949
+ },
2950
+ dispatch: x,
2951
+ draggableNodes: D,
2952
+ over: Ce,
2953
+ measureDroppableContainers: k
2954
+ }), [H, Rn, J, I, x, Se, D, Ce, k]);
2955
+ return F.createElement(er.Provider, {
2956
+ value: C
2957
+ }, F.createElement(Nt.Provider, {
2958
+ value: Ir
2959
+ }, F.createElement(hr.Provider, {
2960
+ value: jr
2961
+ }, F.createElement(vr.Provider, {
2962
+ value: Or
2963
+ }, l)), F.createElement(pi, {
2964
+ disabled: a?.restoreFocus === !1
2965
+ })), F.createElement(go, {
2966
+ ...a,
2967
+ hiddenTextDescribedById: Se
2968
+ }));
2969
+ function Ar() {
2970
+ const U = me?.autoScrollEnabled === !1, ee = typeof c == "object" ? c.enabled === !1 : c === !1, te = S && !U && !ee;
2971
+ return typeof c == "object" ? {
2972
+ ...c,
2973
+ enabled: te
2974
+ } : {
2975
+ enabled: te
2976
+ };
2977
+ }
2978
+ }), yi = /* @__PURE__ */ st(null), Un = "button", wi = "Draggable";
2979
+ function Si(e) {
2980
+ let {
2981
+ id: t,
2982
+ data: n,
2983
+ disabled: r = !1,
2984
+ attributes: o
2985
+ } = e;
2986
+ const i = ft(wi), {
2987
+ activators: s,
2988
+ activatorEvent: a,
2989
+ active: c,
2990
+ activeNodeRect: l,
2991
+ ariaDescribedById: h,
2992
+ draggableNodes: f,
2993
+ over: p
2994
+ } = Ae(Nt), {
2995
+ role: d = Un,
2996
+ roleDescription: m = "draggable",
2997
+ tabIndex: g = 0
2998
+ } = o ?? {}, b = c?.id === t, x = Ae(b ? vr : yi), [w, C] = Dt(), [E, O] = Dt(), S = si(s, t), R = ot(n);
2999
+ pe(
3000
+ () => (f.set(t, {
3001
+ id: t,
3002
+ key: i,
3003
+ node: w,
3004
+ activatorNode: E,
3005
+ data: R
3006
+ }), () => {
3007
+ const P = f.get(t);
3008
+ P && P.key === i && f.delete(t);
3009
+ }),
3010
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3011
+ [f, t]
3012
+ );
3013
+ const D = A(() => ({
3014
+ role: d,
3015
+ tabIndex: g,
3016
+ "aria-disabled": r,
3017
+ "aria-pressed": b && d === Un ? !0 : void 0,
3018
+ "aria-roledescription": m,
3019
+ "aria-describedby": h.draggable
3020
+ }), [r, d, g, b, m, h.draggable]);
3021
+ return {
3022
+ active: c,
3023
+ activatorEvent: a,
3024
+ activeNodeRect: l,
3025
+ attributes: D,
3026
+ isDragging: b,
3027
+ listeners: r ? void 0 : S,
3028
+ node: w,
3029
+ over: p,
3030
+ setNodeRef: C,
3031
+ setActivatorNodeRef: O,
3032
+ transform: x
3033
+ };
3034
+ }
3035
+ function Ri() {
3036
+ return Ae(hr);
3037
+ }
3038
+ const Ci = "Droppable", Ei = {
3039
+ timeout: 25
3040
+ };
3041
+ function Di(e) {
3042
+ let {
3043
+ data: t,
3044
+ disabled: n = !1,
3045
+ id: r,
3046
+ resizeObserverConfig: o
3047
+ } = e;
3048
+ const i = ft(Ci), {
3049
+ active: s,
3050
+ dispatch: a,
3051
+ over: c,
3052
+ measureDroppableContainers: l
3053
+ } = Ae(Nt), h = M({
3054
+ disabled: n
3055
+ }), f = M(!1), p = M(null), d = M(null), {
3056
+ disabled: m,
3057
+ updateMeasurementsFor: g,
3058
+ timeout: b
3059
+ } = {
3060
+ ...Ei,
3061
+ ...o
3062
+ }, x = ot(g ?? r), w = G(
3063
+ () => {
3064
+ if (!f.current) {
3065
+ f.current = !0;
3066
+ return;
3067
+ }
3068
+ d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
3069
+ l(Array.isArray(x.current) ? x.current : [x.current]), d.current = null;
3070
+ }, b);
3071
+ },
3072
+ //eslint-disable-next-line react-hooks/exhaustive-deps
3073
+ [b]
3074
+ ), C = kt({
3075
+ callback: w,
3076
+ disabled: m || !s
3077
+ }), E = G((D, P) => {
3078
+ C && (P && (C.unobserve(P), f.current = !1), D && C.observe(D));
3079
+ }, [C]), [O, S] = Dt(E), R = ot(t);
3080
+ return L(() => {
3081
+ !C || !O.current || (C.disconnect(), f.current = !1, C.observe(O.current));
3082
+ }, [O, C]), L(
3083
+ () => (a({
3084
+ type: V.RegisterDroppable,
3085
+ element: {
3086
+ id: r,
3087
+ key: i,
3088
+ disabled: n,
3089
+ node: O,
3090
+ rect: p,
3091
+ data: R
3092
+ }
3093
+ }), () => a({
3094
+ type: V.UnregisterDroppable,
3095
+ key: i,
3096
+ id: r
3097
+ })),
3098
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3099
+ [r]
3100
+ ), L(() => {
3101
+ n !== h.current.disabled && (a({
3102
+ type: V.SetDroppableDisabled,
3103
+ id: r,
3104
+ key: i,
3105
+ disabled: n
3106
+ }), h.current.disabled = n);
3107
+ }, [r, i, n, a]), {
3108
+ active: s,
3109
+ rect: p,
3110
+ isOver: c?.id === r,
3111
+ node: O,
3112
+ over: c,
3113
+ setNodeRef: S
3114
+ };
3115
+ }
3116
+ function Lt(e, t, n) {
3117
+ const r = e.slice();
3118
+ return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
3119
+ }
3120
+ function _i(e, t) {
3121
+ return e.reduce((n, r, o) => {
3122
+ const i = t.get(r);
3123
+ return i && (n[o] = i), n;
3124
+ }, Array(e.length));
3125
+ }
3126
+ function yt(e) {
3127
+ return e !== null && e >= 0;
3128
+ }
3129
+ function Oi(e, t) {
3130
+ if (e === t)
3131
+ return !0;
3132
+ if (e.length !== t.length)
3133
+ return !1;
3134
+ for (let n = 0; n < e.length; n++)
3135
+ if (e[n] !== t[n])
3136
+ return !1;
3137
+ return !0;
3138
+ }
3139
+ function Ti(e) {
3140
+ return typeof e == "boolean" ? {
3141
+ draggable: e,
3142
+ droppable: e
3143
+ } : e;
3144
+ }
3145
+ const wt = {
3146
+ scaleX: 1,
3147
+ scaleY: 1
3148
+ }, ji = (e) => {
3149
+ var t;
3150
+ let {
3151
+ rects: n,
3152
+ activeNodeRect: r,
3153
+ activeIndex: o,
3154
+ overIndex: i,
3155
+ index: s
3156
+ } = e;
3157
+ const a = (t = n[o]) != null ? t : r;
3158
+ if (!a)
3159
+ return null;
3160
+ const c = Ii(n, s, o);
3161
+ if (s === o) {
3162
+ const l = n[i];
3163
+ return l ? {
3164
+ x: o < i ? l.left + l.width - (a.left + a.width) : l.left - a.left,
3165
+ y: 0,
3166
+ ...wt
3167
+ } : null;
3168
+ }
3169
+ return s > o && s <= i ? {
3170
+ x: -a.width - c,
3171
+ y: 0,
3172
+ ...wt
3173
+ } : s < o && s >= i ? {
3174
+ x: a.width + c,
3175
+ y: 0,
3176
+ ...wt
3177
+ } : {
3178
+ x: 0,
3179
+ y: 0,
3180
+ ...wt
3181
+ };
3182
+ };
3183
+ function Ii(e, t, n) {
3184
+ const r = e[t], o = e[t - 1], i = e[t + 1];
3185
+ return !r || !o && !i ? 0 : n < t ? o ? r.left - (o.left + o.width) : i.left - (r.left + r.width) : i ? i.left - (r.left + r.width) : r.left - (o.left + o.width);
3186
+ }
3187
+ const pr = (e) => {
3188
+ let {
3189
+ rects: t,
3190
+ activeIndex: n,
3191
+ overIndex: r,
3192
+ index: o
3193
+ } = e;
3194
+ const i = Lt(t, r, n), s = t[o], a = i[o];
3195
+ return !a || !s ? null : {
3196
+ x: a.left - s.left,
3197
+ y: a.top - s.top,
3198
+ scaleX: a.width / s.width,
3199
+ scaleY: a.height / s.height
3200
+ };
3201
+ }, St = {
3202
+ scaleX: 1,
3203
+ scaleY: 1
3204
+ }, Ai = (e) => {
3205
+ var t;
3206
+ let {
3207
+ activeIndex: n,
3208
+ activeNodeRect: r,
3209
+ index: o,
3210
+ rects: i,
3211
+ overIndex: s
3212
+ } = e;
3213
+ const a = (t = i[n]) != null ? t : r;
3214
+ if (!a)
3215
+ return null;
3216
+ if (o === n) {
3217
+ const l = i[s];
3218
+ return l ? {
3219
+ x: 0,
3220
+ y: n < s ? l.top + l.height - (a.top + a.height) : l.top - a.top,
3221
+ ...St
3222
+ } : null;
3223
+ }
3224
+ const c = ki(i, o, n);
3225
+ return o > n && o <= s ? {
3226
+ x: 0,
3227
+ y: -a.height - c,
3228
+ ...St
3229
+ } : o < n && o >= s ? {
3230
+ x: 0,
3231
+ y: a.height + c,
3232
+ ...St
3233
+ } : {
3234
+ x: 0,
3235
+ y: 0,
3236
+ ...St
3237
+ };
3238
+ };
3239
+ function ki(e, t, n) {
3240
+ const r = e[t], o = e[t - 1], i = e[t + 1];
3241
+ return r ? n < t ? o ? r.top - (o.top + o.height) : i ? i.top - (r.top + r.height) : 0 : i ? i.top - (r.top + r.height) : o ? r.top - (o.top + o.height) : 0 : 0;
3242
+ }
3243
+ const br = "Sortable", mr = /* @__PURE__ */ F.createContext({
3244
+ activeIndex: -1,
3245
+ containerId: br,
3246
+ disableTransforms: !1,
3247
+ items: [],
3248
+ overIndex: -1,
3249
+ useDragOverlay: !1,
3250
+ sortedRects: [],
3251
+ strategy: pr,
3252
+ disabled: {
3253
+ draggable: !1,
3254
+ droppable: !1
3255
+ }
3256
+ });
3257
+ function xr(e) {
3258
+ let {
3259
+ children: t,
3260
+ id: n,
3261
+ items: r,
3262
+ strategy: o = pr,
3263
+ disabled: i = !1
3264
+ } = e;
3265
+ const {
3266
+ active: s,
3267
+ dragOverlay: a,
3268
+ droppableRects: c,
3269
+ over: l,
3270
+ measureDroppableContainers: h
3271
+ } = Ri(), f = ft(br, n), p = a.rect !== null, d = A(() => r.map((S) => typeof S == "object" && "id" in S ? S.id : S), [r]), m = s != null, g = s ? d.indexOf(s.id) : -1, b = l ? d.indexOf(l.id) : -1, x = M(d), w = !Oi(d, x.current), C = b !== -1 && g === -1 || w, E = Ti(i);
3272
+ pe(() => {
3273
+ w && m && h(d);
3274
+ }, [w, d, m, h]), L(() => {
3275
+ x.current = d;
3276
+ }, [d]);
3277
+ const O = A(
3278
+ () => ({
3279
+ activeIndex: g,
3280
+ containerId: f,
3281
+ disabled: E,
3282
+ disableTransforms: C,
3283
+ items: d,
3284
+ overIndex: b,
3285
+ useDragOverlay: p,
3286
+ sortedRects: _i(d, c),
3287
+ strategy: o
3288
+ }),
3289
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3290
+ [g, f, E.draggable, E.droppable, C, d, b, c, p, o]
3291
+ );
3292
+ return F.createElement(mr.Provider, {
3293
+ value: O
3294
+ }, t);
3295
+ }
3296
+ const Ni = (e) => {
3297
+ let {
3298
+ id: t,
3299
+ items: n,
3300
+ activeIndex: r,
3301
+ overIndex: o
3302
+ } = e;
3303
+ return Lt(n, r, o).indexOf(t);
3304
+ }, Li = (e) => {
3305
+ let {
3306
+ containerId: t,
3307
+ isSorting: n,
3308
+ wasDragging: r,
3309
+ index: o,
3310
+ items: i,
3311
+ newIndex: s,
3312
+ previousItems: a,
3313
+ previousContainerId: c,
3314
+ transition: l
3315
+ } = e;
3316
+ return !l || !r || a !== i && o === s ? !1 : n ? !0 : s !== o && t === c;
3317
+ }, Mi = {
3318
+ duration: 200,
3319
+ easing: "ease"
3320
+ }, yr = "transform", Pi = /* @__PURE__ */ Be.Transition.toString({
3321
+ property: yr,
3322
+ duration: 0,
3323
+ easing: "linear"
3324
+ }), zi = {
3325
+ roleDescription: "sortable"
3326
+ };
3327
+ function $i(e) {
3328
+ let {
3329
+ disabled: t,
3330
+ index: n,
3331
+ node: r,
3332
+ rect: o
3333
+ } = e;
3334
+ const [i, s] = re(null), a = M(n);
3335
+ return pe(() => {
3336
+ if (!t && n !== a.current && r.current) {
3337
+ const c = o.current;
3338
+ if (c) {
3339
+ const l = Ye(r.current, {
3340
+ ignoreTransform: !0
3341
+ }), h = {
3342
+ x: c.left - l.left,
3343
+ y: c.top - l.top,
3344
+ scaleX: c.width / l.width,
3345
+ scaleY: c.height / l.height
3346
+ };
3347
+ (h.x || h.y) && s(h);
3348
+ }
3349
+ }
3350
+ n !== a.current && (a.current = n);
3351
+ }, [t, n, r, o]), L(() => {
3352
+ i && s(null);
3353
+ }, [i]), i;
3354
+ }
3355
+ function wr(e) {
3356
+ let {
3357
+ animateLayoutChanges: t = Li,
3358
+ attributes: n,
3359
+ disabled: r,
3360
+ data: o,
3361
+ getNewIndex: i = Ni,
3362
+ id: s,
3363
+ strategy: a,
3364
+ resizeObserverConfig: c,
3365
+ transition: l = Mi
3366
+ } = e;
3367
+ const {
3368
+ items: h,
3369
+ containerId: f,
3370
+ activeIndex: p,
3371
+ disabled: d,
3372
+ disableTransforms: m,
3373
+ sortedRects: g,
3374
+ overIndex: b,
3375
+ useDragOverlay: x,
3376
+ strategy: w
3377
+ } = Ae(mr), C = Vi(r, d), E = h.indexOf(s), O = A(() => ({
3378
+ sortable: {
3379
+ containerId: f,
3380
+ index: E,
3381
+ items: h
3382
+ },
3383
+ ...o
3384
+ }), [f, o, E, h]), S = A(() => h.slice(h.indexOf(s)), [h, s]), {
3385
+ rect: R,
3386
+ node: D,
3387
+ isOver: P,
3388
+ setNodeRef: $
3389
+ } = Di({
3390
+ id: s,
3391
+ data: O,
3392
+ disabled: C.droppable,
3393
+ resizeObserverConfig: {
3394
+ updateMeasurementsFor: S,
3395
+ ...c
3396
+ }
3397
+ }), {
3398
+ active: N,
3399
+ activatorEvent: q,
3400
+ activeNodeRect: J,
3401
+ attributes: oe,
3402
+ setNodeRef: me,
3403
+ listeners: je,
3404
+ isDragging: H,
3405
+ over: Ie,
3406
+ setActivatorNodeRef: ie,
3407
+ transform: Se
3408
+ } = Si({
3409
+ id: s,
3410
+ data: O,
3411
+ attributes: {
3412
+ ...zi,
3413
+ ...n
3414
+ },
3415
+ disabled: C.draggable
3416
+ }), v = to($, me), y = !!N, T = y && !m && yt(p) && yt(b), k = !x && H, ue = k && T ? Se : null, z = T ? ue ?? (a ?? w)({
3417
+ rects: g,
3418
+ activeNodeRect: J,
3419
+ activeIndex: p,
3420
+ overIndex: b,
3421
+ index: E
3422
+ }) : null, X = yt(p) && yt(b) ? i({
3423
+ id: s,
3424
+ items: h,
3425
+ activeIndex: p,
3426
+ overIndex: b
3427
+ }) : E, Q = N?.id, I = M({
3428
+ activeId: Q,
3429
+ items: h,
3430
+ newIndex: X,
3431
+ containerId: f
3432
+ }), Ue = h !== I.current.items, de = t({
3433
+ active: N,
3434
+ containerId: f,
3435
+ isDragging: H,
3436
+ isSorting: y,
3437
+ id: s,
3438
+ index: E,
3439
+ items: h,
3440
+ newIndex: I.current.newIndex,
3441
+ previousItems: I.current.items,
3442
+ previousContainerId: I.current.containerId,
3443
+ transition: l,
3444
+ wasDragging: I.current.activeId != null
3445
+ }), Ne = $i({
3446
+ disabled: !de,
3447
+ index: E,
3448
+ node: D,
3449
+ rect: R
3450
+ });
3451
+ return L(() => {
3452
+ y && I.current.newIndex !== X && (I.current.newIndex = X), f !== I.current.containerId && (I.current.containerId = f), h !== I.current.items && (I.current.items = h);
3453
+ }, [y, X, f, h]), L(() => {
3454
+ if (Q === I.current.activeId)
3455
+ return;
3456
+ if (Q != null && I.current.activeId == null) {
3457
+ I.current.activeId = Q;
3458
+ return;
3459
+ }
3460
+ const Le = setTimeout(() => {
3461
+ I.current.activeId = Q;
3462
+ }, 50);
3463
+ return () => clearTimeout(Le);
3464
+ }, [Q]), {
3465
+ active: N,
3466
+ activeIndex: p,
3467
+ attributes: oe,
3468
+ data: O,
3469
+ rect: R,
3470
+ index: E,
3471
+ newIndex: X,
3472
+ items: h,
3473
+ isOver: P,
3474
+ isSorting: y,
3475
+ isDragging: H,
3476
+ listeners: je,
3477
+ node: D,
3478
+ overIndex: b,
3479
+ over: Ie,
3480
+ setNodeRef: v,
3481
+ setActivatorNodeRef: ie,
3482
+ setDroppableNodeRef: $,
3483
+ setDraggableNodeRef: me,
3484
+ transform: Ne ?? z,
3485
+ transition: xe()
3486
+ };
3487
+ function xe() {
3488
+ if (
3489
+ // Temporarily disable transitions for a single frame to set up derived transforms
3490
+ Ne || // Or to prevent items jumping to back to their "new" position when items change
3491
+ Ue && I.current.newIndex === E
3492
+ )
3493
+ return Pi;
3494
+ if (!(k && !un(q) || !l) && (y || de))
3495
+ return Be.Transition.toString({
3496
+ ...l,
3497
+ property: yr
3498
+ });
3499
+ }
3500
+ }
3501
+ function Vi(e, t) {
3502
+ var n, r;
3503
+ return typeof e == "boolean" ? {
3504
+ draggable: e,
3505
+ // Backwards compatibility
3506
+ droppable: !1
3507
+ } : {
3508
+ draggable: (n = e?.draggable) != null ? n : t.draggable,
3509
+ droppable: (r = e?.droppable) != null ? r : t.droppable
3510
+ };
3511
+ }
3512
+ j.Down, j.Right, j.Up, j.Left;
3513
+ const Fi = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Bi = (e) => e.replace(
3514
+ /^([A-Z])|[\s-_]+(\w)/g,
3515
+ (t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
3516
+ ), Gn = (e) => {
3517
+ const t = Bi(e);
3518
+ return t.charAt(0).toUpperCase() + t.slice(1);
3519
+ }, Sr = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim(), Wi = (e) => {
3520
+ for (const t in e)
3521
+ if (t.startsWith("aria-") || t === "role" || t === "title")
3522
+ return !0;
3523
+ };
3524
+ var Hi = {
3525
+ xmlns: "http://www.w3.org/2000/svg",
3526
+ width: 24,
3527
+ height: 24,
3528
+ viewBox: "0 0 24 24",
3529
+ fill: "none",
3530
+ stroke: "currentColor",
3531
+ strokeWidth: 2,
3532
+ strokeLinecap: "round",
3533
+ strokeLinejoin: "round"
3534
+ };
3535
+ const Yi = on(
3536
+ ({
3537
+ color: e = "currentColor",
3538
+ size: t = 24,
3539
+ strokeWidth: n = 2,
3540
+ absoluteStrokeWidth: r,
3541
+ className: o = "",
3542
+ children: i,
3543
+ iconNode: s,
3544
+ ...a
3545
+ }, c) => Kt(
3546
+ "svg",
3547
+ {
3548
+ ref: c,
3549
+ ...Hi,
3550
+ width: t,
3551
+ height: t,
3552
+ stroke: e,
3553
+ strokeWidth: r ? Number(n) * 24 / Number(t) : n,
3554
+ className: Sr("lucide", o),
3555
+ ...!i && !Wi(a) && { "aria-hidden": "true" },
3556
+ ...a
3557
+ },
3558
+ [
3559
+ ...s.map(([l, h]) => Kt(l, h)),
3560
+ ...Array.isArray(i) ? i : [i]
3561
+ ]
3562
+ )
3563
+ );
3564
+ const Z = (e, t) => {
3565
+ const n = on(
3566
+ ({ className: r, ...o }, i) => Kt(Yi, {
3567
+ ref: i,
3568
+ iconNode: t,
3569
+ className: Sr(
3570
+ `lucide-${Fi(Gn(e))}`,
3571
+ `lucide-${e}`,
3572
+ r
3573
+ ),
3574
+ ...o
3575
+ })
3576
+ );
3577
+ return n.displayName = Gn(e), n;
3578
+ };
3579
+ const Ui = [
3580
+ ["path", { d: "M12 5v14", key: "s699le" }],
3581
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
3582
+ ], Gi = Z("arrow-down", Ui);
3583
+ const qi = [
3584
+ ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
3585
+ ["path", { d: "M17 20V4", key: "1ejh1v" }],
3586
+ ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
3587
+ ["path", { d: "M7 4v16", key: "1glfcx" }]
3588
+ ], Xi = Z("arrow-up-down", qi);
3589
+ const Ji = [
3590
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
3591
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
3592
+ ], Ki = Z("arrow-up", Ji);
3593
+ const Zi = [
3594
+ ["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", key: "1fy3hk" }]
3595
+ ], Qi = Z("bookmark", Zi);
3596
+ const es = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ts = Z("chevron-left", es);
3597
+ const ns = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], rs = Z("chevron-right", ns);
3598
+ const os = [
3599
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
3600
+ ["path", { d: "M12 3v18", key: "108xh3" }]
3601
+ ], is = Z("columns-2", os);
3602
+ const ss = [
3603
+ [
3604
+ "path",
3605
+ {
3606
+ d: "M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",
3607
+ key: "1yo7s0"
3608
+ }
3609
+ ],
3610
+ ["path", { d: "m12 9 6 6", key: "anjzzh" }],
3611
+ ["path", { d: "m18 9-6 6", key: "1fp51s" }]
3612
+ ], as = Z("delete", ss);
3613
+ const ls = [
3614
+ [
3615
+ "path",
3616
+ {
3617
+ d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
3618
+ key: "sc7q7i"
3619
+ }
3620
+ ]
3621
+ ], cs = Z("funnel", ls);
3622
+ const us = [
3623
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
3624
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
3625
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
3626
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
3627
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
3628
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
3629
+ ], ds = Z("grip-vertical", us);
3630
+ const fs = [
3631
+ [
3632
+ "path",
3633
+ {
3634
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
3635
+ key: "1a8usu"
3636
+ }
3637
+ ]
3638
+ ], hs = Z("pen", fs);
3639
+ const vs = [
3640
+ [
3641
+ "path",
3642
+ {
3643
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
3644
+ key: "1i5ecw"
3645
+ }
3646
+ ],
3647
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
3648
+ ], gs = Z("settings", vs);
3649
+ const ps = [
3650
+ ["path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", key: "1m0v6g" }],
3651
+ [
3652
+ "path",
3653
+ {
3654
+ d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",
3655
+ key: "ohrbg2"
3656
+ }
3657
+ ]
3658
+ ], bs = Z("square-pen", ps);
3659
+ const ms = [
3660
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
3661
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
3662
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
3663
+ ], xs = Z("trash", ms);
3664
+ function _(e) {
3665
+ return on((t, n) => {
3666
+ const { children: r, ...o } = t;
3667
+ return (
3668
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3669
+ /* @__PURE__ */ u.jsx(e, { ref: n, ...o, children: r })
3670
+ );
3671
+ });
3672
+ }
3673
+ const Te = new Kn({
3674
+ sortColumn: null,
3675
+ sortDirection: "asc",
3676
+ visibility: {},
3677
+ // initially empty
3678
+ columnOrder: [],
3679
+ // initially empty
3680
+ data: [],
3681
+ sortebleColumns: []
3682
+ });
3683
+ function ys(e) {
3684
+ Te.setState((t) => {
3685
+ const n = e[0] ?? {}, r = Object.keys(n);
3686
+ return {
3687
+ ...t,
3688
+ data: e,
3689
+ columnOrder: r,
3690
+ visibility: r.reduce((o, i) => ({ ...o, [i]: !0 }), {}),
3691
+ sortebleColumns: r.map((o) => ({
3692
+ id: o,
3693
+ label: o,
3694
+ sortable: !0
3695
+ }))
3696
+ };
3697
+ });
3698
+ }
3699
+ const ws = _(at.Trigger), Ss = _(at.Positioner), Rs = _(at.Content), Cs = _(at.Item), Es = _(ke.Label), Ds = _(ke.HiddenInput), _s = _(ke.Control);
3700
+ function Os({ visibility: e, onToggle: t }) {
3701
+ const { sortebleColumns: n } = ct(Te);
3702
+ return /* @__PURE__ */ u.jsxs(at.Root, { closeOnSelect: !1, children: [
3703
+ /* @__PURE__ */ u.jsx(ws, { asChild: !0, children: /* @__PURE__ */ u.jsx(Ve, { "aria-label": "Toggle columns", variant: "outline", size: "sm", ml: "1", children: /* @__PURE__ */ u.jsx(is, { size: 18 }) }) }),
3704
+ /* @__PURE__ */ u.jsx(sn, { children: /* @__PURE__ */ u.jsx(Ss, { children: /* @__PURE__ */ u.jsx(Rs, { minW: "220px", children: n.map((r) => {
3705
+ const o = !!e[r.id];
3706
+ return /* @__PURE__ */ u.jsx(Cs, { value: r.id, closeOnSelect: !1, children: /* @__PURE__ */ u.jsxs(ke.Root, { checked: o, onCheckedChange: () => t(r.id), children: [
3707
+ /* @__PURE__ */ u.jsx(Ds, {}),
3708
+ /* @__PURE__ */ u.jsx(_s, {}),
3709
+ /* @__PURE__ */ u.jsx(Es, { children: r.label })
3710
+ ] }) }, r.id);
3711
+ }) }) }) })
3712
+ ] });
3713
+ }
3714
+ const Ts = (e) => {
3715
+ Te.setState((t) => ({ ...t, columnOrder: e }));
3716
+ }, js = (e) => {
3717
+ Te.setState((t) => ({
3718
+ ...t,
3719
+ visibility: { ...t.visibility, [e]: !t.visibility[e] }
3720
+ }));
3721
+ };
3722
+ function Is(e) {
3723
+ Te.setState((t) => t.sortColumn === e ? {
3724
+ ...t,
3725
+ sortDirection: t.sortDirection === "asc" ? "desc" : "asc"
3726
+ } : {
3727
+ ...t,
3728
+ sortColumn: e,
3729
+ sortDirection: "asc"
3730
+ });
3731
+ }
3732
+ function As({
3733
+ id: e,
3734
+ children: t,
3735
+ onClick: n,
3736
+ cursor: r,
3737
+ borderRight: o,
3738
+ borderRightColor: i
3739
+ }) {
3740
+ const { setNodeRef: s, attributes: a, listeners: c, transform: l, transition: h } = wr({ id: e });
3741
+ return /* @__PURE__ */ u.jsx(
3742
+ ve.ColumnHeader,
3743
+ {
3744
+ ref: s,
3745
+ onClick: n,
3746
+ w: e === "id" ? "80px" : void 0,
3747
+ style: {
3748
+ transform: Be.Transform.toString(l),
3749
+ transition: h,
3750
+ cursor: r,
3751
+ borderRight: o,
3752
+ borderRightColor: i
3753
+ },
3754
+ ...a,
3755
+ children: /* @__PURE__ */ u.jsxs(ge, { justify: "space-between", children: [
3756
+ t,
3757
+ /* @__PURE__ */ u.jsx("span", { ...c, children: /* @__PURE__ */ u.jsx(ds, { size: 12 }) })
3758
+ ] })
3759
+ }
3760
+ );
3761
+ }
3762
+ function ks() {
3763
+ const { columnOrder: e, visibility: t, sortColumn: n, sortDirection: r, sortebleColumns: o } = ct(Te);
3764
+ console.log(e, "fomr header");
3765
+ const i = e.map((a) => o.find((c) => c.id === a)).filter((a) => t[a.id]), s = (a) => {
3766
+ const { active: c, over: l } = a;
3767
+ if (!l || c.id === l.id) return;
3768
+ const h = e.indexOf(c.id), f = e.indexOf(l.id);
3769
+ Ts(Lt(e, h, f));
3770
+ };
3771
+ return /* @__PURE__ */ u.jsx(ve.Header, { background: "gray.100", position: "sticky", top: 0, p: "0", children: /* @__PURE__ */ u.jsx(gr, { collisionDetection: tr, onDragEnd: s, children: /* @__PURE__ */ u.jsx(xr, { items: e, strategy: ji, children: /* @__PURE__ */ u.jsxs(ve.Row, { children: [
3772
+ i.map((a, c) => {
3773
+ const l = n === a?.id, h = c === i.length - 1;
3774
+ return /* @__PURE__ */ u.jsx(
3775
+ As,
3776
+ {
3777
+ id: a?.id,
3778
+ onClick: () => a?.sortable && Is(a?.id),
3779
+ cursor: a?.sortable ? "pointer" : "default",
3780
+ borderRight: h ? void 0 : "2px solid",
3781
+ children: /* @__PURE__ */ u.jsxs(
3782
+ "span",
3783
+ {
3784
+ style: {
3785
+ display: "flex",
3786
+ alignItems: "center",
3787
+ gap: 6,
3788
+ userSelect: "none"
3789
+ },
3790
+ children: [
3791
+ a?.label,
3792
+ a?.sortable && (l ? r === "asc" ? /* @__PURE__ */ u.jsx(Ki, { size: 14 }) : /* @__PURE__ */ u.jsx(Gi, { size: 14 }) : /* @__PURE__ */ u.jsx(Xi, { size: 14, opacity: 0.4 }))
3793
+ ]
3794
+ }
3795
+ )
3796
+ },
3797
+ a?.id
3798
+ );
3799
+ }),
3800
+ /* @__PURE__ */ u.jsx(ve.ColumnHeader, { borderRight: "2px solid", borderRightColor: "gray.300", children: "Actions" }),
3801
+ /* @__PURE__ */ u.jsx(ve.ColumnHeader, { boxSize: "0.5", children: /* @__PURE__ */ u.jsx(Os, { visibility: t, onToggle: js }) })
3802
+ ] }) }) }) });
3803
+ }
3804
+ const qn = Mr({
3805
+ items: [
3806
+ { label: "10", value: "10" },
3807
+ { label: "20", value: "20" },
3808
+ { label: "50", value: "50" },
3809
+ { label: "100", value: "100" }
3810
+ ]
3811
+ }), Ns = _(le.Positioner), Ls = _(le.Content), Ms = _(le.Item), Ps = _(Ct.PrevTrigger), zs = _(Ct.NextTrigger), $s = _(le.HiddenSelect), Vs = _(le.Control), Fs = _(le.Trigger), Bs = _(le.ValueText), Ws = _(le.IndicatorGroup), Hs = _(le.Indicator);
3812
+ function Ys({
3813
+ totalCount: e,
3814
+ pageSize: t,
3815
+ currentPage: n,
3816
+ onPageChange: r,
3817
+ onPageSizeChange: o,
3818
+ siblingCount: i = 2
3819
+ }) {
3820
+ return /* @__PURE__ */ u.jsx(Qe, { mt: 6, width: "100%", children: /* @__PURE__ */ u.jsxs(ge, { justify: "space-between", mx: "auto", flexWrap: "wrap", children: [
3821
+ /* @__PURE__ */ u.jsxs(ge, { children: [
3822
+ /* @__PURE__ */ u.jsx(we, { fontSize: "sm", color: "gray.600", _dark: { color: "gray.400" }, children: "Rows per page:" }),
3823
+ /* @__PURE__ */ u.jsxs(
3824
+ le.Root,
3825
+ {
3826
+ collection: qn,
3827
+ size: "sm",
3828
+ width: "60px",
3829
+ onValueChange: (s) => o && o(Number(s.items[0].value)),
3830
+ value: [String(t)],
3831
+ children: [
3832
+ /* @__PURE__ */ u.jsx($s, {}),
3833
+ /* @__PURE__ */ u.jsxs(Vs, { children: [
3834
+ /* @__PURE__ */ u.jsx(Fs, { children: /* @__PURE__ */ u.jsx(Bs, { placeholder: "" }) }),
3835
+ /* @__PURE__ */ u.jsx(Ws, { children: /* @__PURE__ */ u.jsx(Hs, {}) })
3836
+ ] }),
3837
+ /* @__PURE__ */ u.jsx(sn, { children: /* @__PURE__ */ u.jsx(Ns, { children: /* @__PURE__ */ u.jsx(Ls, { children: qn.items.map((s) => /* @__PURE__ */ u.jsxs(Ms, { item: s.value, children: [
3838
+ s.label,
3839
+ /* @__PURE__ */ u.jsx(le.ItemIndicator, {})
3840
+ ] }, s.value)) }) }) })
3841
+ ]
3842
+ }
3843
+ )
3844
+ ] }),
3845
+ /* @__PURE__ */ u.jsx(
3846
+ Ct.Root,
3847
+ {
3848
+ count: e,
3849
+ pageSize: t,
3850
+ page: n,
3851
+ siblingCount: i,
3852
+ onPageChange: (s) => r && r(s.page),
3853
+ children: /* @__PURE__ */ u.jsxs(Pr, { size: "sm", variant: "ghost", children: [
3854
+ /* @__PURE__ */ u.jsx(Ps, { asChild: !0, children: /* @__PURE__ */ u.jsx(Ve, { "aria-label": "Previous page", children: /* @__PURE__ */ u.jsx(ts, { size: 18 }) }) }),
3855
+ /* @__PURE__ */ u.jsx(
3856
+ Ct.Items,
3857
+ {
3858
+ render: (s) => /* @__PURE__ */ u.jsx(
3859
+ Ve,
3860
+ {
3861
+ variant: s.type === "page" && s.value === n ? "outline" : "ghost",
3862
+ "aria-current": s.type === "page" && s.value === n ? "page" : void 0,
3863
+ children: s.type === "page" ? s.value : "…"
3864
+ },
3865
+ s.value ?? s.type
3866
+ )
3867
+ }
3868
+ ),
3869
+ /* @__PURE__ */ u.jsx(zs, { asChild: !0, children: /* @__PURE__ */ u.jsx(Ve, { "aria-label": "Next page", children: /* @__PURE__ */ u.jsx(rs, { size: 18 }) }) })
3870
+ ] })
3871
+ }
3872
+ )
3873
+ ] }) });
3874
+ }
3875
+ function Us({
3876
+ data: e = []
3877
+ }) {
3878
+ const { columnOrder: t, visibility: n } = ct(Te);
3879
+ return /* @__PURE__ */ u.jsx(ve.Body, { children: e.map((r) => /* @__PURE__ */ u.jsxs(ve.Row, { children: [
3880
+ t.filter((o) => n[o]).map((o) => /* @__PURE__ */ u.jsx(ve.Cell, { children: r[o] }, o)),
3881
+ /* @__PURE__ */ u.jsxs(ve.Cell, { textAlign: "center", display: "flex", gap: 2, children: [
3882
+ /* @__PURE__ */ u.jsx(bs, { size: 16 }),
3883
+ /* @__PURE__ */ u.jsx(xs, { size: 16 })
3884
+ ] })
3885
+ ] }, r.id)) });
3886
+ }
3887
+ function wa({
3888
+ // headers,
3889
+ data: e = [],
3890
+ loading: t = !1,
3891
+ emptyMessage: n = "No data",
3892
+ actions: r,
3893
+ showIndex: o = !0,
3894
+ page: i = 0,
3895
+ pageSize: s = 10,
3896
+ hideHeaderList: a = {},
3897
+ onPageChange: c,
3898
+ onPageSizeChange: l,
3899
+ density: h = "sm"
3900
+ }) {
3901
+ A(() => {
3902
+ ys(e);
3903
+ }, [e]);
3904
+ const { sortColumn: f, sortDirection: p, data: d } = ct(Te), m = A(() => {
3905
+ const g = [...d];
3906
+ f && g.sort(
3907
+ (x, w) => p === "asc" ? String(x[f]).localeCompare(String(w[f])) : String(w[f]).localeCompare(String(x[f]))
3908
+ );
3909
+ const b = (i - 1) * s;
3910
+ return g.slice(b, b + s);
3911
+ }, [i, s, f, p]);
3912
+ return /* @__PURE__ */ u.jsxs(Qe, { h: "100vh", display: "flex", flexDirection: "column", p: 2, pt: 2, children: [
3913
+ /* @__PURE__ */ u.jsx(Qe, { flex: "1", overflow: "hidden", children: /* @__PURE__ */ u.jsx(Qe, { h: "100%", overflowY: "auto", border: "1px solid", borderColor: "gray.200", borderRadius: "md", children: /* @__PURE__ */ u.jsxs(ve.Root, { variant: "outline", w: "100%", size: h, children: [
3914
+ /* @__PURE__ */ u.jsx(ks, {}),
3915
+ /* @__PURE__ */ u.jsx(Us, { data: m })
3916
+ ] }) }) }),
3917
+ /* @__PURE__ */ u.jsx(Qe, { mt: 0.5, children: /* @__PURE__ */ u.jsx(
3918
+ Ys,
3919
+ {
3920
+ totalCount: e.length,
3921
+ pageSize: s,
3922
+ currentPage: i,
3923
+ onPageChange: c,
3924
+ onPageSizeChange: (g) => {
3925
+ l && l(g), i > 1 && c && c(1);
3926
+ }
3927
+ }
3928
+ ) })
3929
+ ] });
3930
+ }
3931
+ const Rr = (e) => `FILTER_PRESETS_${e ?? "default"}`;
3932
+ function Gs(e) {
3933
+ try {
3934
+ return JSON.parse(localStorage.getItem(Rr(e)) || "[]");
3935
+ } catch {
3936
+ return [];
3937
+ }
3938
+ }
3939
+ const jt = new Kn({}), gn = (e) => {
3940
+ const t = jt.state[e];
3941
+ if (t) return t;
3942
+ const n = Gs(e);
3943
+ return jt.setState((r) => ({
3944
+ ...r,
3945
+ [e]: n
3946
+ })), n;
3947
+ }, Cr = (e, t) => {
3948
+ jt.setState((n) => ({
3949
+ ...n,
3950
+ [e]: t
3951
+ })), localStorage.setItem(Rr(e), JSON.stringify(t));
3952
+ }, qs = (e, t) => {
3953
+ const n = gn(e).filter((r) => r.id !== t);
3954
+ Cr(e, n);
3955
+ }, Xs = (e, t) => {
3956
+ const n = [t, ...gn(e)];
3957
+ Cr(e, n);
3958
+ }, Js = _(ke.Root), Ks = _(ke.HiddenInput), Zs = _(ke.Control), Qs = _(lt.Root), ea = _(lt.Track), ta = _(lt.Range), na = _(lt.Thumbs), ra = _(lt.Control), oa = ({ filter: e, onVisibilityChange: t, onSizeChange: n }) => {
3959
+ const { attributes: r, listeners: o, setNodeRef: i, transform: s, transition: a } = wr({
3960
+ id: e.id
3961
+ }), c = {
3962
+ transform: Be.Transform.toString(s),
3963
+ transition: a,
3964
+ cursor: "grab"
3965
+ };
3966
+ return /* @__PURE__ */ u.jsxs(
3967
+ et,
3968
+ {
3969
+ ref: i,
3970
+ style: c,
3971
+ align: "stretch",
3972
+ border: "1px solid",
3973
+ borderColor: "gray.200",
3974
+ rounded: "md",
3975
+ p: 3,
3976
+ mb: 3,
3977
+ ...r,
3978
+ ...o,
3979
+ children: [
3980
+ /* @__PURE__ */ u.jsx(we, { fontWeight: "bold", children: e.label }),
3981
+ /* @__PURE__ */ u.jsxs(ge, { justify: "space-between", children: [
3982
+ /* @__PURE__ */ u.jsx(we, { fontSize: "sm", children: "Visible" }),
3983
+ /* @__PURE__ */ u.jsxs(
3984
+ Js,
3985
+ {
3986
+ checked: e.visible,
3987
+ onCheckedChange: (l) => t && t(e.id, !!l),
3988
+ size: "sm",
3989
+ children: [
3990
+ /* @__PURE__ */ u.jsx(Ks, {}),
3991
+ /* @__PURE__ */ u.jsx(Zs, {})
3992
+ ]
3993
+ }
3994
+ )
3995
+ ] }),
3996
+ /* @__PURE__ */ u.jsxs(et, { align: "stretch", gap: 1, children: [
3997
+ /* @__PURE__ */ u.jsx(we, { fontSize: "sm", children: "Size" }),
3998
+ /* @__PURE__ */ u.jsx(
3999
+ Qs,
4000
+ {
4001
+ width: "200px",
4002
+ min: 1,
4003
+ max: 5,
4004
+ step: 0.5,
4005
+ value: [e.size ?? 1],
4006
+ onChange: (l) => n && n(e.id, l[0]),
4007
+ children: /* @__PURE__ */ u.jsxs(ra, { children: [
4008
+ /* @__PURE__ */ u.jsx(ea, { children: /* @__PURE__ */ u.jsx(ta, {}) }),
4009
+ /* @__PURE__ */ u.jsx(na, {})
4010
+ ] })
4011
+ }
4012
+ )
4013
+ ] })
4014
+ ]
4015
+ }
4016
+ );
4017
+ }, ia = _(be.Root), sa = _(be.Trigger), aa = _(be.Backdrop), la = _(be.Positioner), ca = _(be.Content), ua = _(be.Header), da = _(be.Title), fa = _(be.Body), ha = _(be.Footer), va = _(be.CloseTrigger), ga = _(It.Root), pa = _(It.List), Xt = _(It.Trigger), Jt = _(It.Content), ba = ({
4018
+ filterDrawerSize: e = "sm",
4019
+ onVisibilityChange: t,
4020
+ onSizeChange: n,
4021
+ onClear: r,
4022
+ filters: o,
4023
+ pageKey: i = "default",
4024
+ currentFilters: s = {},
4025
+ onLoadPreset: a,
4026
+ activePresetName: c,
4027
+ onReorder: l
4028
+ }) => {
4029
+ const f = ct(jt)[i] ?? gn(i), p = () => {
4030
+ const d = prompt("Preset name?");
4031
+ d && Xs(i, {
4032
+ id: crypto.randomUUID(),
4033
+ name: d,
4034
+ date: (/* @__PURE__ */ new Date()).toISOString(),
4035
+ filters: s
4036
+ });
4037
+ };
4038
+ return /* @__PURE__ */ u.jsx(ge, { wrap: "wrap", children: /* @__PURE__ */ u.jsxs(ia, { size: e, children: [
4039
+ /* @__PURE__ */ u.jsx(sa, { asChild: !0, children: /* @__PURE__ */ u.jsxs(Ve, { "aria-label": "Open filters", variant: "outline", size: "xs", ml: 2, p: 2, children: [
4040
+ /* @__PURE__ */ u.jsx(cs, { size: 16 }),
4041
+ "Filters"
4042
+ ] }) }),
4043
+ /* @__PURE__ */ u.jsxs(sn, { children: [
4044
+ /* @__PURE__ */ u.jsx(aa, {}),
4045
+ /* @__PURE__ */ u.jsx(la, { children: /* @__PURE__ */ u.jsxs(ca, { children: [
4046
+ /* @__PURE__ */ u.jsx(ua, { children: /* @__PURE__ */ u.jsx(da, { children: "Filters" }) }),
4047
+ /* @__PURE__ */ u.jsx(fa, { overflowY: "auto", pt: 1, children: /* @__PURE__ */ u.jsxs(ga, { defaultValue: "view", children: [
4048
+ /* @__PURE__ */ u.jsxs(pa, { mb: 4, children: [
4049
+ /* @__PURE__ */ u.jsxs(Xt, { value: "view", children: [
4050
+ /* @__PURE__ */ u.jsx(hs, { size: 16 }),
4051
+ "Edit"
4052
+ ] }),
4053
+ /* @__PURE__ */ u.jsxs(Xt, { value: "settings", children: [
4054
+ /* @__PURE__ */ u.jsx(gs, { size: 16 }),
4055
+ "Settings"
4056
+ ] }),
4057
+ /* @__PURE__ */ u.jsxs(Xt, { value: "presets", children: [
4058
+ /* @__PURE__ */ u.jsx(Qi, { size: 16 }),
4059
+ "Presets"
4060
+ ] })
4061
+ ] }),
4062
+ /* @__PURE__ */ u.jsx(Jt, { value: "view", children: o.filter((d) => d.visible).map((d) => /* @__PURE__ */ u.jsxs(
4063
+ et,
4064
+ {
4065
+ align: "stretch",
4066
+ border: "1px solid",
4067
+ borderColor: "gray.200",
4068
+ rounded: "md",
4069
+ p: 3,
4070
+ mb: 3,
4071
+ children: [
4072
+ /* @__PURE__ */ u.jsx(we, { fontWeight: "bold", children: d.label }),
4073
+ d.customComponent
4074
+ ]
4075
+ },
4076
+ d.id
4077
+ )) }),
4078
+ /* @__PURE__ */ u.jsx(Jt, { value: "settings", children: /* @__PURE__ */ u.jsx(
4079
+ gr,
4080
+ {
4081
+ sensors: bo(po(vn)),
4082
+ collisionDetection: tr,
4083
+ onDragEnd: ({ active: d, over: m }) => {
4084
+ if (!m || d.id === m.id) return;
4085
+ const g = o.findIndex((w) => w.id === d.id), b = o.findIndex((w) => w.id === m.id), x = Lt(o, g, b);
4086
+ console.log(x), l?.(x);
4087
+ },
4088
+ children: /* @__PURE__ */ u.jsx(
4089
+ xr,
4090
+ {
4091
+ items: o.map((d) => d.id),
4092
+ strategy: Ai,
4093
+ children: o.map((d) => /* @__PURE__ */ u.jsx(
4094
+ oa,
4095
+ {
4096
+ filter: d,
4097
+ onVisibilityChange: t,
4098
+ onSizeChange: n
4099
+ },
4100
+ d.id
4101
+ ))
4102
+ }
4103
+ )
4104
+ }
4105
+ ) }),
4106
+ /* @__PURE__ */ u.jsx(Jt, { value: "presets", children: /* @__PURE__ */ u.jsxs(et, { align: "stretch", mb: 3, children: [
4107
+ /* @__PURE__ */ u.jsx($t, { size: "sm", colorScheme: "blue", onClick: p, children: "Save Current Filters" }),
4108
+ f.length === 0 && /* @__PURE__ */ u.jsx(we, { fontSize: "xs", color: "gray.500", children: "No presets saved yet." }),
4109
+ f.map((d) => /* @__PURE__ */ u.jsxs(
4110
+ ge,
4111
+ {
4112
+ justify: "space-between",
4113
+ border: "1px solid",
4114
+ borderColor: c === d.name ? "blue.300" : "gray.200",
4115
+ rounded: "md",
4116
+ p: 2,
4117
+ children: [
4118
+ /* @__PURE__ */ u.jsxs(et, { align: "start", gap: 0, children: [
4119
+ /* @__PURE__ */ u.jsx(we, { fontWeight: "bold", fontSize: "sm", children: d.name }),
4120
+ /* @__PURE__ */ u.jsx(we, { fontSize: "xs", color: "gray.500", children: new Date(d.date).toLocaleDateString() })
4121
+ ] }),
4122
+ /* @__PURE__ */ u.jsxs(ge, { children: [
4123
+ /* @__PURE__ */ u.jsx(
4124
+ $t,
4125
+ {
4126
+ size: "xs",
4127
+ variant: "ghost",
4128
+ onClick: () => a?.(d.filters, d.name),
4129
+ children: "Load"
4130
+ }
4131
+ ),
4132
+ /* @__PURE__ */ u.jsx(
4133
+ Ve,
4134
+ {
4135
+ size: "xs",
4136
+ "aria-label": "Delete preset",
4137
+ variant: "ghost",
4138
+ onClick: () => qs(i, d.id),
4139
+ children: /* @__PURE__ */ u.jsx(as, { size: 14 })
4140
+ }
4141
+ )
4142
+ ] })
4143
+ ]
4144
+ },
4145
+ d.id
4146
+ ))
4147
+ ] }) })
4148
+ ] }) }),
4149
+ /* @__PURE__ */ u.jsxs(ha, { justify: "space-between", children: [
4150
+ /* @__PURE__ */ u.jsx(
4151
+ $t,
4152
+ {
4153
+ size: "sm",
4154
+ variant: "ghost",
4155
+ colorScheme: "red",
4156
+ onClick: () => r && r(),
4157
+ children: "Clear All"
4158
+ }
4159
+ ),
4160
+ /* @__PURE__ */ u.jsx(va, { asChild: !0, children: /* @__PURE__ */ u.jsx(zr, {}) })
4161
+ ] })
4162
+ ] }) })
4163
+ ] })
4164
+ ] }) });
4165
+ }, Sa = ({
4166
+ title: e,
4167
+ filters: t,
4168
+ onVisibilityChange: n,
4169
+ onReorder: r,
4170
+ onSizeChange: o,
4171
+ onClear: i,
4172
+ maxToolbarUnits: s,
4173
+ pageKey: a,
4174
+ currentFilters: c,
4175
+ onLoadPreset: l,
4176
+ activePresetName: h,
4177
+ filterDrawerSize: f = "sm"
4178
+ }) => /* @__PURE__ */ u.jsxs(ge, { wrap: "wrap", pl: 2, pr: 2, width: "100%", justify: "space-between", children: [
4179
+ /* @__PURE__ */ u.jsx(we, { children: e }),
4180
+ /* @__PURE__ */ u.jsxs(ge, { children: [
4181
+ t.length > 0 && t.filter((p) => p.visible).map((p) => /* @__PURE__ */ u.jsx(ge, { children: p.customComponent }, p.id)),
4182
+ /* @__PURE__ */ u.jsx(
4183
+ ba,
4184
+ {
4185
+ filterDrawerSize: f,
4186
+ onVisibilityChange: n ? (p, d) => n(p, d) : void 0,
4187
+ onReorder: r,
4188
+ onSizeChange: o ? (p, d) => o(p, d) : void 0,
4189
+ onClear: i,
4190
+ maxToolbarUnits: s,
4191
+ pageKey: a,
4192
+ filters: t,
4193
+ currentFilters: c,
4194
+ onLoadPreset: l,
4195
+ activePresetName: h
4196
+ }
4197
+ )
4198
+ ] })
4199
+ ] }), Ra = (e, t) => {
4200
+ localStorage.setItem(`FILTER_ORDER_${e}`, JSON.stringify(t));
4201
+ }, Ca = (e) => {
4202
+ try {
4203
+ return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`) || "[]");
4204
+ } catch {
4205
+ return [];
4206
+ }
4207
+ };
4208
+ export {
4209
+ wa as DataTable,
4210
+ Sa as Filters,
4211
+ Xs as addPreset,
4212
+ qs as deletePreset,
4213
+ gn as getPresets,
4214
+ Ca as loadOrder,
4215
+ jt as presetStore,
4216
+ Ra as saveOrder,
4217
+ Cr as savePresets,
4218
+ ys as setData,
4219
+ Te as tableStore,
4220
+ _ as withChildren
4221
+ };