vxui-react 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.
Files changed (55) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +198 -0
  3. package/dist/components/Accordion.d.ts +14 -0
  4. package/dist/components/Alert.d.ts +10 -0
  5. package/dist/components/AppShell.d.ts +37 -0
  6. package/dist/components/Avatar.d.ts +12 -0
  7. package/dist/components/Badge.d.ts +7 -0
  8. package/dist/components/Breadcrumb.d.ts +12 -0
  9. package/dist/components/Button.d.ts +10 -0
  10. package/dist/components/Card.d.ts +6 -0
  11. package/dist/components/Checkbox.d.ts +7 -0
  12. package/dist/components/CodeBlock.d.ts +9 -0
  13. package/dist/components/CommandPalette.d.ts +22 -0
  14. package/dist/components/Dialog.d.ts +11 -0
  15. package/dist/components/DropdownMenu.d.ts +23 -0
  16. package/dist/components/Heading.d.ts +13 -0
  17. package/dist/components/Input.d.ts +9 -0
  18. package/dist/components/LanguageSwitcher.d.ts +9 -0
  19. package/dist/components/Pagination.d.ts +9 -0
  20. package/dist/components/Popover.d.ts +13 -0
  21. package/dist/components/Progress.d.ts +11 -0
  22. package/dist/components/Radio.d.ts +12 -0
  23. package/dist/components/Select.d.ts +7 -0
  24. package/dist/components/Separator.d.ts +6 -0
  25. package/dist/components/Skeleton.d.ts +8 -0
  26. package/dist/components/Slider.d.ts +7 -0
  27. package/dist/components/Spinner.d.ts +8 -0
  28. package/dist/components/Switch.d.ts +7 -0
  29. package/dist/components/Table.d.ts +26 -0
  30. package/dist/components/Tabs.d.ts +5 -0
  31. package/dist/components/Text.d.ts +14 -0
  32. package/dist/components/Textarea.d.ts +7 -0
  33. package/dist/components/ThemeProvider.d.ts +46 -0
  34. package/dist/components/Toast.d.ts +15 -0
  35. package/dist/components/Tooltip.d.ts +11 -0
  36. package/dist/components/mobile/ActionSheet.d.ts +15 -0
  37. package/dist/components/mobile/BottomNav.d.ts +15 -0
  38. package/dist/components/mobile/MobileApp.d.ts +1 -0
  39. package/dist/components/mobile/MobileDrawer.d.ts +27 -0
  40. package/dist/components/mobile/MobileList.d.ts +24 -0
  41. package/dist/components/mobile/MobilePreviewPage.d.ts +5 -0
  42. package/dist/components/mobile/MobileShell.d.ts +24 -0
  43. package/dist/components/pages/ErrorPage.d.ts +9 -0
  44. package/dist/components/pages/HomePage.d.ts +10 -0
  45. package/dist/components/pages/LoginPage.d.ts +12 -0
  46. package/dist/components/pages/PrivacyPolicyPage.d.ts +5 -0
  47. package/dist/components/pages/RegisterPage.d.ts +14 -0
  48. package/dist/components/pages/TermsOfServicePage.d.ts +5 -0
  49. package/dist/index.cjs +85 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +3818 -0
  52. package/dist/lib/cx.d.ts +1 -0
  53. package/dist/lib/index.d.ts +61 -0
  54. package/dist/vxui-react.css +1 -0
  55. package/package.json +69 -0
package/dist/index.js ADDED
@@ -0,0 +1,3818 @@
1
+ import { jsx as a, jsxs as g, Fragment as ue } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import q, { forwardRef as ae, createElement as He, useRef as $, useEffect as U, useState as W, useMemo as Ne, useContext as St, createContext as Rt, useCallback as Z } from "react";
4
+ import * as kt from "react-dom";
5
+ import Xn from "react-dom";
6
+ /**
7
+ * @license lucide-react v0.511.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */
12
+ const qn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Zn = (e) => e.replace(
13
+ /^([A-Z])|[\s-_]+(\w)/g,
14
+ (t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
15
+ ), ct = (e) => {
16
+ const t = Zn(e);
17
+ return t.charAt(0).toUpperCase() + t.slice(1);
18
+ }, Pt = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim(), Qn = (e) => {
19
+ for (const t in e)
20
+ if (t.startsWith("aria-") || t === "role" || t === "title")
21
+ return !0;
22
+ };
23
+ /**
24
+ * @license lucide-react v0.511.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */
29
+ var Jn = {
30
+ xmlns: "http://www.w3.org/2000/svg",
31
+ width: 24,
32
+ height: 24,
33
+ viewBox: "0 0 24 24",
34
+ fill: "none",
35
+ stroke: "currentColor",
36
+ strokeWidth: 2,
37
+ strokeLinecap: "round",
38
+ strokeLinejoin: "round"
39
+ };
40
+ /**
41
+ * @license lucide-react v0.511.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */
46
+ const er = ae(
47
+ ({
48
+ color: e = "currentColor",
49
+ size: t = 24,
50
+ strokeWidth: n = 2,
51
+ absoluteStrokeWidth: r,
52
+ className: o = "",
53
+ children: s,
54
+ iconNode: c,
55
+ ...i
56
+ }, d) => He(
57
+ "svg",
58
+ {
59
+ ref: d,
60
+ ...Jn,
61
+ width: t,
62
+ height: t,
63
+ stroke: e,
64
+ strokeWidth: r ? Number(n) * 24 / Number(t) : n,
65
+ className: Pt("lucide", o),
66
+ ...!s && !Qn(i) && { "aria-hidden": "true" },
67
+ ...i
68
+ },
69
+ [
70
+ ...c.map(([u, v]) => He(u, v)),
71
+ ...Array.isArray(s) ? s : [s]
72
+ ]
73
+ )
74
+ );
75
+ /**
76
+ * @license lucide-react v0.511.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */
81
+ const Re = (e, t) => {
82
+ const n = ae(
83
+ ({ className: r, ...o }, s) => He(er, {
84
+ ref: s,
85
+ iconNode: t,
86
+ className: Pt(
87
+ `lucide-${qn(ct(e))}`,
88
+ `lucide-${e}`,
89
+ r
90
+ ),
91
+ ...o
92
+ })
93
+ );
94
+ return n.displayName = ct(e), n;
95
+ };
96
+ /**
97
+ * @license lucide-react v0.511.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */
102
+ const tr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], nr = Re("chevron-right", tr);
103
+ /**
104
+ * @license lucide-react v0.511.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */
109
+ const rr = [
110
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
111
+ ["path", { d: "M9 3v18", key: "fh3hqa" }],
112
+ ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
113
+ ], lt = Re("panel-left-close", rr);
114
+ /**
115
+ * @license lucide-react v0.511.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+ const or = [
121
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
122
+ ["path", { d: "M9 3v18", key: "fh3hqa" }],
123
+ ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
124
+ ], ut = Re("panel-left-open", or);
125
+ /**
126
+ * @license lucide-react v0.511.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */
131
+ const ar = [
132
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
133
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
134
+ ], It = Re("x", ar);
135
+ function E(...e) {
136
+ return e.filter(Boolean).join(" ");
137
+ }
138
+ const dt = ae(function({ className: t, variant: n = "solid", size: r = "md", fullWidth: o = !1, type: s = "button", ...c }, i) {
139
+ return /* @__PURE__ */ a(
140
+ "button",
141
+ {
142
+ ref: i,
143
+ type: s,
144
+ className: E(
145
+ "vx-button",
146
+ `vx-button--${n}`,
147
+ `vx-button--${r}`,
148
+ o && "vx-button--full-width",
149
+ t
150
+ ),
151
+ ...c
152
+ }
153
+ );
154
+ });
155
+ function ns({
156
+ brand: e = "VXUI",
157
+ brandCaption: t,
158
+ brandIcon: n,
159
+ breadcrumb: r,
160
+ title: o,
161
+ description: s,
162
+ navItems: c,
163
+ navSections: i,
164
+ sidebarCollapsed: d = !1,
165
+ mobileNavOpen: u = !1,
166
+ onSidebarToggle: v,
167
+ onMobileNavToggle: h,
168
+ menuButtonLabel: p = "Open navigation",
169
+ sidebarCollapseLabel: y = "Collapse",
170
+ sidebarExpandLabel: N = "Expand",
171
+ sidebarCloseLabel: f = "Close sidebar",
172
+ headerActions: m,
173
+ sidebarFooter: b,
174
+ children: w
175
+ }) {
176
+ const x = i ?? (c ? [{ items: c }] : []), _ = $(null), S = $(null), C = $(null), T = $(null);
177
+ return U(() => {
178
+ const L = [
179
+ { host: _.current, scroll: S.current },
180
+ { host: C.current, scroll: T.current }
181
+ ].flatMap(({ host: k, scroll: A }) => {
182
+ if (!k || !A)
183
+ return [];
184
+ let O;
185
+ const V = () => {
186
+ const j = A.scrollHeight > A.clientHeight + 1;
187
+ if (k.dataset.scrollable = j ? "true" : "false", !j) {
188
+ k.dataset.scrollbarState = "hidden", k.style.setProperty("--vx-scrollbar-thumb-height", "0px"), k.style.setProperty("--vx-scrollbar-thumb-offset", "0px");
189
+ return;
190
+ }
191
+ const G = Math.max(k.clientHeight - 16, 0), X = Math.max(A.clientHeight / A.scrollHeight * G, 36), me = A.scrollHeight - A.clientHeight, De = Math.max(G - X, 0), ce = me > 0 ? A.scrollTop / me * De : 0;
192
+ k.style.setProperty("--vx-scrollbar-thumb-height", `${X}px`), k.style.setProperty("--vx-scrollbar-thumb-offset", `${ce}px`), k.dataset.scrollbarState !== "active" && (k.dataset.scrollbarState = "hidden");
193
+ }, P = () => {
194
+ k.dataset.scrollable === "true" && (k.dataset.scrollbarState = "active", O !== void 0 && window.clearTimeout(O), O = window.setTimeout(() => {
195
+ k.dataset.scrollbarState = "hidden";
196
+ }, 640));
197
+ }, F = () => {
198
+ V(), P();
199
+ };
200
+ V(), A.addEventListener("scroll", F, { passive: !0 });
201
+ const D = new ResizeObserver(() => {
202
+ V();
203
+ });
204
+ return D.observe(k), D.observe(A), [() => {
205
+ A.removeEventListener("scroll", F), D.disconnect(), O !== void 0 && window.clearTimeout(O);
206
+ }];
207
+ });
208
+ return () => {
209
+ L.forEach((k) => k());
210
+ };
211
+ }, []), /* @__PURE__ */ g("div", { className: "vx-shell", "data-collapsed": d, "data-nav-open": u, children: [
212
+ /* @__PURE__ */ g(
213
+ "aside",
214
+ {
215
+ ref: _,
216
+ className: "vx-sidebar vx-scroll-host",
217
+ "data-scrollable": "false",
218
+ "data-scrollbar-state": "hidden",
219
+ children: [
220
+ /* @__PURE__ */ g("div", { ref: S, className: "vx-sidebar__scroll vx-scroll-area", children: [
221
+ /* @__PURE__ */ a("div", { className: "vx-sidebar__header", children: /* @__PURE__ */ g("div", { className: "vx-sidebar__brand", children: [
222
+ n ? /* @__PURE__ */ a("span", { className: "vx-sidebar__brand-icon", children: n }) : null,
223
+ /* @__PURE__ */ g("div", { className: "vx-sidebar__brand-copy", children: [
224
+ /* @__PURE__ */ a("span", { className: "vx-sidebar__brand-text", children: e }),
225
+ t ? /* @__PURE__ */ a("span", { className: "vx-sidebar__brand-caption", children: t }) : null
226
+ ] })
227
+ ] }) }),
228
+ /* @__PURE__ */ a("nav", { className: "vx-sidebar__nav", "aria-label": "Primary navigation", children: x.map((R, L) => /* @__PURE__ */ g(
229
+ "div",
230
+ {
231
+ className: "vx-nav-section-block",
232
+ children: [
233
+ R.title ? /* @__PURE__ */ a("div", { className: "vx-nav-section-block__title", children: R.title }) : null,
234
+ /* @__PURE__ */ a("div", { className: "vx-nav-section-block__items", children: R.items.map((k) => /* @__PURE__ */ g(
235
+ "button",
236
+ {
237
+ type: "button",
238
+ className: E("vx-nav-item", k.active && "vx-nav-item--active"),
239
+ onClick: k.onSelect,
240
+ children: [
241
+ k.icon ? /* @__PURE__ */ a("span", { className: "vx-nav-item__icon", children: k.icon }) : null,
242
+ /* @__PURE__ */ a("span", { className: "vx-nav-item__label", children: k.label }),
243
+ k.badge ? /* @__PURE__ */ a("span", { className: "vx-nav-item__badge", children: k.badge }) : null,
244
+ k.trailing ? /* @__PURE__ */ a("span", { className: "vx-nav-item__trailing", children: k.trailing }) : null
245
+ ]
246
+ },
247
+ k.key
248
+ )) })
249
+ ]
250
+ },
251
+ R.key ?? R.title ?? L
252
+ )) }),
253
+ /* @__PURE__ */ g("div", { className: "vx-sidebar__footer", children: [
254
+ b ? /* @__PURE__ */ a("div", { className: "vx-sidebar__footer-content", children: b }) : null,
255
+ v ? /* @__PURE__ */ g(
256
+ dt,
257
+ {
258
+ variant: "ghost",
259
+ size: "sm",
260
+ className: "vx-sidebar__toggle",
261
+ onClick: v,
262
+ "aria-label": d ? N : y,
263
+ children: [
264
+ d ? /* @__PURE__ */ a(ut, { size: 16 }) : /* @__PURE__ */ a(lt, { size: 16 }),
265
+ /* @__PURE__ */ a("span", { className: "vx-sidebar__toggle-label", children: d ? N : y })
266
+ ]
267
+ }
268
+ ) : null
269
+ ] })
270
+ ] }),
271
+ /* @__PURE__ */ a("span", { className: "vx-overlay-scrollbar", "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: "vx-overlay-scrollbar__thumb" }) })
272
+ ]
273
+ }
274
+ ),
275
+ h ? /* @__PURE__ */ a(
276
+ "button",
277
+ {
278
+ type: "button",
279
+ className: "vx-shell__overlay",
280
+ "aria-label": f,
281
+ onClick: h
282
+ }
283
+ ) : null,
284
+ /* @__PURE__ */ g("div", { className: "vx-shell__main", children: [
285
+ /* @__PURE__ */ g("header", { className: "vx-topbar", children: [
286
+ h ? /* @__PURE__ */ a(
287
+ dt,
288
+ {
289
+ variant: "ghost",
290
+ size: "sm",
291
+ className: "vx-topbar__menu",
292
+ "aria-label": p,
293
+ onClick: h,
294
+ children: u ? /* @__PURE__ */ a(lt, { size: 16 }) : /* @__PURE__ */ a(ut, { size: 16 })
295
+ }
296
+ ) : null,
297
+ /* @__PURE__ */ a("div", { className: "vx-topbar__title-group", children: r || /* @__PURE__ */ g("div", { children: [
298
+ o ? /* @__PURE__ */ a("h1", { className: "vx-topbar__title", children: o }) : null,
299
+ s ? /* @__PURE__ */ a("p", { className: "vx-topbar__description", children: s }) : null
300
+ ] }) }),
301
+ m ? /* @__PURE__ */ a("div", { className: "vx-topbar__actions", children: m }) : null
302
+ ] }),
303
+ /* @__PURE__ */ g(
304
+ "div",
305
+ {
306
+ ref: C,
307
+ className: "vx-shell__content-wrap vx-scroll-host",
308
+ "data-scrollable": "false",
309
+ "data-scrollbar-state": "hidden",
310
+ children: [
311
+ /* @__PURE__ */ a("main", { ref: T, className: "vx-shell__content vx-scroll-area", children: w }),
312
+ /* @__PURE__ */ a("span", { className: "vx-overlay-scrollbar", "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: "vx-overlay-scrollbar__thumb" }) })
313
+ ]
314
+ }
315
+ )
316
+ ] })
317
+ ] });
318
+ }
319
+ function rs({ className: e, variant: t = "neutral", ...n }) {
320
+ return /* @__PURE__ */ a("span", { className: E("vx-badge", `vx-badge--${t}`, e), ...n });
321
+ }
322
+ function os({ className: e, ...t }) {
323
+ return /* @__PURE__ */ a("section", { className: E("vx-card", e), ...t });
324
+ }
325
+ function as({ className: e, ...t }) {
326
+ return /* @__PURE__ */ a("header", { className: E("vx-card__header", e), ...t });
327
+ }
328
+ function ss({ className: e, ...t }) {
329
+ return /* @__PURE__ */ a("h2", { className: E("vx-card__title", e), ...t });
330
+ }
331
+ function is({ className: e, ...t }) {
332
+ return /* @__PURE__ */ a("p", { className: E("vx-card__description", e), ...t });
333
+ }
334
+ function cs({ className: e, ...t }) {
335
+ return /* @__PURE__ */ a("div", { className: E("vx-card__content", e), ...t });
336
+ }
337
+ function I(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
338
+ return function(o) {
339
+ if (e == null || e(o), n === !1 || !o.defaultPrevented)
340
+ return t == null ? void 0 : t(o);
341
+ };
342
+ }
343
+ function ft(e, t) {
344
+ if (typeof e == "function")
345
+ return e(t);
346
+ e != null && (e.current = t);
347
+ }
348
+ function At(...e) {
349
+ return (t) => {
350
+ let n = !1;
351
+ const r = e.map((o) => {
352
+ const s = ft(o, t);
353
+ return !n && typeof s == "function" && (n = !0), s;
354
+ });
355
+ if (n)
356
+ return () => {
357
+ for (let o = 0; o < r.length; o++) {
358
+ const s = r[o];
359
+ typeof s == "function" ? s() : ft(e[o], null);
360
+ }
361
+ };
362
+ };
363
+ }
364
+ function B(...e) {
365
+ return l.useCallback(At(...e), e);
366
+ }
367
+ function sr(e, t) {
368
+ const n = l.createContext(t), r = (s) => {
369
+ const { children: c, ...i } = s, d = l.useMemo(() => i, Object.values(i));
370
+ return /* @__PURE__ */ a(n.Provider, { value: d, children: c });
371
+ };
372
+ r.displayName = e + "Provider";
373
+ function o(s) {
374
+ const c = l.useContext(n);
375
+ if (c) return c;
376
+ if (t !== void 0) return t;
377
+ throw new Error(`\`${s}\` must be used within \`${e}\``);
378
+ }
379
+ return [r, o];
380
+ }
381
+ function se(e, t = []) {
382
+ let n = [];
383
+ function r(s, c) {
384
+ const i = l.createContext(c), d = n.length;
385
+ n = [...n, c];
386
+ const u = (h) => {
387
+ var b;
388
+ const { scope: p, children: y, ...N } = h, f = ((b = p == null ? void 0 : p[e]) == null ? void 0 : b[d]) || i, m = l.useMemo(() => N, Object.values(N));
389
+ return /* @__PURE__ */ a(f.Provider, { value: m, children: y });
390
+ };
391
+ u.displayName = s + "Provider";
392
+ function v(h, p) {
393
+ var f;
394
+ const y = ((f = p == null ? void 0 : p[e]) == null ? void 0 : f[d]) || i, N = l.useContext(y);
395
+ if (N) return N;
396
+ if (c !== void 0) return c;
397
+ throw new Error(`\`${h}\` must be used within \`${s}\``);
398
+ }
399
+ return [u, v];
400
+ }
401
+ const o = () => {
402
+ const s = n.map((c) => l.createContext(c));
403
+ return function(i) {
404
+ const d = (i == null ? void 0 : i[e]) || s;
405
+ return l.useMemo(
406
+ () => ({ [`__scope${e}`]: { ...i, [e]: d } }),
407
+ [i, d]
408
+ );
409
+ };
410
+ };
411
+ return o.scopeName = e, [r, ir(o, ...t)];
412
+ }
413
+ function ir(...e) {
414
+ const t = e[0];
415
+ if (e.length === 1) return t;
416
+ const n = () => {
417
+ const r = e.map((o) => ({
418
+ useScope: o(),
419
+ scopeName: o.scopeName
420
+ }));
421
+ return function(s) {
422
+ const c = r.reduce((i, { useScope: d, scopeName: u }) => {
423
+ const h = d(s)[`__scope${u}`];
424
+ return { ...i, ...h };
425
+ }, {});
426
+ return l.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
427
+ };
428
+ };
429
+ return n.scopeName = t.scopeName, n;
430
+ }
431
+ var Q = globalThis != null && globalThis.document ? l.useLayoutEffect : () => {
432
+ }, cr = l[" useId ".trim().toString()] || (() => {
433
+ }), lr = 0;
434
+ function le(e) {
435
+ const [t, n] = l.useState(cr());
436
+ return Q(() => {
437
+ n((r) => r ?? String(lr++));
438
+ }, [e]), e || (t ? `radix-${t}` : "");
439
+ }
440
+ var ur = l[" useInsertionEffect ".trim().toString()] || Q;
441
+ function de({
442
+ prop: e,
443
+ defaultProp: t,
444
+ onChange: n = () => {
445
+ },
446
+ caller: r
447
+ }) {
448
+ const [o, s, c] = dr({
449
+ defaultProp: t,
450
+ onChange: n
451
+ }), i = e !== void 0, d = i ? e : o;
452
+ {
453
+ const v = l.useRef(e !== void 0);
454
+ l.useEffect(() => {
455
+ const h = v.current;
456
+ h !== i && console.warn(
457
+ `${r} is changing from ${h ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
458
+ ), v.current = i;
459
+ }, [i, r]);
460
+ }
461
+ const u = l.useCallback(
462
+ (v) => {
463
+ var h;
464
+ if (i) {
465
+ const p = fr(v) ? v(e) : v;
466
+ p !== e && ((h = c.current) == null || h.call(c, p));
467
+ } else
468
+ s(v);
469
+ },
470
+ [i, e, s, c]
471
+ );
472
+ return [d, u];
473
+ }
474
+ function dr({
475
+ defaultProp: e,
476
+ onChange: t
477
+ }) {
478
+ const [n, r] = l.useState(e), o = l.useRef(n), s = l.useRef(t);
479
+ return ur(() => {
480
+ s.current = t;
481
+ }, [t]), l.useEffect(() => {
482
+ var c;
483
+ o.current !== n && ((c = s.current) == null || c.call(s, n), o.current = n);
484
+ }, [n, o]), [n, r, s];
485
+ }
486
+ function fr(e) {
487
+ return typeof e == "function";
488
+ }
489
+ // @__NO_SIDE_EFFECTS__
490
+ function Te(e) {
491
+ const t = /* @__PURE__ */ vr(e), n = l.forwardRef((r, o) => {
492
+ const { children: s, ...c } = r, i = l.Children.toArray(s), d = i.find(hr);
493
+ if (d) {
494
+ const u = d.props.children, v = i.map((h) => h === d ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : h);
495
+ return /* @__PURE__ */ a(t, { ...c, ref: o, children: l.isValidElement(u) ? l.cloneElement(u, void 0, v) : null });
496
+ }
497
+ return /* @__PURE__ */ a(t, { ...c, ref: o, children: s });
498
+ });
499
+ return n.displayName = `${e}.Slot`, n;
500
+ }
501
+ // @__NO_SIDE_EFFECTS__
502
+ function vr(e) {
503
+ const t = l.forwardRef((n, r) => {
504
+ const { children: o, ...s } = n;
505
+ if (l.isValidElement(o)) {
506
+ const c = br(o), i = pr(s, o.props);
507
+ return o.type !== l.Fragment && (i.ref = r ? At(r, c) : c), l.cloneElement(o, i);
508
+ }
509
+ return l.Children.count(o) > 1 ? l.Children.only(null) : null;
510
+ });
511
+ return t.displayName = `${e}.SlotClone`, t;
512
+ }
513
+ var mr = Symbol("radix.slottable");
514
+ function hr(e) {
515
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === mr;
516
+ }
517
+ function pr(e, t) {
518
+ const n = { ...t };
519
+ for (const r in t) {
520
+ const o = e[r], s = t[r];
521
+ /^on[A-Z]/.test(r) ? o && s ? n[r] = (...i) => {
522
+ const d = s(...i);
523
+ return o(...i), d;
524
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...s } : r === "className" && (n[r] = [o, s].filter(Boolean).join(" "));
525
+ }
526
+ return { ...e, ...n };
527
+ }
528
+ function br(e) {
529
+ var r, o;
530
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
531
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
532
+ }
533
+ var xr = [
534
+ "a",
535
+ "button",
536
+ "div",
537
+ "form",
538
+ "h2",
539
+ "h3",
540
+ "img",
541
+ "input",
542
+ "label",
543
+ "li",
544
+ "nav",
545
+ "ol",
546
+ "p",
547
+ "select",
548
+ "span",
549
+ "svg",
550
+ "ul"
551
+ ], M = xr.reduce((e, t) => {
552
+ const n = /* @__PURE__ */ Te(`Primitive.${t}`), r = l.forwardRef((o, s) => {
553
+ const { asChild: c, ...i } = o, d = c ? n : t;
554
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(d, { ...i, ref: s });
555
+ });
556
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
557
+ }, {});
558
+ function Mt(e, t) {
559
+ e && kt.flushSync(() => e.dispatchEvent(t));
560
+ }
561
+ function z(e) {
562
+ const t = l.useRef(e);
563
+ return l.useEffect(() => {
564
+ t.current = e;
565
+ }), l.useMemo(() => (...n) => {
566
+ var r;
567
+ return (r = t.current) == null ? void 0 : r.call(t, ...n);
568
+ }, []);
569
+ }
570
+ function gr(e, t = globalThis == null ? void 0 : globalThis.document) {
571
+ const n = z(e);
572
+ l.useEffect(() => {
573
+ const r = (o) => {
574
+ o.key === "Escape" && n(o);
575
+ };
576
+ return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
577
+ }, [n, t]);
578
+ }
579
+ var yr = "DismissableLayer", ze = "dismissableLayer.update", _r = "dismissableLayer.pointerDownOutside", wr = "dismissableLayer.focusOutside", vt, Dt = l.createContext({
580
+ layers: /* @__PURE__ */ new Set(),
581
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
582
+ branches: /* @__PURE__ */ new Set()
583
+ }), Ze = l.forwardRef(
584
+ (e, t) => {
585
+ const {
586
+ disableOutsidePointerEvents: n = !1,
587
+ onEscapeKeyDown: r,
588
+ onPointerDownOutside: o,
589
+ onFocusOutside: s,
590
+ onInteractOutside: c,
591
+ onDismiss: i,
592
+ ...d
593
+ } = e, u = l.useContext(Dt), [v, h] = l.useState(null), p = (v == null ? void 0 : v.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, y] = l.useState({}), N = B(t, (T) => h(T)), f = Array.from(u.layers), [m] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), b = f.indexOf(m), w = v ? f.indexOf(v) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, _ = w >= b, S = Er((T) => {
594
+ const R = T.target, L = [...u.branches].some((k) => k.contains(R));
595
+ !_ || L || (o == null || o(T), c == null || c(T), T.defaultPrevented || i == null || i());
596
+ }, p), C = Cr((T) => {
597
+ const R = T.target;
598
+ [...u.branches].some((k) => k.contains(R)) || (s == null || s(T), c == null || c(T), T.defaultPrevented || i == null || i());
599
+ }, p);
600
+ return gr((T) => {
601
+ w === u.layers.size - 1 && (r == null || r(T), !T.defaultPrevented && i && (T.preventDefault(), i()));
602
+ }, p), l.useEffect(() => {
603
+ if (v)
604
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (vt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(v)), u.layers.add(v), mt(), () => {
605
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = vt);
606
+ };
607
+ }, [v, p, n, u]), l.useEffect(() => () => {
608
+ v && (u.layers.delete(v), u.layersWithOutsidePointerEventsDisabled.delete(v), mt());
609
+ }, [v, u]), l.useEffect(() => {
610
+ const T = () => y({});
611
+ return document.addEventListener(ze, T), () => document.removeEventListener(ze, T);
612
+ }, []), /* @__PURE__ */ a(
613
+ M.div,
614
+ {
615
+ ...d,
616
+ ref: N,
617
+ style: {
618
+ pointerEvents: x ? _ ? "auto" : "none" : void 0,
619
+ ...e.style
620
+ },
621
+ onFocusCapture: I(e.onFocusCapture, C.onFocusCapture),
622
+ onBlurCapture: I(e.onBlurCapture, C.onBlurCapture),
623
+ onPointerDownCapture: I(
624
+ e.onPointerDownCapture,
625
+ S.onPointerDownCapture
626
+ )
627
+ }
628
+ );
629
+ }
630
+ );
631
+ Ze.displayName = yr;
632
+ var Nr = "DismissableLayerBranch", Lt = l.forwardRef((e, t) => {
633
+ const n = l.useContext(Dt), r = l.useRef(null), o = B(t, r);
634
+ return l.useEffect(() => {
635
+ const s = r.current;
636
+ if (s)
637
+ return n.branches.add(s), () => {
638
+ n.branches.delete(s);
639
+ };
640
+ }, [n.branches]), /* @__PURE__ */ a(M.div, { ...e, ref: o });
641
+ });
642
+ Lt.displayName = Nr;
643
+ function Er(e, t = globalThis == null ? void 0 : globalThis.document) {
644
+ const n = z(e), r = l.useRef(!1), o = l.useRef(() => {
645
+ });
646
+ return l.useEffect(() => {
647
+ const s = (i) => {
648
+ if (i.target && !r.current) {
649
+ let d = function() {
650
+ Ot(
651
+ _r,
652
+ n,
653
+ u,
654
+ { discrete: !0 }
655
+ );
656
+ };
657
+ const u = { originalEvent: i };
658
+ i.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = d, t.addEventListener("click", o.current, { once: !0 })) : d();
659
+ } else
660
+ t.removeEventListener("click", o.current);
661
+ r.current = !1;
662
+ }, c = window.setTimeout(() => {
663
+ t.addEventListener("pointerdown", s);
664
+ }, 0);
665
+ return () => {
666
+ window.clearTimeout(c), t.removeEventListener("pointerdown", s), t.removeEventListener("click", o.current);
667
+ };
668
+ }, [t, n]), {
669
+ // ensures we check React component tree (not just DOM tree)
670
+ onPointerDownCapture: () => r.current = !0
671
+ };
672
+ }
673
+ function Cr(e, t = globalThis == null ? void 0 : globalThis.document) {
674
+ const n = z(e), r = l.useRef(!1);
675
+ return l.useEffect(() => {
676
+ const o = (s) => {
677
+ s.target && !r.current && Ot(wr, n, { originalEvent: s }, {
678
+ discrete: !1
679
+ });
680
+ };
681
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
682
+ }, [t, n]), {
683
+ onFocusCapture: () => r.current = !0,
684
+ onBlurCapture: () => r.current = !1
685
+ };
686
+ }
687
+ function mt() {
688
+ const e = new CustomEvent(ze);
689
+ document.dispatchEvent(e);
690
+ }
691
+ function Ot(e, t, n, { discrete: r }) {
692
+ const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
693
+ t && o.addEventListener(e, t, { once: !0 }), r ? Mt(o, s) : o.dispatchEvent(s);
694
+ }
695
+ var Tr = Ze, Sr = Lt, Le = "focusScope.autoFocusOnMount", Oe = "focusScope.autoFocusOnUnmount", ht = { bubbles: !1, cancelable: !0 }, Rr = "FocusScope", Ft = l.forwardRef((e, t) => {
696
+ const {
697
+ loop: n = !1,
698
+ trapped: r = !1,
699
+ onMountAutoFocus: o,
700
+ onUnmountAutoFocus: s,
701
+ ...c
702
+ } = e, [i, d] = l.useState(null), u = z(o), v = z(s), h = l.useRef(null), p = B(t, (f) => d(f)), y = l.useRef({
703
+ paused: !1,
704
+ pause() {
705
+ this.paused = !0;
706
+ },
707
+ resume() {
708
+ this.paused = !1;
709
+ }
710
+ }).current;
711
+ l.useEffect(() => {
712
+ if (r) {
713
+ let f = function(x) {
714
+ if (y.paused || !i) return;
715
+ const _ = x.target;
716
+ i.contains(_) ? h.current = _ : Y(h.current, { select: !0 });
717
+ }, m = function(x) {
718
+ if (y.paused || !i) return;
719
+ const _ = x.relatedTarget;
720
+ _ !== null && (i.contains(_) || Y(h.current, { select: !0 }));
721
+ }, b = function(x) {
722
+ if (document.activeElement === document.body)
723
+ for (const S of x)
724
+ S.removedNodes.length > 0 && Y(i);
725
+ };
726
+ document.addEventListener("focusin", f), document.addEventListener("focusout", m);
727
+ const w = new MutationObserver(b);
728
+ return i && w.observe(i, { childList: !0, subtree: !0 }), () => {
729
+ document.removeEventListener("focusin", f), document.removeEventListener("focusout", m), w.disconnect();
730
+ };
731
+ }
732
+ }, [r, i, y.paused]), l.useEffect(() => {
733
+ if (i) {
734
+ bt.add(y);
735
+ const f = document.activeElement;
736
+ if (!i.contains(f)) {
737
+ const b = new CustomEvent(Le, ht);
738
+ i.addEventListener(Le, u), i.dispatchEvent(b), b.defaultPrevented || (kr(Dr($t(i)), { select: !0 }), document.activeElement === f && Y(i));
739
+ }
740
+ return () => {
741
+ i.removeEventListener(Le, u), setTimeout(() => {
742
+ const b = new CustomEvent(Oe, ht);
743
+ i.addEventListener(Oe, v), i.dispatchEvent(b), b.defaultPrevented || Y(f ?? document.body, { select: !0 }), i.removeEventListener(Oe, v), bt.remove(y);
744
+ }, 0);
745
+ };
746
+ }
747
+ }, [i, u, v, y]);
748
+ const N = l.useCallback(
749
+ (f) => {
750
+ if (!n && !r || y.paused) return;
751
+ const m = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, b = document.activeElement;
752
+ if (m && b) {
753
+ const w = f.currentTarget, [x, _] = Pr(w);
754
+ x && _ ? !f.shiftKey && b === _ ? (f.preventDefault(), n && Y(x, { select: !0 })) : f.shiftKey && b === x && (f.preventDefault(), n && Y(_, { select: !0 })) : b === w && f.preventDefault();
755
+ }
756
+ },
757
+ [n, r, y.paused]
758
+ );
759
+ return /* @__PURE__ */ a(M.div, { tabIndex: -1, ...c, ref: p, onKeyDown: N });
760
+ });
761
+ Ft.displayName = Rr;
762
+ function kr(e, { select: t = !1 } = {}) {
763
+ const n = document.activeElement;
764
+ for (const r of e)
765
+ if (Y(r, { select: t }), document.activeElement !== n) return;
766
+ }
767
+ function Pr(e) {
768
+ const t = $t(e), n = pt(t, e), r = pt(t.reverse(), e);
769
+ return [n, r];
770
+ }
771
+ function $t(e) {
772
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
773
+ acceptNode: (r) => {
774
+ const o = r.tagName === "INPUT" && r.type === "hidden";
775
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
776
+ }
777
+ });
778
+ for (; n.nextNode(); ) t.push(n.currentNode);
779
+ return t;
780
+ }
781
+ function pt(e, t) {
782
+ for (const n of e)
783
+ if (!Ir(n, { upTo: t })) return n;
784
+ }
785
+ function Ir(e, { upTo: t }) {
786
+ if (getComputedStyle(e).visibility === "hidden") return !0;
787
+ for (; e; ) {
788
+ if (t !== void 0 && e === t) return !1;
789
+ if (getComputedStyle(e).display === "none") return !0;
790
+ e = e.parentElement;
791
+ }
792
+ return !1;
793
+ }
794
+ function Ar(e) {
795
+ return e instanceof HTMLInputElement && "select" in e;
796
+ }
797
+ function Y(e, { select: t = !1 } = {}) {
798
+ if (e && e.focus) {
799
+ const n = document.activeElement;
800
+ e.focus({ preventScroll: !0 }), e !== n && Ar(e) && t && e.select();
801
+ }
802
+ }
803
+ var bt = Mr();
804
+ function Mr() {
805
+ let e = [];
806
+ return {
807
+ add(t) {
808
+ const n = e[0];
809
+ t !== n && (n == null || n.pause()), e = xt(e, t), e.unshift(t);
810
+ },
811
+ remove(t) {
812
+ var n;
813
+ e = xt(e, t), (n = e[0]) == null || n.resume();
814
+ }
815
+ };
816
+ }
817
+ function xt(e, t) {
818
+ const n = [...e], r = n.indexOf(t);
819
+ return r !== -1 && n.splice(r, 1), n;
820
+ }
821
+ function Dr(e) {
822
+ return e.filter((t) => t.tagName !== "A");
823
+ }
824
+ var Lr = "Portal", Qe = l.forwardRef((e, t) => {
825
+ var i;
826
+ const { container: n, ...r } = e, [o, s] = l.useState(!1);
827
+ Q(() => s(!0), []);
828
+ const c = n || o && ((i = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : i.body);
829
+ return c ? Xn.createPortal(/* @__PURE__ */ a(M.div, { ...r, ref: t }), c) : null;
830
+ });
831
+ Qe.displayName = Lr;
832
+ function Or(e, t) {
833
+ return l.useReducer((n, r) => t[n][r] ?? n, e);
834
+ }
835
+ var ie = (e) => {
836
+ const { present: t, children: n } = e, r = Fr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : l.Children.only(n), s = B(r.ref, $r(o));
837
+ return typeof n == "function" || r.isPresent ? l.cloneElement(o, { ref: s }) : null;
838
+ };
839
+ ie.displayName = "Presence";
840
+ function Fr(e) {
841
+ const [t, n] = l.useState(), r = l.useRef(null), o = l.useRef(e), s = l.useRef("none"), c = e ? "mounted" : "unmounted", [i, d] = Or(c, {
842
+ mounted: {
843
+ UNMOUNT: "unmounted",
844
+ ANIMATION_OUT: "unmountSuspended"
845
+ },
846
+ unmountSuspended: {
847
+ MOUNT: "mounted",
848
+ ANIMATION_END: "unmounted"
849
+ },
850
+ unmounted: {
851
+ MOUNT: "mounted"
852
+ }
853
+ });
854
+ return l.useEffect(() => {
855
+ const u = pe(r.current);
856
+ s.current = i === "mounted" ? u : "none";
857
+ }, [i]), Q(() => {
858
+ const u = r.current, v = o.current;
859
+ if (v !== e) {
860
+ const p = s.current, y = pe(u);
861
+ e ? d("MOUNT") : y === "none" || (u == null ? void 0 : u.display) === "none" ? d("UNMOUNT") : d(v && p !== y ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
862
+ }
863
+ }, [e, d]), Q(() => {
864
+ if (t) {
865
+ let u;
866
+ const v = t.ownerDocument.defaultView ?? window, h = (y) => {
867
+ const f = pe(r.current).includes(CSS.escape(y.animationName));
868
+ if (y.target === t && f && (d("ANIMATION_END"), !o.current)) {
869
+ const m = t.style.animationFillMode;
870
+ t.style.animationFillMode = "forwards", u = v.setTimeout(() => {
871
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = m);
872
+ });
873
+ }
874
+ }, p = (y) => {
875
+ y.target === t && (s.current = pe(r.current));
876
+ };
877
+ return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", h), t.addEventListener("animationend", h), () => {
878
+ v.clearTimeout(u), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", h), t.removeEventListener("animationend", h);
879
+ };
880
+ } else
881
+ d("ANIMATION_END");
882
+ }, [t, d]), {
883
+ isPresent: ["mounted", "unmountSuspended"].includes(i),
884
+ ref: l.useCallback((u) => {
885
+ r.current = u ? getComputedStyle(u) : null, n(u);
886
+ }, [])
887
+ };
888
+ }
889
+ function pe(e) {
890
+ return (e == null ? void 0 : e.animationName) || "none";
891
+ }
892
+ function $r(e) {
893
+ var r, o;
894
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
895
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
896
+ }
897
+ var Fe = 0;
898
+ function Wr() {
899
+ l.useEffect(() => {
900
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
901
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? gt()), document.body.insertAdjacentElement("beforeend", e[1] ?? gt()), Fe++, () => {
902
+ Fe === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Fe--;
903
+ };
904
+ }, []);
905
+ }
906
+ function gt() {
907
+ const e = document.createElement("span");
908
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
909
+ }
910
+ var H = function() {
911
+ return H = Object.assign || function(t) {
912
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
913
+ n = arguments[r];
914
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
915
+ }
916
+ return t;
917
+ }, H.apply(this, arguments);
918
+ };
919
+ function Wt(e, t) {
920
+ var n = {};
921
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
922
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
923
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
924
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
925
+ return n;
926
+ }
927
+ function Br(e, t, n) {
928
+ if (n || arguments.length === 2) for (var r = 0, o = t.length, s; r < o; r++)
929
+ (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
930
+ return e.concat(s || Array.prototype.slice.call(t));
931
+ }
932
+ var Ee = "right-scroll-bar-position", Ce = "width-before-scroll-bar", Ur = "with-scroll-bars-hidden", Kr = "--removed-body-scroll-bar-size";
933
+ function $e(e, t) {
934
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
935
+ }
936
+ function Vr(e, t) {
937
+ var n = W(function() {
938
+ return {
939
+ // value
940
+ value: e,
941
+ // last callback
942
+ callback: t,
943
+ // "memoized" public interface
944
+ facade: {
945
+ get current() {
946
+ return n.value;
947
+ },
948
+ set current(r) {
949
+ var o = n.value;
950
+ o !== r && (n.value = r, n.callback(r, o));
951
+ }
952
+ }
953
+ };
954
+ })[0];
955
+ return n.callback = t, n.facade;
956
+ }
957
+ var Hr = typeof window < "u" ? l.useLayoutEffect : l.useEffect, yt = /* @__PURE__ */ new WeakMap();
958
+ function zr(e, t) {
959
+ var n = Vr(null, function(r) {
960
+ return e.forEach(function(o) {
961
+ return $e(o, r);
962
+ });
963
+ });
964
+ return Hr(function() {
965
+ var r = yt.get(n);
966
+ if (r) {
967
+ var o = new Set(r), s = new Set(e), c = n.current;
968
+ o.forEach(function(i) {
969
+ s.has(i) || $e(i, null);
970
+ }), s.forEach(function(i) {
971
+ o.has(i) || $e(i, c);
972
+ });
973
+ }
974
+ yt.set(n, e);
975
+ }, [e]), n;
976
+ }
977
+ function jr(e) {
978
+ return e;
979
+ }
980
+ function Gr(e, t) {
981
+ t === void 0 && (t = jr);
982
+ var n = [], r = !1, o = {
983
+ read: function() {
984
+ if (r)
985
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
986
+ return n.length ? n[n.length - 1] : e;
987
+ },
988
+ useMedium: function(s) {
989
+ var c = t(s, r);
990
+ return n.push(c), function() {
991
+ n = n.filter(function(i) {
992
+ return i !== c;
993
+ });
994
+ };
995
+ },
996
+ assignSyncMedium: function(s) {
997
+ for (r = !0; n.length; ) {
998
+ var c = n;
999
+ n = [], c.forEach(s);
1000
+ }
1001
+ n = {
1002
+ push: function(i) {
1003
+ return s(i);
1004
+ },
1005
+ filter: function() {
1006
+ return n;
1007
+ }
1008
+ };
1009
+ },
1010
+ assignMedium: function(s) {
1011
+ r = !0;
1012
+ var c = [];
1013
+ if (n.length) {
1014
+ var i = n;
1015
+ n = [], i.forEach(s), c = n;
1016
+ }
1017
+ var d = function() {
1018
+ var v = c;
1019
+ c = [], v.forEach(s);
1020
+ }, u = function() {
1021
+ return Promise.resolve().then(d);
1022
+ };
1023
+ u(), n = {
1024
+ push: function(v) {
1025
+ c.push(v), u();
1026
+ },
1027
+ filter: function(v) {
1028
+ return c = c.filter(v), n;
1029
+ }
1030
+ };
1031
+ }
1032
+ };
1033
+ return o;
1034
+ }
1035
+ function Yr(e) {
1036
+ e === void 0 && (e = {});
1037
+ var t = Gr(null);
1038
+ return t.options = H({ async: !0, ssr: !1 }, e), t;
1039
+ }
1040
+ var Bt = function(e) {
1041
+ var t = e.sideCar, n = Wt(e, ["sideCar"]);
1042
+ if (!t)
1043
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
1044
+ var r = t.read();
1045
+ if (!r)
1046
+ throw new Error("Sidecar medium not found");
1047
+ return l.createElement(r, H({}, n));
1048
+ };
1049
+ Bt.isSideCarExport = !0;
1050
+ function Xr(e, t) {
1051
+ return e.useMedium(t), Bt;
1052
+ }
1053
+ var Ut = Yr(), We = function() {
1054
+ }, ke = l.forwardRef(function(e, t) {
1055
+ var n = l.useRef(null), r = l.useState({
1056
+ onScrollCapture: We,
1057
+ onWheelCapture: We,
1058
+ onTouchMoveCapture: We
1059
+ }), o = r[0], s = r[1], c = e.forwardProps, i = e.children, d = e.className, u = e.removeScrollBar, v = e.enabled, h = e.shards, p = e.sideCar, y = e.noRelative, N = e.noIsolation, f = e.inert, m = e.allowPinchZoom, b = e.as, w = b === void 0 ? "div" : b, x = e.gapMode, _ = Wt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = p, C = zr([n, t]), T = H(H({}, _), o);
1060
+ return l.createElement(
1061
+ l.Fragment,
1062
+ null,
1063
+ v && l.createElement(S, { sideCar: Ut, removeScrollBar: u, shards: h, noRelative: y, noIsolation: N, inert: f, setCallbacks: s, allowPinchZoom: !!m, lockRef: n, gapMode: x }),
1064
+ c ? l.cloneElement(l.Children.only(i), H(H({}, T), { ref: C })) : l.createElement(w, H({}, T, { className: d, ref: C }), i)
1065
+ );
1066
+ });
1067
+ ke.defaultProps = {
1068
+ enabled: !0,
1069
+ removeScrollBar: !0,
1070
+ inert: !1
1071
+ };
1072
+ ke.classNames = {
1073
+ fullWidth: Ce,
1074
+ zeroRight: Ee
1075
+ };
1076
+ var qr = function() {
1077
+ if (typeof __webpack_nonce__ < "u")
1078
+ return __webpack_nonce__;
1079
+ };
1080
+ function Zr() {
1081
+ if (!document)
1082
+ return null;
1083
+ var e = document.createElement("style");
1084
+ e.type = "text/css";
1085
+ var t = qr();
1086
+ return t && e.setAttribute("nonce", t), e;
1087
+ }
1088
+ function Qr(e, t) {
1089
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
1090
+ }
1091
+ function Jr(e) {
1092
+ var t = document.head || document.getElementsByTagName("head")[0];
1093
+ t.appendChild(e);
1094
+ }
1095
+ var eo = function() {
1096
+ var e = 0, t = null;
1097
+ return {
1098
+ add: function(n) {
1099
+ e == 0 && (t = Zr()) && (Qr(t, n), Jr(t)), e++;
1100
+ },
1101
+ remove: function() {
1102
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
1103
+ }
1104
+ };
1105
+ }, to = function() {
1106
+ var e = eo();
1107
+ return function(t, n) {
1108
+ l.useEffect(function() {
1109
+ return e.add(t), function() {
1110
+ e.remove();
1111
+ };
1112
+ }, [t && n]);
1113
+ };
1114
+ }, Kt = function() {
1115
+ var e = to(), t = function(n) {
1116
+ var r = n.styles, o = n.dynamic;
1117
+ return e(r, o), null;
1118
+ };
1119
+ return t;
1120
+ }, no = {
1121
+ left: 0,
1122
+ top: 0,
1123
+ right: 0,
1124
+ gap: 0
1125
+ }, Be = function(e) {
1126
+ return parseInt(e || "", 10) || 0;
1127
+ }, ro = function(e) {
1128
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
1129
+ return [Be(n), Be(r), Be(o)];
1130
+ }, oo = function(e) {
1131
+ if (e === void 0 && (e = "margin"), typeof window > "u")
1132
+ return no;
1133
+ var t = ro(e), n = document.documentElement.clientWidth, r = window.innerWidth;
1134
+ return {
1135
+ left: t[0],
1136
+ top: t[1],
1137
+ right: t[2],
1138
+ gap: Math.max(0, r - n + t[2] - t[0])
1139
+ };
1140
+ }, ao = Kt(), oe = "data-scroll-locked", so = function(e, t, n, r) {
1141
+ var o = e.left, s = e.top, c = e.right, i = e.gap;
1142
+ return n === void 0 && (n = "margin"), `
1143
+ .`.concat(Ur, ` {
1144
+ overflow: hidden `).concat(r, `;
1145
+ padding-right: `).concat(i, "px ").concat(r, `;
1146
+ }
1147
+ body[`).concat(oe, `] {
1148
+ overflow: hidden `).concat(r, `;
1149
+ overscroll-behavior: contain;
1150
+ `).concat([
1151
+ t && "position: relative ".concat(r, ";"),
1152
+ n === "margin" && `
1153
+ padding-left: `.concat(o, `px;
1154
+ padding-top: `).concat(s, `px;
1155
+ padding-right: `).concat(c, `px;
1156
+ margin-left:0;
1157
+ margin-top:0;
1158
+ margin-right: `).concat(i, "px ").concat(r, `;
1159
+ `),
1160
+ n === "padding" && "padding-right: ".concat(i, "px ").concat(r, ";")
1161
+ ].filter(Boolean).join(""), `
1162
+ }
1163
+
1164
+ .`).concat(Ee, ` {
1165
+ right: `).concat(i, "px ").concat(r, `;
1166
+ }
1167
+
1168
+ .`).concat(Ce, ` {
1169
+ margin-right: `).concat(i, "px ").concat(r, `;
1170
+ }
1171
+
1172
+ .`).concat(Ee, " .").concat(Ee, ` {
1173
+ right: 0 `).concat(r, `;
1174
+ }
1175
+
1176
+ .`).concat(Ce, " .").concat(Ce, ` {
1177
+ margin-right: 0 `).concat(r, `;
1178
+ }
1179
+
1180
+ body[`).concat(oe, `] {
1181
+ `).concat(Kr, ": ").concat(i, `px;
1182
+ }
1183
+ `);
1184
+ }, _t = function() {
1185
+ var e = parseInt(document.body.getAttribute(oe) || "0", 10);
1186
+ return isFinite(e) ? e : 0;
1187
+ }, io = function() {
1188
+ l.useEffect(function() {
1189
+ return document.body.setAttribute(oe, (_t() + 1).toString()), function() {
1190
+ var e = _t() - 1;
1191
+ e <= 0 ? document.body.removeAttribute(oe) : document.body.setAttribute(oe, e.toString());
1192
+ };
1193
+ }, []);
1194
+ }, co = function(e) {
1195
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
1196
+ io();
1197
+ var s = l.useMemo(function() {
1198
+ return oo(o);
1199
+ }, [o]);
1200
+ return l.createElement(ao, { styles: so(s, !t, o, n ? "" : "!important") });
1201
+ }, je = !1;
1202
+ if (typeof window < "u")
1203
+ try {
1204
+ var be = Object.defineProperty({}, "passive", {
1205
+ get: function() {
1206
+ return je = !0, !0;
1207
+ }
1208
+ });
1209
+ window.addEventListener("test", be, be), window.removeEventListener("test", be, be);
1210
+ } catch {
1211
+ je = !1;
1212
+ }
1213
+ var ee = je ? { passive: !1 } : !1, lo = function(e) {
1214
+ return e.tagName === "TEXTAREA";
1215
+ }, Vt = function(e, t) {
1216
+ if (!(e instanceof Element))
1217
+ return !1;
1218
+ var n = window.getComputedStyle(e);
1219
+ return (
1220
+ // not-not-scrollable
1221
+ n[t] !== "hidden" && // contains scroll inside self
1222
+ !(n.overflowY === n.overflowX && !lo(e) && n[t] === "visible")
1223
+ );
1224
+ }, uo = function(e) {
1225
+ return Vt(e, "overflowY");
1226
+ }, fo = function(e) {
1227
+ return Vt(e, "overflowX");
1228
+ }, wt = function(e, t) {
1229
+ var n = t.ownerDocument, r = t;
1230
+ do {
1231
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
1232
+ var o = Ht(e, r);
1233
+ if (o) {
1234
+ var s = zt(e, r), c = s[1], i = s[2];
1235
+ if (c > i)
1236
+ return !0;
1237
+ }
1238
+ r = r.parentNode;
1239
+ } while (r && r !== n.body);
1240
+ return !1;
1241
+ }, vo = function(e) {
1242
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
1243
+ return [
1244
+ t,
1245
+ n,
1246
+ r
1247
+ ];
1248
+ }, mo = function(e) {
1249
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
1250
+ return [
1251
+ t,
1252
+ n,
1253
+ r
1254
+ ];
1255
+ }, Ht = function(e, t) {
1256
+ return e === "v" ? uo(t) : fo(t);
1257
+ }, zt = function(e, t) {
1258
+ return e === "v" ? vo(t) : mo(t);
1259
+ }, ho = function(e, t) {
1260
+ return e === "h" && t === "rtl" ? -1 : 1;
1261
+ }, po = function(e, t, n, r, o) {
1262
+ var s = ho(e, window.getComputedStyle(t).direction), c = s * r, i = n.target, d = t.contains(i), u = !1, v = c > 0, h = 0, p = 0;
1263
+ do {
1264
+ if (!i)
1265
+ break;
1266
+ var y = zt(e, i), N = y[0], f = y[1], m = y[2], b = f - m - s * N;
1267
+ (N || b) && Ht(e, i) && (h += b, p += N);
1268
+ var w = i.parentNode;
1269
+ i = w && w.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? w.host : w;
1270
+ } while (
1271
+ // portaled content
1272
+ !d && i !== document.body || // self content
1273
+ d && (t.contains(i) || t === i)
1274
+ );
1275
+ return (v && Math.abs(h) < 1 || !v && Math.abs(p) < 1) && (u = !0), u;
1276
+ }, xe = function(e) {
1277
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
1278
+ }, Nt = function(e) {
1279
+ return [e.deltaX, e.deltaY];
1280
+ }, Et = function(e) {
1281
+ return e && "current" in e ? e.current : e;
1282
+ }, bo = function(e, t) {
1283
+ return e[0] === t[0] && e[1] === t[1];
1284
+ }, xo = function(e) {
1285
+ return `
1286
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
1287
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
1288
+ `);
1289
+ }, go = 0, te = [];
1290
+ function yo(e) {
1291
+ var t = l.useRef([]), n = l.useRef([0, 0]), r = l.useRef(), o = l.useState(go++)[0], s = l.useState(Kt)[0], c = l.useRef(e);
1292
+ l.useEffect(function() {
1293
+ c.current = e;
1294
+ }, [e]), l.useEffect(function() {
1295
+ if (e.inert) {
1296
+ document.body.classList.add("block-interactivity-".concat(o));
1297
+ var f = Br([e.lockRef.current], (e.shards || []).map(Et), !0).filter(Boolean);
1298
+ return f.forEach(function(m) {
1299
+ return m.classList.add("allow-interactivity-".concat(o));
1300
+ }), function() {
1301
+ document.body.classList.remove("block-interactivity-".concat(o)), f.forEach(function(m) {
1302
+ return m.classList.remove("allow-interactivity-".concat(o));
1303
+ });
1304
+ };
1305
+ }
1306
+ }, [e.inert, e.lockRef.current, e.shards]);
1307
+ var i = l.useCallback(function(f, m) {
1308
+ if ("touches" in f && f.touches.length === 2 || f.type === "wheel" && f.ctrlKey)
1309
+ return !c.current.allowPinchZoom;
1310
+ var b = xe(f), w = n.current, x = "deltaX" in f ? f.deltaX : w[0] - b[0], _ = "deltaY" in f ? f.deltaY : w[1] - b[1], S, C = f.target, T = Math.abs(x) > Math.abs(_) ? "h" : "v";
1311
+ if ("touches" in f && T === "h" && C.type === "range")
1312
+ return !1;
1313
+ var R = window.getSelection(), L = R && R.anchorNode, k = L ? L === C || L.contains(C) : !1;
1314
+ if (k)
1315
+ return !1;
1316
+ var A = wt(T, C);
1317
+ if (!A)
1318
+ return !0;
1319
+ if (A ? S = T : (S = T === "v" ? "h" : "v", A = wt(T, C)), !A)
1320
+ return !1;
1321
+ if (!r.current && "changedTouches" in f && (x || _) && (r.current = S), !S)
1322
+ return !0;
1323
+ var O = r.current || S;
1324
+ return po(O, m, f, O === "h" ? x : _);
1325
+ }, []), d = l.useCallback(function(f) {
1326
+ var m = f;
1327
+ if (!(!te.length || te[te.length - 1] !== s)) {
1328
+ var b = "deltaY" in m ? Nt(m) : xe(m), w = t.current.filter(function(S) {
1329
+ return S.name === m.type && (S.target === m.target || m.target === S.shadowParent) && bo(S.delta, b);
1330
+ })[0];
1331
+ if (w && w.should) {
1332
+ m.cancelable && m.preventDefault();
1333
+ return;
1334
+ }
1335
+ if (!w) {
1336
+ var x = (c.current.shards || []).map(Et).filter(Boolean).filter(function(S) {
1337
+ return S.contains(m.target);
1338
+ }), _ = x.length > 0 ? i(m, x[0]) : !c.current.noIsolation;
1339
+ _ && m.cancelable && m.preventDefault();
1340
+ }
1341
+ }
1342
+ }, []), u = l.useCallback(function(f, m, b, w) {
1343
+ var x = { name: f, delta: m, target: b, should: w, shadowParent: _o(b) };
1344
+ t.current.push(x), setTimeout(function() {
1345
+ t.current = t.current.filter(function(_) {
1346
+ return _ !== x;
1347
+ });
1348
+ }, 1);
1349
+ }, []), v = l.useCallback(function(f) {
1350
+ n.current = xe(f), r.current = void 0;
1351
+ }, []), h = l.useCallback(function(f) {
1352
+ u(f.type, Nt(f), f.target, i(f, e.lockRef.current));
1353
+ }, []), p = l.useCallback(function(f) {
1354
+ u(f.type, xe(f), f.target, i(f, e.lockRef.current));
1355
+ }, []);
1356
+ l.useEffect(function() {
1357
+ return te.push(s), e.setCallbacks({
1358
+ onScrollCapture: h,
1359
+ onWheelCapture: h,
1360
+ onTouchMoveCapture: p
1361
+ }), document.addEventListener("wheel", d, ee), document.addEventListener("touchmove", d, ee), document.addEventListener("touchstart", v, ee), function() {
1362
+ te = te.filter(function(f) {
1363
+ return f !== s;
1364
+ }), document.removeEventListener("wheel", d, ee), document.removeEventListener("touchmove", d, ee), document.removeEventListener("touchstart", v, ee);
1365
+ };
1366
+ }, []);
1367
+ var y = e.removeScrollBar, N = e.inert;
1368
+ return l.createElement(
1369
+ l.Fragment,
1370
+ null,
1371
+ N ? l.createElement(s, { styles: xo(o) }) : null,
1372
+ y ? l.createElement(co, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
1373
+ );
1374
+ }
1375
+ function _o(e) {
1376
+ for (var t = null; e !== null; )
1377
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
1378
+ return t;
1379
+ }
1380
+ const wo = Xr(Ut, yo);
1381
+ var jt = l.forwardRef(function(e, t) {
1382
+ return l.createElement(ke, H({}, e, { ref: t, sideCar: wo }));
1383
+ });
1384
+ jt.classNames = ke.classNames;
1385
+ var No = function(e) {
1386
+ if (typeof document > "u")
1387
+ return null;
1388
+ var t = Array.isArray(e) ? e[0] : e;
1389
+ return t.ownerDocument.body;
1390
+ }, ne = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), ye = {}, Ue = 0, Gt = function(e) {
1391
+ return e && (e.host || Gt(e.parentNode));
1392
+ }, Eo = function(e, t) {
1393
+ return t.map(function(n) {
1394
+ if (e.contains(n))
1395
+ return n;
1396
+ var r = Gt(n);
1397
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1398
+ }).filter(function(n) {
1399
+ return !!n;
1400
+ });
1401
+ }, Co = function(e, t, n, r) {
1402
+ var o = Eo(t, Array.isArray(e) ? e : [e]);
1403
+ ye[n] || (ye[n] = /* @__PURE__ */ new WeakMap());
1404
+ var s = ye[n], c = [], i = /* @__PURE__ */ new Set(), d = new Set(o), u = function(h) {
1405
+ !h || i.has(h) || (i.add(h), u(h.parentNode));
1406
+ };
1407
+ o.forEach(u);
1408
+ var v = function(h) {
1409
+ !h || d.has(h) || Array.prototype.forEach.call(h.children, function(p) {
1410
+ if (i.has(p))
1411
+ v(p);
1412
+ else
1413
+ try {
1414
+ var y = p.getAttribute(r), N = y !== null && y !== "false", f = (ne.get(p) || 0) + 1, m = (s.get(p) || 0) + 1;
1415
+ ne.set(p, f), s.set(p, m), c.push(p), f === 1 && N && ge.set(p, !0), m === 1 && p.setAttribute(n, "true"), N || p.setAttribute(r, "true");
1416
+ } catch (b) {
1417
+ console.error("aria-hidden: cannot operate on ", p, b);
1418
+ }
1419
+ });
1420
+ };
1421
+ return v(t), i.clear(), Ue++, function() {
1422
+ c.forEach(function(h) {
1423
+ var p = ne.get(h) - 1, y = s.get(h) - 1;
1424
+ ne.set(h, p), s.set(h, y), p || (ge.has(h) || h.removeAttribute(r), ge.delete(h)), y || h.removeAttribute(n);
1425
+ }), Ue--, Ue || (ne = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), ye = {});
1426
+ };
1427
+ }, To = function(e, t, n) {
1428
+ n === void 0 && (n = "data-aria-hidden");
1429
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = No(e);
1430
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Co(r, o, n, "aria-hidden")) : function() {
1431
+ return null;
1432
+ };
1433
+ }, Pe = "Dialog", [Yt] = se(Pe), [So, K] = Yt(Pe), Xt = (e) => {
1434
+ const {
1435
+ __scopeDialog: t,
1436
+ children: n,
1437
+ open: r,
1438
+ defaultOpen: o,
1439
+ onOpenChange: s,
1440
+ modal: c = !0
1441
+ } = e, i = l.useRef(null), d = l.useRef(null), [u, v] = de({
1442
+ prop: r,
1443
+ defaultProp: o ?? !1,
1444
+ onChange: s,
1445
+ caller: Pe
1446
+ });
1447
+ return /* @__PURE__ */ a(
1448
+ So,
1449
+ {
1450
+ scope: t,
1451
+ triggerRef: i,
1452
+ contentRef: d,
1453
+ contentId: le(),
1454
+ titleId: le(),
1455
+ descriptionId: le(),
1456
+ open: u,
1457
+ onOpenChange: v,
1458
+ onOpenToggle: l.useCallback(() => v((h) => !h), [v]),
1459
+ modal: c,
1460
+ children: n
1461
+ }
1462
+ );
1463
+ };
1464
+ Xt.displayName = Pe;
1465
+ var qt = "DialogTrigger", Zt = l.forwardRef(
1466
+ (e, t) => {
1467
+ const { __scopeDialog: n, ...r } = e, o = K(qt, n), s = B(t, o.triggerRef);
1468
+ return /* @__PURE__ */ a(
1469
+ M.button,
1470
+ {
1471
+ type: "button",
1472
+ "aria-haspopup": "dialog",
1473
+ "aria-expanded": o.open,
1474
+ "aria-controls": o.contentId,
1475
+ "data-state": tt(o.open),
1476
+ ...r,
1477
+ ref: s,
1478
+ onClick: I(e.onClick, o.onOpenToggle)
1479
+ }
1480
+ );
1481
+ }
1482
+ );
1483
+ Zt.displayName = qt;
1484
+ var Je = "DialogPortal", [Ro, Qt] = Yt(Je, {
1485
+ forceMount: void 0
1486
+ }), Jt = (e) => {
1487
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = K(Je, t);
1488
+ return /* @__PURE__ */ a(Ro, { scope: t, forceMount: n, children: l.Children.map(r, (c) => /* @__PURE__ */ a(ie, { present: n || s.open, children: /* @__PURE__ */ a(Qe, { asChild: !0, container: o, children: c }) })) });
1489
+ };
1490
+ Jt.displayName = Je;
1491
+ var Se = "DialogOverlay", en = l.forwardRef(
1492
+ (e, t) => {
1493
+ const n = Qt(Se, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = K(Se, e.__scopeDialog);
1494
+ return s.modal ? /* @__PURE__ */ a(ie, { present: r || s.open, children: /* @__PURE__ */ a(Po, { ...o, ref: t }) }) : null;
1495
+ }
1496
+ );
1497
+ en.displayName = Se;
1498
+ var ko = /* @__PURE__ */ Te("DialogOverlay.RemoveScroll"), Po = l.forwardRef(
1499
+ (e, t) => {
1500
+ const { __scopeDialog: n, ...r } = e, o = K(Se, n);
1501
+ return (
1502
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1503
+ // ie. when `Overlay` and `Content` are siblings
1504
+ /* @__PURE__ */ a(jt, { as: ko, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ a(
1505
+ M.div,
1506
+ {
1507
+ "data-state": tt(o.open),
1508
+ ...r,
1509
+ ref: t,
1510
+ style: { pointerEvents: "auto", ...r.style }
1511
+ }
1512
+ ) })
1513
+ );
1514
+ }
1515
+ ), J = "DialogContent", tn = l.forwardRef(
1516
+ (e, t) => {
1517
+ const n = Qt(J, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = K(J, e.__scopeDialog);
1518
+ return /* @__PURE__ */ a(ie, { present: r || s.open, children: s.modal ? /* @__PURE__ */ a(Io, { ...o, ref: t }) : /* @__PURE__ */ a(Ao, { ...o, ref: t }) });
1519
+ }
1520
+ );
1521
+ tn.displayName = J;
1522
+ var Io = l.forwardRef(
1523
+ (e, t) => {
1524
+ const n = K(J, e.__scopeDialog), r = l.useRef(null), o = B(t, n.contentRef, r);
1525
+ return l.useEffect(() => {
1526
+ const s = r.current;
1527
+ if (s) return To(s);
1528
+ }, []), /* @__PURE__ */ a(
1529
+ nn,
1530
+ {
1531
+ ...e,
1532
+ ref: o,
1533
+ trapFocus: n.open,
1534
+ disableOutsidePointerEvents: !0,
1535
+ onCloseAutoFocus: I(e.onCloseAutoFocus, (s) => {
1536
+ var c;
1537
+ s.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
1538
+ }),
1539
+ onPointerDownOutside: I(e.onPointerDownOutside, (s) => {
1540
+ const c = s.detail.originalEvent, i = c.button === 0 && c.ctrlKey === !0;
1541
+ (c.button === 2 || i) && s.preventDefault();
1542
+ }),
1543
+ onFocusOutside: I(
1544
+ e.onFocusOutside,
1545
+ (s) => s.preventDefault()
1546
+ )
1547
+ }
1548
+ );
1549
+ }
1550
+ ), Ao = l.forwardRef(
1551
+ (e, t) => {
1552
+ const n = K(J, e.__scopeDialog), r = l.useRef(!1), o = l.useRef(!1);
1553
+ return /* @__PURE__ */ a(
1554
+ nn,
1555
+ {
1556
+ ...e,
1557
+ ref: t,
1558
+ trapFocus: !1,
1559
+ disableOutsidePointerEvents: !1,
1560
+ onCloseAutoFocus: (s) => {
1561
+ var c, i;
1562
+ (c = e.onCloseAutoFocus) == null || c.call(e, s), s.defaultPrevented || (r.current || (i = n.triggerRef.current) == null || i.focus(), s.preventDefault()), r.current = !1, o.current = !1;
1563
+ },
1564
+ onInteractOutside: (s) => {
1565
+ var d, u;
1566
+ (d = e.onInteractOutside) == null || d.call(e, s), s.defaultPrevented || (r.current = !0, s.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1567
+ const c = s.target;
1568
+ ((u = n.triggerRef.current) == null ? void 0 : u.contains(c)) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && o.current && s.preventDefault();
1569
+ }
1570
+ }
1571
+ );
1572
+ }
1573
+ ), nn = l.forwardRef(
1574
+ (e, t) => {
1575
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...c } = e, i = K(J, n), d = l.useRef(null), u = B(t, d);
1576
+ return Wr(), /* @__PURE__ */ g(ue, { children: [
1577
+ /* @__PURE__ */ a(
1578
+ Ft,
1579
+ {
1580
+ asChild: !0,
1581
+ loop: !0,
1582
+ trapped: r,
1583
+ onMountAutoFocus: o,
1584
+ onUnmountAutoFocus: s,
1585
+ children: /* @__PURE__ */ a(
1586
+ Ze,
1587
+ {
1588
+ role: "dialog",
1589
+ id: i.contentId,
1590
+ "aria-describedby": i.descriptionId,
1591
+ "aria-labelledby": i.titleId,
1592
+ "data-state": tt(i.open),
1593
+ ...c,
1594
+ ref: u,
1595
+ onDismiss: () => i.onOpenChange(!1)
1596
+ }
1597
+ )
1598
+ }
1599
+ ),
1600
+ /* @__PURE__ */ g(ue, { children: [
1601
+ /* @__PURE__ */ a(Mo, { titleId: i.titleId }),
1602
+ /* @__PURE__ */ a(Lo, { contentRef: d, descriptionId: i.descriptionId })
1603
+ ] })
1604
+ ] });
1605
+ }
1606
+ ), et = "DialogTitle", rn = l.forwardRef(
1607
+ (e, t) => {
1608
+ const { __scopeDialog: n, ...r } = e, o = K(et, n);
1609
+ return /* @__PURE__ */ a(M.h2, { id: o.titleId, ...r, ref: t });
1610
+ }
1611
+ );
1612
+ rn.displayName = et;
1613
+ var on = "DialogDescription", an = l.forwardRef(
1614
+ (e, t) => {
1615
+ const { __scopeDialog: n, ...r } = e, o = K(on, n);
1616
+ return /* @__PURE__ */ a(M.p, { id: o.descriptionId, ...r, ref: t });
1617
+ }
1618
+ );
1619
+ an.displayName = on;
1620
+ var sn = "DialogClose", cn = l.forwardRef(
1621
+ (e, t) => {
1622
+ const { __scopeDialog: n, ...r } = e, o = K(sn, n);
1623
+ return /* @__PURE__ */ a(
1624
+ M.button,
1625
+ {
1626
+ type: "button",
1627
+ ...r,
1628
+ ref: t,
1629
+ onClick: I(e.onClick, () => o.onOpenChange(!1))
1630
+ }
1631
+ );
1632
+ }
1633
+ );
1634
+ cn.displayName = sn;
1635
+ function tt(e) {
1636
+ return e ? "open" : "closed";
1637
+ }
1638
+ var ln = "DialogTitleWarning", [ls, un] = sr(ln, {
1639
+ contentName: J,
1640
+ titleName: et,
1641
+ docsSlug: "dialog"
1642
+ }), Mo = ({ titleId: e }) => {
1643
+ const t = un(ln), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1644
+
1645
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1646
+
1647
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
1648
+ return l.useEffect(() => {
1649
+ e && (document.getElementById(e) || console.error(n));
1650
+ }, [n, e]), null;
1651
+ }, Do = "DialogDescriptionWarning", Lo = ({ contentRef: e, descriptionId: t }) => {
1652
+ const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${un(Do).contentName}}.`;
1653
+ return l.useEffect(() => {
1654
+ var s;
1655
+ const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
1656
+ t && o && (document.getElementById(t) || console.warn(r));
1657
+ }, [r, e, t]), null;
1658
+ }, Oo = Xt, Fo = Zt, $o = Jt, Wo = en, Bo = tn, Uo = rn, Ko = an, Vo = cn;
1659
+ function us({
1660
+ trigger: e,
1661
+ title: t,
1662
+ description: n,
1663
+ children: r,
1664
+ footer: o,
1665
+ className: s,
1666
+ ...c
1667
+ }) {
1668
+ return /* @__PURE__ */ g(Oo, { ...c, children: [
1669
+ /* @__PURE__ */ a(Fo, { asChild: !0, children: e }),
1670
+ /* @__PURE__ */ g($o, { children: [
1671
+ /* @__PURE__ */ a(Wo, { className: "vx-dialog__overlay" }),
1672
+ /* @__PURE__ */ g(Bo, { className: E("vx-dialog__content", s), children: [
1673
+ /* @__PURE__ */ g("div", { className: "vx-dialog__header", children: [
1674
+ /* @__PURE__ */ g("div", { children: [
1675
+ /* @__PURE__ */ a(Uo, { className: "vx-dialog__title", children: t }),
1676
+ n ? /* @__PURE__ */ a(Ko, { className: "vx-dialog__description", children: n }) : null
1677
+ ] }),
1678
+ /* @__PURE__ */ a(Vo, { className: "vx-dialog__close", "aria-label": "Close dialog", children: /* @__PURE__ */ a(It, { size: 16 }) })
1679
+ ] }),
1680
+ /* @__PURE__ */ a("div", { className: "vx-dialog__body", children: r }),
1681
+ o ? /* @__PURE__ */ a("div", { className: "vx-dialog__footer", children: o }) : null
1682
+ ] })
1683
+ ] })
1684
+ ] });
1685
+ }
1686
+ function ds({ className: e, label: t, hint: n, prefix: r, suffix: o, error: s, ...c }) {
1687
+ return /* @__PURE__ */ g("label", { className: "vx-field-group", children: [
1688
+ t ? /* @__PURE__ */ a("span", { className: "vx-field-group__label", children: t }) : null,
1689
+ /* @__PURE__ */ g("span", { className: E("vx-input", s && "vx-input--invalid", e), children: [
1690
+ r ? /* @__PURE__ */ a("span", { className: "vx-input__ornament", children: r }) : null,
1691
+ /* @__PURE__ */ a("input", { className: "vx-input__field", "aria-invalid": s ? "true" : void 0, ...c }),
1692
+ o ? /* @__PURE__ */ a("span", { className: "vx-input__ornament", children: o }) : null
1693
+ ] }),
1694
+ s ? /* @__PURE__ */ a("span", { className: "vx-field-group__error", children: s }) : null,
1695
+ !s && n ? /* @__PURE__ */ a("span", { className: "vx-field-group__hint", children: n }) : null
1696
+ ] });
1697
+ }
1698
+ function Ho(e) {
1699
+ const t = l.useRef({ value: e, previous: e });
1700
+ return l.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
1701
+ }
1702
+ function zo(e) {
1703
+ const [t, n] = l.useState(void 0);
1704
+ return Q(() => {
1705
+ if (e) {
1706
+ n({ width: e.offsetWidth, height: e.offsetHeight });
1707
+ const r = new ResizeObserver((o) => {
1708
+ if (!Array.isArray(o) || !o.length)
1709
+ return;
1710
+ const s = o[0];
1711
+ let c, i;
1712
+ if ("borderBoxSize" in s) {
1713
+ const d = s.borderBoxSize, u = Array.isArray(d) ? d[0] : d;
1714
+ c = u.inlineSize, i = u.blockSize;
1715
+ } else
1716
+ c = e.offsetWidth, i = e.offsetHeight;
1717
+ n({ width: c, height: i });
1718
+ });
1719
+ return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
1720
+ } else
1721
+ n(void 0);
1722
+ }, [e]), t;
1723
+ }
1724
+ var Ie = "Switch", [jo] = se(Ie), [Go, Yo] = jo(Ie), dn = l.forwardRef(
1725
+ (e, t) => {
1726
+ const {
1727
+ __scopeSwitch: n,
1728
+ name: r,
1729
+ checked: o,
1730
+ defaultChecked: s,
1731
+ required: c,
1732
+ disabled: i,
1733
+ value: d = "on",
1734
+ onCheckedChange: u,
1735
+ form: v,
1736
+ ...h
1737
+ } = e, [p, y] = l.useState(null), N = B(t, (x) => y(x)), f = l.useRef(!1), m = p ? v || !!p.closest("form") : !0, [b, w] = de({
1738
+ prop: o,
1739
+ defaultProp: s ?? !1,
1740
+ onChange: u,
1741
+ caller: Ie
1742
+ });
1743
+ return /* @__PURE__ */ g(Go, { scope: n, checked: b, disabled: i, children: [
1744
+ /* @__PURE__ */ a(
1745
+ M.button,
1746
+ {
1747
+ type: "button",
1748
+ role: "switch",
1749
+ "aria-checked": b,
1750
+ "aria-required": c,
1751
+ "data-state": hn(b),
1752
+ "data-disabled": i ? "" : void 0,
1753
+ disabled: i,
1754
+ value: d,
1755
+ ...h,
1756
+ ref: N,
1757
+ onClick: I(e.onClick, (x) => {
1758
+ w((_) => !_), m && (f.current = x.isPropagationStopped(), f.current || x.stopPropagation());
1759
+ })
1760
+ }
1761
+ ),
1762
+ m && /* @__PURE__ */ a(
1763
+ mn,
1764
+ {
1765
+ control: p,
1766
+ bubbles: !f.current,
1767
+ name: r,
1768
+ value: d,
1769
+ checked: b,
1770
+ required: c,
1771
+ disabled: i,
1772
+ form: v,
1773
+ style: { transform: "translateX(-100%)" }
1774
+ }
1775
+ )
1776
+ ] });
1777
+ }
1778
+ );
1779
+ dn.displayName = Ie;
1780
+ var fn = "SwitchThumb", vn = l.forwardRef(
1781
+ (e, t) => {
1782
+ const { __scopeSwitch: n, ...r } = e, o = Yo(fn, n);
1783
+ return /* @__PURE__ */ a(
1784
+ M.span,
1785
+ {
1786
+ "data-state": hn(o.checked),
1787
+ "data-disabled": o.disabled ? "" : void 0,
1788
+ ...r,
1789
+ ref: t
1790
+ }
1791
+ );
1792
+ }
1793
+ );
1794
+ vn.displayName = fn;
1795
+ var Xo = "SwitchBubbleInput", mn = l.forwardRef(
1796
+ ({
1797
+ __scopeSwitch: e,
1798
+ control: t,
1799
+ checked: n,
1800
+ bubbles: r = !0,
1801
+ ...o
1802
+ }, s) => {
1803
+ const c = l.useRef(null), i = B(c, s), d = Ho(n), u = zo(t);
1804
+ return l.useEffect(() => {
1805
+ const v = c.current;
1806
+ if (!v) return;
1807
+ const h = window.HTMLInputElement.prototype, y = Object.getOwnPropertyDescriptor(
1808
+ h,
1809
+ "checked"
1810
+ ).set;
1811
+ if (d !== n && y) {
1812
+ const N = new Event("click", { bubbles: r });
1813
+ y.call(v, n), v.dispatchEvent(N);
1814
+ }
1815
+ }, [d, n, r]), /* @__PURE__ */ a(
1816
+ "input",
1817
+ {
1818
+ type: "checkbox",
1819
+ "aria-hidden": !0,
1820
+ defaultChecked: n,
1821
+ ...o,
1822
+ tabIndex: -1,
1823
+ ref: i,
1824
+ style: {
1825
+ ...o.style,
1826
+ ...u,
1827
+ position: "absolute",
1828
+ pointerEvents: "none",
1829
+ opacity: 0,
1830
+ margin: 0
1831
+ }
1832
+ }
1833
+ );
1834
+ }
1835
+ );
1836
+ mn.displayName = Xo;
1837
+ function hn(e) {
1838
+ return e ? "checked" : "unchecked";
1839
+ }
1840
+ var qo = dn, Zo = vn;
1841
+ function fs({ className: e, label: t, description: n, ...r }) {
1842
+ return /* @__PURE__ */ g("label", { className: "vx-switch", children: [
1843
+ /* @__PURE__ */ g("span", { className: "vx-switch__copy", children: [
1844
+ /* @__PURE__ */ a("span", { className: "vx-switch__label", children: t }),
1845
+ n ? /* @__PURE__ */ a("span", { className: "vx-switch__description", children: n }) : null
1846
+ ] }),
1847
+ /* @__PURE__ */ a(qo, { className: E("vx-switch__control", e), ...r, children: /* @__PURE__ */ a(Zo, { className: "vx-switch__thumb" }) })
1848
+ ] });
1849
+ }
1850
+ function pn(e) {
1851
+ const t = e + "CollectionProvider", [n, r] = se(t), [o, s] = n(
1852
+ t,
1853
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
1854
+ ), c = (f) => {
1855
+ const { scope: m, children: b } = f, w = q.useRef(null), x = q.useRef(/* @__PURE__ */ new Map()).current;
1856
+ return /* @__PURE__ */ a(o, { scope: m, itemMap: x, collectionRef: w, children: b });
1857
+ };
1858
+ c.displayName = t;
1859
+ const i = e + "CollectionSlot", d = /* @__PURE__ */ Te(i), u = q.forwardRef(
1860
+ (f, m) => {
1861
+ const { scope: b, children: w } = f, x = s(i, b), _ = B(m, x.collectionRef);
1862
+ return /* @__PURE__ */ a(d, { ref: _, children: w });
1863
+ }
1864
+ );
1865
+ u.displayName = i;
1866
+ const v = e + "CollectionItemSlot", h = "data-radix-collection-item", p = /* @__PURE__ */ Te(v), y = q.forwardRef(
1867
+ (f, m) => {
1868
+ const { scope: b, children: w, ...x } = f, _ = q.useRef(null), S = B(m, _), C = s(v, b);
1869
+ return q.useEffect(() => (C.itemMap.set(_, { ref: _, ...x }), () => void C.itemMap.delete(_))), /* @__PURE__ */ a(p, { [h]: "", ref: S, children: w });
1870
+ }
1871
+ );
1872
+ y.displayName = v;
1873
+ function N(f) {
1874
+ const m = s(e + "CollectionConsumer", f);
1875
+ return q.useCallback(() => {
1876
+ const w = m.collectionRef.current;
1877
+ if (!w) return [];
1878
+ const x = Array.from(w.querySelectorAll(`[${h}]`));
1879
+ return Array.from(m.itemMap.values()).sort(
1880
+ (C, T) => x.indexOf(C.ref.current) - x.indexOf(T.ref.current)
1881
+ );
1882
+ }, [m.collectionRef, m.itemMap]);
1883
+ }
1884
+ return [
1885
+ { Provider: c, Slot: u, ItemSlot: y },
1886
+ N,
1887
+ r
1888
+ ];
1889
+ }
1890
+ var Qo = l.createContext(void 0);
1891
+ function bn(e) {
1892
+ const t = l.useContext(Qo);
1893
+ return e || t || "ltr";
1894
+ }
1895
+ var Ke = "rovingFocusGroup.onEntryFocus", Jo = { bubbles: !1, cancelable: !0 }, fe = "RovingFocusGroup", [Ge, xn, ea] = pn(fe), [ta, gn] = se(
1896
+ fe,
1897
+ [ea]
1898
+ ), [na, ra] = ta(fe), yn = l.forwardRef(
1899
+ (e, t) => /* @__PURE__ */ a(Ge.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a(Ge.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a(oa, { ...e, ref: t }) }) })
1900
+ );
1901
+ yn.displayName = fe;
1902
+ var oa = l.forwardRef((e, t) => {
1903
+ const {
1904
+ __scopeRovingFocusGroup: n,
1905
+ orientation: r,
1906
+ loop: o = !1,
1907
+ dir: s,
1908
+ currentTabStopId: c,
1909
+ defaultCurrentTabStopId: i,
1910
+ onCurrentTabStopIdChange: d,
1911
+ onEntryFocus: u,
1912
+ preventScrollOnEntryFocus: v = !1,
1913
+ ...h
1914
+ } = e, p = l.useRef(null), y = B(t, p), N = bn(s), [f, m] = de({
1915
+ prop: c,
1916
+ defaultProp: i ?? null,
1917
+ onChange: d,
1918
+ caller: fe
1919
+ }), [b, w] = l.useState(!1), x = z(u), _ = xn(n), S = l.useRef(!1), [C, T] = l.useState(0);
1920
+ return l.useEffect(() => {
1921
+ const R = p.current;
1922
+ if (R)
1923
+ return R.addEventListener(Ke, x), () => R.removeEventListener(Ke, x);
1924
+ }, [x]), /* @__PURE__ */ a(
1925
+ na,
1926
+ {
1927
+ scope: n,
1928
+ orientation: r,
1929
+ dir: N,
1930
+ loop: o,
1931
+ currentTabStopId: f,
1932
+ onItemFocus: l.useCallback(
1933
+ (R) => m(R),
1934
+ [m]
1935
+ ),
1936
+ onItemShiftTab: l.useCallback(() => w(!0), []),
1937
+ onFocusableItemAdd: l.useCallback(
1938
+ () => T((R) => R + 1),
1939
+ []
1940
+ ),
1941
+ onFocusableItemRemove: l.useCallback(
1942
+ () => T((R) => R - 1),
1943
+ []
1944
+ ),
1945
+ children: /* @__PURE__ */ a(
1946
+ M.div,
1947
+ {
1948
+ tabIndex: b || C === 0 ? -1 : 0,
1949
+ "data-orientation": r,
1950
+ ...h,
1951
+ ref: y,
1952
+ style: { outline: "none", ...e.style },
1953
+ onMouseDown: I(e.onMouseDown, () => {
1954
+ S.current = !0;
1955
+ }),
1956
+ onFocus: I(e.onFocus, (R) => {
1957
+ const L = !S.current;
1958
+ if (R.target === R.currentTarget && L && !b) {
1959
+ const k = new CustomEvent(Ke, Jo);
1960
+ if (R.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
1961
+ const A = _().filter((D) => D.focusable), O = A.find((D) => D.active), V = A.find((D) => D.id === f), F = [O, V, ...A].filter(
1962
+ Boolean
1963
+ ).map((D) => D.ref.current);
1964
+ Nn(F, v);
1965
+ }
1966
+ }
1967
+ S.current = !1;
1968
+ }),
1969
+ onBlur: I(e.onBlur, () => w(!1))
1970
+ }
1971
+ )
1972
+ }
1973
+ );
1974
+ }), _n = "RovingFocusGroupItem", wn = l.forwardRef(
1975
+ (e, t) => {
1976
+ const {
1977
+ __scopeRovingFocusGroup: n,
1978
+ focusable: r = !0,
1979
+ active: o = !1,
1980
+ tabStopId: s,
1981
+ children: c,
1982
+ ...i
1983
+ } = e, d = le(), u = s || d, v = ra(_n, n), h = v.currentTabStopId === u, p = xn(n), { onFocusableItemAdd: y, onFocusableItemRemove: N, currentTabStopId: f } = v;
1984
+ return l.useEffect(() => {
1985
+ if (r)
1986
+ return y(), () => N();
1987
+ }, [r, y, N]), /* @__PURE__ */ a(
1988
+ Ge.ItemSlot,
1989
+ {
1990
+ scope: n,
1991
+ id: u,
1992
+ focusable: r,
1993
+ active: o,
1994
+ children: /* @__PURE__ */ a(
1995
+ M.span,
1996
+ {
1997
+ tabIndex: h ? 0 : -1,
1998
+ "data-orientation": v.orientation,
1999
+ ...i,
2000
+ ref: t,
2001
+ onMouseDown: I(e.onMouseDown, (m) => {
2002
+ r ? v.onItemFocus(u) : m.preventDefault();
2003
+ }),
2004
+ onFocus: I(e.onFocus, () => v.onItemFocus(u)),
2005
+ onKeyDown: I(e.onKeyDown, (m) => {
2006
+ if (m.key === "Tab" && m.shiftKey) {
2007
+ v.onItemShiftTab();
2008
+ return;
2009
+ }
2010
+ if (m.target !== m.currentTarget) return;
2011
+ const b = ia(m, v.orientation, v.dir);
2012
+ if (b !== void 0) {
2013
+ if (m.metaKey || m.ctrlKey || m.altKey || m.shiftKey) return;
2014
+ m.preventDefault();
2015
+ let x = p().filter((_) => _.focusable).map((_) => _.ref.current);
2016
+ if (b === "last") x.reverse();
2017
+ else if (b === "prev" || b === "next") {
2018
+ b === "prev" && x.reverse();
2019
+ const _ = x.indexOf(m.currentTarget);
2020
+ x = v.loop ? ca(x, _ + 1) : x.slice(_ + 1);
2021
+ }
2022
+ setTimeout(() => Nn(x));
2023
+ }
2024
+ }),
2025
+ children: typeof c == "function" ? c({ isCurrentTabStop: h, hasTabStop: f != null }) : c
2026
+ }
2027
+ )
2028
+ }
2029
+ );
2030
+ }
2031
+ );
2032
+ wn.displayName = _n;
2033
+ var aa = {
2034
+ ArrowLeft: "prev",
2035
+ ArrowUp: "prev",
2036
+ ArrowRight: "next",
2037
+ ArrowDown: "next",
2038
+ PageUp: "first",
2039
+ Home: "first",
2040
+ PageDown: "last",
2041
+ End: "last"
2042
+ };
2043
+ function sa(e, t) {
2044
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
2045
+ }
2046
+ function ia(e, t, n) {
2047
+ const r = sa(e.key, n);
2048
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
2049
+ return aa[r];
2050
+ }
2051
+ function Nn(e, t = !1) {
2052
+ const n = document.activeElement;
2053
+ for (const r of e)
2054
+ if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
2055
+ }
2056
+ function ca(e, t) {
2057
+ return e.map((n, r) => e[(t + r) % e.length]);
2058
+ }
2059
+ var la = yn, ua = wn, Ae = "Tabs", [da] = se(Ae, [
2060
+ gn
2061
+ ]), En = gn(), [fa, nt] = da(Ae), Cn = l.forwardRef(
2062
+ (e, t) => {
2063
+ const {
2064
+ __scopeTabs: n,
2065
+ value: r,
2066
+ onValueChange: o,
2067
+ defaultValue: s,
2068
+ orientation: c = "horizontal",
2069
+ dir: i,
2070
+ activationMode: d = "automatic",
2071
+ ...u
2072
+ } = e, v = bn(i), [h, p] = de({
2073
+ prop: r,
2074
+ onChange: o,
2075
+ defaultProp: s ?? "",
2076
+ caller: Ae
2077
+ });
2078
+ return /* @__PURE__ */ a(
2079
+ fa,
2080
+ {
2081
+ scope: n,
2082
+ baseId: le(),
2083
+ value: h,
2084
+ onValueChange: p,
2085
+ orientation: c,
2086
+ dir: v,
2087
+ activationMode: d,
2088
+ children: /* @__PURE__ */ a(
2089
+ M.div,
2090
+ {
2091
+ dir: v,
2092
+ "data-orientation": c,
2093
+ ...u,
2094
+ ref: t
2095
+ }
2096
+ )
2097
+ }
2098
+ );
2099
+ }
2100
+ );
2101
+ Cn.displayName = Ae;
2102
+ var Tn = "TabsList", Sn = l.forwardRef(
2103
+ (e, t) => {
2104
+ const { __scopeTabs: n, loop: r = !0, ...o } = e, s = nt(Tn, n), c = En(n);
2105
+ return /* @__PURE__ */ a(
2106
+ la,
2107
+ {
2108
+ asChild: !0,
2109
+ ...c,
2110
+ orientation: s.orientation,
2111
+ dir: s.dir,
2112
+ loop: r,
2113
+ children: /* @__PURE__ */ a(
2114
+ M.div,
2115
+ {
2116
+ role: "tablist",
2117
+ "aria-orientation": s.orientation,
2118
+ ...o,
2119
+ ref: t
2120
+ }
2121
+ )
2122
+ }
2123
+ );
2124
+ }
2125
+ );
2126
+ Sn.displayName = Tn;
2127
+ var Rn = "TabsTrigger", kn = l.forwardRef(
2128
+ (e, t) => {
2129
+ const { __scopeTabs: n, value: r, disabled: o = !1, ...s } = e, c = nt(Rn, n), i = En(n), d = An(c.baseId, r), u = Mn(c.baseId, r), v = r === c.value;
2130
+ return /* @__PURE__ */ a(
2131
+ ua,
2132
+ {
2133
+ asChild: !0,
2134
+ ...i,
2135
+ focusable: !o,
2136
+ active: v,
2137
+ children: /* @__PURE__ */ a(
2138
+ M.button,
2139
+ {
2140
+ type: "button",
2141
+ role: "tab",
2142
+ "aria-selected": v,
2143
+ "aria-controls": u,
2144
+ "data-state": v ? "active" : "inactive",
2145
+ "data-disabled": o ? "" : void 0,
2146
+ disabled: o,
2147
+ id: d,
2148
+ ...s,
2149
+ ref: t,
2150
+ onMouseDown: I(e.onMouseDown, (h) => {
2151
+ !o && h.button === 0 && h.ctrlKey === !1 ? c.onValueChange(r) : h.preventDefault();
2152
+ }),
2153
+ onKeyDown: I(e.onKeyDown, (h) => {
2154
+ [" ", "Enter"].includes(h.key) && c.onValueChange(r);
2155
+ }),
2156
+ onFocus: I(e.onFocus, () => {
2157
+ const h = c.activationMode !== "manual";
2158
+ !v && !o && h && c.onValueChange(r);
2159
+ })
2160
+ }
2161
+ )
2162
+ }
2163
+ );
2164
+ }
2165
+ );
2166
+ kn.displayName = Rn;
2167
+ var Pn = "TabsContent", In = l.forwardRef(
2168
+ (e, t) => {
2169
+ const { __scopeTabs: n, value: r, forceMount: o, children: s, ...c } = e, i = nt(Pn, n), d = An(i.baseId, r), u = Mn(i.baseId, r), v = r === i.value, h = l.useRef(v);
2170
+ return l.useEffect(() => {
2171
+ const p = requestAnimationFrame(() => h.current = !1);
2172
+ return () => cancelAnimationFrame(p);
2173
+ }, []), /* @__PURE__ */ a(ie, { present: o || v, children: ({ present: p }) => /* @__PURE__ */ a(
2174
+ M.div,
2175
+ {
2176
+ "data-state": v ? "active" : "inactive",
2177
+ "data-orientation": i.orientation,
2178
+ role: "tabpanel",
2179
+ "aria-labelledby": d,
2180
+ hidden: !p,
2181
+ id: u,
2182
+ tabIndex: 0,
2183
+ ...c,
2184
+ ref: t,
2185
+ style: {
2186
+ ...e.style,
2187
+ animationDuration: h.current ? "0s" : void 0
2188
+ },
2189
+ children: p && s
2190
+ }
2191
+ ) });
2192
+ }
2193
+ );
2194
+ In.displayName = Pn;
2195
+ function An(e, t) {
2196
+ return `${e}-trigger-${t}`;
2197
+ }
2198
+ function Mn(e, t) {
2199
+ return `${e}-content-${t}`;
2200
+ }
2201
+ var va = Cn, ma = Sn, ha = kn, pa = In;
2202
+ const vs = va, ms = ae(function({ className: t, ...n }, r) {
2203
+ return /* @__PURE__ */ a(ma, { ref: r, className: E("vx-tabs__list", t), ...n });
2204
+ }), hs = ae(function({ className: t, ...n }, r) {
2205
+ return /* @__PURE__ */ a(ha, { ref: r, className: E("vx-tabs__trigger", t), ...n });
2206
+ }), ps = ae(function({ className: t, ...n }, r) {
2207
+ return /* @__PURE__ */ a(pa, { ref: r, className: E("vx-tabs__content", t), ...n });
2208
+ }), Dn = {
2209
+ light: {
2210
+ label: "Light",
2211
+ mode: "light"
2212
+ },
2213
+ dark: {
2214
+ label: "Dark",
2215
+ mode: "dark"
2216
+ }
2217
+ };
2218
+ function re(e, t = {}) {
2219
+ return {
2220
+ label: t.label,
2221
+ mode: e,
2222
+ tokens: t.tokens
2223
+ };
2224
+ }
2225
+ const bs = {
2226
+ ...Dn,
2227
+ sunset: re("light", {
2228
+ label: "Sunset",
2229
+ tokens: {
2230
+ "--vx-primary": "#c2410c",
2231
+ "--vx-primary-strong": "#9a3412",
2232
+ "--vx-primary-soft": "rgba(194, 65, 12, 0.12)",
2233
+ "--vx-secondary": "#9a3412",
2234
+ "--vx-bg": "#fff7ed",
2235
+ "--vx-bg-accent": "#ffedd5",
2236
+ "--vx-surface-hover": "#fffaf5",
2237
+ "--vx-border": "#fed7aa",
2238
+ "--vx-border-strong": "#fdba74",
2239
+ "--vx-text": "#431407",
2240
+ "--vx-text-secondary": "#9a3412",
2241
+ "--vx-text-muted": "#b45309",
2242
+ "--vx-shadow-sm": "0 1px 2px rgba(124, 45, 18, 0.08)",
2243
+ "--vx-shadow": "0 14px 32px rgba(124, 45, 18, 0.08)",
2244
+ "--vx-shadow-lg": "0 28px 64px rgba(124, 45, 18, 0.12)"
2245
+ }
2246
+ }),
2247
+ mint: re("light", {
2248
+ label: "Mint",
2249
+ tokens: {
2250
+ "--vx-primary": "#0f766e",
2251
+ "--vx-primary-strong": "#115e59",
2252
+ "--vx-primary-soft": "rgba(15, 118, 110, 0.12)",
2253
+ "--vx-secondary": "#0f766e",
2254
+ "--vx-bg": "#f0fdfa",
2255
+ "--vx-bg-accent": "#ccfbf1",
2256
+ "--vx-surface-hover": "#f6fffd",
2257
+ "--vx-border": "#99f6e4",
2258
+ "--vx-border-strong": "#5eead4",
2259
+ "--vx-text": "#042f2e",
2260
+ "--vx-text-secondary": "#115e59",
2261
+ "--vx-text-muted": "#0f766e",
2262
+ "--vx-shadow-sm": "0 1px 2px rgba(4, 47, 46, 0.08)",
2263
+ "--vx-shadow": "0 14px 32px rgba(4, 47, 46, 0.08)",
2264
+ "--vx-shadow-lg": "0 28px 64px rgba(4, 47, 46, 0.12)"
2265
+ }
2266
+ }),
2267
+ graphite: re("dark", {
2268
+ label: "Graphite",
2269
+ tokens: {
2270
+ "--vx-primary": "#f59e0b",
2271
+ "--vx-primary-strong": "#d97706",
2272
+ "--vx-primary-soft": "rgba(245, 158, 11, 0.16)",
2273
+ "--vx-bg": "#111111",
2274
+ "--vx-bg-accent": "#191919",
2275
+ "--vx-surface": "#18181b",
2276
+ "--vx-surface-strong": "#111111",
2277
+ "--vx-surface-hover": "#222225",
2278
+ "--vx-border": "rgba(244, 244, 245, 0.10)",
2279
+ "--vx-border-strong": "rgba(244, 244, 245, 0.18)",
2280
+ "--vx-text": "#fafafa",
2281
+ "--vx-text-secondary": "#d4d4d8",
2282
+ "--vx-text-muted": "#a1a1aa",
2283
+ "--vx-shadow-sm": "0 1px 2px rgba(0, 0, 0, 0.34)",
2284
+ "--vx-shadow": "0 20px 44px rgba(0, 0, 0, 0.28)",
2285
+ "--vx-shadow-lg": "0 30px 72px rgba(0, 0, 0, 0.38)"
2286
+ }
2287
+ }),
2288
+ "ivory-gold": re("light", {
2289
+ label: "Ivory Gold",
2290
+ tokens: {
2291
+ "--vx-primary": "#a0742a",
2292
+ "--vx-primary-strong": "#7d5a1e",
2293
+ "--vx-primary-soft": "rgba(160, 116, 42, 0.12)",
2294
+ "--vx-bg": "#faf6ee",
2295
+ "--vx-bg-accent": "#f2ead8",
2296
+ "--vx-surface": "#ffffff",
2297
+ "--vx-surface-strong": "#faf6ee",
2298
+ "--vx-surface-hover": "#f6f0e4",
2299
+ "--vx-border": "rgba(160, 116, 42, 0.18)",
2300
+ "--vx-border-strong": "rgba(160, 116, 42, 0.38)",
2301
+ "--vx-text": "#1c1409",
2302
+ "--vx-text-secondary": "#5a4320",
2303
+ "--vx-text-muted": "#9a7c4a",
2304
+ "--vx-shadow-sm": "0 1px 2px rgba(90, 67, 32, 0.08)",
2305
+ "--vx-shadow": "0 12px 32px rgba(90, 67, 32, 0.10)",
2306
+ "--vx-shadow-lg": "0 28px 64px rgba(90, 67, 32, 0.14)",
2307
+ "--vx-success": "#1a9e6e",
2308
+ "--vx-warning": "#c4820a",
2309
+ "--vx-danger": "#d63b3b"
2310
+ }
2311
+ }),
2312
+ "black-gold": re("dark", {
2313
+ label: "Black Gold",
2314
+ tokens: {
2315
+ "--vx-primary": "#c8a97c",
2316
+ "--vx-primary-strong": "#9a7545",
2317
+ "--vx-primary-soft": "rgba(200, 169, 124, 0.16)",
2318
+ "--vx-bg": "#05070b",
2319
+ "--vx-bg-accent": "#0a0d14",
2320
+ "--vx-surface": "rgba(15, 18, 25, 0.76)",
2321
+ "--vx-surface-strong": "rgba(18, 21, 29, 0.9)",
2322
+ "--vx-surface-hover": "rgba(245, 233, 215, 0.1)",
2323
+ "--vx-border": "rgba(245, 233, 215, 0.12)",
2324
+ "--vx-border-strong": "rgba(200, 169, 124, 0.42)",
2325
+ "--vx-text": "#f5e9d7",
2326
+ "--vx-text-secondary": "#d7c8b2",
2327
+ "--vx-text-muted": "#928a81",
2328
+ "--vx-shadow-sm": "0 1px 2px rgba(0, 0, 0, 0.4)",
2329
+ "--vx-shadow": "0 0 42px rgba(200, 169, 124, 0.16)",
2330
+ "--vx-shadow-lg": "0 34px 120px rgba(0, 0, 0, 0.62)",
2331
+ "--vx-success": "#32d49a",
2332
+ "--vx-warning": "#e6ad64",
2333
+ "--vx-danger": "#ef6a64"
2334
+ }
2335
+ }),
2336
+ ocean: re("dark", {
2337
+ label: "Ocean",
2338
+ tokens: {
2339
+ "--vx-primary": "#38bdf8",
2340
+ "--vx-primary-strong": "#0ea5e9",
2341
+ "--vx-primary-soft": "rgba(56, 189, 248, 0.16)",
2342
+ "--vx-bg": "#06131f",
2343
+ "--vx-bg-accent": "#0b1a2b",
2344
+ "--vx-surface": "#0d2236",
2345
+ "--vx-surface-strong": "#06131f",
2346
+ "--vx-surface-hover": "#13314d",
2347
+ "--vx-border": "rgba(125, 211, 252, 0.16)",
2348
+ "--vx-border-strong": "rgba(56, 189, 248, 0.24)",
2349
+ "--vx-text": "#e0f2fe",
2350
+ "--vx-text-secondary": "#bae6fd",
2351
+ "--vx-text-muted": "#7dd3fc",
2352
+ "--vx-shadow-sm": "0 1px 2px rgba(2, 6, 23, 0.34)",
2353
+ "--vx-shadow": "0 20px 44px rgba(2, 6, 23, 0.28)",
2354
+ "--vx-shadow-lg": "0 30px 72px rgba(2, 6, 23, 0.4)"
2355
+ }
2356
+ })
2357
+ };
2358
+ function ba(e) {
2359
+ return {
2360
+ ...Dn,
2361
+ ...e
2362
+ };
2363
+ }
2364
+ function xa(e, t) {
2365
+ if (e && t[e])
2366
+ return e;
2367
+ if (t.light)
2368
+ return "light";
2369
+ const [n] = Object.keys(t);
2370
+ return n ?? "light";
2371
+ }
2372
+ function ga(e, t) {
2373
+ const n = window.localStorage.getItem(e);
2374
+ return n && t[n] ? n : null;
2375
+ }
2376
+ function ya(e, t, n) {
2377
+ var o;
2378
+ if (((o = e[n]) == null ? void 0 : o.mode) === t)
2379
+ return n;
2380
+ const r = Object.entries(e).find(([, s]) => s.mode === t);
2381
+ return r == null ? void 0 : r[0];
2382
+ }
2383
+ const Ln = Rt(null);
2384
+ function xs({
2385
+ children: e,
2386
+ defaultTheme: t = "light",
2387
+ storageKey: n = "vxui-react-theme",
2388
+ themes: r
2389
+ }) {
2390
+ const o = Ne(() => ba(r), [r]), s = Ne(() => xa(t, o), [t, o]), c = $([]), [i, d] = W(() => typeof window > "u" ? s : ga(n, o) ?? s), u = o[i] ? i : s, v = o[u];
2391
+ U(() => {
2392
+ i !== u && d(u);
2393
+ }, [u, i]), U(() => {
2394
+ const p = document.documentElement;
2395
+ for (const N of c.current)
2396
+ p.style.removeProperty(N);
2397
+ p.dataset.theme = v.mode, p.dataset.themeName = u;
2398
+ const y = Object.entries(v.tokens ?? {}).filter(
2399
+ (N) => typeof N[1] == "string" && N[1].length > 0
2400
+ );
2401
+ for (const [N, f] of y)
2402
+ p.style.setProperty(N, f);
2403
+ c.current = y.map(([N]) => N), window.localStorage.setItem(n, u);
2404
+ }, [v, u, n]);
2405
+ const h = Ne(
2406
+ () => ({
2407
+ theme: u,
2408
+ mode: v.mode,
2409
+ themes: o,
2410
+ setTheme: (p) => {
2411
+ d(o[p] ? p : s);
2412
+ },
2413
+ toggleTheme: () => {
2414
+ d((p) => {
2415
+ const N = (o[p] ?? v).mode === "light" ? "dark" : "light";
2416
+ return ya(o, N, N) ?? p;
2417
+ });
2418
+ }
2419
+ }),
2420
+ [v, s, o, u]
2421
+ );
2422
+ return /* @__PURE__ */ a(Ln.Provider, { value: h, children: e });
2423
+ }
2424
+ function gs() {
2425
+ const e = St(Ln);
2426
+ if (!e)
2427
+ throw new Error("useTheme must be used within ThemeProvider.");
2428
+ return e;
2429
+ }
2430
+ var _a = Object.freeze({
2431
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
2432
+ position: "absolute",
2433
+ border: 0,
2434
+ width: 1,
2435
+ height: 1,
2436
+ padding: 0,
2437
+ margin: -1,
2438
+ overflow: "hidden",
2439
+ clip: "rect(0, 0, 0, 0)",
2440
+ whiteSpace: "nowrap",
2441
+ wordWrap: "normal"
2442
+ }), wa = "VisuallyHidden", rt = l.forwardRef(
2443
+ (e, t) => /* @__PURE__ */ a(
2444
+ M.span,
2445
+ {
2446
+ ...e,
2447
+ ref: t,
2448
+ style: { ..._a, ...e.style }
2449
+ }
2450
+ )
2451
+ );
2452
+ rt.displayName = wa;
2453
+ var ot = "ToastProvider", [at, Na, Ea] = pn("Toast"), [On] = se("Toast", [Ea]), [Ca, Me] = On(ot), Fn = (e) => {
2454
+ const {
2455
+ __scopeToast: t,
2456
+ label: n = "Notification",
2457
+ duration: r = 5e3,
2458
+ swipeDirection: o = "right",
2459
+ swipeThreshold: s = 50,
2460
+ children: c
2461
+ } = e, [i, d] = l.useState(null), [u, v] = l.useState(0), h = l.useRef(!1), p = l.useRef(!1);
2462
+ return n.trim() || console.error(
2463
+ `Invalid prop \`label\` supplied to \`${ot}\`. Expected non-empty \`string\`.`
2464
+ ), /* @__PURE__ */ a(at.Provider, { scope: t, children: /* @__PURE__ */ a(
2465
+ Ca,
2466
+ {
2467
+ scope: t,
2468
+ label: n,
2469
+ duration: r,
2470
+ swipeDirection: o,
2471
+ swipeThreshold: s,
2472
+ toastCount: u,
2473
+ viewport: i,
2474
+ onViewportChange: d,
2475
+ onToastAdd: l.useCallback(() => v((y) => y + 1), []),
2476
+ onToastRemove: l.useCallback(() => v((y) => y - 1), []),
2477
+ isFocusedToastEscapeKeyDownRef: h,
2478
+ isClosePausedRef: p,
2479
+ children: c
2480
+ }
2481
+ ) });
2482
+ };
2483
+ Fn.displayName = ot;
2484
+ var $n = "ToastViewport", Ta = ["F8"], Ye = "toast.viewportPause", Xe = "toast.viewportResume", Wn = l.forwardRef(
2485
+ (e, t) => {
2486
+ const {
2487
+ __scopeToast: n,
2488
+ hotkey: r = Ta,
2489
+ label: o = "Notifications ({hotkey})",
2490
+ ...s
2491
+ } = e, c = Me($n, n), i = Na(n), d = l.useRef(null), u = l.useRef(null), v = l.useRef(null), h = l.useRef(null), p = B(t, h, c.onViewportChange), y = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), N = c.toastCount > 0;
2492
+ l.useEffect(() => {
2493
+ const m = (b) => {
2494
+ var x;
2495
+ r.length !== 0 && r.every((_) => b[_] || b.code === _) && ((x = h.current) == null || x.focus());
2496
+ };
2497
+ return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
2498
+ }, [r]), l.useEffect(() => {
2499
+ const m = d.current, b = h.current;
2500
+ if (N && m && b) {
2501
+ const w = () => {
2502
+ if (!c.isClosePausedRef.current) {
2503
+ const C = new CustomEvent(Ye);
2504
+ b.dispatchEvent(C), c.isClosePausedRef.current = !0;
2505
+ }
2506
+ }, x = () => {
2507
+ if (c.isClosePausedRef.current) {
2508
+ const C = new CustomEvent(Xe);
2509
+ b.dispatchEvent(C), c.isClosePausedRef.current = !1;
2510
+ }
2511
+ }, _ = (C) => {
2512
+ !m.contains(C.relatedTarget) && x();
2513
+ }, S = () => {
2514
+ m.contains(document.activeElement) || x();
2515
+ };
2516
+ return m.addEventListener("focusin", w), m.addEventListener("focusout", _), m.addEventListener("pointermove", w), m.addEventListener("pointerleave", S), window.addEventListener("blur", w), window.addEventListener("focus", x), () => {
2517
+ m.removeEventListener("focusin", w), m.removeEventListener("focusout", _), m.removeEventListener("pointermove", w), m.removeEventListener("pointerleave", S), window.removeEventListener("blur", w), window.removeEventListener("focus", x);
2518
+ };
2519
+ }
2520
+ }, [N, c.isClosePausedRef]);
2521
+ const f = l.useCallback(
2522
+ ({ tabbingDirection: m }) => {
2523
+ const w = i().map((x) => {
2524
+ const _ = x.ref.current, S = [_, ...Ba(_)];
2525
+ return m === "forwards" ? S : S.reverse();
2526
+ });
2527
+ return (m === "forwards" ? w.reverse() : w).flat();
2528
+ },
2529
+ [i]
2530
+ );
2531
+ return l.useEffect(() => {
2532
+ const m = h.current;
2533
+ if (m) {
2534
+ const b = (w) => {
2535
+ var S, C, T;
2536
+ const x = w.altKey || w.ctrlKey || w.metaKey;
2537
+ if (w.key === "Tab" && !x) {
2538
+ const R = document.activeElement, L = w.shiftKey;
2539
+ if (w.target === m && L) {
2540
+ (S = u.current) == null || S.focus();
2541
+ return;
2542
+ }
2543
+ const O = f({ tabbingDirection: L ? "backwards" : "forwards" }), V = O.findIndex((P) => P === R);
2544
+ Ve(O.slice(V + 1)) ? w.preventDefault() : L ? (C = u.current) == null || C.focus() : (T = v.current) == null || T.focus();
2545
+ }
2546
+ };
2547
+ return m.addEventListener("keydown", b), () => m.removeEventListener("keydown", b);
2548
+ }
2549
+ }, [i, f]), /* @__PURE__ */ g(
2550
+ Sr,
2551
+ {
2552
+ ref: d,
2553
+ role: "region",
2554
+ "aria-label": o.replace("{hotkey}", y),
2555
+ tabIndex: -1,
2556
+ style: { pointerEvents: N ? void 0 : "none" },
2557
+ children: [
2558
+ N && /* @__PURE__ */ a(
2559
+ qe,
2560
+ {
2561
+ ref: u,
2562
+ onFocusFromOutsideViewport: () => {
2563
+ const m = f({
2564
+ tabbingDirection: "forwards"
2565
+ });
2566
+ Ve(m);
2567
+ }
2568
+ }
2569
+ ),
2570
+ /* @__PURE__ */ a(at.Slot, { scope: n, children: /* @__PURE__ */ a(M.ol, { tabIndex: -1, ...s, ref: p }) }),
2571
+ N && /* @__PURE__ */ a(
2572
+ qe,
2573
+ {
2574
+ ref: v,
2575
+ onFocusFromOutsideViewport: () => {
2576
+ const m = f({
2577
+ tabbingDirection: "backwards"
2578
+ });
2579
+ Ve(m);
2580
+ }
2581
+ }
2582
+ )
2583
+ ]
2584
+ }
2585
+ );
2586
+ }
2587
+ );
2588
+ Wn.displayName = $n;
2589
+ var Bn = "ToastFocusProxy", qe = l.forwardRef(
2590
+ (e, t) => {
2591
+ const { __scopeToast: n, onFocusFromOutsideViewport: r, ...o } = e, s = Me(Bn, n);
2592
+ return /* @__PURE__ */ a(
2593
+ rt,
2594
+ {
2595
+ tabIndex: 0,
2596
+ ...o,
2597
+ ref: t,
2598
+ style: { position: "fixed" },
2599
+ onFocus: (c) => {
2600
+ var u;
2601
+ const i = c.relatedTarget;
2602
+ !((u = s.viewport) != null && u.contains(i)) && r();
2603
+ }
2604
+ }
2605
+ );
2606
+ }
2607
+ );
2608
+ qe.displayName = Bn;
2609
+ var ve = "Toast", Sa = "toast.swipeStart", Ra = "toast.swipeMove", ka = "toast.swipeCancel", Pa = "toast.swipeEnd", Un = l.forwardRef(
2610
+ (e, t) => {
2611
+ const { forceMount: n, open: r, defaultOpen: o, onOpenChange: s, ...c } = e, [i, d] = de({
2612
+ prop: r,
2613
+ defaultProp: o ?? !0,
2614
+ onChange: s,
2615
+ caller: ve
2616
+ });
2617
+ return /* @__PURE__ */ a(ie, { present: n || i, children: /* @__PURE__ */ a(
2618
+ Ma,
2619
+ {
2620
+ open: i,
2621
+ ...c,
2622
+ ref: t,
2623
+ onClose: () => d(!1),
2624
+ onPause: z(e.onPause),
2625
+ onResume: z(e.onResume),
2626
+ onSwipeStart: I(e.onSwipeStart, (u) => {
2627
+ u.currentTarget.setAttribute("data-swipe", "start");
2628
+ }),
2629
+ onSwipeMove: I(e.onSwipeMove, (u) => {
2630
+ const { x: v, y: h } = u.detail.delta;
2631
+ u.currentTarget.setAttribute("data-swipe", "move"), u.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${v}px`), u.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${h}px`);
2632
+ }),
2633
+ onSwipeCancel: I(e.onSwipeCancel, (u) => {
2634
+ u.currentTarget.setAttribute("data-swipe", "cancel"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
2635
+ }),
2636
+ onSwipeEnd: I(e.onSwipeEnd, (u) => {
2637
+ const { x: v, y: h } = u.detail.delta;
2638
+ u.currentTarget.setAttribute("data-swipe", "end"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), u.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${v}px`), u.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${h}px`), d(!1);
2639
+ })
2640
+ }
2641
+ ) });
2642
+ }
2643
+ );
2644
+ Un.displayName = ve;
2645
+ var [Ia, Aa] = On(ve, {
2646
+ onClose() {
2647
+ }
2648
+ }), Ma = l.forwardRef(
2649
+ (e, t) => {
2650
+ const {
2651
+ __scopeToast: n,
2652
+ type: r = "foreground",
2653
+ duration: o,
2654
+ open: s,
2655
+ onClose: c,
2656
+ onEscapeKeyDown: i,
2657
+ onPause: d,
2658
+ onResume: u,
2659
+ onSwipeStart: v,
2660
+ onSwipeMove: h,
2661
+ onSwipeCancel: p,
2662
+ onSwipeEnd: y,
2663
+ ...N
2664
+ } = e, f = Me(ve, n), [m, b] = l.useState(null), w = B(t, (P) => b(P)), x = l.useRef(null), _ = l.useRef(null), S = o || f.duration, C = l.useRef(0), T = l.useRef(S), R = l.useRef(0), { onToastAdd: L, onToastRemove: k } = f, A = z(() => {
2665
+ var F;
2666
+ (m == null ? void 0 : m.contains(document.activeElement)) && ((F = f.viewport) == null || F.focus()), c();
2667
+ }), O = l.useCallback(
2668
+ (P) => {
2669
+ !P || P === 1 / 0 || (window.clearTimeout(R.current), C.current = (/* @__PURE__ */ new Date()).getTime(), R.current = window.setTimeout(A, P));
2670
+ },
2671
+ [A]
2672
+ );
2673
+ l.useEffect(() => {
2674
+ const P = f.viewport;
2675
+ if (P) {
2676
+ const F = () => {
2677
+ O(T.current), u == null || u();
2678
+ }, D = () => {
2679
+ const j = (/* @__PURE__ */ new Date()).getTime() - C.current;
2680
+ T.current = T.current - j, window.clearTimeout(R.current), d == null || d();
2681
+ };
2682
+ return P.addEventListener(Ye, D), P.addEventListener(Xe, F), () => {
2683
+ P.removeEventListener(Ye, D), P.removeEventListener(Xe, F);
2684
+ };
2685
+ }
2686
+ }, [f.viewport, S, d, u, O]), l.useEffect(() => {
2687
+ s && !f.isClosePausedRef.current && O(S);
2688
+ }, [s, S, f.isClosePausedRef, O]), l.useEffect(() => (L(), () => k()), [L, k]);
2689
+ const V = l.useMemo(() => m ? Gn(m) : null, [m]);
2690
+ return f.viewport ? /* @__PURE__ */ g(ue, { children: [
2691
+ V && /* @__PURE__ */ a(
2692
+ Da,
2693
+ {
2694
+ __scopeToast: n,
2695
+ role: "status",
2696
+ "aria-live": r === "foreground" ? "assertive" : "polite",
2697
+ children: V
2698
+ }
2699
+ ),
2700
+ /* @__PURE__ */ a(Ia, { scope: n, onClose: A, children: kt.createPortal(
2701
+ /* @__PURE__ */ a(at.ItemSlot, { scope: n, children: /* @__PURE__ */ a(
2702
+ Tr,
2703
+ {
2704
+ asChild: !0,
2705
+ onEscapeKeyDown: I(i, () => {
2706
+ f.isFocusedToastEscapeKeyDownRef.current || A(), f.isFocusedToastEscapeKeyDownRef.current = !1;
2707
+ }),
2708
+ children: /* @__PURE__ */ a(
2709
+ M.li,
2710
+ {
2711
+ tabIndex: 0,
2712
+ "data-state": s ? "open" : "closed",
2713
+ "data-swipe-direction": f.swipeDirection,
2714
+ ...N,
2715
+ ref: w,
2716
+ style: { userSelect: "none", touchAction: "none", ...e.style },
2717
+ onKeyDown: I(e.onKeyDown, (P) => {
2718
+ P.key === "Escape" && (i == null || i(P.nativeEvent), P.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, A()));
2719
+ }),
2720
+ onPointerDown: I(e.onPointerDown, (P) => {
2721
+ P.button === 0 && (x.current = { x: P.clientX, y: P.clientY });
2722
+ }),
2723
+ onPointerMove: I(e.onPointerMove, (P) => {
2724
+ if (!x.current) return;
2725
+ const F = P.clientX - x.current.x, D = P.clientY - x.current.y, j = !!_.current, G = ["left", "right"].includes(f.swipeDirection), X = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, me = G ? X(0, F) : 0, De = G ? 0 : X(0, D), ce = P.pointerType === "touch" ? 10 : 2, he = { x: me, y: De }, it = { originalEvent: P, delta: he };
2726
+ j ? (_.current = he, _e(Ra, h, it, {
2727
+ discrete: !1
2728
+ })) : Ct(he, f.swipeDirection, ce) ? (_.current = he, _e(Sa, v, it, {
2729
+ discrete: !1
2730
+ }), P.target.setPointerCapture(P.pointerId)) : (Math.abs(F) > ce || Math.abs(D) > ce) && (x.current = null);
2731
+ }),
2732
+ onPointerUp: I(e.onPointerUp, (P) => {
2733
+ const F = _.current, D = P.target;
2734
+ if (D.hasPointerCapture(P.pointerId) && D.releasePointerCapture(P.pointerId), _.current = null, x.current = null, F) {
2735
+ const j = P.currentTarget, G = { originalEvent: P, delta: F };
2736
+ Ct(F, f.swipeDirection, f.swipeThreshold) ? _e(Pa, y, G, {
2737
+ discrete: !0
2738
+ }) : _e(
2739
+ ka,
2740
+ p,
2741
+ G,
2742
+ {
2743
+ discrete: !0
2744
+ }
2745
+ ), j.addEventListener("click", (X) => X.preventDefault(), {
2746
+ once: !0
2747
+ });
2748
+ }
2749
+ })
2750
+ }
2751
+ )
2752
+ }
2753
+ ) }),
2754
+ f.viewport
2755
+ ) })
2756
+ ] }) : null;
2757
+ }
2758
+ ), Da = (e) => {
2759
+ const { __scopeToast: t, children: n, ...r } = e, o = Me(ve, t), [s, c] = l.useState(!1), [i, d] = l.useState(!1);
2760
+ return $a(() => c(!0)), l.useEffect(() => {
2761
+ const u = window.setTimeout(() => d(!0), 1e3);
2762
+ return () => window.clearTimeout(u);
2763
+ }, []), i ? null : /* @__PURE__ */ a(Qe, { asChild: !0, children: /* @__PURE__ */ a(rt, { ...r, children: s && /* @__PURE__ */ g(ue, { children: [
2764
+ o.label,
2765
+ " ",
2766
+ n
2767
+ ] }) }) });
2768
+ }, La = "ToastTitle", Kn = l.forwardRef(
2769
+ (e, t) => {
2770
+ const { __scopeToast: n, ...r } = e;
2771
+ return /* @__PURE__ */ a(M.div, { ...r, ref: t });
2772
+ }
2773
+ );
2774
+ Kn.displayName = La;
2775
+ var Oa = "ToastDescription", Vn = l.forwardRef(
2776
+ (e, t) => {
2777
+ const { __scopeToast: n, ...r } = e;
2778
+ return /* @__PURE__ */ a(M.div, { ...r, ref: t });
2779
+ }
2780
+ );
2781
+ Vn.displayName = Oa;
2782
+ var Hn = "ToastAction", Fa = l.forwardRef(
2783
+ (e, t) => {
2784
+ const { altText: n, ...r } = e;
2785
+ return n.trim() ? /* @__PURE__ */ a(jn, { altText: n, asChild: !0, children: /* @__PURE__ */ a(st, { ...r, ref: t }) }) : (console.error(
2786
+ `Invalid prop \`altText\` supplied to \`${Hn}\`. Expected non-empty \`string\`.`
2787
+ ), null);
2788
+ }
2789
+ );
2790
+ Fa.displayName = Hn;
2791
+ var zn = "ToastClose", st = l.forwardRef(
2792
+ (e, t) => {
2793
+ const { __scopeToast: n, ...r } = e, o = Aa(zn, n);
2794
+ return /* @__PURE__ */ a(jn, { asChild: !0, children: /* @__PURE__ */ a(
2795
+ M.button,
2796
+ {
2797
+ type: "button",
2798
+ ...r,
2799
+ ref: t,
2800
+ onClick: I(e.onClick, o.onClose)
2801
+ }
2802
+ ) });
2803
+ }
2804
+ );
2805
+ st.displayName = zn;
2806
+ var jn = l.forwardRef((e, t) => {
2807
+ const { __scopeToast: n, altText: r, ...o } = e;
2808
+ return /* @__PURE__ */ a(
2809
+ M.div,
2810
+ {
2811
+ "data-radix-toast-announce-exclude": "",
2812
+ "data-radix-toast-announce-alt": r || void 0,
2813
+ ...o,
2814
+ ref: t
2815
+ }
2816
+ );
2817
+ });
2818
+ function Gn(e) {
2819
+ const t = [];
2820
+ return Array.from(e.childNodes).forEach((r) => {
2821
+ if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), Wa(r)) {
2822
+ const o = r.ariaHidden || r.hidden || r.style.display === "none", s = r.dataset.radixToastAnnounceExclude === "";
2823
+ if (!o)
2824
+ if (s) {
2825
+ const c = r.dataset.radixToastAnnounceAlt;
2826
+ c && t.push(c);
2827
+ } else
2828
+ t.push(...Gn(r));
2829
+ }
2830
+ }), t;
2831
+ }
2832
+ function _e(e, t, n, { discrete: r }) {
2833
+ const o = n.originalEvent.currentTarget, s = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: n });
2834
+ t && o.addEventListener(e, t, { once: !0 }), r ? Mt(o, s) : o.dispatchEvent(s);
2835
+ }
2836
+ var Ct = (e, t, n = 0) => {
2837
+ const r = Math.abs(e.x), o = Math.abs(e.y), s = r > o;
2838
+ return t === "left" || t === "right" ? s && r > n : !s && o > n;
2839
+ };
2840
+ function $a(e = () => {
2841
+ }) {
2842
+ const t = z(e);
2843
+ Q(() => {
2844
+ let n = 0, r = 0;
2845
+ return n = window.requestAnimationFrame(() => r = window.requestAnimationFrame(t)), () => {
2846
+ window.cancelAnimationFrame(n), window.cancelAnimationFrame(r);
2847
+ };
2848
+ }, [t]);
2849
+ }
2850
+ function Wa(e) {
2851
+ return e.nodeType === e.ELEMENT_NODE;
2852
+ }
2853
+ function Ba(e) {
2854
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
2855
+ acceptNode: (r) => {
2856
+ const o = r.tagName === "INPUT" && r.type === "hidden";
2857
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
2858
+ }
2859
+ });
2860
+ for (; n.nextNode(); ) t.push(n.currentNode);
2861
+ return t;
2862
+ }
2863
+ function Ve(e) {
2864
+ const t = document.activeElement;
2865
+ return e.some((n) => n === t ? !0 : (n.focus(), document.activeElement !== t));
2866
+ }
2867
+ var Ua = Fn, Ka = Wn, Va = Un, Ha = Kn, za = Vn, ja = st;
2868
+ const Yn = Rt(null);
2869
+ let Ga = 1;
2870
+ function ys({ children: e }) {
2871
+ const [t, n] = W([]), r = Ne(
2872
+ () => ({
2873
+ push: (o) => {
2874
+ n((s) => [...s, { id: Ga += 1, tone: "info", ...o }]);
2875
+ }
2876
+ }),
2877
+ []
2878
+ );
2879
+ return /* @__PURE__ */ a(Yn.Provider, { value: r, children: /* @__PURE__ */ g(Ua, { swipeDirection: "right", children: [
2880
+ e,
2881
+ t.map((o) => /* @__PURE__ */ g(
2882
+ Va,
2883
+ {
2884
+ className: E("vx-toast", `vx-toast--${o.tone ?? "info"}`),
2885
+ duration: 4500,
2886
+ open: !0,
2887
+ onOpenChange: (s) => {
2888
+ s || n((c) => c.filter((i) => i.id !== o.id));
2889
+ },
2890
+ children: [
2891
+ /* @__PURE__ */ g("div", { className: "vx-toast__content", children: [
2892
+ /* @__PURE__ */ a(Ha, { className: "vx-toast__title", children: o.title }),
2893
+ o.description ? /* @__PURE__ */ a(za, { className: "vx-toast__description", children: o.description }) : null
2894
+ ] }),
2895
+ /* @__PURE__ */ a(ja, { className: "vx-toast__close", "aria-label": "Dismiss notification", children: /* @__PURE__ */ a(It, { size: 16 }) })
2896
+ ]
2897
+ },
2898
+ o.id
2899
+ )),
2900
+ /* @__PURE__ */ a(Ka, { className: "vx-toast__viewport" })
2901
+ ] }) });
2902
+ }
2903
+ function _s() {
2904
+ const e = St(Yn);
2905
+ if (!e)
2906
+ throw new Error("useToast must be used within ToastProvider.");
2907
+ return e;
2908
+ }
2909
+ function ws({
2910
+ as: e = "p",
2911
+ variant: t = "default",
2912
+ size: n = "base",
2913
+ weight: r = "normal",
2914
+ truncate: o = !1,
2915
+ className: s,
2916
+ ...c
2917
+ }) {
2918
+ return /* @__PURE__ */ a(
2919
+ e,
2920
+ {
2921
+ className: E(
2922
+ "vx-text-component",
2923
+ `vx-text--${t}`,
2924
+ `vx-text-size--${n}`,
2925
+ `vx-text-weight--${r}`,
2926
+ o && "vx-text--truncate",
2927
+ s
2928
+ ),
2929
+ ...c
2930
+ }
2931
+ );
2932
+ }
2933
+ function Ns({
2934
+ as: e,
2935
+ level: t = 2,
2936
+ variant: n = "default",
2937
+ weight: r = "bold",
2938
+ truncate: o = !1,
2939
+ className: s,
2940
+ ...c
2941
+ }) {
2942
+ const i = e || `h${t}`;
2943
+ return /* @__PURE__ */ a(
2944
+ i,
2945
+ {
2946
+ className: E(
2947
+ "vx-heading",
2948
+ `vx-heading--h${t}`,
2949
+ `vx-heading--${n}`,
2950
+ `vx-heading-weight--${r}`,
2951
+ o && "vx-text--truncate",
2952
+ s
2953
+ ),
2954
+ ...c
2955
+ }
2956
+ );
2957
+ }
2958
+ function Es({ className: e, label: t, hint: n, placeholder: r, children: o, ...s }) {
2959
+ return /* @__PURE__ */ g("label", { className: "vx-field-group", children: [
2960
+ t ? /* @__PURE__ */ a("span", { className: "vx-field-group__label", children: t }) : null,
2961
+ /* @__PURE__ */ g("span", { className: E("vx-select", e), children: [
2962
+ /* @__PURE__ */ g("select", { className: "vx-select__field", ...s, children: [
2963
+ r ? /* @__PURE__ */ a("option", { value: "", disabled: !0, children: r }) : null,
2964
+ o
2965
+ ] }),
2966
+ /* @__PURE__ */ a("span", { className: "vx-select__arrow", "aria-hidden": "true", children: /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ a("path", { d: "M2.5 4.5L6 8L9.5 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
2967
+ ] }),
2968
+ n ? /* @__PURE__ */ a("span", { className: "vx-field-group__hint", children: n }) : null
2969
+ ] });
2970
+ }
2971
+ function Cs({ className: e, label: t, description: n, indeterminate: r, ...o }) {
2972
+ return /* @__PURE__ */ g("label", { className: E("vx-checkbox", o.disabled && "vx-checkbox--disabled"), children: [
2973
+ /* @__PURE__ */ g("span", { className: "vx-checkbox__control-wrap", children: [
2974
+ /* @__PURE__ */ a(
2975
+ "input",
2976
+ {
2977
+ type: "checkbox",
2978
+ className: E("vx-checkbox__input", e),
2979
+ ref: (s) => {
2980
+ s && (s.indeterminate = r ?? !1);
2981
+ },
2982
+ ...o
2983
+ }
2984
+ ),
2985
+ /* @__PURE__ */ a("span", { className: "vx-checkbox__box", "aria-hidden": "true", children: r ? /* @__PURE__ */ a("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ a("path", { d: "M2 5h6", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) }) : /* @__PURE__ */ a("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ a("path", { d: "M2 5l2.5 2.5L8 3", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
2986
+ ] }),
2987
+ t ? /* @__PURE__ */ g("span", { className: "vx-checkbox__copy", children: [
2988
+ /* @__PURE__ */ a("span", { className: "vx-checkbox__label", children: t }),
2989
+ n ? /* @__PURE__ */ a("span", { className: "vx-checkbox__description", children: n }) : null
2990
+ ] }) : null
2991
+ ] });
2992
+ }
2993
+ function Ts({ className: e, label: t, description: n, ...r }) {
2994
+ return /* @__PURE__ */ g("label", { className: E("vx-radio", r.disabled && "vx-radio--disabled"), children: [
2995
+ /* @__PURE__ */ g("span", { className: "vx-radio__control-wrap", children: [
2996
+ /* @__PURE__ */ a("input", { type: "radio", className: E("vx-radio__input", e), ...r }),
2997
+ /* @__PURE__ */ a("span", { className: "vx-radio__circle", "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: "vx-radio__dot" }) })
2998
+ ] }),
2999
+ t ? /* @__PURE__ */ g("span", { className: "vx-radio__copy", children: [
3000
+ /* @__PURE__ */ a("span", { className: "vx-radio__label", children: t }),
3001
+ n ? /* @__PURE__ */ a("span", { className: "vx-radio__description", children: n }) : null
3002
+ ] }) : null
3003
+ ] });
3004
+ }
3005
+ function Ss({ label: e, children: t, className: n }) {
3006
+ return /* @__PURE__ */ g("fieldset", { className: E("vx-radio-group", n), children: [
3007
+ e ? /* @__PURE__ */ a("legend", { className: "vx-field-group__label", children: e }) : null,
3008
+ /* @__PURE__ */ a("div", { className: "vx-radio-group__items", children: t })
3009
+ ] });
3010
+ }
3011
+ function Rs({ className: e, label: t, hint: n, resize: r = "vertical", style: o, ...s }) {
3012
+ return /* @__PURE__ */ g("label", { className: "vx-field-group", children: [
3013
+ t ? /* @__PURE__ */ a("span", { className: "vx-field-group__label", children: t }) : null,
3014
+ /* @__PURE__ */ a(
3015
+ "textarea",
3016
+ {
3017
+ className: E("vx-textarea", e),
3018
+ style: { resize: r, ...o },
3019
+ ...s
3020
+ }
3021
+ ),
3022
+ n ? /* @__PURE__ */ a("span", { className: "vx-field-group__hint", children: n }) : null
3023
+ ] });
3024
+ }
3025
+ function ks({ className: e, label: t, showValue: n = !1, hint: r, value: o, defaultValue: s, ...c }) {
3026
+ return /* @__PURE__ */ g("label", { className: "vx-field-group", children: [
3027
+ t || n ? /* @__PURE__ */ g("span", { className: "vx-slider__header", children: [
3028
+ t ? /* @__PURE__ */ a("span", { className: "vx-field-group__label vx-slider__label", children: t }) : null,
3029
+ n ? /* @__PURE__ */ a("span", { className: "vx-slider__value", children: o ?? s ?? "" }) : null
3030
+ ] }) : null,
3031
+ /* @__PURE__ */ a(
3032
+ "input",
3033
+ {
3034
+ type: "range",
3035
+ className: E("vx-slider", e),
3036
+ value: o,
3037
+ defaultValue: s,
3038
+ ...c
3039
+ }
3040
+ ),
3041
+ r ? /* @__PURE__ */ a("span", { className: "vx-field-group__hint", children: r }) : null
3042
+ ] });
3043
+ }
3044
+ const Ya = { sm: 16, md: 24, lg: 36 };
3045
+ function Ps({ className: e, size: t = "md", label: n = "Loading…", ...r }) {
3046
+ const o = Ya[t];
3047
+ return /* @__PURE__ */ a(
3048
+ "span",
3049
+ {
3050
+ role: "status",
3051
+ "aria-label": n,
3052
+ className: E("vx-spinner", `vx-spinner--${t}`, e),
3053
+ ...r,
3054
+ children: /* @__PURE__ */ a(
3055
+ "svg",
3056
+ {
3057
+ width: o,
3058
+ height: o,
3059
+ viewBox: "0 0 24 24",
3060
+ fill: "none",
3061
+ "aria-hidden": "true",
3062
+ children: /* @__PURE__ */ a(
3063
+ "circle",
3064
+ {
3065
+ cx: "12",
3066
+ cy: "12",
3067
+ r: "9",
3068
+ stroke: "currentColor",
3069
+ strokeWidth: "2.5",
3070
+ strokeLinecap: "round",
3071
+ strokeDasharray: "42 14"
3072
+ }
3073
+ )
3074
+ }
3075
+ )
3076
+ }
3077
+ );
3078
+ }
3079
+ function Is({
3080
+ className: e,
3081
+ value: t = 0,
3082
+ max: n = 100,
3083
+ label: r,
3084
+ showLabel: o = !1,
3085
+ size: s = "md",
3086
+ variant: c = "default",
3087
+ indeterminate: i = !1,
3088
+ ...d
3089
+ }) {
3090
+ const u = i ? void 0 : Math.min(100, Math.max(0, t / n * 100));
3091
+ return /* @__PURE__ */ g("div", { className: E("vx-progress-wrap", e), ...d, children: [
3092
+ r || o ? /* @__PURE__ */ g("div", { className: "vx-progress__header", children: [
3093
+ r ? /* @__PURE__ */ a("span", { className: "vx-progress__label", children: r }) : null,
3094
+ o && !i ? /* @__PURE__ */ g("span", { className: "vx-progress__value", children: [
3095
+ Math.round(u),
3096
+ "%"
3097
+ ] }) : null
3098
+ ] }) : null,
3099
+ /* @__PURE__ */ a(
3100
+ "div",
3101
+ {
3102
+ role: "progressbar",
3103
+ "aria-valuenow": i ? void 0 : t,
3104
+ "aria-valuemin": 0,
3105
+ "aria-valuemax": n,
3106
+ "aria-label": r,
3107
+ className: E(
3108
+ "vx-progress",
3109
+ `vx-progress--${s}`,
3110
+ `vx-progress--${c}`,
3111
+ i && "vx-progress--indeterminate"
3112
+ ),
3113
+ children: /* @__PURE__ */ a(
3114
+ "div",
3115
+ {
3116
+ className: "vx-progress__bar",
3117
+ style: i ? void 0 : { width: `${u}%` }
3118
+ }
3119
+ )
3120
+ }
3121
+ )
3122
+ ] });
3123
+ }
3124
+ const Xa = {
3125
+ info: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
3126
+ /* @__PURE__ */ a("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
3127
+ /* @__PURE__ */ a("path", { d: "M8 7v4M8 5.5v.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3128
+ ] }),
3129
+ success: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
3130
+ /* @__PURE__ */ a("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
3131
+ /* @__PURE__ */ a("path", { d: "M5 8.5l2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
3132
+ ] }),
3133
+ warning: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
3134
+ /* @__PURE__ */ a("path", { d: "M8 2L14.5 13.5H1.5L8 2z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }),
3135
+ /* @__PURE__ */ a("path", { d: "M8 6.5v3M8 11v.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3136
+ ] }),
3137
+ danger: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
3138
+ /* @__PURE__ */ a("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
3139
+ /* @__PURE__ */ a("path", { d: "M10 6L6 10M6 6l4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3140
+ ] })
3141
+ };
3142
+ function As({
3143
+ className: e,
3144
+ variant: t = "info",
3145
+ title: n,
3146
+ icon: r,
3147
+ onClose: o,
3148
+ children: s,
3149
+ ...c
3150
+ }) {
3151
+ return /* @__PURE__ */ g(
3152
+ "div",
3153
+ {
3154
+ role: "alert",
3155
+ className: E("vx-alert", `vx-alert--${t}`, e),
3156
+ ...c,
3157
+ children: [
3158
+ /* @__PURE__ */ a("span", { className: "vx-alert__icon", children: r ?? Xa[t] }),
3159
+ /* @__PURE__ */ g("div", { className: "vx-alert__body", children: [
3160
+ n ? /* @__PURE__ */ a("p", { className: "vx-alert__title", children: n }) : null,
3161
+ s ? /* @__PURE__ */ a("div", { className: "vx-alert__content", children: s }) : null
3162
+ ] }),
3163
+ o ? /* @__PURE__ */ a("button", { type: "button", className: "vx-alert__close", onClick: o, "aria-label": "关闭", children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M1 1l12 12M13 1L1 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) }) : null
3164
+ ]
3165
+ }
3166
+ );
3167
+ }
3168
+ function Ms({
3169
+ className: e,
3170
+ width: t,
3171
+ height: n,
3172
+ variant: r = "rect",
3173
+ lines: o = 1,
3174
+ style: s,
3175
+ ...c
3176
+ }) {
3177
+ return r === "text" && o > 1 ? /* @__PURE__ */ a("span", { className: E("vx-skeleton-text", e), ...c, children: Array.from({ length: o }).map((i, d) => /* @__PURE__ */ a(
3178
+ "span",
3179
+ {
3180
+ className: "vx-skeleton vx-skeleton--text",
3181
+ style: d === o - 1 ? { width: "70%" } : void 0
3182
+ },
3183
+ d
3184
+ )) }) : /* @__PURE__ */ a(
3185
+ "span",
3186
+ {
3187
+ className: E(
3188
+ "vx-skeleton",
3189
+ `vx-skeleton--${r}`,
3190
+ e
3191
+ ),
3192
+ style: {
3193
+ width: typeof t == "number" ? `${t}px` : t,
3194
+ height: typeof n == "number" ? `${n}px` : n,
3195
+ ...s
3196
+ },
3197
+ ...c
3198
+ }
3199
+ );
3200
+ }
3201
+ function Ds({ content: e, placement: t = "top", delay: n = 600, children: r, className: o }) {
3202
+ const [s, c] = W(!1), i = $(null), d = Z(() => {
3203
+ i.current = setTimeout(() => c(!0), n);
3204
+ }, [n]), u = Z(() => {
3205
+ i.current && clearTimeout(i.current), c(!1);
3206
+ }, []);
3207
+ return U(() => () => {
3208
+ i.current && clearTimeout(i.current);
3209
+ }, []), /* @__PURE__ */ g("span", { className: E("vx-tooltip-wrap", o), onMouseEnter: d, onMouseLeave: u, onFocus: d, onBlur: u, children: [
3210
+ r,
3211
+ s ? /* @__PURE__ */ a("span", { role: "tooltip", className: E("vx-tooltip", `vx-tooltip--${t}`), children: e }) : null
3212
+ ] });
3213
+ }
3214
+ function Ls({
3215
+ content: e,
3216
+ placement: t = "bottom",
3217
+ trigger: n = "click",
3218
+ children: r,
3219
+ className: o,
3220
+ open: s,
3221
+ onOpenChange: c
3222
+ }) {
3223
+ const [i, d] = W(!1), u = s !== void 0, v = u ? s : i, h = $(null), p = Z((f) => {
3224
+ u || d(f), c == null || c(f);
3225
+ }, [u, c]), y = Z(() => p(!v), [v, p]);
3226
+ U(() => {
3227
+ if (!v) return;
3228
+ const f = (b) => {
3229
+ b.key === "Escape" && p(!1);
3230
+ }, m = (b) => {
3231
+ h.current && !h.current.contains(b.target) && p(!1);
3232
+ };
3233
+ return document.addEventListener("keydown", f), document.addEventListener("mousedown", m), () => {
3234
+ document.removeEventListener("keydown", f), document.removeEventListener("mousedown", m);
3235
+ };
3236
+ }, [v, p]);
3237
+ const N = n === "click" ? { onClick: y } : { onMouseEnter: () => p(!0), onMouseLeave: () => p(!1) };
3238
+ return /* @__PURE__ */ g("div", { ref: h, className: E("vx-popover-wrap", o), ...N, children: [
3239
+ r,
3240
+ v ? /* @__PURE__ */ a("div", { className: E("vx-popover", `vx-popover--${t}`), role: "dialog", children: e }) : null
3241
+ ] });
3242
+ }
3243
+ function Os({
3244
+ trigger: e,
3245
+ groups: t,
3246
+ items: n,
3247
+ align: r = "left",
3248
+ className: o,
3249
+ open: s,
3250
+ onOpenChange: c
3251
+ }) {
3252
+ const [i, d] = W(!1), u = s !== void 0, v = u ? s : i, h = $(null), p = Z((f) => {
3253
+ u || d(f), c == null || c(f);
3254
+ }, [u, c]), y = Z(() => p(!v), [v, p]);
3255
+ U(() => {
3256
+ if (!v) return;
3257
+ const f = (b) => {
3258
+ b.key === "Escape" && p(!1);
3259
+ }, m = (b) => {
3260
+ h.current && !h.current.contains(b.target) && p(!1);
3261
+ };
3262
+ return document.addEventListener("keydown", f), document.addEventListener("mousedown", m), () => {
3263
+ document.removeEventListener("keydown", f), document.removeEventListener("mousedown", m);
3264
+ };
3265
+ }, [v, p]);
3266
+ const N = t ?? (n ? [{ items: n }] : []);
3267
+ return /* @__PURE__ */ g("div", { ref: h, className: E("vx-dropdown", o), children: [
3268
+ /* @__PURE__ */ a(
3269
+ "div",
3270
+ {
3271
+ className: "vx-dropdown__trigger",
3272
+ onClick: y,
3273
+ role: "button",
3274
+ tabIndex: 0,
3275
+ onKeyDown: (f) => {
3276
+ (f.key === "Enter" || f.key === " ") && y();
3277
+ },
3278
+ children: e
3279
+ }
3280
+ ),
3281
+ v ? /* @__PURE__ */ a("div", { className: E("vx-dropdown__menu", `vx-dropdown__menu--${r}`), role: "menu", children: N.map((f, m) => /* @__PURE__ */ g("div", { className: "vx-dropdown__group", children: [
3282
+ f.label ? /* @__PURE__ */ a("div", { className: "vx-dropdown__group-label", children: f.label }) : null,
3283
+ m > 0 && !f.label ? /* @__PURE__ */ a("div", { className: "vx-dropdown__separator", role: "separator" }) : null,
3284
+ f.items.map((b, w) => /* @__PURE__ */ g(
3285
+ "button",
3286
+ {
3287
+ role: "menuitem",
3288
+ disabled: b.disabled,
3289
+ className: E(
3290
+ "vx-dropdown__item",
3291
+ b.danger && "vx-dropdown__item--danger",
3292
+ b.disabled && "vx-dropdown__item--disabled"
3293
+ ),
3294
+ onClick: () => {
3295
+ var x;
3296
+ b.disabled || ((x = b.onClick) == null || x.call(b), p(!1));
3297
+ },
3298
+ children: [
3299
+ b.icon ? /* @__PURE__ */ a("span", { className: "vx-dropdown__item-icon", children: b.icon }) : null,
3300
+ /* @__PURE__ */ a("span", { className: "vx-dropdown__item-label", children: b.label }),
3301
+ b.shortcut ? /* @__PURE__ */ a("kbd", { className: "vx-dropdown__shortcut", children: b.shortcut }) : null
3302
+ ]
3303
+ },
3304
+ w
3305
+ ))
3306
+ ] }, m)) }) : null
3307
+ ] });
3308
+ }
3309
+ const qa = () => /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M4.5 2.5L7.5 6l-3 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
3310
+ function Fs({ items: e, separator: t, className: n }) {
3311
+ return /* @__PURE__ */ a("nav", { "aria-label": "Breadcrumb", className: E("vx-breadcrumb", n), children: /* @__PURE__ */ a("ol", { className: "vx-breadcrumb__list", children: e.map((r, o) => {
3312
+ const s = o === e.length - 1;
3313
+ return /* @__PURE__ */ g("li", { className: "vx-breadcrumb__item", children: [
3314
+ s ? /* @__PURE__ */ a("span", { className: "vx-breadcrumb__current", "aria-current": "page", children: r.label }) : r.href ? /* @__PURE__ */ a("a", { href: r.href, className: "vx-breadcrumb__link", children: r.label }) : /* @__PURE__ */ a("button", { type: "button", className: "vx-breadcrumb__link", onClick: r.onClick, children: r.label }),
3315
+ s ? null : /* @__PURE__ */ a("span", { className: "vx-breadcrumb__sep", "aria-hidden": "true", children: t ?? /* @__PURE__ */ a(qa, {}) })
3316
+ ] }, o);
3317
+ }) }) });
3318
+ }
3319
+ function we(e, t) {
3320
+ return Array.from({ length: t - e + 1 }, (n, r) => e + r);
3321
+ }
3322
+ function $s({ page: e, total: t, pageSize: n = 10, siblingCount: r = 1, onChange: o, className: s }) {
3323
+ const c = Math.max(1, Math.ceil(t / n)), i = (() => {
3324
+ const d = r * 2 + 5;
3325
+ if (c <= d) return we(1, c);
3326
+ const u = Math.max(e - r, 1), v = Math.min(e + r, c), h = u > 3, p = v < c - 2;
3327
+ return !h && p ? [...we(1, 3 + r * 2), "…", c] : h && !p ? [1, "…", ...we(c - (2 + r * 2), c)] : [1, "…", ...we(u, v), "…", c];
3328
+ })();
3329
+ return /* @__PURE__ */ g("nav", { role: "navigation", "aria-label": "Pagination", className: E("vx-pagination", s), children: [
3330
+ /* @__PURE__ */ a(
3331
+ "button",
3332
+ {
3333
+ type: "button",
3334
+ className: "vx-pagination__btn vx-pagination__btn--prev",
3335
+ disabled: e <= 1,
3336
+ onClick: () => o(e - 1),
3337
+ "aria-label": "上一页",
3338
+ children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M9 11L5 7l4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
3339
+ }
3340
+ ),
3341
+ i.map(
3342
+ (d, u) => d === "…" ? /* @__PURE__ */ a("span", { className: "vx-pagination__ellipsis", "aria-hidden": "true", children: "…" }, `e-${u}`) : /* @__PURE__ */ a(
3343
+ "button",
3344
+ {
3345
+ type: "button",
3346
+ "aria-current": d === e ? "page" : void 0,
3347
+ className: E("vx-pagination__btn", d === e && "vx-pagination__btn--active"),
3348
+ onClick: () => o(d),
3349
+ children: d
3350
+ },
3351
+ d
3352
+ )
3353
+ ),
3354
+ /* @__PURE__ */ a(
3355
+ "button",
3356
+ {
3357
+ type: "button",
3358
+ className: "vx-pagination__btn vx-pagination__btn--next",
3359
+ disabled: e >= c,
3360
+ onClick: () => o(e + 1),
3361
+ "aria-label": "下一页",
3362
+ children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M5 11l4-4-4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
3363
+ }
3364
+ )
3365
+ ] });
3366
+ }
3367
+ function Ws({ items: e, multiple: t = !1, defaultOpen: n = [], className: r }) {
3368
+ const [o, s] = W(new Set(n));
3369
+ function c(i) {
3370
+ s((d) => {
3371
+ const u = new Set(t ? d : []);
3372
+ return d.has(i) ? u.delete(i) : u.add(i), u;
3373
+ });
3374
+ }
3375
+ return /* @__PURE__ */ a("div", { className: E("vx-accordion", r), children: e.map((i) => {
3376
+ const d = o.has(i.key);
3377
+ return /* @__PURE__ */ g("div", { className: E("vx-accordion__item", d && "vx-accordion__item--open", i.disabled && "vx-accordion__item--disabled"), children: [
3378
+ /* @__PURE__ */ g(
3379
+ "button",
3380
+ {
3381
+ type: "button",
3382
+ disabled: i.disabled,
3383
+ "aria-expanded": d,
3384
+ className: "vx-accordion__trigger",
3385
+ onClick: () => !i.disabled && c(i.key),
3386
+ children: [
3387
+ /* @__PURE__ */ a("span", { className: "vx-accordion__title", children: i.title }),
3388
+ /* @__PURE__ */ a("span", { className: "vx-accordion__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ a("path", { d: "M3 5l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
3389
+ ]
3390
+ }
3391
+ ),
3392
+ d ? /* @__PURE__ */ a("div", { className: "vx-accordion__content", children: i.content }) : null
3393
+ ] }, i.key);
3394
+ }) });
3395
+ }
3396
+ function Bs({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
3397
+ return /* @__PURE__ */ a(
3398
+ "hr",
3399
+ {
3400
+ role: n ? "none" : "separator",
3401
+ "aria-orientation": n ? void 0 : t,
3402
+ className: E("vx-separator", `vx-separator--${t}`, e),
3403
+ ...r
3404
+ }
3405
+ );
3406
+ }
3407
+ function Za(e) {
3408
+ const t = e.trim().split(/\s+/);
3409
+ return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
3410
+ }
3411
+ const Tt = [0, 30, 60, 120, 160, 200, 240, 270, 300, 340];
3412
+ function Qa(e) {
3413
+ let t = 0;
3414
+ for (let n = 0; n < e.length; n++) t += e.charCodeAt(n);
3415
+ return Tt[t % Tt.length];
3416
+ }
3417
+ function Us({ src: e, name: t, size: n = "md", shape: r = "circle", fallback: o, className: s, alt: c, ...i }) {
3418
+ const [d, u] = W(!1), v = e && !d, h = t ?? c ?? "", p = h ? Qa(h) : 200;
3419
+ return /* @__PURE__ */ a(
3420
+ "span",
3421
+ {
3422
+ className: E("vx-avatar", `vx-avatar--${n}`, `vx-avatar--${r}`, s),
3423
+ "aria-label": h || void 0,
3424
+ style: v ? void 0 : { "--vx-avatar-hue": p },
3425
+ children: v ? /* @__PURE__ */ a(
3426
+ "img",
3427
+ {
3428
+ src: e,
3429
+ alt: c ?? t ?? "",
3430
+ className: "vx-avatar__img",
3431
+ onError: () => u(!0),
3432
+ ...i
3433
+ }
3434
+ ) : o ? /* @__PURE__ */ a("span", { className: "vx-avatar__fallback", children: o }) : h ? /* @__PURE__ */ a("span", { className: "vx-avatar__initials", children: Za(h) }) : /* @__PURE__ */ g("svg", { className: "vx-avatar__placeholder", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
3435
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "8", r: "4", stroke: "currentColor", strokeWidth: "1.5" }),
3436
+ /* @__PURE__ */ a("path", { d: "M4 20c0-4 3.58-7 8-7s8 3 8 7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3437
+ ] })
3438
+ }
3439
+ );
3440
+ }
3441
+ function Ks({
3442
+ columns: e,
3443
+ data: t,
3444
+ striped: n = !1,
3445
+ hoverable: r = !0,
3446
+ bordered: o = !1,
3447
+ compact: s = !1,
3448
+ stickyHeader: c = !1,
3449
+ caption: i,
3450
+ emptyText: d = "暂无数据",
3451
+ sortColumn: u,
3452
+ sortDirection: v,
3453
+ onSortChange: h,
3454
+ className: p,
3455
+ ...y
3456
+ }) {
3457
+ const [N, f] = W(null), [m, b] = W(null), w = u !== void 0, x = w ? u : N, _ = w ? v ?? null : m, S = Z((C) => {
3458
+ let T;
3459
+ x !== C ? T = "asc" : _ === "asc" ? T = "desc" : _ === "desc" ? T = null : T = "asc", w || (f(T === null ? null : C), b(T)), h == null || h(C, T);
3460
+ }, [x, _, w, h]);
3461
+ return /* @__PURE__ */ a("div", { className: E("vx-table-wrap", p), ...y, children: /* @__PURE__ */ g(
3462
+ "table",
3463
+ {
3464
+ className: E(
3465
+ "vx-table",
3466
+ n && "vx-table--striped",
3467
+ r && "vx-table--hoverable",
3468
+ o && "vx-table--bordered",
3469
+ s && "vx-table--compact",
3470
+ c && "vx-table--sticky"
3471
+ ),
3472
+ children: [
3473
+ i ? /* @__PURE__ */ a("caption", { className: "vx-table__caption", children: i }) : null,
3474
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.map((C) => /* @__PURE__ */ a(
3475
+ "th",
3476
+ {
3477
+ className: E(
3478
+ "vx-table__th",
3479
+ C.sortable && "vx-table__th--sortable",
3480
+ C.align && `vx-table__th--${C.align}`,
3481
+ C.className
3482
+ ),
3483
+ style: { width: C.width },
3484
+ onClick: C.sortable ? () => S(C.key) : void 0,
3485
+ "aria-sort": x === C.key ? _ === "asc" ? "ascending" : _ === "desc" ? "descending" : "none" : void 0,
3486
+ children: /* @__PURE__ */ g("span", { className: "vx-table__th-inner", children: [
3487
+ C.header,
3488
+ C.sortable ? /* @__PURE__ */ a("span", { className: "vx-table__sort-icon", "aria-hidden": "true", children: x === C.key && _ === "asc" ? "↑" : x === C.key && _ === "desc" ? "↓" : "↕" }) : null
3489
+ ] })
3490
+ },
3491
+ C.key
3492
+ )) }) }),
3493
+ /* @__PURE__ */ a("tbody", { children: t.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length, className: "vx-table__empty", children: d }) }) : t.map((C, T) => /* @__PURE__ */ a("tr", { className: "vx-table__row", children: e.map((R) => /* @__PURE__ */ a(
3494
+ "td",
3495
+ {
3496
+ className: E("vx-table__td", R.align && `vx-table__td--${R.align}`, R.className),
3497
+ children: R.accessor(C)
3498
+ },
3499
+ R.key
3500
+ )) }, T)) })
3501
+ ]
3502
+ }
3503
+ ) });
3504
+ }
3505
+ function Vs({ topBar: e, bottomNav: t, children: n, className: r }) {
3506
+ return /* @__PURE__ */ g("div", { className: E("vxm-shell", r), children: [
3507
+ e && /* @__PURE__ */ a("div", { className: "vxm-shell__topbar", children: e }),
3508
+ /* @__PURE__ */ a("main", { className: "vxm-shell__main", children: n }),
3509
+ t && /* @__PURE__ */ a("div", { className: "vxm-shell__bottomnav", children: t })
3510
+ ] });
3511
+ }
3512
+ function Hs({ title: e, leading: t, trailing: n, className: r }) {
3513
+ return /* @__PURE__ */ g("div", { className: E("vxm-topbar", r), children: [
3514
+ /* @__PURE__ */ a("div", { className: "vxm-topbar__leading", children: t }),
3515
+ /* @__PURE__ */ a("div", { className: "vxm-topbar__title", children: e }),
3516
+ /* @__PURE__ */ a("div", { className: "vxm-topbar__trailing", children: n })
3517
+ ] });
3518
+ }
3519
+ function zs({ label: e, className: t, children: n, ...r }) {
3520
+ return /* @__PURE__ */ a("button", { type: "button", className: E("vxm-icon-btn", t), "aria-label": e, ...r, children: n });
3521
+ }
3522
+ function js({ items: e, className: t }) {
3523
+ return /* @__PURE__ */ a("nav", { className: E("vxm-bottomnav", t), "aria-label": "底部导航", children: e.map((n) => /* @__PURE__ */ g(
3524
+ "button",
3525
+ {
3526
+ type: "button",
3527
+ className: E("vxm-bottomnav__item", n.active && "vxm-bottomnav__item--active"),
3528
+ onClick: n.onSelect,
3529
+ "aria-current": n.active ? "page" : void 0,
3530
+ children: [
3531
+ /* @__PURE__ */ g("span", { className: "vxm-bottomnav__icon", children: [
3532
+ n.icon,
3533
+ n.badge != null && /* @__PURE__ */ a("span", { className: "vxm-bottomnav__badge", "aria-label": `${n.badge} 条未读`, children: n.badge })
3534
+ ] }),
3535
+ /* @__PURE__ */ a("span", { className: "vxm-bottomnav__label", children: n.label })
3536
+ ]
3537
+ },
3538
+ n.key
3539
+ )) });
3540
+ }
3541
+ function Gs({
3542
+ open: e,
3543
+ onClose: t,
3544
+ title: n,
3545
+ description: r,
3546
+ children: o,
3547
+ className: s
3548
+ }) {
3549
+ const c = $(null), i = $(0), [d, u] = W(!1), [v, h] = W(0), p = $(0);
3550
+ U(() => {
3551
+ e || (h(0), p.current = 0);
3552
+ }, [e]), U(() => {
3553
+ if (!e) return;
3554
+ const m = (b) => {
3555
+ b.key === "Escape" && t();
3556
+ };
3557
+ return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
3558
+ }, [e, t]), U(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
3559
+ document.body.style.overflow = "";
3560
+ }), [e]);
3561
+ const y = (m) => {
3562
+ i.current = m.touches[0].clientY, p.current = 0, u(!0);
3563
+ }, N = (m) => {
3564
+ const b = m.touches[0].clientY - i.current;
3565
+ b < 0 || (p.current = b, h(b));
3566
+ }, f = () => {
3567
+ u(!1);
3568
+ const m = c.current;
3569
+ if (!m) return;
3570
+ const b = m.offsetHeight * 0.32;
3571
+ p.current > b ? t() : h(0);
3572
+ };
3573
+ return e ? /* @__PURE__ */ a(
3574
+ "div",
3575
+ {
3576
+ className: "vxm-actionsheet__overlay",
3577
+ onClick: t,
3578
+ role: "presentation",
3579
+ "aria-hidden": "true",
3580
+ children: /* @__PURE__ */ g(
3581
+ "div",
3582
+ {
3583
+ ref: c,
3584
+ className: E("vxm-actionsheet", s),
3585
+ style: {
3586
+ transform: `translateY(${v}px)`,
3587
+ transition: d ? "none" : "transform 280ms cubic-bezier(0.32, 0.72, 0, 1)"
3588
+ },
3589
+ onClick: (m) => m.stopPropagation(),
3590
+ onTouchStart: y,
3591
+ onTouchMove: N,
3592
+ onTouchEnd: f,
3593
+ role: "dialog",
3594
+ "aria-modal": !0,
3595
+ "aria-label": n ?? "Action sheet",
3596
+ children: [
3597
+ /* @__PURE__ */ a("div", { className: "vxm-actionsheet__handle", "aria-hidden": "true" }),
3598
+ (n || r) && /* @__PURE__ */ g("div", { className: "vxm-actionsheet__header", children: [
3599
+ n && /* @__PURE__ */ a("h3", { className: "vxm-actionsheet__title", children: n }),
3600
+ r && /* @__PURE__ */ a("p", { className: "vxm-actionsheet__description", children: r })
3601
+ ] }),
3602
+ /* @__PURE__ */ a("div", { className: "vxm-actionsheet__body", children: o })
3603
+ ]
3604
+ }
3605
+ )
3606
+ }
3607
+ ) : null;
3608
+ }
3609
+ function Ys({ icon: e, destructive: t, className: n, children: r, ...o }) {
3610
+ return /* @__PURE__ */ g(
3611
+ "button",
3612
+ {
3613
+ type: "button",
3614
+ className: E("vxm-actionsheet-item", t && "vxm-actionsheet-item--destructive", n),
3615
+ ...o,
3616
+ children: [
3617
+ e && /* @__PURE__ */ a("span", { className: "vxm-actionsheet-item__icon", children: e }),
3618
+ r
3619
+ ]
3620
+ }
3621
+ );
3622
+ }
3623
+ function Xs({ className: e, ...t }) {
3624
+ return /* @__PURE__ */ a("ul", { className: E("vxm-list", e), role: "list", ...t });
3625
+ }
3626
+ function qs({ title: e, className: t, children: n, ...r }) {
3627
+ return /* @__PURE__ */ g("div", { className: E("vxm-list-section", t), ...r, children: [
3628
+ e && /* @__PURE__ */ a("div", { className: "vxm-list-section__title", children: e }),
3629
+ n
3630
+ ] });
3631
+ }
3632
+ function Zs({
3633
+ leading: e,
3634
+ trailing: t,
3635
+ label: n,
3636
+ description: r,
3637
+ chevron: o,
3638
+ destructive: s,
3639
+ disabled: c,
3640
+ onClick: i,
3641
+ className: d
3642
+ }) {
3643
+ const u = /* @__PURE__ */ g(ue, { children: [
3644
+ e && /* @__PURE__ */ a("span", { className: "vxm-list-item__leading", children: e }),
3645
+ /* @__PURE__ */ g("span", { className: "vxm-list-item__content", children: [
3646
+ /* @__PURE__ */ a("span", { className: "vxm-list-item__label", children: n }),
3647
+ r && /* @__PURE__ */ a("span", { className: "vxm-list-item__description", children: r })
3648
+ ] }),
3649
+ t && /* @__PURE__ */ a("span", { className: "vxm-list-item__trailing", children: t }),
3650
+ o && /* @__PURE__ */ a(nr, { size: 16, className: "vxm-list-item__chevron", "aria-hidden": "true" })
3651
+ ] });
3652
+ return /* @__PURE__ */ a(
3653
+ "li",
3654
+ {
3655
+ className: E(
3656
+ "vxm-list-item",
3657
+ s && "vxm-list-item--destructive",
3658
+ c && "vxm-list-item--disabled",
3659
+ !i && "vxm-list-item--static",
3660
+ d
3661
+ ),
3662
+ children: /* @__PURE__ */ a(
3663
+ "button",
3664
+ {
3665
+ type: "button",
3666
+ className: "vxm-list-item__btn",
3667
+ onClick: c ? void 0 : i,
3668
+ disabled: c,
3669
+ tabIndex: i ? 0 : -1,
3670
+ children: u
3671
+ }
3672
+ )
3673
+ }
3674
+ );
3675
+ }
3676
+ function Qs({
3677
+ open: e,
3678
+ onClose: t,
3679
+ width: n = 280,
3680
+ header: r,
3681
+ footer: o,
3682
+ children: s,
3683
+ className: c
3684
+ }) {
3685
+ const i = $(null), d = $(0), u = $(0), [v, h] = W(!1), [p, y] = W(0);
3686
+ U(() => {
3687
+ e || (y(0), u.current = 0);
3688
+ }, [e]), U(() => {
3689
+ if (!e) return;
3690
+ const x = (_) => {
3691
+ _.key === "Escape" && t();
3692
+ };
3693
+ return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
3694
+ }, [e, t]), U(() => (document.body.style.overflow = e ? "hidden" : "", () => {
3695
+ document.body.style.overflow = "";
3696
+ }), [e]);
3697
+ const N = (x) => {
3698
+ d.current = x.touches[0].clientX, u.current = 0, h(!0);
3699
+ }, f = (x) => {
3700
+ const _ = x.touches[0].clientX - d.current;
3701
+ _ > 0 || (u.current = _, y(_));
3702
+ }, m = () => {
3703
+ h(!1), Math.abs(u.current) > n * 0.3 ? t() : y(0);
3704
+ };
3705
+ if (!e) return null;
3706
+ const w = 0.52 * Math.max(0, 1 + p / n);
3707
+ return /* @__PURE__ */ g("div", { className: "vxm-drawer__overlay", style: { "--vxm-overlay-opacity": w }, children: [
3708
+ /* @__PURE__ */ a(
3709
+ "div",
3710
+ {
3711
+ className: "vxm-drawer__scrim",
3712
+ onClick: t,
3713
+ "aria-hidden": "true"
3714
+ }
3715
+ ),
3716
+ /* @__PURE__ */ g(
3717
+ "div",
3718
+ {
3719
+ ref: i,
3720
+ className: E("vxm-drawer", c),
3721
+ style: {
3722
+ width: n,
3723
+ transform: `translateX(${p}px)`,
3724
+ transition: v ? "none" : "transform 280ms cubic-bezier(0.32, 0.72, 0, 1)"
3725
+ },
3726
+ onTouchStart: N,
3727
+ onTouchMove: f,
3728
+ onTouchEnd: m,
3729
+ role: "dialog",
3730
+ "aria-modal": !0,
3731
+ "aria-label": "Navigation drawer",
3732
+ children: [
3733
+ r && /* @__PURE__ */ a("div", { className: "vxm-drawer__header", children: r }),
3734
+ /* @__PURE__ */ a("div", { className: "vxm-drawer__body", children: s }),
3735
+ o && /* @__PURE__ */ a("div", { className: "vxm-drawer__footer", children: o })
3736
+ ]
3737
+ }
3738
+ )
3739
+ ] });
3740
+ }
3741
+ function Js({ icon: e, label: t, badge: n, active: r, onClick: o }) {
3742
+ return /* @__PURE__ */ g(
3743
+ "button",
3744
+ {
3745
+ type: "button",
3746
+ className: E("vxm-drawer-item", r && "vxm-drawer-item--active"),
3747
+ onClick: o,
3748
+ "aria-current": r ? "page" : void 0,
3749
+ children: [
3750
+ e && /* @__PURE__ */ a("span", { className: "vxm-drawer-item__icon", children: e }),
3751
+ /* @__PURE__ */ a("span", { className: "vxm-drawer-item__label", children: t }),
3752
+ n != null && /* @__PURE__ */ a("span", { className: "vxm-drawer-item__badge", children: n })
3753
+ ]
3754
+ }
3755
+ );
3756
+ }
3757
+ function ei({ title: e, children: t }) {
3758
+ return /* @__PURE__ */ g("div", { className: "vxm-drawer-section", children: [
3759
+ e && /* @__PURE__ */ a("div", { className: "vxm-drawer-section__title", children: e }),
3760
+ /* @__PURE__ */ a("div", { className: "vxm-drawer-section__items", children: t })
3761
+ ] });
3762
+ }
3763
+ export {
3764
+ Ws as Accordion,
3765
+ Gs as ActionSheet,
3766
+ Ys as ActionSheetItem,
3767
+ As as Alert,
3768
+ ns as AppShell,
3769
+ Us as Avatar,
3770
+ rs as Badge,
3771
+ js as BottomNav,
3772
+ Fs as Breadcrumb,
3773
+ dt as Button,
3774
+ os as Card,
3775
+ cs as CardContent,
3776
+ is as CardDescription,
3777
+ as as CardHeader,
3778
+ ss as CardTitle,
3779
+ Cs as Checkbox,
3780
+ us as Dialog,
3781
+ Js as DrawerNavItem,
3782
+ ei as DrawerNavSection,
3783
+ Os as DropdownMenu,
3784
+ Ns as Heading,
3785
+ ds as Input,
3786
+ Qs as MobileDrawer,
3787
+ zs as MobileIconButton,
3788
+ Xs as MobileList,
3789
+ Zs as MobileListItem,
3790
+ qs as MobileListSection,
3791
+ Vs as MobileShell,
3792
+ Hs as MobileTopBar,
3793
+ $s as Pagination,
3794
+ Ls as Popover,
3795
+ Is as Progress,
3796
+ Ts as Radio,
3797
+ Ss as RadioGroup,
3798
+ Es as Select,
3799
+ Bs as Separator,
3800
+ Ms as Skeleton,
3801
+ ks as Slider,
3802
+ Ps as Spinner,
3803
+ fs as Switch,
3804
+ Ks as Table,
3805
+ vs as Tabs,
3806
+ ps as TabsContent,
3807
+ ms as TabsList,
3808
+ hs as TabsTrigger,
3809
+ ws as Text,
3810
+ Rs as Textarea,
3811
+ xs as ThemeProvider,
3812
+ ys as ToastProvider,
3813
+ Ds as Tooltip,
3814
+ re as createTheme,
3815
+ bs as themePresets,
3816
+ gs as useTheme,
3817
+ _s as useToast
3818
+ };