@moises.ai/design-system 1.0.23 → 1.0.25

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.
@@ -1,286 +1,286 @@
1
- import { aS as ge, aT as oe, aU as X, aV as te, aW as O, aX as Ce, v as A, aY as K, aZ as Pe, a_ as he, a$ as _n, b0 as In, b1 as Mn, b2 as Pn, b3 as xn, b4 as Sn, b5 as An, b6 as Nn, b7 as Fn, b8 as ue, b9 as Be, ba as On, bb as Dn, bc as Ln, bd as kn, be as Vn, bf as Gn, bg as $n, bh as xe, bi as Kn, bj as Bn, bk as Hn, aN as ee, bl as jn, bm as zn, bn as rt, bo as Un, bp as Wn, bq as Tr, br as wr, bs as qn, bt as Yn, aR as yr, aQ as Xn, aI as Zn } from "./index-CpglT-SS.js";
2
- import { bu as Cc, bv as hc, bw as Tc, bx as wc, by as yc, bz as Ec, bA as Rc, bB as _c, bC as Ic, bD as Mc, bE as Pc, bF as xc, bG as Sc, bH as Ac, bI as Nc, bJ as Fc, bK as Oc, bL as Dc, bM as Lc, bN as kc, bO as Vc, bP as Gc } from "./index-CpglT-SS.js";
1
+ import { b9 as rt, l as se, s as ie, ba as ae, j as D, bb as Fr, aB as P, u as Y, bc as ot, bd as Ae, be as To, bf as yo, bg as Eo, bh as wo, bi as Ro, bj as _o, bk as Io, bl as Ao, bm as So, m as de, t as nt, bn as xo, bo as Mo, bp as Po, bq as Fo, br as No, bs as Oo, bt as Do, o as Se, bu as Lo, bv as ko, bw as Vo, bx as Nr, by as Or, b3 as Re, bz as Go, bA as $o, bB as Dr, bC as Ko, k as Bo, bD as Lr, aD as jo, aC as Ho } from "./index-BIjOAs1j.js";
2
+ import { bE as As, bF as Ss, bG as xs, bH as Ms, bI as Ps, bJ as Fs, bK as Ns, r as Os, bL as Ds, bM as Ls, bN as ks, bO as Vs, bP as Gs, bQ as $s, bR as Ks, bS as Bs, bT as js, bU as Hs, bV as zs, bW as Us, bX as Ws, bY as qs, bZ as Ys, b_ as Xs, b$ as Zs } from "./index-BIjOAs1j.js";
3
3
  import * as a from "react";
4
- import V from "react";
5
- import { jsx as i, Fragment as _e, jsxs as Ie } from "react/jsx-runtime";
6
- import * as Jn from "react-dom";
7
- import Qn, { flushSync as me } from "react-dom";
8
- var cr = a[" useEffectEvent ".trim().toString()], lr = a[" useInsertionEffect ".trim().toString()];
9
- function Er(e) {
10
- if (typeof cr == "function")
11
- return cr(e);
12
- const t = a.useRef(() => {
4
+ import q from "react";
5
+ import { jsx as i, Fragment as at, jsxs as st } from "react/jsx-runtime";
6
+ import * as zo from "react-dom";
7
+ import { flushSync as ue } from "react-dom";
8
+ var Rr = a[" useEffectEvent ".trim().toString()], _r = a[" useInsertionEffect ".trim().toString()];
9
+ function kr(e) {
10
+ if (typeof Rr == "function")
11
+ return Rr(e);
12
+ const r = a.useRef(() => {
13
13
  throw new Error("Cannot call an event handler while rendering.");
14
14
  });
15
- return typeof lr == "function" ? lr(() => {
16
- t.current = e;
17
- }) : ge(() => {
18
- t.current = e;
19
- }), a.useMemo(() => (...o) => {
20
- var r;
21
- return (r = t.current) == null ? void 0 : r.call(t, ...o);
15
+ return typeof _r == "function" ? _r(() => {
16
+ r.current = e;
17
+ }) : rt(() => {
18
+ r.current = e;
19
+ }), a.useMemo(() => (...t) => {
20
+ var o;
21
+ return (o = r.current) == null ? void 0 : o.call(r, ...t);
22
22
  }, []);
23
23
  }
24
- var He = "Collapsible", [ea, Rt] = oe(He), [ta, _t] = ea(He), It = a.forwardRef(
25
- (e, t) => {
24
+ var xe = "Collapsible", [Uo, it] = se(xe), [Wo, ct] = Uo(xe), lt = a.forwardRef(
25
+ (e, r) => {
26
26
  const {
27
- __scopeCollapsible: o,
28
- open: r,
27
+ __scopeCollapsible: t,
28
+ open: o,
29
29
  defaultOpen: n,
30
30
  disabled: s,
31
- onOpenChange: c,
32
- ...l
33
- } = e, [u, d] = X({
34
- prop: r,
31
+ onOpenChange: u,
32
+ ...c
33
+ } = e, [f, d] = ie({
34
+ prop: o,
35
35
  defaultProp: n ?? !1,
36
- onChange: c,
37
- caller: He
36
+ onChange: u,
37
+ caller: xe
38
38
  });
39
39
  return /* @__PURE__ */ i(
40
- ta,
40
+ Wo,
41
41
  {
42
- scope: o,
42
+ scope: t,
43
43
  disabled: s,
44
- contentId: te(),
45
- open: u,
46
- onOpenToggle: a.useCallback(() => d((f) => !f), [d]),
44
+ contentId: ae(),
45
+ open: f,
46
+ onOpenToggle: a.useCallback(() => d((b) => !b), [d]),
47
47
  children: /* @__PURE__ */ i(
48
- O.div,
48
+ D.div,
49
49
  {
50
- "data-state": St(u),
50
+ "data-state": pt(f),
51
51
  "data-disabled": s ? "" : void 0,
52
- ...l,
53
- ref: t
52
+ ...c,
53
+ ref: r
54
54
  }
55
55
  )
56
56
  }
57
57
  );
58
58
  }
59
59
  );
60
- It.displayName = He;
61
- var Rr = "CollapsibleTrigger", Mt = a.forwardRef(
62
- (e, t) => {
63
- const { __scopeCollapsible: o, ...r } = e, n = _t(Rr, o);
60
+ lt.displayName = xe;
61
+ var Vr = "CollapsibleTrigger", ut = a.forwardRef(
62
+ (e, r) => {
63
+ const { __scopeCollapsible: t, ...o } = e, n = ct(Vr, t);
64
64
  return /* @__PURE__ */ i(
65
- O.button,
65
+ D.button,
66
66
  {
67
67
  type: "button",
68
68
  "aria-controls": n.contentId,
69
69
  "aria-expanded": n.open || !1,
70
- "data-state": St(n.open),
70
+ "data-state": pt(n.open),
71
71
  "data-disabled": n.disabled ? "" : void 0,
72
72
  disabled: n.disabled,
73
- ...r,
74
- ref: t,
75
- onClick: A(e.onClick, n.onOpenToggle)
73
+ ...o,
74
+ ref: r,
75
+ onClick: P(e.onClick, n.onOpenToggle)
76
76
  }
77
77
  );
78
78
  }
79
79
  );
80
- Mt.displayName = Rr;
81
- var Pt = "CollapsibleContent", xt = a.forwardRef(
82
- (e, t) => {
83
- const { forceMount: o, ...r } = e, n = _t(Pt, e.__scopeCollapsible);
84
- return /* @__PURE__ */ i(Ce, { present: o || n.open, children: ({ present: s }) => /* @__PURE__ */ i(oa, { ...r, ref: t, present: s }) });
80
+ ut.displayName = Vr;
81
+ var dt = "CollapsibleContent", ft = a.forwardRef(
82
+ (e, r) => {
83
+ const { forceMount: t, ...o } = e, n = ct(dt, e.__scopeCollapsible);
84
+ return /* @__PURE__ */ i(Fr, { present: t || n.open, children: ({ present: s }) => /* @__PURE__ */ i(qo, { ...o, ref: r, present: s }) });
85
85
  }
86
86
  );
87
- xt.displayName = Pt;
88
- var oa = a.forwardRef((e, t) => {
89
- const { __scopeCollapsible: o, present: r, children: n, ...s } = e, c = _t(Pt, o), [l, u] = a.useState(r), d = a.useRef(null), f = K(t, d), b = a.useRef(0), w = b.current, E = a.useRef(0), C = E.current, v = c.open || l, m = a.useRef(v), h = a.useRef(void 0);
87
+ ft.displayName = dt;
88
+ var qo = a.forwardRef((e, r) => {
89
+ const { __scopeCollapsible: t, present: o, children: n, ...s } = e, u = ct(dt, t), [c, f] = a.useState(o), d = a.useRef(null), b = Y(r, d), w = a.useRef(0), I = w.current, R = a.useRef(0), _ = R.current, m = u.open || c, p = a.useRef(m), T = a.useRef(void 0);
90
90
  return a.useEffect(() => {
91
- const p = requestAnimationFrame(() => m.current = !1);
92
- return () => cancelAnimationFrame(p);
93
- }, []), ge(() => {
94
- const p = d.current;
95
- if (p) {
96
- h.current = h.current || {
97
- transitionDuration: p.style.transitionDuration,
98
- animationName: p.style.animationName
99
- }, p.style.transitionDuration = "0s", p.style.animationName = "none";
100
- const g = p.getBoundingClientRect();
101
- b.current = g.height, E.current = g.width, m.current || (p.style.transitionDuration = h.current.transitionDuration, p.style.animationName = h.current.animationName), u(r);
91
+ const l = requestAnimationFrame(() => p.current = !1);
92
+ return () => cancelAnimationFrame(l);
93
+ }, []), rt(() => {
94
+ const l = d.current;
95
+ if (l) {
96
+ T.current = T.current || {
97
+ transitionDuration: l.style.transitionDuration,
98
+ animationName: l.style.animationName
99
+ }, l.style.transitionDuration = "0s", l.style.animationName = "none";
100
+ const h = l.getBoundingClientRect();
101
+ w.current = h.height, R.current = h.width, p.current || (l.style.transitionDuration = T.current.transitionDuration, l.style.animationName = T.current.animationName), f(o);
102
102
  }
103
- }, [c.open, r]), /* @__PURE__ */ i(
104
- O.div,
103
+ }, [u.open, o]), /* @__PURE__ */ i(
104
+ D.div,
105
105
  {
106
- "data-state": St(c.open),
107
- "data-disabled": c.disabled ? "" : void 0,
108
- id: c.contentId,
109
- hidden: !v,
106
+ "data-state": pt(u.open),
107
+ "data-disabled": u.disabled ? "" : void 0,
108
+ id: u.contentId,
109
+ hidden: !m,
110
110
  ...s,
111
- ref: f,
111
+ ref: b,
112
112
  style: {
113
- "--radix-collapsible-content-height": w ? `${w}px` : void 0,
114
- "--radix-collapsible-content-width": C ? `${C}px` : void 0,
113
+ "--radix-collapsible-content-height": I ? `${I}px` : void 0,
114
+ "--radix-collapsible-content-width": _ ? `${_}px` : void 0,
115
115
  ...e.style
116
116
  },
117
- children: v && n
117
+ children: m && n
118
118
  }
119
119
  );
120
120
  });
121
- function St(e) {
121
+ function pt(e) {
122
122
  return e ? "open" : "closed";
123
123
  }
124
- var _r = It, Ir = Mt, Mr = xt;
125
- const rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
124
+ var Gr = lt, $r = ut, Kr = ft;
125
+ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
126
  __proto__: null,
127
- Collapsible: It,
128
- CollapsibleContent: xt,
129
- CollapsibleTrigger: Mt,
130
- Content: Mr,
131
- Root: _r,
132
- Trigger: Ir,
133
- createCollapsibleScope: Rt
127
+ Collapsible: lt,
128
+ CollapsibleContent: ft,
129
+ CollapsibleTrigger: ut,
130
+ Content: Kr,
131
+ Root: Gr,
132
+ Trigger: $r,
133
+ createCollapsibleScope: it
134
134
  }, Symbol.toStringTag, { value: "Module" }));
135
- var re = "Accordion", ra = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [At, na, aa] = Pe(re), [je, sa] = oe(re, [
136
- aa,
137
- Rt
138
- ]), Nt = Rt(), Ft = V.forwardRef(
139
- (e, t) => {
140
- const { type: o, ...r } = e, n = r, s = r;
141
- return /* @__PURE__ */ i(At.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(ua, { ...s, ref: t }) : /* @__PURE__ */ i(la, { ...n, ref: t }) });
135
+ var J = "Accordion", Yo = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [mt, Xo, Zo] = ot(J), [Me, Jo] = se(J, [
136
+ Zo,
137
+ it
138
+ ]), vt = it(), bt = q.forwardRef(
139
+ (e, r) => {
140
+ const { type: t, ...o } = e, n = o, s = o;
141
+ return /* @__PURE__ */ i(mt.Provider, { scope: e.__scopeAccordion, children: t === "multiple" ? /* @__PURE__ */ i(rn, { ...s, ref: r }) : /* @__PURE__ */ i(tn, { ...n, ref: r }) });
142
142
  }
143
143
  );
144
- Ft.displayName = re;
145
- var [Pr, ia] = je(re), [xr, ca] = je(
146
- re,
144
+ bt.displayName = J;
145
+ var [Br, Qo] = Me(J), [jr, en] = Me(
146
+ J,
147
147
  { collapsible: !1 }
148
- ), la = V.forwardRef(
149
- (e, t) => {
148
+ ), tn = q.forwardRef(
149
+ (e, r) => {
150
150
  const {
151
- value: o,
152
- defaultValue: r,
151
+ value: t,
152
+ defaultValue: o,
153
153
  onValueChange: n = () => {
154
154
  },
155
155
  collapsible: s = !1,
156
- ...c
157
- } = e, [l, u] = X({
158
- prop: o,
159
- defaultProp: r ?? "",
156
+ ...u
157
+ } = e, [c, f] = ie({
158
+ prop: t,
159
+ defaultProp: o ?? "",
160
160
  onChange: n,
161
- caller: re
161
+ caller: J
162
162
  });
163
163
  return /* @__PURE__ */ i(
164
- Pr,
164
+ Br,
165
165
  {
166
166
  scope: e.__scopeAccordion,
167
- value: V.useMemo(() => l ? [l] : [], [l]),
168
- onItemOpen: u,
169
- onItemClose: V.useCallback(() => s && u(""), [s, u]),
170
- children: /* @__PURE__ */ i(xr, { scope: e.__scopeAccordion, collapsible: s, children: /* @__PURE__ */ i(Sr, { ...c, ref: t }) })
167
+ value: q.useMemo(() => c ? [c] : [], [c]),
168
+ onItemOpen: f,
169
+ onItemClose: q.useCallback(() => s && f(""), [s, f]),
170
+ children: /* @__PURE__ */ i(jr, { scope: e.__scopeAccordion, collapsible: s, children: /* @__PURE__ */ i(Hr, { ...u, ref: r }) })
171
171
  }
172
172
  );
173
173
  }
174
- ), ua = V.forwardRef((e, t) => {
174
+ ), rn = q.forwardRef((e, r) => {
175
175
  const {
176
- value: o,
177
- defaultValue: r,
176
+ value: t,
177
+ defaultValue: o,
178
178
  onValueChange: n = () => {
179
179
  },
180
180
  ...s
181
- } = e, [c, l] = X({
182
- prop: o,
183
- defaultProp: r ?? [],
181
+ } = e, [u, c] = ie({
182
+ prop: t,
183
+ defaultProp: o ?? [],
184
184
  onChange: n,
185
- caller: re
186
- }), u = V.useCallback(
187
- (f) => l((b = []) => [...b, f]),
188
- [l]
189
- ), d = V.useCallback(
190
- (f) => l((b = []) => b.filter((w) => w !== f)),
191
- [l]
185
+ caller: J
186
+ }), f = q.useCallback(
187
+ (b) => c((w = []) => [...w, b]),
188
+ [c]
189
+ ), d = q.useCallback(
190
+ (b) => c((w = []) => w.filter((I) => I !== b)),
191
+ [c]
192
192
  );
193
193
  return /* @__PURE__ */ i(
194
- Pr,
194
+ Br,
195
195
  {
196
196
  scope: e.__scopeAccordion,
197
- value: c,
198
- onItemOpen: u,
197
+ value: u,
198
+ onItemOpen: f,
199
199
  onItemClose: d,
200
- children: /* @__PURE__ */ i(xr, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(Sr, { ...s, ref: t }) })
200
+ children: /* @__PURE__ */ i(jr, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(Hr, { ...s, ref: r }) })
201
201
  }
202
202
  );
203
- }), [da, ze] = je(re), Sr = V.forwardRef(
204
- (e, t) => {
205
- const { __scopeAccordion: o, disabled: r, dir: n, orientation: s = "vertical", ...c } = e, l = V.useRef(null), u = K(l, t), d = na(o), b = he(n) === "ltr", w = A(e.onKeyDown, (E) => {
206
- var F;
207
- if (!ra.includes(E.key)) return;
208
- const C = E.target, v = d().filter((I) => {
209
- var T;
210
- return !((T = I.ref.current) != null && T.disabled);
211
- }), m = v.findIndex((I) => I.ref.current === C), h = v.length;
212
- if (m === -1) return;
213
- E.preventDefault();
214
- let p = m;
215
- const g = 0, y = h - 1, R = () => {
216
- p = m + 1, p > y && (p = g);
217
- }, P = () => {
218
- p = m - 1, p < g && (p = y);
203
+ }), [on, Pe] = Me(J), Hr = q.forwardRef(
204
+ (e, r) => {
205
+ const { __scopeAccordion: t, disabled: o, dir: n, orientation: s = "vertical", ...u } = e, c = q.useRef(null), f = Y(c, r), d = Xo(t), w = Ae(n) === "ltr", I = P(e.onKeyDown, (R) => {
206
+ var N;
207
+ if (!Yo.includes(R.key)) return;
208
+ const _ = R.target, m = d().filter((M) => {
209
+ var v;
210
+ return !((v = M.ref.current) != null && v.disabled);
211
+ }), p = m.findIndex((M) => M.ref.current === _), T = m.length;
212
+ if (p === -1) return;
213
+ R.preventDefault();
214
+ let l = p;
215
+ const h = 0, S = T - 1, F = () => {
216
+ l = p + 1, l > S && (l = h);
217
+ }, x = () => {
218
+ l = p - 1, l < h && (l = S);
219
219
  };
220
- switch (E.key) {
220
+ switch (R.key) {
221
221
  case "Home":
222
- p = g;
222
+ l = h;
223
223
  break;
224
224
  case "End":
225
- p = y;
225
+ l = S;
226
226
  break;
227
227
  case "ArrowRight":
228
- s === "horizontal" && (b ? R() : P());
228
+ s === "horizontal" && (w ? F() : x());
229
229
  break;
230
230
  case "ArrowDown":
231
- s === "vertical" && R();
231
+ s === "vertical" && F();
232
232
  break;
233
233
  case "ArrowLeft":
234
- s === "horizontal" && (b ? P() : R());
234
+ s === "horizontal" && (w ? x() : F());
235
235
  break;
236
236
  case "ArrowUp":
237
- s === "vertical" && P();
237
+ s === "vertical" && x();
238
238
  break;
239
239
  }
240
- const D = p % h;
241
- (F = v[D].ref.current) == null || F.focus();
240
+ const V = l % T;
241
+ (N = m[V].ref.current) == null || N.focus();
242
242
  });
243
243
  return /* @__PURE__ */ i(
244
- da,
244
+ on,
245
245
  {
246
- scope: o,
247
- disabled: r,
246
+ scope: t,
247
+ disabled: o,
248
248
  direction: n,
249
249
  orientation: s,
250
- children: /* @__PURE__ */ i(At.Slot, { scope: o, children: /* @__PURE__ */ i(
251
- O.div,
250
+ children: /* @__PURE__ */ i(mt.Slot, { scope: t, children: /* @__PURE__ */ i(
251
+ D.div,
252
252
  {
253
- ...c,
253
+ ...u,
254
254
  "data-orientation": s,
255
- ref: u,
256
- onKeyDown: r ? void 0 : w
255
+ ref: f,
256
+ onKeyDown: o ? void 0 : I
257
257
  }
258
258
  ) })
259
259
  }
260
260
  );
261
261
  }
262
- ), ke = "AccordionItem", [fa, Ot] = je(ke), Dt = V.forwardRef(
263
- (e, t) => {
264
- const { __scopeAccordion: o, value: r, ...n } = e, s = ze(ke, o), c = ia(ke, o), l = Nt(o), u = te(), d = r && c.value.includes(r) || !1, f = s.disabled || e.disabled;
262
+ ), _e = "AccordionItem", [nn, gt] = Me(_e), ht = q.forwardRef(
263
+ (e, r) => {
264
+ const { __scopeAccordion: t, value: o, ...n } = e, s = Pe(_e, t), u = Qo(_e, t), c = vt(t), f = ae(), d = o && u.value.includes(o) || !1, b = s.disabled || e.disabled;
265
265
  return /* @__PURE__ */ i(
266
- fa,
266
+ nn,
267
267
  {
268
- scope: o,
268
+ scope: t,
269
269
  open: d,
270
- disabled: f,
271
- triggerId: u,
270
+ disabled: b,
271
+ triggerId: f,
272
272
  children: /* @__PURE__ */ i(
273
- _r,
273
+ Gr,
274
274
  {
275
275
  "data-orientation": s.orientation,
276
- "data-state": Fr(d),
277
- ...l,
276
+ "data-state": Wr(d),
277
+ ...c,
278
278
  ...n,
279
- ref: t,
280
- disabled: f,
279
+ ref: r,
280
+ disabled: b,
281
281
  open: d,
282
- onOpenChange: (b) => {
283
- b ? c.onItemOpen(r) : c.onItemClose(r);
282
+ onOpenChange: (w) => {
283
+ w ? u.onItemOpen(o) : u.onItemClose(o);
284
284
  }
285
285
  }
286
286
  )
@@ -288,52 +288,52 @@ var [Pr, ia] = je(re), [xr, ca] = je(
288
288
  );
289
289
  }
290
290
  );
291
- Dt.displayName = ke;
292
- var Ar = "AccordionHeader", Lt = V.forwardRef(
293
- (e, t) => {
294
- const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(Ar, o);
291
+ ht.displayName = _e;
292
+ var zr = "AccordionHeader", Ct = q.forwardRef(
293
+ (e, r) => {
294
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(zr, t);
295
295
  return /* @__PURE__ */ i(
296
- O.h3,
296
+ D.h3,
297
297
  {
298
298
  "data-orientation": n.orientation,
299
- "data-state": Fr(s.open),
299
+ "data-state": Wr(s.open),
300
300
  "data-disabled": s.disabled ? "" : void 0,
301
- ...r,
302
- ref: t
301
+ ...o,
302
+ ref: r
303
303
  }
304
304
  );
305
305
  }
306
306
  );
307
- Lt.displayName = Ar;
308
- var nt = "AccordionTrigger", kt = V.forwardRef(
309
- (e, t) => {
310
- const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(nt, o), c = ca(nt, o), l = Nt(o);
311
- return /* @__PURE__ */ i(At.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
312
- Ir,
307
+ Ct.displayName = zr;
308
+ var Ke = "AccordionTrigger", Tt = q.forwardRef(
309
+ (e, r) => {
310
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(Ke, t), u = en(Ke, t), c = vt(t);
311
+ return /* @__PURE__ */ i(mt.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
312
+ $r,
313
313
  {
314
- "aria-disabled": s.open && !c.collapsible || void 0,
314
+ "aria-disabled": s.open && !u.collapsible || void 0,
315
315
  "data-orientation": n.orientation,
316
316
  id: s.triggerId,
317
- ...l,
318
- ...r,
319
- ref: t
317
+ ...c,
318
+ ...o,
319
+ ref: r
320
320
  }
321
321
  ) });
322
322
  }
323
323
  );
324
- kt.displayName = nt;
325
- var Nr = "AccordionContent", Vt = V.forwardRef(
326
- (e, t) => {
327
- const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(Nr, o), c = Nt(o);
324
+ Tt.displayName = Ke;
325
+ var Ur = "AccordionContent", yt = q.forwardRef(
326
+ (e, r) => {
327
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(Ur, t), u = vt(t);
328
328
  return /* @__PURE__ */ i(
329
- Mr,
329
+ Kr,
330
330
  {
331
331
  role: "region",
332
332
  "aria-labelledby": s.triggerId,
333
333
  "data-orientation": n.orientation,
334
- ...c,
335
- ...r,
336
- ref: t,
334
+ ...u,
335
+ ...o,
336
+ ref: r,
337
337
  style: {
338
338
  "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
339
339
  "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
@@ -343,126 +343,126 @@ var Nr = "AccordionContent", Vt = V.forwardRef(
343
343
  );
344
344
  }
345
345
  );
346
- Vt.displayName = Nr;
347
- function Fr(e) {
346
+ yt.displayName = Ur;
347
+ function Wr(e) {
348
348
  return e ? "open" : "closed";
349
349
  }
350
- var pa = Ft, va = Dt, ma = Lt, ga = kt, ba = Vt;
351
- const nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
350
+ var an = bt, sn = ht, cn = Ct, ln = Tt, un = yt;
351
+ const bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
352
352
  __proto__: null,
353
- Accordion: Ft,
354
- AccordionContent: Vt,
355
- AccordionHeader: Lt,
356
- AccordionItem: Dt,
357
- AccordionTrigger: kt,
358
- Content: ba,
359
- Header: ma,
360
- Item: va,
361
- Root: pa,
362
- Trigger: ga,
363
- createAccordionScope: sa
353
+ Accordion: bt,
354
+ AccordionContent: yt,
355
+ AccordionHeader: Ct,
356
+ AccordionItem: ht,
357
+ AccordionTrigger: Tt,
358
+ Content: un,
359
+ Header: cn,
360
+ Item: sn,
361
+ Root: an,
362
+ Trigger: ln,
363
+ createAccordionScope: Jo
364
364
  }, Symbol.toStringTag, { value: "Module" }));
365
- var Ca = "Label", Ue = a.forwardRef((e, t) => /* @__PURE__ */ i(
366
- O.label,
365
+ var dn = "Label", Fe = a.forwardRef((e, r) => /* @__PURE__ */ i(
366
+ D.label,
367
367
  {
368
368
  ...e,
369
- ref: t,
370
- onMouseDown: (o) => {
369
+ ref: r,
370
+ onMouseDown: (t) => {
371
371
  var n;
372
- o.target.closest("button, input, select, textarea") || ((n = e.onMouseDown) == null || n.call(e, o), !o.defaultPrevented && o.detail > 1 && o.preventDefault());
372
+ t.target.closest("button, input, select, textarea") || ((n = e.onMouseDown) == null || n.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
373
373
  }
374
374
  }
375
375
  ));
376
- Ue.displayName = Ca;
377
- var ha = Ue;
378
- const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
376
+ Fe.displayName = dn;
377
+ var fn = Fe;
378
+ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
379
379
  __proto__: null,
380
- Label: Ue,
381
- Root: ha
380
+ Label: Fe,
381
+ Root: fn
382
382
  }, Symbol.toStringTag, { value: "Module" }));
383
- var [Gt, Ta] = oe("Form"), $t = "Form", [wa, Te] = Gt($t), [ya, Or] = Gt($t), Kt = a.forwardRef(
384
- (e, t) => {
385
- const { __scopeForm: o, onClearServerErrors: r = () => {
386
- }, ...n } = e, s = a.useRef(null), c = K(t, s), [l, u] = a.useState({}), d = a.useCallback(
387
- (T) => l[T],
388
- [l]
389
- ), f = a.useCallback(
390
- (T, _) => u((x) => ({
391
- ...x,
392
- [T]: { ...x[T] ?? {}, ..._ }
383
+ var [Et, pn] = se("Form"), wt = "Form", [mn, fe] = Et(wt), [vn, qr] = Et(wt), Rt = a.forwardRef(
384
+ (e, r) => {
385
+ const { __scopeForm: t, onClearServerErrors: o = () => {
386
+ }, ...n } = e, s = a.useRef(null), u = Y(r, s), [c, f] = a.useState({}), d = a.useCallback(
387
+ (v) => c[v],
388
+ [c]
389
+ ), b = a.useCallback(
390
+ (v, g) => f((y) => ({
391
+ ...y,
392
+ [v]: { ...y[v] ?? {}, ...g }
393
393
  })),
394
394
  []
395
- ), b = a.useCallback((T) => {
396
- u((_) => ({ ..._, [T]: void 0 })), p((_) => ({ ..._, [T]: {} }));
397
- }, []), [w, E] = a.useState({}), C = a.useCallback(
398
- (T) => w[T] ?? [],
399
- [w]
400
- ), v = a.useCallback((T, _) => {
401
- E((x) => ({
402
- ...x,
403
- [T]: [...x[T] ?? [], _]
395
+ ), w = a.useCallback((v) => {
396
+ f((g) => ({ ...g, [v]: void 0 })), l((g) => ({ ...g, [v]: {} }));
397
+ }, []), [I, R] = a.useState({}), _ = a.useCallback(
398
+ (v) => I[v] ?? [],
399
+ [I]
400
+ ), m = a.useCallback((v, g) => {
401
+ R((y) => ({
402
+ ...y,
403
+ [v]: [...y[v] ?? [], g]
404
404
  }));
405
- }, []), m = a.useCallback((T, _) => {
406
- E((x) => ({
407
- ...x,
408
- [T]: (x[T] ?? []).filter(
409
- (L) => L.id !== _
405
+ }, []), p = a.useCallback((v, g) => {
406
+ R((y) => ({
407
+ ...y,
408
+ [v]: (y[v] ?? []).filter(
409
+ (O) => O.id !== g
410
410
  )
411
411
  }));
412
- }, []), [h, p] = a.useState({}), g = a.useCallback(
413
- (T) => h[T] ?? {},
414
- [h]
415
- ), y = a.useCallback((T, _) => {
416
- p((x) => ({
417
- ...x,
418
- [T]: { ...x[T] ?? {}, ..._ }
412
+ }, []), [T, l] = a.useState({}), h = a.useCallback(
413
+ (v) => T[v] ?? {},
414
+ [T]
415
+ ), S = a.useCallback((v, g) => {
416
+ l((y) => ({
417
+ ...y,
418
+ [v]: { ...y[v] ?? {}, ...g }
419
419
  }));
420
- }, []), [R, P] = a.useState({}), D = a.useCallback((T, _) => {
421
- P((x) => {
422
- const L = new Set(x[T]).add(_);
423
- return { ...x, [T]: L };
420
+ }, []), [F, x] = a.useState({}), V = a.useCallback((v, g) => {
421
+ x((y) => {
422
+ const O = new Set(y[v]).add(g);
423
+ return { ...y, [v]: O };
424
424
  });
425
- }, []), F = a.useCallback((T, _) => {
426
- P((x) => {
427
- const L = new Set(x[T]);
428
- return L.delete(_), { ...x, [T]: L };
425
+ }, []), N = a.useCallback((v, g) => {
426
+ x((y) => {
427
+ const O = new Set(y[v]);
428
+ return O.delete(g), { ...y, [v]: O };
429
429
  });
430
- }, []), I = a.useCallback(
431
- (T) => Array.from(R[T] ?? []).join(" ") || void 0,
432
- [R]
430
+ }, []), M = a.useCallback(
431
+ (v) => Array.from(F[v] ?? []).join(" ") || void 0,
432
+ [F]
433
433
  );
434
434
  return /* @__PURE__ */ i(
435
- wa,
435
+ mn,
436
436
  {
437
- scope: o,
437
+ scope: t,
438
438
  getFieldValidity: d,
439
- onFieldValidityChange: f,
440
- getFieldCustomMatcherEntries: C,
441
- onFieldCustomMatcherEntryAdd: v,
442
- onFieldCustomMatcherEntryRemove: m,
443
- getFieldCustomErrors: g,
444
- onFieldCustomErrorsChange: y,
445
- onFieldValiditionClear: b,
439
+ onFieldValidityChange: b,
440
+ getFieldCustomMatcherEntries: _,
441
+ onFieldCustomMatcherEntryAdd: m,
442
+ onFieldCustomMatcherEntryRemove: p,
443
+ getFieldCustomErrors: h,
444
+ onFieldCustomErrorsChange: S,
445
+ onFieldValiditionClear: w,
446
446
  children: /* @__PURE__ */ i(
447
- ya,
447
+ vn,
448
448
  {
449
- scope: o,
450
- onFieldMessageIdAdd: D,
451
- onFieldMessageIdRemove: F,
452
- getFieldDescription: I,
449
+ scope: t,
450
+ onFieldMessageIdAdd: V,
451
+ onFieldMessageIdRemove: N,
452
+ getFieldDescription: M,
453
453
  children: /* @__PURE__ */ i(
454
- O.form,
454
+ D.form,
455
455
  {
456
456
  ...n,
457
- ref: c,
458
- onInvalid: A(e.onInvalid, (T) => {
459
- const _ = Dr(T.currentTarget);
460
- _ === T.target && _.focus(), T.preventDefault();
457
+ ref: u,
458
+ onInvalid: P(e.onInvalid, (v) => {
459
+ const g = Yr(v.currentTarget);
460
+ g === v.target && g.focus(), v.preventDefault();
461
461
  }),
462
- onSubmit: A(e.onSubmit, r, {
462
+ onSubmit: P(e.onSubmit, o, {
463
463
  checkForDefaultPrevented: !1
464
464
  }),
465
- onReset: A(e.onReset, r)
465
+ onReset: P(e.onReset, o)
466
466
  }
467
467
  )
468
468
  }
@@ -471,115 +471,115 @@ var [Gt, Ta] = oe("Form"), $t = "Form", [wa, Te] = Gt($t), [ya, Or] = Gt($t), Kt
471
471
  );
472
472
  }
473
473
  );
474
- Kt.displayName = $t;
475
- var Bt = "FormField", [Ea, We] = Gt(Bt), Ht = a.forwardRef(
476
- (e, t) => {
477
- const { __scopeForm: o, name: r, serverInvalid: n = !1, ...s } = e, l = Te(Bt, o).getFieldValidity(r), u = te();
478
- return /* @__PURE__ */ i(Ea, { scope: o, id: u, name: r, serverInvalid: n, children: /* @__PURE__ */ i(
479
- O.div,
474
+ Rt.displayName = wt;
475
+ var _t = "FormField", [bn, Ne] = Et(_t), It = a.forwardRef(
476
+ (e, r) => {
477
+ const { __scopeForm: t, name: o, serverInvalid: n = !1, ...s } = e, c = fe(_t, t).getFieldValidity(o), f = ae();
478
+ return /* @__PURE__ */ i(bn, { scope: t, id: f, name: o, serverInvalid: n, children: /* @__PURE__ */ i(
479
+ D.div,
480
480
  {
481
- "data-valid": Xt(l, n),
482
- "data-invalid": Zt(l, n),
481
+ "data-valid": Nt(c, n),
482
+ "data-invalid": Ot(c, n),
483
483
  ...s,
484
- ref: t
484
+ ref: r
485
485
  }
486
486
  ) });
487
487
  }
488
488
  );
489
- Ht.displayName = Bt;
490
- var at = "FormLabel", jt = a.forwardRef(
491
- (e, t) => {
492
- const { __scopeForm: o, ...r } = e, n = Te(at, o), s = We(at, o), c = r.htmlFor || s.id, l = n.getFieldValidity(s.name);
489
+ It.displayName = _t;
490
+ var Be = "FormLabel", At = a.forwardRef(
491
+ (e, r) => {
492
+ const { __scopeForm: t, ...o } = e, n = fe(Be, t), s = Ne(Be, t), u = o.htmlFor || s.id, c = n.getFieldValidity(s.name);
493
493
  return /* @__PURE__ */ i(
494
- Ue,
494
+ Fe,
495
495
  {
496
- "data-valid": Xt(l, s.serverInvalid),
497
- "data-invalid": Zt(l, s.serverInvalid),
498
- ...r,
499
- ref: t,
500
- htmlFor: c
496
+ "data-valid": Nt(c, s.serverInvalid),
497
+ "data-invalid": Ot(c, s.serverInvalid),
498
+ ...o,
499
+ ref: r,
500
+ htmlFor: u
501
501
  }
502
502
  );
503
503
  }
504
504
  );
505
- jt.displayName = at;
506
- var De = "FormControl", zt = a.forwardRef(
507
- (e, t) => {
508
- const { __scopeForm: o, ...r } = e, n = Te(De, o), s = We(De, o), c = Or(De, o), l = a.useRef(null), u = K(t, l), d = r.name || s.name, f = r.id || s.id, b = n.getFieldCustomMatcherEntries(d), { onFieldValidityChange: w, onFieldCustomErrorsChange: E, onFieldValiditionClear: C } = n, v = a.useCallback(
509
- async (p) => {
510
- if (Lr(p.validity)) {
511
- const x = tt(p.validity);
512
- w(d, x);
505
+ At.displayName = Be;
506
+ var we = "FormControl", St = a.forwardRef(
507
+ (e, r) => {
508
+ const { __scopeForm: t, ...o } = e, n = fe(we, t), s = Ne(we, t), u = qr(we, t), c = a.useRef(null), f = Y(r, c), d = o.name || s.name, b = o.id || s.id, w = n.getFieldCustomMatcherEntries(d), { onFieldValidityChange: I, onFieldCustomErrorsChange: R, onFieldValiditionClear: _ } = n, m = a.useCallback(
509
+ async (l) => {
510
+ if (Xr(l.validity)) {
511
+ const y = Ge(l.validity);
512
+ I(d, y);
513
513
  return;
514
514
  }
515
- const g = p.form ? new FormData(p.form) : new FormData(), y = [p.value, g], R = [], P = [];
516
- b.forEach((x) => {
517
- Aa(x, y) ? P.push(x) : Na(x) && R.push(x);
515
+ const h = l.form ? new FormData(l.form) : new FormData(), S = [l.value, h], F = [], x = [];
516
+ w.forEach((y) => {
517
+ Rn(y, S) ? x.push(y) : _n(y) && F.push(y);
518
518
  });
519
- const D = R.map(({ id: x, match: L }) => [x, L(...y)]), F = Object.fromEntries(D), I = Object.values(F).some(Boolean), T = I;
520
- p.setCustomValidity(T ? Me : "");
521
- const _ = tt(p.validity);
522
- if (w(d, _), E(d, F), !I && P.length > 0) {
523
- const x = P.map(
524
- ({ id: U, match: ne }) => ne(...y).then((Y) => [U, Y])
525
- ), L = await Promise.all(x), M = Object.fromEntries(L), G = Object.values(M).some(Boolean);
526
- p.setCustomValidity(G ? Me : "");
527
- const Z = tt(p.validity);
528
- w(d, Z), E(d, M);
519
+ const V = F.map(({ id: y, match: O }) => [y, O(...S)]), N = Object.fromEntries(V), M = Object.values(N).some(Boolean), v = M;
520
+ l.setCustomValidity(v ? ge : "");
521
+ const g = Ge(l.validity);
522
+ if (I(d, g), R(d, N), !M && x.length > 0) {
523
+ const y = x.map(
524
+ ({ id: H, match: Q }) => Q(...S).then((W) => [H, W])
525
+ ), O = await Promise.all(y), C = Object.fromEntries(O), k = Object.values(C).some(Boolean);
526
+ l.setCustomValidity(k ? ge : "");
527
+ const X = Ge(l.validity);
528
+ I(d, X), R(d, C);
529
529
  }
530
530
  },
531
- [b, d, E, w]
531
+ [w, d, R, I]
532
532
  );
533
533
  a.useEffect(() => {
534
- const p = l.current;
535
- if (p) {
536
- const g = () => v(p);
537
- return p.addEventListener("change", g), () => p.removeEventListener("change", g);
534
+ const l = c.current;
535
+ if (l) {
536
+ const h = () => m(l);
537
+ return l.addEventListener("change", h), () => l.removeEventListener("change", h);
538
538
  }
539
- }, [v]);
540
- const m = a.useCallback(() => {
541
- const p = l.current;
542
- p && (p.setCustomValidity(""), C(d));
543
- }, [d, C]);
539
+ }, [m]);
540
+ const p = a.useCallback(() => {
541
+ const l = c.current;
542
+ l && (l.setCustomValidity(""), _(d));
543
+ }, [d, _]);
544
544
  a.useEffect(() => {
545
- var g;
546
- const p = (g = l.current) == null ? void 0 : g.form;
547
- if (p)
548
- return p.addEventListener("reset", m), () => p.removeEventListener("reset", m);
549
- }, [m]), a.useEffect(() => {
550
- const p = l.current, g = p == null ? void 0 : p.closest("form");
551
- if (g && s.serverInvalid) {
552
- const y = Dr(g);
553
- y === p && y.focus();
545
+ var h;
546
+ const l = (h = c.current) == null ? void 0 : h.form;
547
+ if (l)
548
+ return l.addEventListener("reset", p), () => l.removeEventListener("reset", p);
549
+ }, [p]), a.useEffect(() => {
550
+ const l = c.current, h = l == null ? void 0 : l.closest("form");
551
+ if (h && s.serverInvalid) {
552
+ const S = Yr(h);
553
+ S === l && S.focus();
554
554
  }
555
555
  }, [s.serverInvalid]);
556
- const h = n.getFieldValidity(d);
556
+ const T = n.getFieldValidity(d);
557
557
  return /* @__PURE__ */ i(
558
- O.input,
558
+ D.input,
559
559
  {
560
- "data-valid": Xt(h, s.serverInvalid),
561
- "data-invalid": Zt(h, s.serverInvalid),
560
+ "data-valid": Nt(T, s.serverInvalid),
561
+ "data-invalid": Ot(T, s.serverInvalid),
562
562
  "aria-invalid": s.serverInvalid ? !0 : void 0,
563
- "aria-describedby": c.getFieldDescription(d),
563
+ "aria-describedby": u.getFieldDescription(d),
564
564
  title: "",
565
- ...r,
566
- ref: u,
567
- id: f,
565
+ ...o,
566
+ ref: f,
567
+ id: b,
568
568
  name: d,
569
- onInvalid: A(e.onInvalid, (p) => {
570
- const g = p.currentTarget;
571
- v(g);
569
+ onInvalid: P(e.onInvalid, (l) => {
570
+ const h = l.currentTarget;
571
+ m(h);
572
572
  }),
573
- onChange: A(e.onChange, (p) => {
574
- m();
573
+ onChange: P(e.onChange, (l) => {
574
+ p();
575
575
  })
576
576
  }
577
577
  );
578
578
  }
579
579
  );
580
- zt.displayName = De;
581
- var Me = "This value is not valid", Ra = {
582
- badInput: Me,
580
+ St.displayName = we;
581
+ var ge = "This value is not valid", gn = {
582
+ badInput: ge,
583
583
  patternMismatch: "This value does not match the required pattern",
584
584
  rangeOverflow: "This value is too large",
585
585
  rangeUnderflow: "This value is too small",
@@ -589,284 +589,284 @@ var Me = "This value is not valid", Ra = {
589
589
  typeMismatch: "This value does not match the required type",
590
590
  valid: void 0,
591
591
  valueMissing: "This value is missing"
592
- }, Se = "FormMessage", Ut = a.forwardRef(
593
- (e, t) => {
594
- const { match: o, name: r, ...n } = e, s = We(Se, e.__scopeForm), c = r ?? s.name;
595
- return o === void 0 ? /* @__PURE__ */ i(Wt, { ...n, ref: t, name: c, children: e.children || Me }) : typeof o == "function" ? /* @__PURE__ */ i(Ia, { match: o, ...n, ref: t, name: c }) : /* @__PURE__ */ i(_a, { match: o, ...n, ref: t, name: c });
592
+ }, he = "FormMessage", xt = a.forwardRef(
593
+ (e, r) => {
594
+ const { match: t, name: o, ...n } = e, s = Ne(he, e.__scopeForm), u = o ?? s.name;
595
+ return t === void 0 ? /* @__PURE__ */ i(Mt, { ...n, ref: r, name: u, children: e.children || ge }) : typeof t == "function" ? /* @__PURE__ */ i(Cn, { match: t, ...n, ref: r, name: u }) : /* @__PURE__ */ i(hn, { match: t, ...n, ref: r, name: u });
596
596
  }
597
597
  );
598
- Ut.displayName = Se;
599
- var _a = a.forwardRef(
600
- (e, t) => {
601
- const { match: o, forceMatch: r = !1, name: n, children: s, ...c } = e, u = Te(Se, c.__scopeForm).getFieldValidity(n);
602
- return r || (u == null ? void 0 : u[o]) ? /* @__PURE__ */ i(Wt, { ref: t, ...c, name: n, children: s ?? Ra[o] }) : null;
603
- }
604
- ), Ia = a.forwardRef(
605
- (e, t) => {
606
- const { match: o, forceMatch: r = !1, name: n, id: s, children: c, ...l } = e, u = Te(Se, l.__scopeForm), d = a.useRef(null), f = K(t, d), b = te(), w = s ?? b, E = a.useMemo(() => ({ id: w, match: o }), [w, o]), { onFieldCustomMatcherEntryAdd: C, onFieldCustomMatcherEntryRemove: v } = u;
607
- a.useEffect(() => (C(n, E), () => v(n, E.id)), [E, n, C, v]);
608
- const m = u.getFieldValidity(n), p = u.getFieldCustomErrors(n)[w];
609
- return r || m && !Lr(m) && p ? /* @__PURE__ */ i(Wt, { id: w, ref: f, ...l, name: n, children: c ?? Me }) : null;
610
- }
611
- ), Wt = a.forwardRef(
612
- (e, t) => {
613
- const { __scopeForm: o, id: r, name: n, ...s } = e, c = Or(Se, o), l = te(), u = r ?? l, { onFieldMessageIdAdd: d, onFieldMessageIdRemove: f } = c;
614
- return a.useEffect(() => (d(n, u), () => f(n, u)), [n, u, d, f]), /* @__PURE__ */ i(O.span, { id: u, ...s, ref: t });
615
- }
616
- ), st = "FormValidityState", qt = (e) => {
617
- const { __scopeForm: t, name: o, children: r } = e, n = Te(st, t), s = We(st, t), c = o ?? s.name, l = n.getFieldValidity(c);
618
- return /* @__PURE__ */ i(_e, { children: r(l) });
598
+ xt.displayName = he;
599
+ var hn = a.forwardRef(
600
+ (e, r) => {
601
+ const { match: t, forceMatch: o = !1, name: n, children: s, ...u } = e, f = fe(he, u.__scopeForm).getFieldValidity(n);
602
+ return o || (f == null ? void 0 : f[t]) ? /* @__PURE__ */ i(Mt, { ref: r, ...u, name: n, children: s ?? gn[t] }) : null;
603
+ }
604
+ ), Cn = a.forwardRef(
605
+ (e, r) => {
606
+ const { match: t, forceMatch: o = !1, name: n, id: s, children: u, ...c } = e, f = fe(he, c.__scopeForm), d = a.useRef(null), b = Y(r, d), w = ae(), I = s ?? w, R = a.useMemo(() => ({ id: I, match: t }), [I, t]), { onFieldCustomMatcherEntryAdd: _, onFieldCustomMatcherEntryRemove: m } = f;
607
+ a.useEffect(() => (_(n, R), () => m(n, R.id)), [R, n, _, m]);
608
+ const p = f.getFieldValidity(n), l = f.getFieldCustomErrors(n)[I];
609
+ return o || p && !Xr(p) && l ? /* @__PURE__ */ i(Mt, { id: I, ref: b, ...c, name: n, children: u ?? ge }) : null;
610
+ }
611
+ ), Mt = a.forwardRef(
612
+ (e, r) => {
613
+ const { __scopeForm: t, id: o, name: n, ...s } = e, u = qr(he, t), c = ae(), f = o ?? c, { onFieldMessageIdAdd: d, onFieldMessageIdRemove: b } = u;
614
+ return a.useEffect(() => (d(n, f), () => b(n, f)), [n, f, d, b]), /* @__PURE__ */ i(D.span, { id: f, ...s, ref: r });
615
+ }
616
+ ), je = "FormValidityState", Pt = (e) => {
617
+ const { __scopeForm: r, name: t, children: o } = e, n = fe(je, r), s = Ne(je, r), u = t ?? s.name, c = n.getFieldValidity(u);
618
+ return /* @__PURE__ */ i(at, { children: o(c) });
619
619
  };
620
- qt.displayName = st;
621
- var Ma = "FormSubmit", Yt = a.forwardRef(
622
- (e, t) => {
623
- const { __scopeForm: o, ...r } = e;
624
- return /* @__PURE__ */ i(O.button, { type: "submit", ...r, ref: t });
620
+ Pt.displayName = je;
621
+ var Tn = "FormSubmit", Ft = a.forwardRef(
622
+ (e, r) => {
623
+ const { __scopeForm: t, ...o } = e;
624
+ return /* @__PURE__ */ i(D.button, { type: "submit", ...o, ref: r });
625
625
  }
626
626
  );
627
- Yt.displayName = Ma;
628
- function tt(e) {
629
- const t = {};
630
- for (const o in e)
631
- t[o] = e[o];
632
- return t;
627
+ Ft.displayName = Tn;
628
+ function Ge(e) {
629
+ const r = {};
630
+ for (const t in e)
631
+ r[t] = e[t];
632
+ return r;
633
633
  }
634
- function Pa(e) {
634
+ function yn(e) {
635
635
  return e instanceof HTMLElement;
636
636
  }
637
- function xa(e) {
637
+ function En(e) {
638
638
  return "validity" in e;
639
639
  }
640
- function Sa(e) {
641
- return xa(e) && (e.validity.valid === !1 || e.getAttribute("aria-invalid") === "true");
640
+ function wn(e) {
641
+ return En(e) && (e.validity.valid === !1 || e.getAttribute("aria-invalid") === "true");
642
642
  }
643
- function Dr(e) {
644
- const t = e.elements, [o] = Array.from(t).filter(Pa).filter(Sa);
645
- return o;
643
+ function Yr(e) {
644
+ const r = e.elements, [t] = Array.from(r).filter(yn).filter(wn);
645
+ return t;
646
646
  }
647
- function Aa(e, t) {
648
- return e.match.constructor.name === "AsyncFunction" || Fa(e.match, t);
647
+ function Rn(e, r) {
648
+ return e.match.constructor.name === "AsyncFunction" || In(e.match, r);
649
649
  }
650
- function Na(e) {
650
+ function _n(e) {
651
651
  return e.match.constructor.name === "Function";
652
652
  }
653
- function Fa(e, t) {
654
- return e(...t) instanceof Promise;
653
+ function In(e, r) {
654
+ return e(...r) instanceof Promise;
655
655
  }
656
- function Lr(e) {
657
- let t = !1;
658
- for (const o in e) {
659
- const r = o;
660
- if (r !== "valid" && r !== "customError" && e[r]) {
661
- t = !0;
656
+ function Xr(e) {
657
+ let r = !1;
658
+ for (const t in e) {
659
+ const o = t;
660
+ if (o !== "valid" && o !== "customError" && e[o]) {
661
+ r = !0;
662
662
  break;
663
663
  }
664
664
  }
665
- return t;
665
+ return r;
666
666
  }
667
- function Xt(e, t) {
668
- if ((e == null ? void 0 : e.valid) === !0 && !t) return !0;
667
+ function Nt(e, r) {
668
+ if ((e == null ? void 0 : e.valid) === !0 && !r) return !0;
669
669
  }
670
- function Zt(e, t) {
671
- if ((e == null ? void 0 : e.valid) === !1 || t) return !0;
670
+ function Ot(e, r) {
671
+ if ((e == null ? void 0 : e.valid) === !1 || r) return !0;
672
672
  }
673
- var Oa = Kt, Da = Ht, La = jt, ka = zt, Va = Ut, Ga = qt, $a = Yt;
674
- const sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
673
+ var An = Rt, Sn = It, xn = At, Mn = St, Pn = xt, Fn = Pt, Nn = Ft;
674
+ const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
675
675
  __proto__: null,
676
- Control: ka,
677
- Field: Da,
678
- Form: Kt,
679
- FormControl: zt,
680
- FormField: Ht,
681
- FormLabel: jt,
682
- FormMessage: Ut,
683
- FormSubmit: Yt,
684
- FormValidityState: qt,
685
- Label: La,
686
- Message: Va,
687
- Root: Oa,
688
- Submit: $a,
689
- ValidityState: Ga,
690
- createFormScope: Ta
676
+ Control: Mn,
677
+ Field: Sn,
678
+ Form: Rt,
679
+ FormControl: St,
680
+ FormField: It,
681
+ FormLabel: At,
682
+ FormMessage: xt,
683
+ FormSubmit: Ft,
684
+ FormValidityState: Pt,
685
+ Label: xn,
686
+ Message: Pn,
687
+ Root: An,
688
+ Submit: Nn,
689
+ ValidityState: Fn,
690
+ createFormScope: pn
691
691
  }, Symbol.toStringTag, { value: "Module" }));
692
- var Ae = "Menubar", [it, Ka, Ba] = Pe(Ae), [kr, Ha] = oe(Ae, [
693
- Ba,
694
- ue
695
- ]), z = _n(), Vr = ue(), [ja, Jt] = kr(Ae), Qt = a.forwardRef(
696
- (e, t) => {
692
+ var Ce = "Menubar", [He, On, Dn] = ot(Ce), [Zr, Ln] = se(Ce, [
693
+ Dn,
694
+ de
695
+ ]), j = To(), Jr = de(), [kn, Dt] = Zr(Ce), Lt = a.forwardRef(
696
+ (e, r) => {
697
697
  const {
698
- __scopeMenubar: o,
699
- value: r,
698
+ __scopeMenubar: t,
699
+ value: o,
700
700
  onValueChange: n,
701
701
  defaultValue: s,
702
- loop: c = !0,
703
- dir: l,
704
- ...u
705
- } = e, d = he(l), f = Vr(o), [b, w] = X({
706
- prop: r,
702
+ loop: u = !0,
703
+ dir: c,
704
+ ...f
705
+ } = e, d = Ae(c), b = Jr(t), [w, I] = ie({
706
+ prop: o,
707
707
  onChange: n,
708
708
  defaultProp: s ?? "",
709
- caller: Ae
710
- }), [E, C] = a.useState(null);
709
+ caller: Ce
710
+ }), [R, _] = a.useState(null);
711
711
  return /* @__PURE__ */ i(
712
- ja,
712
+ kn,
713
713
  {
714
- scope: o,
715
- value: b,
714
+ scope: t,
715
+ value: w,
716
716
  onMenuOpen: a.useCallback(
717
- (v) => {
718
- w(v), C(v);
717
+ (m) => {
718
+ I(m), _(m);
719
719
  },
720
- [w]
720
+ [I]
721
721
  ),
722
- onMenuClose: a.useCallback(() => w(""), [w]),
722
+ onMenuClose: a.useCallback(() => I(""), [I]),
723
723
  onMenuToggle: a.useCallback(
724
- (v) => {
725
- w((m) => m ? "" : v), C(v);
724
+ (m) => {
725
+ I((p) => p ? "" : m), _(m);
726
726
  },
727
- [w]
727
+ [I]
728
728
  ),
729
729
  dir: d,
730
- loop: c,
731
- children: /* @__PURE__ */ i(it.Provider, { scope: o, children: /* @__PURE__ */ i(it.Slot, { scope: o, children: /* @__PURE__ */ i(
732
- Be,
730
+ loop: u,
731
+ children: /* @__PURE__ */ i(He.Provider, { scope: t, children: /* @__PURE__ */ i(He.Slot, { scope: t, children: /* @__PURE__ */ i(
732
+ nt,
733
733
  {
734
734
  asChild: !0,
735
- ...f,
735
+ ...b,
736
736
  orientation: "horizontal",
737
- loop: c,
737
+ loop: u,
738
738
  dir: d,
739
- currentTabStopId: E,
740
- onCurrentTabStopIdChange: C,
741
- children: /* @__PURE__ */ i(O.div, { role: "menubar", ...u, ref: t })
739
+ currentTabStopId: R,
740
+ onCurrentTabStopIdChange: _,
741
+ children: /* @__PURE__ */ i(D.div, { role: "menubar", ...f, ref: r })
742
742
  }
743
743
  ) }) })
744
744
  }
745
745
  );
746
746
  }
747
747
  );
748
- Qt.displayName = Ae;
749
- var eo = "MenubarMenu", [za, Gr] = kr(eo), to = (e) => {
750
- const { __scopeMenubar: t, value: o, ...r } = e, n = te(), s = o || n || "LEGACY_REACT_AUTO_VALUE", c = Jt(eo, t), l = z(t), u = a.useRef(null), d = a.useRef(!1), f = c.value === s;
748
+ Lt.displayName = Ce;
749
+ var kt = "MenubarMenu", [Vn, Qr] = Zr(kt), Vt = (e) => {
750
+ const { __scopeMenubar: r, value: t, ...o } = e, n = ae(), s = t || n || "LEGACY_REACT_AUTO_VALUE", u = Dt(kt, r), c = j(r), f = a.useRef(null), d = a.useRef(!1), b = u.value === s;
751
751
  return a.useEffect(() => {
752
- f || (d.current = !1);
753
- }, [f]), /* @__PURE__ */ i(
754
- za,
752
+ b || (d.current = !1);
753
+ }, [b]), /* @__PURE__ */ i(
754
+ Vn,
755
755
  {
756
- scope: t,
756
+ scope: r,
757
757
  value: s,
758
- triggerId: te(),
759
- triggerRef: u,
760
- contentId: te(),
758
+ triggerId: ae(),
759
+ triggerRef: f,
760
+ contentId: ae(),
761
761
  wasKeyboardTriggerOpenRef: d,
762
762
  children: /* @__PURE__ */ i(
763
- Fn,
763
+ So,
764
764
  {
765
- ...l,
766
- open: f,
767
- onOpenChange: (b) => {
768
- b || c.onMenuClose();
765
+ ...c,
766
+ open: b,
767
+ onOpenChange: (w) => {
768
+ w || u.onMenuClose();
769
769
  },
770
770
  modal: !1,
771
- dir: c.dir,
772
- ...r
771
+ dir: u.dir,
772
+ ...o
773
773
  }
774
774
  )
775
775
  }
776
776
  );
777
777
  };
778
- to.displayName = eo;
779
- var ct = "MenubarTrigger", oo = a.forwardRef(
780
- (e, t) => {
781
- const { __scopeMenubar: o, disabled: r = !1, ...n } = e, s = Vr(o), c = z(o), l = Jt(ct, o), u = Gr(ct, o), d = a.useRef(null), f = K(t, d, u.triggerRef), [b, w] = a.useState(!1), E = l.value === u.value;
782
- return /* @__PURE__ */ i(it.ItemSlot, { scope: o, value: u.value, disabled: r, children: /* @__PURE__ */ i(
783
- xe,
778
+ Vt.displayName = kt;
779
+ var ze = "MenubarTrigger", Gt = a.forwardRef(
780
+ (e, r) => {
781
+ const { __scopeMenubar: t, disabled: o = !1, ...n } = e, s = Jr(t), u = j(t), c = Dt(ze, t), f = Qr(ze, t), d = a.useRef(null), b = Y(r, d, f.triggerRef), [w, I] = a.useState(!1), R = c.value === f.value;
782
+ return /* @__PURE__ */ i(He.ItemSlot, { scope: t, value: f.value, disabled: o, children: /* @__PURE__ */ i(
783
+ Se,
784
784
  {
785
785
  asChild: !0,
786
786
  ...s,
787
- focusable: !r,
788
- tabStopId: u.value,
789
- children: /* @__PURE__ */ i(Kn, { asChild: !0, ...c, children: /* @__PURE__ */ i(
790
- O.button,
787
+ focusable: !o,
788
+ tabStopId: f.value,
789
+ children: /* @__PURE__ */ i(Lo, { asChild: !0, ...u, children: /* @__PURE__ */ i(
790
+ D.button,
791
791
  {
792
792
  type: "button",
793
793
  role: "menuitem",
794
- id: u.triggerId,
794
+ id: f.triggerId,
795
795
  "aria-haspopup": "menu",
796
- "aria-expanded": E,
797
- "aria-controls": E ? u.contentId : void 0,
798
- "data-highlighted": b ? "" : void 0,
799
- "data-state": E ? "open" : "closed",
800
- "data-disabled": r ? "" : void 0,
801
- disabled: r,
796
+ "aria-expanded": R,
797
+ "aria-controls": R ? f.contentId : void 0,
798
+ "data-highlighted": w ? "" : void 0,
799
+ "data-state": R ? "open" : "closed",
800
+ "data-disabled": o ? "" : void 0,
801
+ disabled: o,
802
802
  ...n,
803
- ref: f,
804
- onPointerDown: A(e.onPointerDown, (C) => {
805
- !r && C.button === 0 && C.ctrlKey === !1 && (l.onMenuOpen(u.value), E || C.preventDefault());
803
+ ref: b,
804
+ onPointerDown: P(e.onPointerDown, (_) => {
805
+ !o && _.button === 0 && _.ctrlKey === !1 && (c.onMenuOpen(f.value), R || _.preventDefault());
806
806
  }),
807
- onPointerEnter: A(e.onPointerEnter, () => {
808
- var v;
809
- !!l.value && !E && (l.onMenuOpen(u.value), (v = d.current) == null || v.focus());
807
+ onPointerEnter: P(e.onPointerEnter, () => {
808
+ var m;
809
+ !!c.value && !R && (c.onMenuOpen(f.value), (m = d.current) == null || m.focus());
810
810
  }),
811
- onKeyDown: A(e.onKeyDown, (C) => {
812
- r || (["Enter", " "].includes(C.key) && l.onMenuToggle(u.value), C.key === "ArrowDown" && l.onMenuOpen(u.value), ["Enter", " ", "ArrowDown"].includes(C.key) && (u.wasKeyboardTriggerOpenRef.current = !0, C.preventDefault()));
811
+ onKeyDown: P(e.onKeyDown, (_) => {
812
+ o || (["Enter", " "].includes(_.key) && c.onMenuToggle(f.value), _.key === "ArrowDown" && c.onMenuOpen(f.value), ["Enter", " ", "ArrowDown"].includes(_.key) && (f.wasKeyboardTriggerOpenRef.current = !0, _.preventDefault()));
813
813
  }),
814
- onFocus: A(e.onFocus, () => w(!0)),
815
- onBlur: A(e.onBlur, () => w(!1))
814
+ onFocus: P(e.onFocus, () => I(!0)),
815
+ onBlur: P(e.onBlur, () => I(!1))
816
816
  }
817
817
  ) })
818
818
  }
819
819
  ) });
820
820
  }
821
821
  );
822
- oo.displayName = ct;
823
- var Ua = "MenubarPortal", ro = (e) => {
824
- const { __scopeMenubar: t, ...o } = e, r = z(t);
825
- return /* @__PURE__ */ i(On, { ...r, ...o });
822
+ Gt.displayName = ze;
823
+ var Gn = "MenubarPortal", $t = (e) => {
824
+ const { __scopeMenubar: r, ...t } = e, o = j(r);
825
+ return /* @__PURE__ */ i(xo, { ...o, ...t });
826
826
  };
827
- ro.displayName = Ua;
828
- var lt = "MenubarContent", no = a.forwardRef(
829
- (e, t) => {
830
- const { __scopeMenubar: o, align: r = "start", ...n } = e, s = z(o), c = Jt(lt, o), l = Gr(lt, o), u = Ka(o), d = a.useRef(!1);
827
+ $t.displayName = Gn;
828
+ var Ue = "MenubarContent", Kt = a.forwardRef(
829
+ (e, r) => {
830
+ const { __scopeMenubar: t, align: o = "start", ...n } = e, s = j(t), u = Dt(Ue, t), c = Qr(Ue, t), f = On(t), d = a.useRef(!1);
831
831
  return /* @__PURE__ */ i(
832
- Pn,
832
+ wo,
833
833
  {
834
- id: l.contentId,
835
- "aria-labelledby": l.triggerId,
834
+ id: c.contentId,
835
+ "aria-labelledby": c.triggerId,
836
836
  "data-radix-menubar-content": "",
837
837
  ...s,
838
838
  ...n,
839
- ref: t,
840
- align: r,
841
- onCloseAutoFocus: A(e.onCloseAutoFocus, (f) => {
842
- var w;
843
- !!!c.value && !d.current && ((w = l.triggerRef.current) == null || w.focus()), d.current = !1, f.preventDefault();
839
+ ref: r,
840
+ align: o,
841
+ onCloseAutoFocus: P(e.onCloseAutoFocus, (b) => {
842
+ var I;
843
+ !!!u.value && !d.current && ((I = c.triggerRef.current) == null || I.focus()), d.current = !1, b.preventDefault();
844
844
  }),
845
- onFocusOutside: A(e.onFocusOutside, (f) => {
846
- const b = f.target;
847
- u().some((E) => {
848
- var C;
849
- return (C = E.ref.current) == null ? void 0 : C.contains(b);
850
- }) && f.preventDefault();
845
+ onFocusOutside: P(e.onFocusOutside, (b) => {
846
+ const w = b.target;
847
+ f().some((R) => {
848
+ var _;
849
+ return (_ = R.ref.current) == null ? void 0 : _.contains(w);
850
+ }) && b.preventDefault();
851
851
  }),
852
- onInteractOutside: A(e.onInteractOutside, () => {
852
+ onInteractOutside: P(e.onInteractOutside, () => {
853
853
  d.current = !0;
854
854
  }),
855
- onEntryFocus: (f) => {
856
- l.wasKeyboardTriggerOpenRef.current || f.preventDefault();
855
+ onEntryFocus: (b) => {
856
+ c.wasKeyboardTriggerOpenRef.current || b.preventDefault();
857
857
  },
858
- onKeyDown: A(
858
+ onKeyDown: P(
859
859
  e.onKeyDown,
860
- (f) => {
861
- if (["ArrowRight", "ArrowLeft"].includes(f.key)) {
862
- const b = f.target, w = b.hasAttribute("data-radix-menubar-subtrigger"), E = b.closest("[data-radix-menubar-content]") !== f.currentTarget, v = (c.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === f.key;
863
- if (!v && w || E && v) return;
864
- let p = u().filter((R) => !R.disabled).map((R) => R.value);
865
- v && p.reverse();
866
- const g = p.indexOf(l.value);
867
- p = c.loop ? ns(p, g + 1) : p.slice(g + 1);
868
- const [y] = p;
869
- y && c.onMenuOpen(y);
860
+ (b) => {
861
+ if (["ArrowRight", "ArrowLeft"].includes(b.key)) {
862
+ const w = b.target, I = w.hasAttribute("data-radix-menubar-subtrigger"), R = w.closest("[data-radix-menubar-content]") !== b.currentTarget, m = (u.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === b.key;
863
+ if (!m && I || R && m) return;
864
+ let l = f().filter((F) => !F.disabled).map((F) => F.value);
865
+ m && l.reverse();
866
+ const h = l.indexOf(c.value);
867
+ l = u.loop ? Zn(l, h + 1) : l.slice(h + 1);
868
+ const [S] = l;
869
+ S && u.onMenuOpen(S);
870
870
  }
871
871
  },
872
872
  { checkForDefaultPrevented: !1 }
@@ -883,103 +883,103 @@ var lt = "MenubarContent", no = a.forwardRef(
883
883
  );
884
884
  }
885
885
  );
886
- no.displayName = lt;
887
- var Wa = "MenubarGroup", ao = a.forwardRef(
888
- (e, t) => {
889
- const { __scopeMenubar: o, ...r } = e, n = z(o);
890
- return /* @__PURE__ */ i(xn, { ...n, ...r, ref: t });
886
+ Kt.displayName = Ue;
887
+ var $n = "MenubarGroup", Bt = a.forwardRef(
888
+ (e, r) => {
889
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
890
+ return /* @__PURE__ */ i(Ro, { ...n, ...o, ref: r });
891
891
  }
892
892
  );
893
- ao.displayName = Wa;
894
- var qa = "MenubarLabel", so = a.forwardRef(
895
- (e, t) => {
896
- const { __scopeMenubar: o, ...r } = e, n = z(o);
897
- return /* @__PURE__ */ i(Nn, { ...n, ...r, ref: t });
893
+ Bt.displayName = $n;
894
+ var Kn = "MenubarLabel", jt = a.forwardRef(
895
+ (e, r) => {
896
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
897
+ return /* @__PURE__ */ i(Ao, { ...n, ...o, ref: r });
898
898
  }
899
899
  );
900
- so.displayName = qa;
901
- var Ya = "MenubarItem", io = a.forwardRef(
902
- (e, t) => {
903
- const { __scopeMenubar: o, ...r } = e, n = z(o);
904
- return /* @__PURE__ */ i(Sn, { ...n, ...r, ref: t });
900
+ jt.displayName = Kn;
901
+ var Bn = "MenubarItem", Ht = a.forwardRef(
902
+ (e, r) => {
903
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
904
+ return /* @__PURE__ */ i(_o, { ...n, ...o, ref: r });
905
905
  }
906
906
  );
907
- io.displayName = Ya;
908
- var Xa = "MenubarCheckboxItem", co = a.forwardRef(
909
- (e, t) => {
910
- const { __scopeMenubar: o, ...r } = e, n = z(o);
911
- return /* @__PURE__ */ i(Mn, { ...n, ...r, ref: t });
907
+ Ht.displayName = Bn;
908
+ var jn = "MenubarCheckboxItem", zt = a.forwardRef(
909
+ (e, r) => {
910
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
911
+ return /* @__PURE__ */ i(Eo, { ...n, ...o, ref: r });
912
912
  }
913
913
  );
914
- co.displayName = Xa;
915
- var Za = "MenubarRadioGroup", lo = a.forwardRef(
916
- (e, t) => {
917
- const { __scopeMenubar: o, ...r } = e, n = z(o);
918
- return /* @__PURE__ */ i(Dn, { ...n, ...r, ref: t });
914
+ zt.displayName = jn;
915
+ var Hn = "MenubarRadioGroup", Ut = a.forwardRef(
916
+ (e, r) => {
917
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
918
+ return /* @__PURE__ */ i(Mo, { ...n, ...o, ref: r });
919
919
  }
920
920
  );
921
- lo.displayName = Za;
922
- var Ja = "MenubarRadioItem", uo = a.forwardRef(
923
- (e, t) => {
924
- const { __scopeMenubar: o, ...r } = e, n = z(o);
925
- return /* @__PURE__ */ i(Ln, { ...n, ...r, ref: t });
921
+ Ut.displayName = Hn;
922
+ var zn = "MenubarRadioItem", Wt = a.forwardRef(
923
+ (e, r) => {
924
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
925
+ return /* @__PURE__ */ i(Po, { ...n, ...o, ref: r });
926
926
  }
927
927
  );
928
- uo.displayName = Ja;
929
- var Qa = "MenubarItemIndicator", fo = a.forwardRef((e, t) => {
930
- const { __scopeMenubar: o, ...r } = e, n = z(o);
931
- return /* @__PURE__ */ i(An, { ...n, ...r, ref: t });
928
+ Wt.displayName = zn;
929
+ var Un = "MenubarItemIndicator", qt = a.forwardRef((e, r) => {
930
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
931
+ return /* @__PURE__ */ i(Io, { ...n, ...o, ref: r });
932
932
  });
933
- fo.displayName = Qa;
934
- var es = "MenubarSeparator", po = a.forwardRef(
935
- (e, t) => {
936
- const { __scopeMenubar: o, ...r } = e, n = z(o);
937
- return /* @__PURE__ */ i(kn, { ...n, ...r, ref: t });
933
+ qt.displayName = Un;
934
+ var Wn = "MenubarSeparator", Yt = a.forwardRef(
935
+ (e, r) => {
936
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
937
+ return /* @__PURE__ */ i(Fo, { ...n, ...o, ref: r });
938
938
  }
939
939
  );
940
- po.displayName = es;
941
- var ts = "MenubarArrow", vo = a.forwardRef(
942
- (e, t) => {
943
- const { __scopeMenubar: o, ...r } = e, n = z(o);
944
- return /* @__PURE__ */ i(In, { ...n, ...r, ref: t });
940
+ Yt.displayName = Wn;
941
+ var qn = "MenubarArrow", Xt = a.forwardRef(
942
+ (e, r) => {
943
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
944
+ return /* @__PURE__ */ i(yo, { ...n, ...o, ref: r });
945
945
  }
946
946
  );
947
- vo.displayName = ts;
948
- var $r = "MenubarSub", mo = (e) => {
949
- const { __scopeMenubar: t, children: o, open: r, onOpenChange: n, defaultOpen: s } = e, c = z(t), [l, u] = X({
950
- prop: r,
947
+ Xt.displayName = qn;
948
+ var eo = "MenubarSub", Zt = (e) => {
949
+ const { __scopeMenubar: r, children: t, open: o, onOpenChange: n, defaultOpen: s } = e, u = j(r), [c, f] = ie({
950
+ prop: o,
951
951
  defaultProp: s ?? !1,
952
952
  onChange: n,
953
- caller: $r
953
+ caller: eo
954
954
  });
955
- return /* @__PURE__ */ i(Vn, { ...c, open: l, onOpenChange: u, children: o });
955
+ return /* @__PURE__ */ i(No, { ...u, open: c, onOpenChange: f, children: t });
956
956
  };
957
- mo.displayName = $r;
958
- var os = "MenubarSubTrigger", go = a.forwardRef(
959
- (e, t) => {
960
- const { __scopeMenubar: o, ...r } = e, n = z(o);
957
+ Zt.displayName = eo;
958
+ var Yn = "MenubarSubTrigger", Jt = a.forwardRef(
959
+ (e, r) => {
960
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
961
961
  return /* @__PURE__ */ i(
962
- $n,
962
+ Do,
963
963
  {
964
964
  "data-radix-menubar-subtrigger": "",
965
965
  ...n,
966
- ...r,
967
- ref: t
966
+ ...o,
967
+ ref: r
968
968
  }
969
969
  );
970
970
  }
971
971
  );
972
- go.displayName = os;
973
- var rs = "MenubarSubContent", bo = a.forwardRef(
974
- (e, t) => {
975
- const { __scopeMenubar: o, ...r } = e, n = z(o);
972
+ Jt.displayName = Yn;
973
+ var Xn = "MenubarSubContent", Qt = a.forwardRef(
974
+ (e, r) => {
975
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
976
976
  return /* @__PURE__ */ i(
977
- Gn,
977
+ Oo,
978
978
  {
979
979
  ...n,
980
980
  "data-radix-menubar-content": "",
981
- ...r,
982
- ref: t,
981
+ ...o,
982
+ ref: r,
983
983
  style: {
984
984
  ...e.style,
985
985
  "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
@@ -992,643 +992,50 @@ var rs = "MenubarSubContent", bo = a.forwardRef(
992
992
  );
993
993
  }
994
994
  );
995
- bo.displayName = rs;
996
- function ns(e, t) {
997
- return e.map((o, r) => e[(t + r) % e.length]);
995
+ Qt.displayName = Xn;
996
+ function Zn(e, r) {
997
+ return e.map((t, o) => e[(r + o) % e.length]);
998
998
  }
999
- var as = Qt, ss = to, is = oo, cs = ro, ls = no, us = ao, ds = so, fs = io, ps = co, vs = lo, ms = uo, gs = fo, bs = po, Cs = vo, hs = mo, Ts = go, ws = bo;
1000
- const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
999
+ var Jn = Lt, Qn = Vt, ea = Gt, ta = $t, ra = Kt, oa = Bt, na = jt, aa = Ht, sa = zt, ia = Ut, ca = Wt, la = qt, ua = Yt, da = Xt, fa = Zt, pa = Jt, ma = Qt;
1000
+ const Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1001
1001
  __proto__: null,
1002
- Arrow: Cs,
1003
- CheckboxItem: ps,
1004
- Content: ls,
1005
- Group: us,
1006
- Item: fs,
1007
- ItemIndicator: gs,
1008
- Label: ds,
1009
- Menu: ss,
1010
- Menubar: Qt,
1011
- MenubarArrow: vo,
1012
- MenubarCheckboxItem: co,
1013
- MenubarContent: no,
1014
- MenubarGroup: ao,
1015
- MenubarItem: io,
1016
- MenubarItemIndicator: fo,
1017
- MenubarLabel: so,
1018
- MenubarMenu: to,
1019
- MenubarPortal: ro,
1020
- MenubarRadioGroup: lo,
1021
- MenubarRadioItem: uo,
1022
- MenubarSeparator: po,
1023
- MenubarSub: mo,
1024
- MenubarSubContent: bo,
1025
- MenubarSubTrigger: go,
1026
- MenubarTrigger: oo,
1027
- Portal: cs,
1028
- RadioGroup: vs,
1029
- RadioItem: ms,
1030
- Root: as,
1031
- Separator: bs,
1032
- Sub: hs,
1033
- SubContent: ws,
1034
- SubTrigger: Ts,
1035
- Trigger: is,
1036
- createMenubarScope: Ha
1002
+ Arrow: da,
1003
+ CheckboxItem: sa,
1004
+ Content: ra,
1005
+ Group: oa,
1006
+ Item: aa,
1007
+ ItemIndicator: la,
1008
+ Label: na,
1009
+ Menu: Qn,
1010
+ Menubar: Lt,
1011
+ MenubarArrow: Xt,
1012
+ MenubarCheckboxItem: zt,
1013
+ MenubarContent: Kt,
1014
+ MenubarGroup: Bt,
1015
+ MenubarItem: Ht,
1016
+ MenubarItemIndicator: qt,
1017
+ MenubarLabel: jt,
1018
+ MenubarMenu: Vt,
1019
+ MenubarPortal: $t,
1020
+ MenubarRadioGroup: Ut,
1021
+ MenubarRadioItem: Wt,
1022
+ MenubarSeparator: Yt,
1023
+ MenubarSub: Zt,
1024
+ MenubarSubContent: Qt,
1025
+ MenubarSubTrigger: Jt,
1026
+ MenubarTrigger: Gt,
1027
+ Portal: ta,
1028
+ RadioGroup: ia,
1029
+ RadioItem: ca,
1030
+ Root: Jn,
1031
+ Separator: ua,
1032
+ Sub: fa,
1033
+ SubContent: ma,
1034
+ SubTrigger: pa,
1035
+ Trigger: ea,
1036
+ createMenubarScope: Ln
1037
1037
  }, Symbol.toStringTag, { value: "Module" }));
1038
- var pe = "NavigationMenu", [Co, Kr, ys] = Pe(pe), [ut, Es, Rs] = Pe(pe), [ho, _s] = oe(
1039
- pe,
1040
- [ys, Rs]
1041
- ), [Is, Q] = ho(pe), [Ms, Ps] = ho(pe), To = a.forwardRef(
1042
- (e, t) => {
1043
- const {
1044
- __scopeNavigationMenu: o,
1045
- value: r,
1046
- onValueChange: n,
1047
- defaultValue: s,
1048
- delayDuration: c = 200,
1049
- skipDelayDuration: l = 300,
1050
- orientation: u = "horizontal",
1051
- dir: d,
1052
- ...f
1053
- } = e, [b, w] = a.useState(null), E = K(t, (I) => w(I)), C = he(d), v = a.useRef(0), m = a.useRef(0), h = a.useRef(0), [p, g] = a.useState(!0), [y, R] = X({
1054
- prop: r,
1055
- onChange: (I) => {
1056
- const T = I !== "", _ = l > 0;
1057
- T ? (window.clearTimeout(h.current), _ && g(!1)) : (window.clearTimeout(h.current), h.current = window.setTimeout(
1058
- () => g(!0),
1059
- l
1060
- )), n == null || n(I);
1061
- },
1062
- defaultProp: s ?? "",
1063
- caller: pe
1064
- }), P = a.useCallback(() => {
1065
- window.clearTimeout(m.current), m.current = window.setTimeout(() => R(""), 150);
1066
- }, [R]), D = a.useCallback(
1067
- (I) => {
1068
- window.clearTimeout(m.current), R(I);
1069
- },
1070
- [R]
1071
- ), F = a.useCallback(
1072
- (I) => {
1073
- y === I ? window.clearTimeout(m.current) : v.current = window.setTimeout(() => {
1074
- window.clearTimeout(m.current), R(I);
1075
- }, c);
1076
- },
1077
- [y, R, c]
1078
- );
1079
- return a.useEffect(() => () => {
1080
- window.clearTimeout(v.current), window.clearTimeout(m.current), window.clearTimeout(h.current);
1081
- }, []), /* @__PURE__ */ i(
1082
- Br,
1083
- {
1084
- scope: o,
1085
- isRootMenu: !0,
1086
- value: y,
1087
- dir: C,
1088
- orientation: u,
1089
- rootNavigationMenu: b,
1090
- onTriggerEnter: (I) => {
1091
- window.clearTimeout(v.current), p ? F(I) : D(I);
1092
- },
1093
- onTriggerLeave: () => {
1094
- window.clearTimeout(v.current), P();
1095
- },
1096
- onContentEnter: () => window.clearTimeout(m.current),
1097
- onContentLeave: P,
1098
- onItemSelect: (I) => {
1099
- R((T) => T === I ? "" : I);
1100
- },
1101
- onItemDismiss: () => R(""),
1102
- children: /* @__PURE__ */ i(
1103
- O.nav,
1104
- {
1105
- "aria-label": "Main",
1106
- "data-orientation": u,
1107
- dir: C,
1108
- ...f,
1109
- ref: E
1110
- }
1111
- )
1112
- }
1113
- );
1114
- }
1115
- );
1116
- To.displayName = pe;
1117
- var dt = "NavigationMenuSub", wo = a.forwardRef(
1118
- (e, t) => {
1119
- const {
1120
- __scopeNavigationMenu: o,
1121
- value: r,
1122
- onValueChange: n,
1123
- defaultValue: s,
1124
- orientation: c = "horizontal",
1125
- ...l
1126
- } = e, u = Q(dt, o), [d, f] = X({
1127
- prop: r,
1128
- onChange: n,
1129
- defaultProp: s ?? "",
1130
- caller: dt
1131
- });
1132
- return /* @__PURE__ */ i(
1133
- Br,
1134
- {
1135
- scope: o,
1136
- isRootMenu: !1,
1137
- value: d,
1138
- dir: u.dir,
1139
- orientation: c,
1140
- rootNavigationMenu: u.rootNavigationMenu,
1141
- onTriggerEnter: (b) => f(b),
1142
- onItemSelect: (b) => f(b),
1143
- onItemDismiss: () => f(""),
1144
- children: /* @__PURE__ */ i(O.div, { "data-orientation": c, ...l, ref: t })
1145
- }
1146
- );
1147
- }
1148
- );
1149
- wo.displayName = dt;
1150
- var Br = (e) => {
1151
- const {
1152
- scope: t,
1153
- isRootMenu: o,
1154
- rootNavigationMenu: r,
1155
- dir: n,
1156
- orientation: s,
1157
- children: c,
1158
- value: l,
1159
- onItemSelect: u,
1160
- onItemDismiss: d,
1161
- onTriggerEnter: f,
1162
- onTriggerLeave: b,
1163
- onContentEnter: w,
1164
- onContentLeave: E
1165
- } = e, [C, v] = a.useState(null), [m, h] = a.useState(/* @__PURE__ */ new Map()), [p, g] = a.useState(null);
1166
- return /* @__PURE__ */ i(
1167
- Is,
1168
- {
1169
- scope: t,
1170
- isRootMenu: o,
1171
- rootNavigationMenu: r,
1172
- value: l,
1173
- previousValue: jn(l),
1174
- baseId: te(),
1175
- dir: n,
1176
- orientation: s,
1177
- viewport: C,
1178
- onViewportChange: v,
1179
- indicatorTrack: p,
1180
- onIndicatorTrackChange: g,
1181
- onTriggerEnter: ee(f),
1182
- onTriggerLeave: ee(b),
1183
- onContentEnter: ee(w),
1184
- onContentLeave: ee(E),
1185
- onItemSelect: ee(u),
1186
- onItemDismiss: ee(d),
1187
- onViewportContentChange: a.useCallback((y, R) => {
1188
- h((P) => (P.set(y, R), new Map(P)));
1189
- }, []),
1190
- onViewportContentRemove: a.useCallback((y) => {
1191
- h((R) => R.has(y) ? (R.delete(y), new Map(R)) : R);
1192
- }, []),
1193
- children: /* @__PURE__ */ i(Co.Provider, { scope: t, children: /* @__PURE__ */ i(Ms, { scope: t, items: m, children: c }) })
1194
- }
1195
- );
1196
- }, Hr = "NavigationMenuList", yo = a.forwardRef(
1197
- (e, t) => {
1198
- const { __scopeNavigationMenu: o, ...r } = e, n = Q(Hr, o), s = /* @__PURE__ */ i(O.ul, { "data-orientation": n.orientation, ...r, ref: t });
1199
- return /* @__PURE__ */ i(O.div, { style: { position: "relative" }, ref: n.onIndicatorTrackChange, children: /* @__PURE__ */ i(Co.Slot, { scope: o, children: n.isRootMenu ? /* @__PURE__ */ i(Wr, { asChild: !0, children: s }) : s }) });
1200
- }
1201
- );
1202
- yo.displayName = Hr;
1203
- var jr = "NavigationMenuItem", [xs, zr] = ho(jr), Eo = a.forwardRef(
1204
- (e, t) => {
1205
- const { __scopeNavigationMenu: o, value: r, ...n } = e, s = te(), c = r || s || "LEGACY_REACT_AUTO_VALUE", l = a.useRef(null), u = a.useRef(null), d = a.useRef(null), f = a.useRef(() => {
1206
- }), b = a.useRef(!1), w = a.useCallback((C = "start") => {
1207
- if (l.current) {
1208
- f.current();
1209
- const v = pt(l.current);
1210
- v.length && Ao(C === "start" ? v : v.reverse());
1211
- }
1212
- }, []), E = a.useCallback(() => {
1213
- if (l.current) {
1214
- const C = pt(l.current);
1215
- C.length && (f.current = Ls(C));
1216
- }
1217
- }, []);
1218
- return /* @__PURE__ */ i(
1219
- xs,
1220
- {
1221
- scope: o,
1222
- value: c,
1223
- triggerRef: u,
1224
- contentRef: l,
1225
- focusProxyRef: d,
1226
- wasEscapeCloseRef: b,
1227
- onEntryKeyDown: w,
1228
- onFocusProxyEnter: w,
1229
- onRootContentClose: E,
1230
- onContentFocusOutside: E,
1231
- children: /* @__PURE__ */ i(O.li, { ...n, ref: t })
1232
- }
1233
- );
1234
- }
1235
- );
1236
- Eo.displayName = jr;
1237
- var ft = "NavigationMenuTrigger", Ro = a.forwardRef((e, t) => {
1238
- const { __scopeNavigationMenu: o, disabled: r, ...n } = e, s = Q(ft, e.__scopeNavigationMenu), c = zr(ft, e.__scopeNavigationMenu), l = a.useRef(null), u = K(l, c.triggerRef, t), d = Yr(s.baseId, c.value), f = Xr(s.baseId, c.value), b = a.useRef(!1), w = a.useRef(!1), E = c.value === s.value;
1239
- return /* @__PURE__ */ Ie(_e, { children: [
1240
- /* @__PURE__ */ i(Co.ItemSlot, { scope: o, value: c.value, children: /* @__PURE__ */ i(qr, { asChild: !0, children: /* @__PURE__ */ i(
1241
- O.button,
1242
- {
1243
- id: d,
1244
- disabled: r,
1245
- "data-disabled": r ? "" : void 0,
1246
- "data-state": No(E),
1247
- "aria-expanded": E,
1248
- "aria-controls": f,
1249
- ...n,
1250
- ref: u,
1251
- onPointerEnter: A(e.onPointerEnter, () => {
1252
- w.current = !1, c.wasEscapeCloseRef.current = !1;
1253
- }),
1254
- onPointerMove: A(
1255
- e.onPointerMove,
1256
- Ve(() => {
1257
- r || w.current || c.wasEscapeCloseRef.current || b.current || (s.onTriggerEnter(c.value), b.current = !0);
1258
- })
1259
- ),
1260
- onPointerLeave: A(
1261
- e.onPointerLeave,
1262
- Ve(() => {
1263
- r || (s.onTriggerLeave(), b.current = !1);
1264
- })
1265
- ),
1266
- onClick: A(e.onClick, () => {
1267
- s.onItemSelect(c.value), w.current = E;
1268
- }),
1269
- onKeyDown: A(e.onKeyDown, (C) => {
1270
- const m = { horizontal: "ArrowDown", vertical: s.dir === "rtl" ? "ArrowLeft" : "ArrowRight" }[s.orientation];
1271
- E && C.key === m && (c.onEntryKeyDown(), C.preventDefault());
1272
- })
1273
- }
1274
- ) }) }),
1275
- E && /* @__PURE__ */ Ie(_e, { children: [
1276
- /* @__PURE__ */ i(
1277
- Bn,
1278
- {
1279
- "aria-hidden": !0,
1280
- tabIndex: 0,
1281
- ref: c.focusProxyRef,
1282
- onFocus: (C) => {
1283
- const v = c.contentRef.current, m = C.relatedTarget, h = m === l.current, p = v == null ? void 0 : v.contains(m);
1284
- (h || !p) && c.onFocusProxyEnter(h ? "start" : "end");
1285
- }
1286
- }
1287
- ),
1288
- s.viewport && /* @__PURE__ */ i("span", { "aria-owns": f })
1289
- ] })
1290
- ] });
1291
- });
1292
- Ro.displayName = ft;
1293
- var Ss = "NavigationMenuLink", ur = "navigationMenu.linkSelect", _o = a.forwardRef(
1294
- (e, t) => {
1295
- const { __scopeNavigationMenu: o, active: r, onSelect: n, ...s } = e;
1296
- return /* @__PURE__ */ i(qr, { asChild: !0, children: /* @__PURE__ */ i(
1297
- O.a,
1298
- {
1299
- "data-active": r ? "" : void 0,
1300
- "aria-current": r ? "page" : void 0,
1301
- ...s,
1302
- ref: t,
1303
- onClick: A(
1304
- e.onClick,
1305
- (c) => {
1306
- const l = c.target, u = new CustomEvent(ur, {
1307
- bubbles: !0,
1308
- cancelable: !0
1309
- });
1310
- if (l.addEventListener(ur, (d) => n == null ? void 0 : n(d), { once: !0 }), rt(l, u), !u.defaultPrevented && !c.metaKey) {
1311
- const d = new CustomEvent(Le, {
1312
- bubbles: !0,
1313
- cancelable: !0
1314
- });
1315
- rt(l, d);
1316
- }
1317
- },
1318
- { checkForDefaultPrevented: !1 }
1319
- )
1320
- }
1321
- ) });
1322
- }
1323
- );
1324
- _o.displayName = Ss;
1325
- var Io = "NavigationMenuIndicator", Mo = a.forwardRef((e, t) => {
1326
- const { forceMount: o, ...r } = e, n = Q(Io, e.__scopeNavigationMenu), s = !!n.value;
1327
- return n.indicatorTrack ? Qn.createPortal(
1328
- /* @__PURE__ */ i(Ce, { present: o || s, children: /* @__PURE__ */ i(As, { ...r, ref: t }) }),
1329
- n.indicatorTrack
1330
- ) : null;
1331
- });
1332
- Mo.displayName = Io;
1333
- var As = a.forwardRef((e, t) => {
1334
- const { __scopeNavigationMenu: o, ...r } = e, n = Q(Io, o), s = Kr(o), [c, l] = a.useState(
1335
- null
1336
- ), [u, d] = a.useState(null), f = n.orientation === "horizontal", b = !!n.value;
1337
- a.useEffect(() => {
1338
- var v;
1339
- const C = (v = s().find((m) => m.value === n.value)) == null ? void 0 : v.ref.current;
1340
- C && l(C);
1341
- }, [s, n.value]);
1342
- const w = () => {
1343
- c && d({
1344
- size: f ? c.offsetWidth : c.offsetHeight,
1345
- offset: f ? c.offsetLeft : c.offsetTop
1346
- });
1347
- };
1348
- return vt(c, w), vt(n.indicatorTrack, w), u ? /* @__PURE__ */ i(
1349
- O.div,
1350
- {
1351
- "aria-hidden": !0,
1352
- "data-state": b ? "visible" : "hidden",
1353
- "data-orientation": n.orientation,
1354
- ...r,
1355
- ref: t,
1356
- style: {
1357
- position: "absolute",
1358
- ...f ? {
1359
- left: 0,
1360
- width: u.size + "px",
1361
- transform: `translateX(${u.offset}px)`
1362
- } : {
1363
- top: 0,
1364
- height: u.size + "px",
1365
- transform: `translateY(${u.offset}px)`
1366
- },
1367
- ...r.style
1368
- }
1369
- }
1370
- ) : null;
1371
- }), be = "NavigationMenuContent", Po = a.forwardRef((e, t) => {
1372
- const { forceMount: o, ...r } = e, n = Q(be, e.__scopeNavigationMenu), s = zr(be, e.__scopeNavigationMenu), c = K(s.contentRef, t), l = s.value === n.value, u = {
1373
- value: s.value,
1374
- triggerRef: s.triggerRef,
1375
- focusProxyRef: s.focusProxyRef,
1376
- wasEscapeCloseRef: s.wasEscapeCloseRef,
1377
- onContentFocusOutside: s.onContentFocusOutside,
1378
- onRootContentClose: s.onRootContentClose,
1379
- ...r
1380
- };
1381
- return n.viewport ? /* @__PURE__ */ i(Ns, { forceMount: o, ...u, ref: c }) : /* @__PURE__ */ i(Ce, { present: o || l, children: /* @__PURE__ */ i(
1382
- Ur,
1383
- {
1384
- "data-state": No(l),
1385
- ...u,
1386
- ref: c,
1387
- onPointerEnter: A(e.onPointerEnter, n.onContentEnter),
1388
- onPointerLeave: A(
1389
- e.onPointerLeave,
1390
- Ve(n.onContentLeave)
1391
- ),
1392
- style: {
1393
- // Prevent interaction when animating out
1394
- pointerEvents: !l && n.isRootMenu ? "none" : void 0,
1395
- ...u.style
1396
- }
1397
- }
1398
- ) });
1399
- });
1400
- Po.displayName = be;
1401
- var Ns = a.forwardRef((e, t) => {
1402
- const o = Q(be, e.__scopeNavigationMenu), { onViewportContentChange: r, onViewportContentRemove: n } = o;
1403
- return ge(() => {
1404
- r(e.value, {
1405
- ref: t,
1406
- ...e
1407
- });
1408
- }, [e, t, r]), ge(() => () => n(e.value), [e.value, n]), null;
1409
- }), Le = "navigationMenu.rootContentDismiss", Ur = a.forwardRef((e, t) => {
1410
- const {
1411
- __scopeNavigationMenu: o,
1412
- value: r,
1413
- triggerRef: n,
1414
- focusProxyRef: s,
1415
- wasEscapeCloseRef: c,
1416
- onRootContentClose: l,
1417
- onContentFocusOutside: u,
1418
- ...d
1419
- } = e, f = Q(be, o), b = a.useRef(null), w = K(b, t), E = Yr(f.baseId, r), C = Xr(f.baseId, r), v = Kr(o), m = a.useRef(null), { onItemDismiss: h } = f;
1420
- a.useEffect(() => {
1421
- const g = b.current;
1422
- if (f.isRootMenu && g) {
1423
- const y = () => {
1424
- var R;
1425
- h(), l(), g.contains(document.activeElement) && ((R = n.current) == null || R.focus());
1426
- };
1427
- return g.addEventListener(Le, y), () => g.removeEventListener(Le, y);
1428
- }
1429
- }, [f.isRootMenu, e.value, n, h, l]);
1430
- const p = a.useMemo(() => {
1431
- const y = v().map((T) => T.value);
1432
- f.dir === "rtl" && y.reverse();
1433
- const R = y.indexOf(f.value), P = y.indexOf(f.previousValue), D = r === f.value, F = P === y.indexOf(r);
1434
- if (!D && !F) return m.current;
1435
- const I = (() => {
1436
- if (R !== P) {
1437
- if (D && P !== -1) return R > P ? "from-end" : "from-start";
1438
- if (F && R !== -1) return R > P ? "to-start" : "to-end";
1439
- }
1440
- return null;
1441
- })();
1442
- return m.current = I, I;
1443
- }, [f.previousValue, f.value, f.dir, v, r]);
1444
- return /* @__PURE__ */ i(Wr, { asChild: !0, children: /* @__PURE__ */ i(
1445
- Hn,
1446
- {
1447
- id: C,
1448
- "aria-labelledby": E,
1449
- "data-motion": p,
1450
- "data-orientation": f.orientation,
1451
- ...d,
1452
- ref: w,
1453
- disableOutsidePointerEvents: !1,
1454
- onDismiss: () => {
1455
- var y;
1456
- const g = new Event(Le, {
1457
- bubbles: !0,
1458
- cancelable: !0
1459
- });
1460
- (y = b.current) == null || y.dispatchEvent(g);
1461
- },
1462
- onFocusOutside: A(e.onFocusOutside, (g) => {
1463
- var R;
1464
- u();
1465
- const y = g.target;
1466
- (R = f.rootNavigationMenu) != null && R.contains(y) && g.preventDefault();
1467
- }),
1468
- onPointerDownOutside: A(e.onPointerDownOutside, (g) => {
1469
- var D;
1470
- const y = g.target, R = v().some((F) => {
1471
- var I;
1472
- return (I = F.ref.current) == null ? void 0 : I.contains(y);
1473
- }), P = f.isRootMenu && ((D = f.viewport) == null ? void 0 : D.contains(y));
1474
- (R || P || !f.isRootMenu) && g.preventDefault();
1475
- }),
1476
- onKeyDown: A(e.onKeyDown, (g) => {
1477
- var P;
1478
- const y = g.altKey || g.ctrlKey || g.metaKey;
1479
- if (g.key === "Tab" && !y) {
1480
- const D = pt(g.currentTarget), F = document.activeElement, I = D.findIndex((x) => x === F), _ = g.shiftKey ? D.slice(0, I).reverse() : D.slice(I + 1, D.length);
1481
- Ao(_) ? g.preventDefault() : (P = s.current) == null || P.focus();
1482
- }
1483
- }),
1484
- onEscapeKeyDown: A(e.onEscapeKeyDown, (g) => {
1485
- c.current = !0;
1486
- })
1487
- }
1488
- ) });
1489
- }), xo = "NavigationMenuViewport", So = a.forwardRef((e, t) => {
1490
- const { forceMount: o, ...r } = e, s = !!Q(xo, e.__scopeNavigationMenu).value;
1491
- return /* @__PURE__ */ i(Ce, { present: o || s, children: /* @__PURE__ */ i(Fs, { ...r, ref: t }) });
1492
- });
1493
- So.displayName = xo;
1494
- var Fs = a.forwardRef((e, t) => {
1495
- const { __scopeNavigationMenu: o, children: r, ...n } = e, s = Q(xo, o), c = K(t, s.onViewportChange), l = Ps(
1496
- be,
1497
- e.__scopeNavigationMenu
1498
- ), [u, d] = a.useState(null), [f, b] = a.useState(null), w = u ? (u == null ? void 0 : u.width) + "px" : void 0, E = u ? (u == null ? void 0 : u.height) + "px" : void 0, C = !!s.value, v = C ? s.value : s.previousValue;
1499
- return vt(f, () => {
1500
- f && d({ width: f.offsetWidth, height: f.offsetHeight });
1501
- }), /* @__PURE__ */ i(
1502
- O.div,
1503
- {
1504
- "data-state": No(C),
1505
- "data-orientation": s.orientation,
1506
- ...n,
1507
- ref: c,
1508
- style: {
1509
- // Prevent interaction when animating out
1510
- pointerEvents: !C && s.isRootMenu ? "none" : void 0,
1511
- "--radix-navigation-menu-viewport-width": w,
1512
- "--radix-navigation-menu-viewport-height": E,
1513
- ...n.style
1514
- },
1515
- onPointerEnter: A(e.onPointerEnter, s.onContentEnter),
1516
- onPointerLeave: A(e.onPointerLeave, Ve(s.onContentLeave)),
1517
- children: Array.from(l.items).map(([h, { ref: p, forceMount: g, ...y }]) => {
1518
- const R = v === h;
1519
- return /* @__PURE__ */ i(Ce, { present: g || R, children: /* @__PURE__ */ i(
1520
- Ur,
1521
- {
1522
- ...y,
1523
- ref: zn(p, (P) => {
1524
- R && P && b(P);
1525
- })
1526
- }
1527
- ) }, h);
1528
- })
1529
- }
1530
- );
1531
- }), Os = "FocusGroup", Wr = a.forwardRef(
1532
- (e, t) => {
1533
- const { __scopeNavigationMenu: o, ...r } = e, n = Q(Os, o);
1534
- return /* @__PURE__ */ i(ut.Provider, { scope: o, children: /* @__PURE__ */ i(ut.Slot, { scope: o, children: /* @__PURE__ */ i(O.div, { dir: n.dir, ...r, ref: t }) }) });
1535
- }
1536
- ), dr = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"], Ds = "FocusGroupItem", qr = a.forwardRef(
1537
- (e, t) => {
1538
- const { __scopeNavigationMenu: o, ...r } = e, n = Es(o), s = Q(Ds, o);
1539
- return /* @__PURE__ */ i(ut.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
1540
- O.button,
1541
- {
1542
- ...r,
1543
- ref: t,
1544
- onKeyDown: A(e.onKeyDown, (c) => {
1545
- if (["Home", "End", ...dr].includes(c.key)) {
1546
- let u = n().map((b) => b.ref.current);
1547
- if ([s.dir === "rtl" ? "ArrowRight" : "ArrowLeft", "ArrowUp", "End"].includes(c.key) && u.reverse(), dr.includes(c.key)) {
1548
- const b = u.indexOf(c.currentTarget);
1549
- u = u.slice(b + 1);
1550
- }
1551
- setTimeout(() => Ao(u)), c.preventDefault();
1552
- }
1553
- })
1554
- }
1555
- ) });
1556
- }
1557
- );
1558
- function pt(e) {
1559
- const t = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
1560
- acceptNode: (r) => {
1561
- const n = r.tagName === "INPUT" && r.type === "hidden";
1562
- return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
1563
- }
1564
- });
1565
- for (; o.nextNode(); ) t.push(o.currentNode);
1566
- return t;
1567
- }
1568
- function Ao(e) {
1569
- const t = document.activeElement;
1570
- return e.some((o) => o === t ? !0 : (o.focus(), document.activeElement !== t));
1571
- }
1572
- function Ls(e) {
1573
- return e.forEach((t) => {
1574
- t.dataset.tabindex = t.getAttribute("tabindex") || "", t.setAttribute("tabindex", "-1");
1575
- }), () => {
1576
- e.forEach((t) => {
1577
- const o = t.dataset.tabindex;
1578
- t.setAttribute("tabindex", o);
1579
- });
1580
- };
1581
- }
1582
- function vt(e, t) {
1583
- const o = ee(t);
1584
- ge(() => {
1585
- let r = 0;
1586
- if (e) {
1587
- const n = new ResizeObserver(() => {
1588
- cancelAnimationFrame(r), r = window.requestAnimationFrame(o);
1589
- });
1590
- return n.observe(e), () => {
1591
- window.cancelAnimationFrame(r), n.unobserve(e);
1592
- };
1593
- }
1594
- }, [e, o]);
1595
- }
1596
- function No(e) {
1597
- return e ? "open" : "closed";
1598
- }
1599
- function Yr(e, t) {
1600
- return `${e}-trigger-${t}`;
1601
- }
1602
- function Xr(e, t) {
1603
- return `${e}-content-${t}`;
1604
- }
1605
- function Ve(e) {
1606
- return (t) => t.pointerType === "mouse" ? e(t) : void 0;
1607
- }
1608
- var ks = To, Vs = wo, Gs = yo, $s = Eo, Ks = Ro, Bs = _o, Hs = Mo, js = Po, zs = So;
1609
- const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1610
- __proto__: null,
1611
- Content: js,
1612
- Indicator: Hs,
1613
- Item: $s,
1614
- Link: Bs,
1615
- List: Gs,
1616
- NavigationMenu: To,
1617
- NavigationMenuContent: Po,
1618
- NavigationMenuIndicator: Mo,
1619
- NavigationMenuItem: Eo,
1620
- NavigationMenuLink: _o,
1621
- NavigationMenuList: yo,
1622
- NavigationMenuSub: wo,
1623
- NavigationMenuTrigger: Ro,
1624
- NavigationMenuViewport: So,
1625
- Root: ks,
1626
- Sub: Vs,
1627
- Trigger: Ks,
1628
- Viewport: zs,
1629
- createNavigationMenuScope: _s
1630
- }, Symbol.toStringTag, { value: "Module" }));
1631
- var Ge = {
1038
+ var Ie = {
1632
1039
  numeric: {
1633
1040
  type: "numeric",
1634
1041
  regexp: /[^\d]/g,
@@ -1648,181 +1055,181 @@ var Ge = {
1648
1055
  inputMode: "text"
1649
1056
  },
1650
1057
  none: null
1651
- }, Fo = "OneTimePasswordField", [mt, { useCollection: Us, createCollectionScope: Ws, useInitCollection: qs }] = Un(Fo), [Ys] = oe(Fo, [
1652
- Ws,
1653
- ue
1654
- ]), Zr = ue(), [Xs, Jr] = Ys(Fo), fr = a.forwardRef(
1058
+ }, er = "OneTimePasswordField", [We, { useCollection: va, createCollectionScope: ba, useInitCollection: ga }] = ko(er), [ha] = se(er, [
1059
+ ba,
1060
+ de
1061
+ ]), to = de(), [Ca, ro] = ha(er), Ir = a.forwardRef(
1655
1062
  function({
1656
- __scopeOneTimePasswordField: t,
1657
- defaultValue: o,
1658
- value: r,
1063
+ __scopeOneTimePasswordField: r,
1064
+ defaultValue: t,
1065
+ value: o,
1659
1066
  onValueChange: n,
1660
1067
  autoSubmit: s = !1,
1661
- children: c,
1662
- onPaste: l,
1663
- onAutoSubmit: u,
1068
+ children: u,
1069
+ onPaste: c,
1070
+ onAutoSubmit: f,
1664
1071
  disabled: d = !1,
1665
- readOnly: f = !1,
1666
- autoComplete: b = "one-time-code",
1667
- autoFocus: w = !1,
1668
- form: E,
1669
- name: C,
1670
- placeholder: v,
1671
- type: m = "text",
1072
+ readOnly: b = !1,
1073
+ autoComplete: w = "one-time-code",
1074
+ autoFocus: I = !1,
1075
+ form: R,
1076
+ name: _,
1077
+ placeholder: m,
1078
+ type: p = "text",
1672
1079
  // TODO: Change default to vertical when inputs use vertical writing mode
1673
- orientation: h = "horizontal",
1674
- dir: p,
1675
- validationType: g = "numeric",
1676
- sanitizeValue: y,
1677
- ...R
1678
- }, P) {
1679
- var ye;
1680
- const D = Zr(t), F = he(p), I = qs(), [T] = I, _ = Ge[g] ? Ge[g] : null, x = a.useCallback(
1681
- (N) => {
1682
- if (Array.isArray(N) ? N = N.map(mr).join("") : N = mr(N), _) {
1683
- const B = new RegExp(_.regexp);
1684
- N = N.replace(B, "");
1685
- } else y && (N = y(N));
1686
- return N.split("");
1080
+ orientation: T = "horizontal",
1081
+ dir: l,
1082
+ validationType: h = "numeric",
1083
+ sanitizeValue: S,
1084
+ ...F
1085
+ }, x) {
1086
+ var me;
1087
+ const V = to(r), N = Ae(l), M = ga(), [v] = M, g = Ie[h] ? Ie[h] : null, y = a.useCallback(
1088
+ (A) => {
1089
+ if (Array.isArray(A) ? A = A.map(xr).join("") : A = xr(A), g) {
1090
+ const $ = new RegExp(g.regexp);
1091
+ A = A.replace($, "");
1092
+ } else S && (A = S(A));
1093
+ return A.split("");
1687
1094
  },
1688
- [_, y]
1689
- ), L = a.useMemo(() => r != null ? x(r) : void 0, [r, x]), [M, k] = X({
1095
+ [g, S]
1096
+ ), O = a.useMemo(() => o != null ? y(o) : void 0, [o, y]), [C, L] = ie({
1690
1097
  caller: "OneTimePasswordField",
1691
- prop: L,
1692
- defaultProp: o != null ? x(o) : [],
1098
+ prop: O,
1099
+ defaultProp: t != null ? y(t) : [],
1693
1100
  onChange: a.useCallback(
1694
- (N) => n == null ? void 0 : n(N.join("")),
1101
+ (A) => n == null ? void 0 : n(A.join("")),
1695
1102
  [n]
1696
1103
  )
1697
- }), G = Er((N) => {
1698
- var B, Ee, tr, or, rr, nr, ar, sr, ir;
1699
- switch (N.type) {
1104
+ }), k = kr((A) => {
1105
+ var $, ve, gr, hr, Cr, Tr, yr, Er, wr;
1106
+ switch (A.type) {
1700
1107
  case "SET_CHAR": {
1701
- const { index: se, char: q } = N, J = (B = T.at(se)) == null ? void 0 : B.element;
1702
- if (M[se] === q) {
1703
- const le = J && ((Ee = T.from(J, 1)) == null ? void 0 : Ee.element);
1704
- ie(le);
1108
+ const { index: te, char: U } = A, Z = ($ = v.at(te)) == null ? void 0 : $.element;
1109
+ if (C[te] === U) {
1110
+ const ne = Z && ((ve = v.from(Z, 1)) == null ? void 0 : ve.element);
1111
+ re(ne);
1705
1112
  return;
1706
1113
  }
1707
- if (q === "")
1114
+ if (U === "")
1708
1115
  return;
1709
- if (_) {
1710
- const le = new RegExp(_.regexp);
1711
- if (q.replace(le, "") !== q)
1116
+ if (g) {
1117
+ const ne = new RegExp(g.regexp);
1118
+ if (U.replace(ne, "") !== U)
1712
1119
  return;
1713
1120
  }
1714
- if (M.length >= T.size) {
1715
- const le = [...M];
1716
- le[se] = q, me(() => k(le));
1717
- const Fe = J && ((tr = T.from(J, 1)) == null ? void 0 : tr.element);
1718
- ie(Fe);
1121
+ if (C.length >= v.size) {
1122
+ const ne = [...C];
1123
+ ne[te] = U, ue(() => L(ne));
1124
+ const ye = Z && ((gr = v.from(Z, 1)) == null ? void 0 : gr.element);
1125
+ re(ye);
1719
1126
  return;
1720
1127
  }
1721
- const ve = [...M];
1722
- ve[se] = q;
1723
- const et = (or = T.at(-1)) == null ? void 0 : or.element;
1724
- if (me(() => k(ve)), J !== et) {
1725
- const le = J && ((rr = T.from(J, 1)) == null ? void 0 : rr.element);
1726
- ie(le);
1128
+ const le = [...C];
1129
+ le[te] = U;
1130
+ const Ve = (hr = v.at(-1)) == null ? void 0 : hr.element;
1131
+ if (ue(() => L(le)), Z !== Ve) {
1132
+ const ne = Z && ((Cr = v.from(Z, 1)) == null ? void 0 : Cr.element);
1133
+ re(ne);
1727
1134
  } else
1728
- J == null || J.select();
1135
+ Z == null || Z.select();
1729
1136
  return;
1730
1137
  }
1731
1138
  case "CLEAR_CHAR": {
1732
- const { index: se, reason: q } = N;
1733
- if (!M[se])
1139
+ const { index: te, reason: U } = A;
1140
+ if (!C[te])
1734
1141
  return;
1735
- const J = M.filter((le, Fe) => Fe !== se), ve = (nr = T.at(se)) == null ? void 0 : nr.element, et = ve && ((ar = T.from(ve, -1)) == null ? void 0 : ar.element);
1736
- me(() => k(J)), q === "Backspace" ? ie(et) : (q === "Delete" || q === "Cut") && ie(ve);
1142
+ const Z = C.filter((ne, ye) => ye !== te), le = (Tr = v.at(te)) == null ? void 0 : Tr.element, Ve = le && ((yr = v.from(le, -1)) == null ? void 0 : yr.element);
1143
+ ue(() => L(Z)), U === "Backspace" ? re(Ve) : (U === "Delete" || U === "Cut") && re(le);
1737
1144
  return;
1738
1145
  }
1739
1146
  case "CLEAR": {
1740
- if (M.length === 0)
1147
+ if (C.length === 0)
1741
1148
  return;
1742
- N.reason === "Backspace" || N.reason === "Delete" ? (me(() => k([])), ie((sr = T.at(0)) == null ? void 0 : sr.element)) : k([]);
1149
+ A.reason === "Backspace" || A.reason === "Delete" ? (ue(() => L([])), re((Er = v.at(0)) == null ? void 0 : Er.element)) : L([]);
1743
1150
  return;
1744
1151
  }
1745
1152
  case "PASTE": {
1746
- const { value: se } = N, q = x(se);
1747
- if (!q)
1153
+ const { value: te } = A, U = y(te);
1154
+ if (!U)
1748
1155
  return;
1749
- me(() => k(q)), ie((ir = T.at(q.length - 1)) == null ? void 0 : ir.element);
1156
+ ue(() => L(U)), re((wr = v.at(U.length - 1)) == null ? void 0 : wr.element);
1750
1157
  return;
1751
1158
  }
1752
1159
  }
1753
- }), Z = a.useRef(_);
1160
+ }), X = a.useRef(g);
1754
1161
  a.useEffect(() => {
1755
- var N;
1756
- _ && ((N = Z.current) == null ? void 0 : N.type) !== _.type && (Z.current = _, k(x(M.join(""))));
1757
- }, [x, k, _, M]);
1758
- const U = a.useRef(null), ne = a.useRef(null), Y = a.useRef(null), we = K(P, Y), ce = (ye = T.at(0)) == null ? void 0 : ye.element, W = a.useCallback(() => {
1759
- var B;
1760
- let N;
1761
- if (E) {
1762
- const Ee = (((B = Y.current) == null ? void 0 : B.ownerDocument) ?? document).getElementById(E);
1763
- Zs(Ee) && (N = Ee);
1764
- } else U.current ? N = U.current.form : ce && (N = ce.form);
1765
- return N ?? null;
1766
- }, [E, ce]), S = a.useCallback(() => {
1767
- const N = W();
1768
- N == null || N.requestSubmit();
1769
- }, [W]);
1162
+ var A;
1163
+ g && ((A = X.current) == null ? void 0 : A.type) !== g.type && (X.current = g, L(y(C.join(""))));
1164
+ }, [y, L, g, C]);
1165
+ const H = a.useRef(null), Q = a.useRef(null), W = a.useRef(null), pe = Y(x, W), oe = (me = v.at(0)) == null ? void 0 : me.element, z = a.useCallback(() => {
1166
+ var $;
1167
+ let A;
1168
+ if (R) {
1169
+ const ve = ((($ = W.current) == null ? void 0 : $.ownerDocument) ?? document).getElementById(R);
1170
+ Ta(ve) && (A = ve);
1171
+ } else H.current ? A = H.current.form : oe && (A = oe.form);
1172
+ return A ?? null;
1173
+ }, [R, oe]), E = a.useCallback(() => {
1174
+ const A = z();
1175
+ A == null || A.requestSubmit();
1176
+ }, [z]);
1770
1177
  a.useEffect(() => {
1771
- const N = W();
1772
- if (N) {
1773
- const B = () => G({ type: "CLEAR", reason: "Reset" });
1774
- return N.addEventListener("reset", B), () => N.removeEventListener("reset", B);
1178
+ const A = z();
1179
+ if (A) {
1180
+ const $ = () => k({ type: "CLEAR", reason: "Reset" });
1181
+ return A.addEventListener("reset", $), () => A.removeEventListener("reset", $);
1775
1182
  }
1776
- }, [G, W]);
1777
- const H = M.join(""), j = a.useRef(H), $ = T.size;
1183
+ }, [k, z]);
1184
+ const K = C.join(""), B = a.useRef(K), G = v.size;
1778
1185
  a.useEffect(() => {
1779
- const N = j.current;
1780
- j.current = H, N !== H && s && M.every((B) => B !== "") && M.length === $ && (u == null || u(M.join("")), S());
1781
- }, [S, s, H, $, u, M]);
1782
- const ae = wr();
1186
+ const A = B.current;
1187
+ B.current = K, A !== K && s && C.every(($) => $ !== "") && C.length === G && (f == null || f(C.join("")), E());
1188
+ }, [E, s, K, G, f, C]);
1189
+ const ee = Or();
1783
1190
  return /* @__PURE__ */ i(
1784
- Xs,
1191
+ Ca,
1785
1192
  {
1786
- scope: t,
1787
- value: M,
1788
- attemptSubmit: S,
1193
+ scope: r,
1194
+ value: C,
1195
+ attemptSubmit: E,
1789
1196
  disabled: d,
1790
- readOnly: f,
1791
- autoComplete: b,
1792
- autoFocus: w,
1793
- form: E,
1794
- name: C,
1795
- placeholder: v,
1796
- type: m,
1797
- hiddenInputRef: U,
1798
- userActionRef: ne,
1799
- dispatch: G,
1800
- validationType: g,
1801
- orientation: h,
1802
- isHydrated: ae,
1803
- sanitizeValue: x,
1804
- children: /* @__PURE__ */ i(mt.Provider, { scope: t, state: I, children: /* @__PURE__ */ i(mt.Slot, { scope: t, children: /* @__PURE__ */ i(
1805
- Be,
1197
+ readOnly: b,
1198
+ autoComplete: w,
1199
+ autoFocus: I,
1200
+ form: R,
1201
+ name: _,
1202
+ placeholder: m,
1203
+ type: p,
1204
+ hiddenInputRef: H,
1205
+ userActionRef: Q,
1206
+ dispatch: k,
1207
+ validationType: h,
1208
+ orientation: T,
1209
+ isHydrated: ee,
1210
+ sanitizeValue: y,
1211
+ children: /* @__PURE__ */ i(We.Provider, { scope: r, state: M, children: /* @__PURE__ */ i(We.Slot, { scope: r, children: /* @__PURE__ */ i(
1212
+ nt,
1806
1213
  {
1807
1214
  asChild: !0,
1808
- ...D,
1809
- orientation: h,
1810
- dir: F,
1215
+ ...V,
1216
+ orientation: T,
1217
+ dir: N,
1811
1218
  children: /* @__PURE__ */ i(
1812
- Tr.div,
1219
+ Nr.div,
1813
1220
  {
1814
- ...R,
1221
+ ...F,
1815
1222
  role: "group",
1816
- ref: we,
1817
- onPaste: A(
1818
- l,
1819
- (N) => {
1820
- N.preventDefault();
1821
- const B = N.clipboardData.getData("Text");
1822
- G({ type: "PASTE", value: B });
1223
+ ref: pe,
1224
+ onPaste: P(
1225
+ c,
1226
+ (A) => {
1227
+ A.preventDefault();
1228
+ const $ = A.clipboardData.getData("Text");
1229
+ k({ type: "PASTE", value: $ });
1823
1230
  }
1824
1231
  ),
1825
- children: c
1232
+ children: u
1826
1233
  }
1827
1234
  )
1828
1235
  }
@@ -1830,16 +1237,16 @@ var Ge = {
1830
1237
  }
1831
1238
  );
1832
1239
  }
1833
- ), pr = a.forwardRef(function({ __scopeOneTimePasswordField: t, ...o }, r) {
1834
- const { value: n, hiddenInputRef: s, name: c } = Jr(
1240
+ ), Ar = a.forwardRef(function({ __scopeOneTimePasswordField: r, ...t }, o) {
1241
+ const { value: n, hiddenInputRef: s, name: u } = ro(
1835
1242
  "OneTimePasswordFieldHiddenInput",
1836
- t
1837
- ), l = K(s, r);
1243
+ r
1244
+ ), c = Y(s, o);
1838
1245
  return /* @__PURE__ */ i(
1839
1246
  "input",
1840
1247
  {
1841
- ref: l,
1842
- name: c,
1248
+ ref: c,
1249
+ name: u,
1843
1250
  value: n.join("").trim(),
1844
1251
  autoComplete: "off",
1845
1252
  autoFocus: !1,
@@ -1847,193 +1254,193 @@ var Ge = {
1847
1254
  autoCorrect: "off",
1848
1255
  autoSave: "off",
1849
1256
  spellCheck: !1,
1850
- ...o,
1257
+ ...t,
1851
1258
  type: "hidden",
1852
1259
  readOnly: !0
1853
1260
  }
1854
1261
  );
1855
- }), vr = a.forwardRef(function({
1856
- __scopeOneTimePasswordField: t,
1857
- onInvalidChange: o,
1858
- index: r,
1262
+ }), Sr = a.forwardRef(function({
1263
+ __scopeOneTimePasswordField: r,
1264
+ onInvalidChange: t,
1265
+ index: o,
1859
1266
  ...n
1860
1267
  }, s) {
1861
1268
  const {
1862
- value: c,
1863
- defaultValue: l,
1864
- disabled: u,
1269
+ value: u,
1270
+ defaultValue: c,
1271
+ disabled: f,
1865
1272
  readOnly: d,
1866
- autoComplete: f,
1867
- autoFocus: b,
1868
- form: w,
1869
- name: E,
1870
- placeholder: C,
1871
- type: v,
1872
- ...m
1873
- } = n, h = Jr(
1273
+ autoComplete: b,
1274
+ autoFocus: w,
1275
+ form: I,
1276
+ name: R,
1277
+ placeholder: _,
1278
+ type: m,
1279
+ ...p
1280
+ } = n, T = ro(
1874
1281
  "OneTimePasswordFieldInput",
1875
- t
1876
- ), { dispatch: p, userActionRef: g, validationType: y, isHydrated: R } = h, P = Us(t), D = Zr(t), F = a.useRef(null), [I, T] = a.useState(null), _ = r ?? (I ? P.indexOf(I) : -1), x = r != null || R;
1877
- let L;
1878
- x && h.placeholder && h.value.length === 0 && (L = h.placeholder[_]);
1879
- const M = K(s, F, T), k = h.value[_] ?? "", G = a.useRef(null);
1282
+ r
1283
+ ), { dispatch: l, userActionRef: h, validationType: S, isHydrated: F } = T, x = va(r), V = to(r), N = a.useRef(null), [M, v] = a.useState(null), g = o ?? (M ? x.indexOf(M) : -1), y = o != null || F;
1284
+ let O;
1285
+ y && T.placeholder && T.value.length === 0 && (O = T.placeholder[g]);
1286
+ const C = Y(s, N, v), L = T.value[g] ?? "", k = a.useRef(null);
1880
1287
  a.useEffect(() => () => {
1881
- window.clearTimeout(G.current);
1288
+ window.clearTimeout(k.current);
1882
1289
  }, []);
1883
- const Z = h.value.join("").trim(), U = Wn(Z.length, [0, P.size - 1]), ne = _ <= U, Y = y in Ge ? Ge[y] : void 0;
1884
- return /* @__PURE__ */ i(mt.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
1885
- xe,
1290
+ const X = T.value.join("").trim(), H = Vo(X.length, [0, x.size - 1]), Q = g <= H, W = S in Ie ? Ie[S] : void 0;
1291
+ return /* @__PURE__ */ i(We.ItemSlot, { scope: r, children: /* @__PURE__ */ i(
1292
+ Se,
1886
1293
  {
1887
- ...D,
1294
+ ...V,
1888
1295
  asChild: !0,
1889
- focusable: !h.disabled && ne,
1890
- active: _ === U,
1891
- children: ({ hasTabStop: we, isCurrentTabStop: ce }) => {
1892
- const W = we ? ce : _ === 0;
1296
+ focusable: !T.disabled && Q,
1297
+ active: g === H,
1298
+ children: ({ hasTabStop: pe, isCurrentTabStop: oe }) => {
1299
+ const z = pe ? oe : g === 0;
1893
1300
  return /* @__PURE__ */ i(
1894
- Tr.input,
1301
+ Nr.input,
1895
1302
  {
1896
- ref: M,
1897
- type: h.type,
1898
- "aria-label": `Character ${_ + 1} of ${P.size}`,
1899
- autoComplete: W ? h.autoComplete : "off",
1900
- "data-1p-ignore": W ? void 0 : "true",
1901
- "data-lpignore": W ? void 0 : "true",
1902
- "data-protonpass-ignore": W ? void 0 : "true",
1903
- "data-bwignore": W ? void 0 : "true",
1904
- inputMode: Y == null ? void 0 : Y.inputMode,
1303
+ ref: C,
1304
+ type: T.type,
1305
+ "aria-label": `Character ${g + 1} of ${x.size}`,
1306
+ autoComplete: z ? T.autoComplete : "off",
1307
+ "data-1p-ignore": z ? void 0 : "true",
1308
+ "data-lpignore": z ? void 0 : "true",
1309
+ "data-protonpass-ignore": z ? void 0 : "true",
1310
+ "data-bwignore": z ? void 0 : "true",
1311
+ inputMode: W == null ? void 0 : W.inputMode,
1905
1312
  maxLength: 1,
1906
- pattern: Y == null ? void 0 : Y.pattern,
1907
- readOnly: h.readOnly,
1908
- value: k,
1909
- placeholder: L,
1313
+ pattern: W == null ? void 0 : W.pattern,
1314
+ readOnly: T.readOnly,
1315
+ value: L,
1316
+ placeholder: O,
1910
1317
  "data-radix-otp-input": "",
1911
- "data-radix-index": _,
1912
- ...m,
1913
- onFocus: A(n.onFocus, (S) => {
1914
- S.currentTarget.select();
1318
+ "data-radix-index": g,
1319
+ ...p,
1320
+ onFocus: P(n.onFocus, (E) => {
1321
+ E.currentTarget.select();
1915
1322
  }),
1916
- onCut: A(n.onCut, (S) => {
1917
- S.currentTarget.value !== "" && (g.current = {
1323
+ onCut: P(n.onCut, (E) => {
1324
+ E.currentTarget.value !== "" && (h.current = {
1918
1325
  type: "cut"
1919
- }, G.current = window.setTimeout(() => {
1920
- g.current = null;
1326
+ }, k.current = window.setTimeout(() => {
1327
+ h.current = null;
1921
1328
  }, 10));
1922
1329
  }),
1923
- onInput: A(n.onInput, (S) => {
1924
- const H = S.currentTarget.value;
1925
- H.length > 1 && (S.preventDefault(), p({ type: "PASTE", value: H }));
1330
+ onInput: P(n.onInput, (E) => {
1331
+ const K = E.currentTarget.value;
1332
+ K.length > 1 && (E.preventDefault(), l({ type: "PASTE", value: K }));
1926
1333
  }),
1927
- onChange: A(n.onChange, (S) => {
1928
- const H = S.target.value;
1929
- S.preventDefault();
1930
- const j = g.current;
1931
- if (g.current = null, j)
1932
- switch (j.type) {
1334
+ onChange: P(n.onChange, (E) => {
1335
+ const K = E.target.value;
1336
+ E.preventDefault();
1337
+ const B = h.current;
1338
+ if (h.current = null, B)
1339
+ switch (B.type) {
1933
1340
  case "cut":
1934
- p({ type: "CLEAR_CHAR", index: _, reason: "Cut" });
1341
+ l({ type: "CLEAR_CHAR", index: g, reason: "Cut" });
1935
1342
  return;
1936
1343
  case "keydown": {
1937
- if (j.key === "Char")
1344
+ if (B.key === "Char")
1938
1345
  return;
1939
- const $ = j.key === "Backspace" && (j.metaKey || j.ctrlKey);
1940
- j.key === "Clear" || $ ? p({ type: "CLEAR", reason: "Backspace" }) : p({ type: "CLEAR_CHAR", index: _, reason: j.key });
1346
+ const G = B.key === "Backspace" && (B.metaKey || B.ctrlKey);
1347
+ B.key === "Clear" || G ? l({ type: "CLEAR", reason: "Backspace" }) : l({ type: "CLEAR_CHAR", index: g, reason: B.key });
1941
1348
  return;
1942
1349
  }
1943
1350
  default:
1944
1351
  return;
1945
1352
  }
1946
- if (S.target.validity.valid)
1947
- if (H === "") {
1948
- let $ = "Backspace";
1949
- if (Js(S.nativeEvent)) {
1950
- const ae = S.nativeEvent.inputType;
1951
- ae === "deleteContentBackward" ? $ = "Backspace" : ae === "deleteByCut" && ($ = "Cut");
1353
+ if (E.target.validity.valid)
1354
+ if (K === "") {
1355
+ let G = "Backspace";
1356
+ if (ya(E.nativeEvent)) {
1357
+ const ee = E.nativeEvent.inputType;
1358
+ ee === "deleteContentBackward" ? G = "Backspace" : ee === "deleteByCut" && (G = "Cut");
1952
1359
  }
1953
- p({ type: "CLEAR_CHAR", index: _, reason: $ });
1360
+ l({ type: "CLEAR_CHAR", index: g, reason: G });
1954
1361
  } else
1955
- p({ type: "SET_CHAR", char: H, index: _, event: S });
1362
+ l({ type: "SET_CHAR", char: K, index: g, event: E });
1956
1363
  else {
1957
- const $ = S.target;
1958
- o == null || o($.value), requestAnimationFrame(() => {
1959
- $.ownerDocument.activeElement === $ && $.select();
1364
+ const G = E.target;
1365
+ t == null || t(G.value), requestAnimationFrame(() => {
1366
+ G.ownerDocument.activeElement === G && G.select();
1960
1367
  });
1961
1368
  }
1962
1369
  }),
1963
- onKeyDown: A(n.onKeyDown, (S) => {
1964
- var H, j, $;
1965
- switch (S.key) {
1370
+ onKeyDown: P(n.onKeyDown, (E) => {
1371
+ var K, B, G;
1372
+ switch (E.key) {
1966
1373
  case "Clear":
1967
1374
  case "Delete":
1968
1375
  case "Backspace": {
1969
- if (S.currentTarget.value === "") {
1970
- if (S.key === "Delete") return;
1971
- if (S.key === "Clear" || S.metaKey || S.ctrlKey)
1972
- p({ type: "CLEAR", reason: "Backspace" });
1376
+ if (E.currentTarget.value === "") {
1377
+ if (E.key === "Delete") return;
1378
+ if (E.key === "Clear" || E.metaKey || E.ctrlKey)
1379
+ l({ type: "CLEAR", reason: "Backspace" });
1973
1380
  else {
1974
- const N = S.currentTarget;
1381
+ const A = E.currentTarget;
1975
1382
  requestAnimationFrame(() => {
1976
- var B;
1977
- ie((B = P.from(N, -1)) == null ? void 0 : B.element);
1383
+ var $;
1384
+ re(($ = x.from(A, -1)) == null ? void 0 : $.element);
1978
1385
  });
1979
1386
  }
1980
1387
  } else
1981
- g.current = {
1388
+ h.current = {
1982
1389
  type: "keydown",
1983
- key: S.key,
1984
- metaKey: S.metaKey,
1985
- ctrlKey: S.ctrlKey
1986
- }, G.current = window.setTimeout(() => {
1987
- g.current = null;
1390
+ key: E.key,
1391
+ metaKey: E.metaKey,
1392
+ ctrlKey: E.ctrlKey
1393
+ }, k.current = window.setTimeout(() => {
1394
+ h.current = null;
1988
1395
  }, 10);
1989
1396
  return;
1990
1397
  }
1991
1398
  case "Enter": {
1992
- S.preventDefault(), h.attemptSubmit();
1399
+ E.preventDefault(), T.attemptSubmit();
1993
1400
  return;
1994
1401
  }
1995
1402
  case "ArrowDown":
1996
1403
  case "ArrowUp": {
1997
- h.orientation === "horizontal" && S.preventDefault();
1404
+ T.orientation === "horizontal" && E.preventDefault();
1998
1405
  return;
1999
1406
  }
2000
1407
  default:
2001
- if (S.currentTarget.value === S.key) {
2002
- const ae = S.currentTarget;
2003
- S.preventDefault(), ie((H = P.from(ae, 1)) == null ? void 0 : H.element);
1408
+ if (E.currentTarget.value === E.key) {
1409
+ const ee = E.currentTarget;
1410
+ E.preventDefault(), re((K = x.from(ee, 1)) == null ? void 0 : K.element);
2004
1411
  return;
2005
1412
  } else if (
2006
1413
  // input already has a value, but...
2007
- S.currentTarget.value && // the value is not selected
2008
- !(S.currentTarget.selectionStart === 0 && S.currentTarget.selectionEnd != null && S.currentTarget.selectionEnd > 0)
1414
+ E.currentTarget.value && // the value is not selected
1415
+ !(E.currentTarget.selectionStart === 0 && E.currentTarget.selectionEnd != null && E.currentTarget.selectionEnd > 0)
2009
1416
  ) {
2010
- const ae = S.key;
2011
- if (S.key.length > 1 || S.key === " ")
1417
+ const ee = E.key;
1418
+ if (E.key.length > 1 || E.key === " ")
2012
1419
  return;
2013
1420
  {
2014
- const ye = (j = P.from(S.currentTarget, 1)) == null ? void 0 : j.element, N = ($ = P.at(-1)) == null ? void 0 : $.element;
2015
- ye !== N && S.currentTarget !== N && (S.currentTarget.selectionStart === 0 ? p({ type: "SET_CHAR", char: ae, index: _, event: S }) : p({
1421
+ const me = (B = x.from(E.currentTarget, 1)) == null ? void 0 : B.element, A = (G = x.at(-1)) == null ? void 0 : G.element;
1422
+ me !== A && E.currentTarget !== A && (E.currentTarget.selectionStart === 0 ? l({ type: "SET_CHAR", char: ee, index: g, event: E }) : l({
2016
1423
  type: "SET_CHAR",
2017
- char: ae,
2018
- index: _ + 1,
2019
- event: S
2020
- }), g.current = {
1424
+ char: ee,
1425
+ index: g + 1,
1426
+ event: E
1427
+ }), h.current = {
2021
1428
  type: "keydown",
2022
1429
  key: "Char",
2023
- metaKey: S.metaKey,
2024
- ctrlKey: S.ctrlKey
2025
- }, G.current = window.setTimeout(() => {
2026
- g.current = null;
1430
+ metaKey: E.metaKey,
1431
+ ctrlKey: E.ctrlKey
1432
+ }, k.current = window.setTimeout(() => {
1433
+ h.current = null;
2027
1434
  }, 10));
2028
1435
  }
2029
1436
  }
2030
1437
  }
2031
1438
  }),
2032
- onPointerDown: A(n.onPointerDown, (S) => {
2033
- var $;
2034
- S.preventDefault();
2035
- const H = Math.min(_, U), j = ($ = P.at(H)) == null ? void 0 : $.element;
2036
- ie(j);
1439
+ onPointerDown: P(n.onPointerDown, (E) => {
1440
+ var G;
1441
+ E.preventDefault();
1442
+ const K = Math.min(g, H), B = (G = x.at(K)) == null ? void 0 : G.element;
1443
+ re(B);
2037
1444
  })
2038
1445
  }
2039
1446
  );
@@ -2041,474 +1448,414 @@ var Ge = {
2041
1448
  }
2042
1449
  ) });
2043
1450
  });
2044
- function Zs(e) {
1451
+ function Ta(e) {
2045
1452
  return (e == null ? void 0 : e.tagName) === "FORM";
2046
1453
  }
2047
- function mr(e) {
1454
+ function xr(e) {
2048
1455
  return e.replace(/\s/g, "");
2049
1456
  }
2050
- function ie(e) {
1457
+ function re(e) {
2051
1458
  e && (e.ownerDocument.activeElement === e ? window.requestAnimationFrame(() => {
2052
- var t;
2053
- (t = e.select) == null || t.call(e);
1459
+ var r;
1460
+ (r = e.select) == null || r.call(e);
2054
1461
  }) : e.focus());
2055
1462
  }
2056
- function Js(e) {
1463
+ function ya(e) {
2057
1464
  return e.type === "input";
2058
1465
  }
2059
- const lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1466
+ const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2060
1467
  __proto__: null,
2061
- HiddenInput: pr,
2062
- Input: vr,
2063
- OneTimePasswordField: fr,
2064
- OneTimePasswordFieldHiddenInput: pr,
2065
- OneTimePasswordFieldInput: vr,
2066
- Root: fr
1468
+ HiddenInput: Ar,
1469
+ Input: Sr,
1470
+ OneTimePasswordField: Ir,
1471
+ OneTimePasswordFieldHiddenInput: Ar,
1472
+ OneTimePasswordFieldInput: Sr,
1473
+ Root: Ir
2067
1474
  }, Symbol.toStringTag, { value: "Module" }));
2068
- var de = "PasswordToggleField", [Qs] = oe(de), [ei, qe] = Qs(de), Re = {
1475
+ var ce = "PasswordToggleField", [Ea] = se(ce), [wa, Oe] = Ea(ce), be = {
2069
1476
  clickTriggered: !1,
2070
1477
  selectionStart: null,
2071
1478
  selectionEnd: null
2072
- }, gt = ({
1479
+ }, qe = ({
2073
1480
  __scopePasswordToggleField: e,
2074
- ...t
1481
+ ...r
2075
1482
  }) => {
2076
- const r = `${te(t.id)}-input`, [n, s] = a.useState(r), c = n ?? r, l = a.useCallback(
2077
- (m) => s(m != null ? String(m) : null),
1483
+ const o = `${ae(r.id)}-input`, [n, s] = a.useState(o), u = n ?? o, c = a.useCallback(
1484
+ (p) => s(p != null ? String(p) : null),
2078
1485
  []
2079
- ), { visible: u, defaultVisible: d, onVisiblityChange: f, children: b } = t, [w = !1, E] = X({
2080
- caller: de,
2081
- prop: u,
1486
+ ), { visible: f, defaultVisible: d, onVisiblityChange: b, children: w } = r, [I = !1, R] = ie({
1487
+ caller: ce,
1488
+ prop: f,
2082
1489
  defaultProp: d ?? !1,
2083
- onChange: f
2084
- }), C = a.useRef(null), v = a.useRef(Re);
1490
+ onChange: b
1491
+ }), _ = a.useRef(null), m = a.useRef(be);
2085
1492
  return /* @__PURE__ */ i(
2086
- ei,
1493
+ wa,
2087
1494
  {
2088
1495
  scope: e,
2089
- inputId: c,
2090
- inputRef: C,
2091
- setVisible: E,
2092
- syncInputId: l,
2093
- visible: w,
2094
- focusState: v,
2095
- children: b
1496
+ inputId: u,
1497
+ inputRef: _,
1498
+ setVisible: R,
1499
+ syncInputId: c,
1500
+ visible: I,
1501
+ focusState: m,
1502
+ children: w
2096
1503
  }
2097
1504
  );
2098
1505
  };
2099
- gt.displayName = de;
2100
- var Qr = de + "Input", bt = a.forwardRef(
1506
+ qe.displayName = ce;
1507
+ var oo = ce + "Input", Ye = a.forwardRef(
2101
1508
  ({
2102
1509
  __scopePasswordToggleField: e,
2103
- autoComplete: t = "current-password",
2104
- autoCapitalize: o = "off",
2105
- spellCheck: r = !1,
1510
+ autoComplete: r = "current-password",
1511
+ autoCapitalize: t = "off",
1512
+ spellCheck: o = !1,
2106
1513
  id: n,
2107
1514
  ...s
2108
- }, c) => {
2109
- const { visible: l, inputRef: u, inputId: d, syncInputId: f, setVisible: b, focusState: w } = qe(Qr, e);
1515
+ }, u) => {
1516
+ const { visible: c, inputRef: f, inputId: d, syncInputId: b, setVisible: w, focusState: I } = Oe(oo, e);
2110
1517
  a.useEffect(() => {
2111
- f(n);
2112
- }, [n, f]);
2113
- const E = Er(b);
1518
+ b(n);
1519
+ }, [n, b]);
1520
+ const R = kr(w);
2114
1521
  return a.useEffect(() => {
2115
- const C = u.current, v = C == null ? void 0 : C.form;
2116
- if (!v)
1522
+ const _ = f.current, m = _ == null ? void 0 : _.form;
1523
+ if (!m)
2117
1524
  return;
2118
- const m = new AbortController();
2119
- return v.addEventListener(
1525
+ const p = new AbortController();
1526
+ return m.addEventListener(
2120
1527
  "reset",
2121
- (h) => {
2122
- h.defaultPrevented || E(!1);
1528
+ (T) => {
1529
+ T.defaultPrevented || R(!1);
2123
1530
  },
2124
- { signal: m.signal }
2125
- ), v.addEventListener(
1531
+ { signal: p.signal }
1532
+ ), m.addEventListener(
2126
1533
  "submit",
2127
1534
  () => {
2128
- E(!1);
1535
+ R(!1);
2129
1536
  },
2130
- { signal: m.signal }
1537
+ { signal: p.signal }
2131
1538
  ), () => {
2132
- m.abort();
1539
+ p.abort();
2133
1540
  };
2134
- }, [u, E]), /* @__PURE__ */ i(
2135
- O.input,
1541
+ }, [f, R]), /* @__PURE__ */ i(
1542
+ D.input,
2136
1543
  {
2137
1544
  ...s,
2138
1545
  id: n ?? d,
2139
- autoCapitalize: o,
2140
- autoComplete: t,
2141
- ref: K(c, u),
2142
- spellCheck: r,
2143
- type: l ? "text" : "password",
2144
- onBlur: A(s.onBlur, (C) => {
2145
- const { selectionStart: v, selectionEnd: m } = C.currentTarget;
2146
- w.current.selectionStart = v, w.current.selectionEnd = m;
1546
+ autoCapitalize: t,
1547
+ autoComplete: r,
1548
+ ref: Y(u, f),
1549
+ spellCheck: o,
1550
+ type: c ? "text" : "password",
1551
+ onBlur: P(s.onBlur, (_) => {
1552
+ const { selectionStart: m, selectionEnd: p } = _.currentTarget;
1553
+ I.current.selectionStart = m, I.current.selectionEnd = p;
2147
1554
  })
2148
1555
  }
2149
1556
  );
2150
1557
  }
2151
1558
  );
2152
- bt.displayName = Qr;
2153
- var en = de + "Toggle", Ct = a.forwardRef(
1559
+ Ye.displayName = oo;
1560
+ var no = ce + "Toggle", Xe = a.forwardRef(
2154
1561
  ({
2155
1562
  __scopePasswordToggleField: e,
2156
- onClick: t,
2157
- onPointerDown: o,
2158
- onPointerCancel: r,
1563
+ onClick: r,
1564
+ onPointerDown: t,
1565
+ onPointerCancel: o,
2159
1566
  onPointerUp: n,
2160
1567
  onFocus: s,
2161
- children: c,
2162
- "aria-label": l,
2163
- "aria-controls": u,
1568
+ children: u,
1569
+ "aria-label": c,
1570
+ "aria-controls": f,
2164
1571
  "aria-hidden": d,
2165
- tabIndex: f,
2166
- ...b
2167
- }, w) => {
2168
- const { setVisible: E, visible: C, inputRef: v, inputId: m, focusState: h } = qe(
2169
- en,
1572
+ tabIndex: b,
1573
+ ...w
1574
+ }, I) => {
1575
+ const { setVisible: R, visible: _, inputRef: m, inputId: p, focusState: T } = Oe(
1576
+ no,
2170
1577
  e
2171
- ), [p, g] = a.useState(void 0), y = a.useRef(null), R = K(w, y), P = wr();
1578
+ ), [l, h] = a.useState(void 0), S = a.useRef(null), F = Y(I, S), x = Or();
2172
1579
  a.useEffect(() => {
2173
- const F = y.current;
2174
- if (!F || l) {
2175
- g(void 0);
1580
+ const N = S.current;
1581
+ if (!N || c) {
1582
+ h(void 0);
2176
1583
  return;
2177
1584
  }
2178
- const I = C ? "Hide password" : "Show password";
2179
- function T(x) {
2180
- g(x || void 0 ? void 0 : I);
1585
+ const M = _ ? "Hide password" : "Show password";
1586
+ function v(y) {
1587
+ h(y || void 0 ? void 0 : M);
2181
1588
  }
2182
- T(F.textContent);
2183
- const _ = new MutationObserver((x) => {
2184
- let L;
2185
- for (const M of x)
2186
- M.type === "characterData" && F.textContent && (L = F.textContent);
2187
- T(L);
1589
+ v(N.textContent);
1590
+ const g = new MutationObserver((y) => {
1591
+ let O;
1592
+ for (const C of y)
1593
+ C.type === "characterData" && N.textContent && (O = N.textContent);
1594
+ v(O);
2188
1595
  });
2189
- return _.observe(F, { characterData: !0, subtree: !0 }), () => {
2190
- _.disconnect();
1596
+ return g.observe(N, { characterData: !0, subtree: !0 }), () => {
1597
+ g.disconnect();
2191
1598
  };
2192
- }, [C, l]);
2193
- const D = l || p;
2194
- return P ? u ?? (u = m) : (d ?? (d = !0), f ?? (f = -1)), a.useEffect(() => {
2195
- var x, L;
2196
- let F = () => {
1599
+ }, [_, c]);
1600
+ const V = c || l;
1601
+ return x ? f ?? (f = p) : (d ?? (d = !0), b ?? (b = -1)), a.useEffect(() => {
1602
+ var y, O;
1603
+ let N = () => {
2197
1604
  };
2198
- const I = ((L = (x = y.current) == null ? void 0 : x.ownerDocument) == null ? void 0 : L.defaultView) || window, T = () => h.current.clickTriggered = !1, _ = () => F = ti(I, T);
2199
- return I.addEventListener("pointerup", _), () => {
2200
- F(), I.removeEventListener("pointerup", _);
1605
+ const M = ((O = (y = S.current) == null ? void 0 : y.ownerDocument) == null ? void 0 : O.defaultView) || window, v = () => T.current.clickTriggered = !1, g = () => N = Ra(M, v);
1606
+ return M.addEventListener("pointerup", g), () => {
1607
+ N(), M.removeEventListener("pointerup", g);
2201
1608
  };
2202
- }, [h]), /* @__PURE__ */ i(
2203
- O.button,
1609
+ }, [T]), /* @__PURE__ */ i(
1610
+ D.button,
2204
1611
  {
2205
- "aria-controls": u,
1612
+ "aria-controls": f,
2206
1613
  "aria-hidden": d,
2207
- "aria-label": D,
2208
- ref: R,
2209
- id: m,
2210
- ...b,
2211
- onPointerDown: A(o, () => {
2212
- h.current.clickTriggered = !0;
1614
+ "aria-label": V,
1615
+ ref: F,
1616
+ id: p,
1617
+ ...w,
1618
+ onPointerDown: P(t, () => {
1619
+ T.current.clickTriggered = !0;
2213
1620
  }),
2214
- onPointerCancel: (F) => {
2215
- r == null || r(F), h.current = Re;
1621
+ onPointerCancel: (N) => {
1622
+ o == null || o(N), T.current = be;
2216
1623
  },
2217
- onClick: (F) => {
2218
- if (t == null || t(F), F.defaultPrevented) {
2219
- h.current = Re;
1624
+ onClick: (N) => {
1625
+ if (r == null || r(N), N.defaultPrevented) {
1626
+ T.current = be;
2220
1627
  return;
2221
1628
  }
2222
- if (me(() => {
2223
- E((I) => !I);
2224
- }), h.current.clickTriggered) {
2225
- const I = v.current;
2226
- if (I) {
2227
- const { selectionStart: T, selectionEnd: _ } = h.current;
2228
- I.focus(), (T !== null || _ !== null) && requestAnimationFrame(() => {
2229
- I.ownerDocument.activeElement === I && (I.selectionStart = T, I.selectionEnd = _);
1629
+ if (ue(() => {
1630
+ R((M) => !M);
1631
+ }), T.current.clickTriggered) {
1632
+ const M = m.current;
1633
+ if (M) {
1634
+ const { selectionStart: v, selectionEnd: g } = T.current;
1635
+ M.focus(), (v !== null || g !== null) && requestAnimationFrame(() => {
1636
+ M.ownerDocument.activeElement === M && (M.selectionStart = v, M.selectionEnd = g);
2230
1637
  });
2231
1638
  }
2232
1639
  }
2233
- h.current = Re;
1640
+ T.current = be;
2234
1641
  },
2235
- onPointerUp: (F) => {
2236
- n == null || n(F), setTimeout(() => {
2237
- h.current = Re;
1642
+ onPointerUp: (N) => {
1643
+ n == null || n(N), setTimeout(() => {
1644
+ T.current = be;
2238
1645
  }, 50);
2239
1646
  },
2240
1647
  type: "button",
2241
- children: c
1648
+ children: u
2242
1649
  }
2243
1650
  );
2244
1651
  }
2245
1652
  );
2246
- Ct.displayName = en;
2247
- var tn = de + "Slot", ht = ({
1653
+ Xe.displayName = no;
1654
+ var ao = ce + "Slot", Ze = ({
2248
1655
  __scopePasswordToggleField: e,
2249
- ...t
1656
+ ...r
2250
1657
  }) => {
2251
- const { visible: o } = qe(
2252
- tn,
1658
+ const { visible: t } = Oe(
1659
+ ao,
2253
1660
  e
2254
1661
  );
2255
- return "render" in t ? (
1662
+ return "render" in r ? (
2256
1663
  //
2257
- t.render({ visible: o })
2258
- ) : o ? t.visible : t.hidden;
1664
+ r.render({ visible: t })
1665
+ ) : t ? r.visible : r.hidden;
2259
1666
  };
2260
- ht.displayName = tn;
2261
- var on = de + "Icon", Tt = a.forwardRef(
1667
+ Ze.displayName = ao;
1668
+ var so = ce + "Icon", Je = a.forwardRef(
2262
1669
  ({
2263
1670
  __scopePasswordToggleField: e,
2264
1671
  // @ts-expect-error
2265
- children: t,
2266
- ...o
2267
- }, r) => {
2268
- const { visible: n } = qe(
2269
- on,
1672
+ children: r,
1673
+ ...t
1674
+ }, o) => {
1675
+ const { visible: n } = Oe(
1676
+ so,
2270
1677
  e
2271
- ), { visible: s, hidden: c, ...l } = o;
2272
- return /* @__PURE__ */ i(O.svg, { ...l, ref: r, "aria-hidden": !0, asChild: !0, children: n ? s : c });
1678
+ ), { visible: s, hidden: u, ...c } = t;
1679
+ return /* @__PURE__ */ i(D.svg, { ...c, ref: o, "aria-hidden": !0, asChild: !0, children: n ? s : u });
2273
1680
  }
2274
1681
  );
2275
- Tt.displayName = on;
2276
- function ti(e, t, o) {
1682
+ Je.displayName = so;
1683
+ function Ra(e, r, t) {
2277
1684
  if (e.requestIdleCallback) {
2278
- const s = e.requestIdleCallback(t, o);
1685
+ const s = e.requestIdleCallback(r, t);
2279
1686
  return () => {
2280
1687
  e.cancelIdleCallback(s);
2281
1688
  };
2282
1689
  }
2283
- const r = Date.now(), n = e.setTimeout(() => {
2284
- t({ didTimeout: !1, timeRemaining: () => Math.max(0, 50 - (Date.now() - r)) });
1690
+ const o = Date.now(), n = e.setTimeout(() => {
1691
+ r({ didTimeout: !1, timeRemaining: () => Math.max(0, 50 - (Date.now() - o)) });
2285
1692
  }, 1);
2286
1693
  return () => {
2287
1694
  e.clearTimeout(n);
2288
1695
  };
2289
1696
  }
2290
- const uc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1697
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2291
1698
  __proto__: null,
2292
- Icon: Tt,
2293
- Input: bt,
2294
- PasswordToggleField: gt,
2295
- PasswordToggleFieldIcon: Tt,
2296
- PasswordToggleFieldInput: bt,
2297
- PasswordToggleFieldSlot: ht,
2298
- PasswordToggleFieldToggle: Ct,
2299
- Root: gt,
2300
- Slot: ht,
2301
- Toggle: Ct
1699
+ Icon: Je,
1700
+ Input: Ye,
1701
+ PasswordToggleField: qe,
1702
+ PasswordToggleFieldIcon: Je,
1703
+ PasswordToggleFieldInput: Ye,
1704
+ PasswordToggleFieldSlot: Ze,
1705
+ PasswordToggleFieldToggle: Xe,
1706
+ Root: qe,
1707
+ Slot: Ze,
1708
+ Toggle: Xe
2302
1709
  }, Symbol.toStringTag, { value: "Module" }));
2303
- var Oo = "Progress", Do = 100, [oi, ri] = oe(Oo), [ni, ai] = oi(Oo), Lo = a.forwardRef(
2304
- (e, t) => {
2305
- const {
2306
- __scopeProgress: o,
2307
- value: r = null,
2308
- max: n,
2309
- getValueLabel: s = si,
2310
- ...c
2311
- } = e;
2312
- (n || n === 0) && !gr(n) && console.error(ii(`${n}`, "Progress"));
2313
- const l = gr(n) ? n : Do;
2314
- r !== null && !br(r, l) && console.error(ci(`${r}`, "Progress"));
2315
- const u = br(r, l) ? r : null, d = $e(u) ? s(u, l) : void 0;
2316
- return /* @__PURE__ */ i(ni, { scope: o, value: u, max: l, children: /* @__PURE__ */ i(
2317
- O.div,
2318
- {
2319
- "aria-valuemax": l,
2320
- "aria-valuemin": 0,
2321
- "aria-valuenow": $e(u) ? u : void 0,
2322
- "aria-valuetext": d,
2323
- role: "progressbar",
2324
- "data-state": nn(u, l),
2325
- "data-value": u ?? void 0,
2326
- "data-max": l,
2327
- ...c,
2328
- ref: t
2329
- }
2330
- ) });
2331
- }
2332
- );
2333
- Lo.displayName = Oo;
2334
- var rn = "ProgressIndicator", ko = a.forwardRef(
2335
- (e, t) => {
2336
- const { __scopeProgress: o, ...r } = e, n = ai(rn, o);
2337
- return /* @__PURE__ */ i(
2338
- O.div,
2339
- {
2340
- "data-state": nn(n.value, n.max),
2341
- "data-value": n.value ?? void 0,
2342
- "data-max": n.max,
2343
- ...r,
2344
- ref: t
2345
- }
2346
- );
2347
- }
2348
- );
2349
- ko.displayName = rn;
2350
- function si(e, t) {
2351
- return `${Math.round(e / t * 100)}%`;
2352
- }
2353
- function nn(e, t) {
2354
- return e == null ? "indeterminate" : e === t ? "complete" : "loading";
2355
- }
2356
- function $e(e) {
2357
- return typeof e == "number";
2358
- }
2359
- function gr(e) {
2360
- return $e(e) && !isNaN(e) && e > 0;
2361
- }
2362
- function br(e, t) {
2363
- return $e(e) && !isNaN(e) && e <= t && e >= 0;
2364
- }
2365
- function ii(e, t) {
2366
- return `Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Do}\`.`;
2367
- }
2368
- function ci(e, t) {
2369
- return `Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2370
- - a positive number
2371
- - less than the value passed to \`max\` (or ${Do} if no \`max\` prop is set)
2372
- - \`null\` or \`undefined\` if the progress is indeterminate.
2373
-
2374
- Defaulting to \`null\`.`;
1710
+ var _a = "Separator", Mr = "horizontal", Ia = ["horizontal", "vertical"], tr = a.forwardRef((e, r) => {
1711
+ const { decorative: t, orientation: o = Mr, ...n } = e, s = Aa(o) ? o : Mr, c = t ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
1712
+ return /* @__PURE__ */ i(
1713
+ D.div,
1714
+ {
1715
+ "data-orientation": s,
1716
+ ...c,
1717
+ ...n,
1718
+ ref: r
1719
+ }
1720
+ );
1721
+ });
1722
+ tr.displayName = _a;
1723
+ function Aa(e) {
1724
+ return Ia.includes(e);
2375
1725
  }
2376
- var li = Lo, ui = ko;
2377
- const dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1726
+ var io = tr;
1727
+ const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2378
1728
  __proto__: null,
2379
- Indicator: ui,
2380
- Progress: Lo,
2381
- ProgressIndicator: ko,
2382
- Root: li,
2383
- createProgressScope: ri
1729
+ Root: io,
1730
+ Separator: tr
2384
1731
  }, Symbol.toStringTag, { value: "Module" }));
2385
- var Vo = "ToastProvider", [Go, di, fi] = Pe("Toast"), [an, pi] = oe("Toast", [fi]), [vi, Ye] = an(Vo), $o = (e) => {
1732
+ var rr = "ToastProvider", [or, Sa, xa] = ot("Toast"), [co, Ma] = se("Toast", [xa]), [Pa, De] = co(rr), nr = (e) => {
2386
1733
  const {
2387
- __scopeToast: t,
2388
- label: o = "Notification",
2389
- duration: r = 5e3,
1734
+ __scopeToast: r,
1735
+ label: t = "Notification",
1736
+ duration: o = 5e3,
2390
1737
  swipeDirection: n = "right",
2391
1738
  swipeThreshold: s = 50,
2392
- children: c
2393
- } = e, [l, u] = a.useState(null), [d, f] = a.useState(0), b = a.useRef(!1), w = a.useRef(!1);
2394
- return o.trim() || console.error(
2395
- `Invalid prop \`label\` supplied to \`${Vo}\`. Expected non-empty \`string\`.`
2396
- ), /* @__PURE__ */ i(Go.Provider, { scope: t, children: /* @__PURE__ */ i(
2397
- vi,
1739
+ children: u
1740
+ } = e, [c, f] = a.useState(null), [d, b] = a.useState(0), w = a.useRef(!1), I = a.useRef(!1);
1741
+ return t.trim() || console.error(
1742
+ `Invalid prop \`label\` supplied to \`${rr}\`. Expected non-empty \`string\`.`
1743
+ ), /* @__PURE__ */ i(or.Provider, { scope: r, children: /* @__PURE__ */ i(
1744
+ Pa,
2398
1745
  {
2399
- scope: t,
2400
- label: o,
2401
- duration: r,
1746
+ scope: r,
1747
+ label: t,
1748
+ duration: o,
2402
1749
  swipeDirection: n,
2403
1750
  swipeThreshold: s,
2404
1751
  toastCount: d,
2405
- viewport: l,
2406
- onViewportChange: u,
2407
- onToastAdd: a.useCallback(() => f((E) => E + 1), []),
2408
- onToastRemove: a.useCallback(() => f((E) => E - 1), []),
2409
- isFocusedToastEscapeKeyDownRef: b,
2410
- isClosePausedRef: w,
2411
- children: c
1752
+ viewport: c,
1753
+ onViewportChange: f,
1754
+ onToastAdd: a.useCallback(() => b((R) => R + 1), []),
1755
+ onToastRemove: a.useCallback(() => b((R) => R - 1), []),
1756
+ isFocusedToastEscapeKeyDownRef: w,
1757
+ isClosePausedRef: I,
1758
+ children: u
2412
1759
  }
2413
1760
  ) });
2414
1761
  };
2415
- $o.displayName = Vo;
2416
- var sn = "ToastViewport", mi = ["F8"], wt = "toast.viewportPause", yt = "toast.viewportResume", Ko = a.forwardRef(
2417
- (e, t) => {
1762
+ nr.displayName = rr;
1763
+ var lo = "ToastViewport", Fa = ["F8"], Qe = "toast.viewportPause", et = "toast.viewportResume", ar = a.forwardRef(
1764
+ (e, r) => {
2418
1765
  const {
2419
- __scopeToast: o,
2420
- hotkey: r = mi,
1766
+ __scopeToast: t,
1767
+ hotkey: o = Fa,
2421
1768
  label: n = "Notifications ({hotkey})",
2422
1769
  ...s
2423
- } = e, c = Ye(sn, o), l = di(o), u = a.useRef(null), d = a.useRef(null), f = a.useRef(null), b = a.useRef(null), w = K(t, b, c.onViewportChange), E = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), C = c.toastCount > 0;
1770
+ } = e, u = De(lo, t), c = Sa(t), f = a.useRef(null), d = a.useRef(null), b = a.useRef(null), w = a.useRef(null), I = Y(r, w, u.onViewportChange), R = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), _ = u.toastCount > 0;
2424
1771
  a.useEffect(() => {
2425
- const m = (h) => {
2426
- var g;
2427
- r.length !== 0 && r.every((y) => h[y] || h.code === y) && ((g = b.current) == null || g.focus());
1772
+ const p = (T) => {
1773
+ var h;
1774
+ o.length !== 0 && o.every((S) => T[S] || T.code === S) && ((h = w.current) == null || h.focus());
2428
1775
  };
2429
- return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
2430
- }, [r]), a.useEffect(() => {
2431
- const m = u.current, h = b.current;
2432
- if (C && m && h) {
2433
- const p = () => {
2434
- if (!c.isClosePausedRef.current) {
2435
- const P = new CustomEvent(wt);
2436
- h.dispatchEvent(P), c.isClosePausedRef.current = !0;
1776
+ return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
1777
+ }, [o]), a.useEffect(() => {
1778
+ const p = f.current, T = w.current;
1779
+ if (_ && p && T) {
1780
+ const l = () => {
1781
+ if (!u.isClosePausedRef.current) {
1782
+ const x = new CustomEvent(Qe);
1783
+ T.dispatchEvent(x), u.isClosePausedRef.current = !0;
2437
1784
  }
2438
- }, g = () => {
2439
- if (c.isClosePausedRef.current) {
2440
- const P = new CustomEvent(yt);
2441
- h.dispatchEvent(P), c.isClosePausedRef.current = !1;
1785
+ }, h = () => {
1786
+ if (u.isClosePausedRef.current) {
1787
+ const x = new CustomEvent(et);
1788
+ T.dispatchEvent(x), u.isClosePausedRef.current = !1;
2442
1789
  }
2443
- }, y = (P) => {
2444
- !m.contains(P.relatedTarget) && g();
2445
- }, R = () => {
2446
- m.contains(document.activeElement) || g();
1790
+ }, S = (x) => {
1791
+ !p.contains(x.relatedTarget) && h();
1792
+ }, F = () => {
1793
+ p.contains(document.activeElement) || h();
2447
1794
  };
2448
- return m.addEventListener("focusin", p), m.addEventListener("focusout", y), m.addEventListener("pointermove", p), m.addEventListener("pointerleave", R), window.addEventListener("blur", p), window.addEventListener("focus", g), () => {
2449
- m.removeEventListener("focusin", p), m.removeEventListener("focusout", y), m.removeEventListener("pointermove", p), m.removeEventListener("pointerleave", R), window.removeEventListener("blur", p), window.removeEventListener("focus", g);
1795
+ return p.addEventListener("focusin", l), p.addEventListener("focusout", S), p.addEventListener("pointermove", l), p.addEventListener("pointerleave", F), window.addEventListener("blur", l), window.addEventListener("focus", h), () => {
1796
+ p.removeEventListener("focusin", l), p.removeEventListener("focusout", S), p.removeEventListener("pointermove", l), p.removeEventListener("pointerleave", F), window.removeEventListener("blur", l), window.removeEventListener("focus", h);
2450
1797
  };
2451
1798
  }
2452
- }, [C, c.isClosePausedRef]);
2453
- const v = a.useCallback(
2454
- ({ tabbingDirection: m }) => {
2455
- const p = l().map((g) => {
2456
- const y = g.ref.current, R = [y, ...Pi(y)];
2457
- return m === "forwards" ? R : R.reverse();
1799
+ }, [_, u.isClosePausedRef]);
1800
+ const m = a.useCallback(
1801
+ ({ tabbingDirection: p }) => {
1802
+ const l = c().map((h) => {
1803
+ const S = h.ref.current, F = [S, ...za(S)];
1804
+ return p === "forwards" ? F : F.reverse();
2458
1805
  });
2459
- return (m === "forwards" ? p.reverse() : p).flat();
1806
+ return (p === "forwards" ? l.reverse() : l).flat();
2460
1807
  },
2461
- [l]
1808
+ [c]
2462
1809
  );
2463
1810
  return a.useEffect(() => {
2464
- const m = b.current;
2465
- if (m) {
2466
- const h = (p) => {
2467
- var R, P, D;
2468
- const g = p.altKey || p.ctrlKey || p.metaKey;
2469
- if (p.key === "Tab" && !g) {
2470
- const F = document.activeElement, I = p.shiftKey;
2471
- if (p.target === m && I) {
2472
- (R = d.current) == null || R.focus();
1811
+ const p = w.current;
1812
+ if (p) {
1813
+ const T = (l) => {
1814
+ var F, x, V;
1815
+ const h = l.altKey || l.ctrlKey || l.metaKey;
1816
+ if (l.key === "Tab" && !h) {
1817
+ const N = document.activeElement, M = l.shiftKey;
1818
+ if (l.target === p && M) {
1819
+ (F = d.current) == null || F.focus();
2473
1820
  return;
2474
1821
  }
2475
- const x = v({ tabbingDirection: I ? "backwards" : "forwards" }), L = x.findIndex((M) => M === F);
2476
- ot(x.slice(L + 1)) ? p.preventDefault() : I ? (P = d.current) == null || P.focus() : (D = f.current) == null || D.focus();
1822
+ const y = m({ tabbingDirection: M ? "backwards" : "forwards" }), O = y.findIndex((C) => C === N);
1823
+ $e(y.slice(O + 1)) ? l.preventDefault() : M ? (x = d.current) == null || x.focus() : (V = b.current) == null || V.focus();
2477
1824
  }
2478
1825
  };
2479
- return m.addEventListener("keydown", h), () => m.removeEventListener("keydown", h);
1826
+ return p.addEventListener("keydown", T), () => p.removeEventListener("keydown", T);
2480
1827
  }
2481
- }, [l, v]), /* @__PURE__ */ Ie(
2482
- qn,
1828
+ }, [c, m]), /* @__PURE__ */ st(
1829
+ Go,
2483
1830
  {
2484
- ref: u,
1831
+ ref: f,
2485
1832
  role: "region",
2486
- "aria-label": n.replace("{hotkey}", E),
1833
+ "aria-label": n.replace("{hotkey}", R),
2487
1834
  tabIndex: -1,
2488
- style: { pointerEvents: C ? void 0 : "none" },
1835
+ style: { pointerEvents: _ ? void 0 : "none" },
2489
1836
  children: [
2490
- C && /* @__PURE__ */ i(
2491
- Et,
1837
+ _ && /* @__PURE__ */ i(
1838
+ tt,
2492
1839
  {
2493
1840
  ref: d,
2494
1841
  onFocusFromOutsideViewport: () => {
2495
- const m = v({
1842
+ const p = m({
2496
1843
  tabbingDirection: "forwards"
2497
1844
  });
2498
- ot(m);
1845
+ $e(p);
2499
1846
  }
2500
1847
  }
2501
1848
  ),
2502
- /* @__PURE__ */ i(Go.Slot, { scope: o, children: /* @__PURE__ */ i(O.ol, { tabIndex: -1, ...s, ref: w }) }),
2503
- C && /* @__PURE__ */ i(
2504
- Et,
1849
+ /* @__PURE__ */ i(or.Slot, { scope: t, children: /* @__PURE__ */ i(D.ol, { tabIndex: -1, ...s, ref: I }) }),
1850
+ _ && /* @__PURE__ */ i(
1851
+ tt,
2505
1852
  {
2506
- ref: f,
1853
+ ref: b,
2507
1854
  onFocusFromOutsideViewport: () => {
2508
- const m = v({
1855
+ const p = m({
2509
1856
  tabbingDirection: "backwards"
2510
1857
  });
2511
- ot(m);
1858
+ $e(p);
2512
1859
  }
2513
1860
  }
2514
1861
  )
@@ -2517,169 +1864,169 @@ var sn = "ToastViewport", mi = ["F8"], wt = "toast.viewportPause", yt = "toast.v
2517
1864
  );
2518
1865
  }
2519
1866
  );
2520
- Ko.displayName = sn;
2521
- var cn = "ToastFocusProxy", Et = a.forwardRef(
2522
- (e, t) => {
2523
- const { __scopeToast: o, onFocusFromOutsideViewport: r, ...n } = e, s = Ye(cn, o);
1867
+ ar.displayName = lo;
1868
+ var uo = "ToastFocusProxy", tt = a.forwardRef(
1869
+ (e, r) => {
1870
+ const { __scopeToast: t, onFocusFromOutsideViewport: o, ...n } = e, s = De(uo, t);
2524
1871
  return /* @__PURE__ */ i(
2525
- yr,
1872
+ Dr,
2526
1873
  {
2527
1874
  "aria-hidden": !0,
2528
1875
  tabIndex: 0,
2529
1876
  ...n,
2530
- ref: t,
1877
+ ref: r,
2531
1878
  style: { position: "fixed" },
2532
- onFocus: (c) => {
1879
+ onFocus: (u) => {
2533
1880
  var d;
2534
- const l = c.relatedTarget;
2535
- !((d = s.viewport) != null && d.contains(l)) && r();
1881
+ const c = u.relatedTarget;
1882
+ !((d = s.viewport) != null && d.contains(c)) && o();
2536
1883
  }
2537
1884
  }
2538
1885
  );
2539
1886
  }
2540
1887
  );
2541
- Et.displayName = cn;
2542
- var Ne = "Toast", gi = "toast.swipeStart", bi = "toast.swipeMove", Ci = "toast.swipeCancel", hi = "toast.swipeEnd", Bo = a.forwardRef(
2543
- (e, t) => {
2544
- const { forceMount: o, open: r, defaultOpen: n, onOpenChange: s, ...c } = e, [l, u] = X({
2545
- prop: r,
1888
+ tt.displayName = uo;
1889
+ var Te = "Toast", Na = "toast.swipeStart", Oa = "toast.swipeMove", Da = "toast.swipeCancel", La = "toast.swipeEnd", sr = a.forwardRef(
1890
+ (e, r) => {
1891
+ const { forceMount: t, open: o, defaultOpen: n, onOpenChange: s, ...u } = e, [c, f] = ie({
1892
+ prop: o,
2546
1893
  defaultProp: n ?? !0,
2547
1894
  onChange: s,
2548
- caller: Ne
1895
+ caller: Te
2549
1896
  });
2550
- return /* @__PURE__ */ i(Ce, { present: o || l, children: /* @__PURE__ */ i(
2551
- yi,
1897
+ return /* @__PURE__ */ i(Fr, { present: t || c, children: /* @__PURE__ */ i(
1898
+ Ga,
2552
1899
  {
2553
- open: l,
2554
- ...c,
2555
- ref: t,
2556
- onClose: () => u(!1),
2557
- onPause: ee(e.onPause),
2558
- onResume: ee(e.onResume),
2559
- onSwipeStart: A(e.onSwipeStart, (d) => {
1900
+ open: c,
1901
+ ...u,
1902
+ ref: r,
1903
+ onClose: () => f(!1),
1904
+ onPause: Re(e.onPause),
1905
+ onResume: Re(e.onResume),
1906
+ onSwipeStart: P(e.onSwipeStart, (d) => {
2560
1907
  d.currentTarget.setAttribute("data-swipe", "start");
2561
1908
  }),
2562
- onSwipeMove: A(e.onSwipeMove, (d) => {
2563
- const { x: f, y: b } = d.detail.delta;
2564
- d.currentTarget.setAttribute("data-swipe", "move"), d.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${f}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${b}px`);
1909
+ onSwipeMove: P(e.onSwipeMove, (d) => {
1910
+ const { x: b, y: w } = d.detail.delta;
1911
+ d.currentTarget.setAttribute("data-swipe", "move"), d.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${b}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
2565
1912
  }),
2566
- onSwipeCancel: A(e.onSwipeCancel, (d) => {
1913
+ onSwipeCancel: P(e.onSwipeCancel, (d) => {
2567
1914
  d.currentTarget.setAttribute("data-swipe", "cancel"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
2568
1915
  }),
2569
- onSwipeEnd: A(e.onSwipeEnd, (d) => {
2570
- const { x: f, y: b } = d.detail.delta;
2571
- d.currentTarget.setAttribute("data-swipe", "end"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${f}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${b}px`), u(!1);
1916
+ onSwipeEnd: P(e.onSwipeEnd, (d) => {
1917
+ const { x: b, y: w } = d.detail.delta;
1918
+ d.currentTarget.setAttribute("data-swipe", "end"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${b}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), f(!1);
2572
1919
  })
2573
1920
  }
2574
1921
  ) });
2575
1922
  }
2576
1923
  );
2577
- Bo.displayName = Ne;
2578
- var [Ti, wi] = an(Ne, {
1924
+ sr.displayName = Te;
1925
+ var [ka, Va] = co(Te, {
2579
1926
  onClose() {
2580
1927
  }
2581
- }), yi = a.forwardRef(
2582
- (e, t) => {
1928
+ }), Ga = a.forwardRef(
1929
+ (e, r) => {
2583
1930
  const {
2584
- __scopeToast: o,
2585
- type: r = "foreground",
1931
+ __scopeToast: t,
1932
+ type: o = "foreground",
2586
1933
  duration: n,
2587
1934
  open: s,
2588
- onClose: c,
2589
- onEscapeKeyDown: l,
2590
- onPause: u,
1935
+ onClose: u,
1936
+ onEscapeKeyDown: c,
1937
+ onPause: f,
2591
1938
  onResume: d,
2592
- onSwipeStart: f,
2593
- onSwipeMove: b,
2594
- onSwipeCancel: w,
2595
- onSwipeEnd: E,
2596
- ...C
2597
- } = e, v = Ye(Ne, o), [m, h] = a.useState(null), p = K(t, (M) => h(M)), g = a.useRef(null), y = a.useRef(null), R = n || v.duration, P = a.useRef(0), D = a.useRef(R), F = a.useRef(0), { onToastAdd: I, onToastRemove: T } = v, _ = ee(() => {
2598
- var k;
2599
- (m == null ? void 0 : m.contains(document.activeElement)) && ((k = v.viewport) == null || k.focus()), c();
2600
- }), x = a.useCallback(
2601
- (M) => {
2602
- !M || M === 1 / 0 || (window.clearTimeout(F.current), P.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(_, M));
1939
+ onSwipeStart: b,
1940
+ onSwipeMove: w,
1941
+ onSwipeCancel: I,
1942
+ onSwipeEnd: R,
1943
+ ..._
1944
+ } = e, m = De(Te, t), [p, T] = a.useState(null), l = Y(r, (C) => T(C)), h = a.useRef(null), S = a.useRef(null), F = n || m.duration, x = a.useRef(0), V = a.useRef(F), N = a.useRef(0), { onToastAdd: M, onToastRemove: v } = m, g = Re(() => {
1945
+ var L;
1946
+ (p == null ? void 0 : p.contains(document.activeElement)) && ((L = m.viewport) == null || L.focus()), u();
1947
+ }), y = a.useCallback(
1948
+ (C) => {
1949
+ !C || C === 1 / 0 || (window.clearTimeout(N.current), x.current = (/* @__PURE__ */ new Date()).getTime(), N.current = window.setTimeout(g, C));
2603
1950
  },
2604
- [_]
1951
+ [g]
2605
1952
  );
2606
1953
  a.useEffect(() => {
2607
- const M = v.viewport;
2608
- if (M) {
2609
- const k = () => {
2610
- x(D.current), d == null || d();
2611
- }, G = () => {
2612
- const Z = (/* @__PURE__ */ new Date()).getTime() - P.current;
2613
- D.current = D.current - Z, window.clearTimeout(F.current), u == null || u();
1954
+ const C = m.viewport;
1955
+ if (C) {
1956
+ const L = () => {
1957
+ y(V.current), d == null || d();
1958
+ }, k = () => {
1959
+ const X = (/* @__PURE__ */ new Date()).getTime() - x.current;
1960
+ V.current = V.current - X, window.clearTimeout(N.current), f == null || f();
2614
1961
  };
2615
- return M.addEventListener(wt, G), M.addEventListener(yt, k), () => {
2616
- M.removeEventListener(wt, G), M.removeEventListener(yt, k);
1962
+ return C.addEventListener(Qe, k), C.addEventListener(et, L), () => {
1963
+ C.removeEventListener(Qe, k), C.removeEventListener(et, L);
2617
1964
  };
2618
1965
  }
2619
- }, [v.viewport, R, u, d, x]), a.useEffect(() => {
2620
- s && !v.isClosePausedRef.current && x(R);
2621
- }, [s, R, v.isClosePausedRef, x]), a.useEffect(() => (I(), () => T()), [I, T]);
2622
- const L = a.useMemo(() => m ? fn(m) : null, [m]);
2623
- return v.viewport ? /* @__PURE__ */ Ie(_e, { children: [
2624
- L && /* @__PURE__ */ i(
2625
- Ei,
1966
+ }, [m.viewport, F, f, d, y]), a.useEffect(() => {
1967
+ s && !m.isClosePausedRef.current && y(F);
1968
+ }, [s, F, m.isClosePausedRef, y]), a.useEffect(() => (M(), () => v()), [M, v]);
1969
+ const O = a.useMemo(() => p ? vo(p) : null, [p]);
1970
+ return m.viewport ? /* @__PURE__ */ st(at, { children: [
1971
+ O && /* @__PURE__ */ i(
1972
+ $a,
2626
1973
  {
2627
- __scopeToast: o,
1974
+ __scopeToast: t,
2628
1975
  role: "status",
2629
- "aria-live": r === "foreground" ? "assertive" : "polite",
1976
+ "aria-live": o === "foreground" ? "assertive" : "polite",
2630
1977
  "aria-atomic": !0,
2631
- children: L
1978
+ children: O
2632
1979
  }
2633
1980
  ),
2634
- /* @__PURE__ */ i(Ti, { scope: o, onClose: _, children: Jn.createPortal(
2635
- /* @__PURE__ */ i(Go.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
2636
- Yn,
1981
+ /* @__PURE__ */ i(ka, { scope: t, onClose: g, children: zo.createPortal(
1982
+ /* @__PURE__ */ i(or.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
1983
+ $o,
2637
1984
  {
2638
1985
  asChild: !0,
2639
- onEscapeKeyDown: A(l, () => {
2640
- v.isFocusedToastEscapeKeyDownRef.current || _(), v.isFocusedToastEscapeKeyDownRef.current = !1;
1986
+ onEscapeKeyDown: P(c, () => {
1987
+ m.isFocusedToastEscapeKeyDownRef.current || g(), m.isFocusedToastEscapeKeyDownRef.current = !1;
2641
1988
  }),
2642
1989
  children: /* @__PURE__ */ i(
2643
- O.li,
1990
+ D.li,
2644
1991
  {
2645
1992
  role: "status",
2646
1993
  "aria-live": "off",
2647
1994
  "aria-atomic": !0,
2648
1995
  tabIndex: 0,
2649
1996
  "data-state": s ? "open" : "closed",
2650
- "data-swipe-direction": v.swipeDirection,
2651
- ...C,
2652
- ref: p,
1997
+ "data-swipe-direction": m.swipeDirection,
1998
+ ..._,
1999
+ ref: l,
2653
2000
  style: { userSelect: "none", touchAction: "none", ...e.style },
2654
- onKeyDown: A(e.onKeyDown, (M) => {
2655
- M.key === "Escape" && (l == null || l(M.nativeEvent), M.nativeEvent.defaultPrevented || (v.isFocusedToastEscapeKeyDownRef.current = !0, _()));
2001
+ onKeyDown: P(e.onKeyDown, (C) => {
2002
+ C.key === "Escape" && (c == null || c(C.nativeEvent), C.nativeEvent.defaultPrevented || (m.isFocusedToastEscapeKeyDownRef.current = !0, g()));
2656
2003
  }),
2657
- onPointerDown: A(e.onPointerDown, (M) => {
2658
- M.button === 0 && (g.current = { x: M.clientX, y: M.clientY });
2004
+ onPointerDown: P(e.onPointerDown, (C) => {
2005
+ C.button === 0 && (h.current = { x: C.clientX, y: C.clientY });
2659
2006
  }),
2660
- onPointerMove: A(e.onPointerMove, (M) => {
2661
- if (!g.current) return;
2662
- const k = M.clientX - g.current.x, G = M.clientY - g.current.y, Z = !!y.current, U = ["left", "right"].includes(v.swipeDirection), ne = ["left", "up"].includes(v.swipeDirection) ? Math.min : Math.max, Y = U ? ne(0, k) : 0, we = U ? 0 : ne(0, G), ce = M.pointerType === "touch" ? 10 : 2, W = { x: Y, y: we }, S = { originalEvent: M, delta: W };
2663
- Z ? (y.current = W, Oe(bi, b, S, {
2007
+ onPointerMove: P(e.onPointerMove, (C) => {
2008
+ if (!h.current) return;
2009
+ const L = C.clientX - h.current.x, k = C.clientY - h.current.y, X = !!S.current, H = ["left", "right"].includes(m.swipeDirection), Q = ["left", "up"].includes(m.swipeDirection) ? Math.min : Math.max, W = H ? Q(0, L) : 0, pe = H ? 0 : Q(0, k), oe = C.pointerType === "touch" ? 10 : 2, z = { x: W, y: pe }, E = { originalEvent: C, delta: z };
2010
+ X ? (S.current = z, Ee(Oa, w, E, {
2664
2011
  discrete: !1
2665
- })) : Cr(W, v.swipeDirection, ce) ? (y.current = W, Oe(gi, f, S, {
2012
+ })) : Pr(z, m.swipeDirection, oe) ? (S.current = z, Ee(Na, b, E, {
2666
2013
  discrete: !1
2667
- }), M.target.setPointerCapture(M.pointerId)) : (Math.abs(k) > ce || Math.abs(G) > ce) && (g.current = null);
2014
+ }), C.target.setPointerCapture(C.pointerId)) : (Math.abs(L) > oe || Math.abs(k) > oe) && (h.current = null);
2668
2015
  }),
2669
- onPointerUp: A(e.onPointerUp, (M) => {
2670
- const k = y.current, G = M.target;
2671
- if (G.hasPointerCapture(M.pointerId) && G.releasePointerCapture(M.pointerId), y.current = null, g.current = null, k) {
2672
- const Z = M.currentTarget, U = { originalEvent: M, delta: k };
2673
- Cr(k, v.swipeDirection, v.swipeThreshold) ? Oe(hi, E, U, {
2016
+ onPointerUp: P(e.onPointerUp, (C) => {
2017
+ const L = S.current, k = C.target;
2018
+ if (k.hasPointerCapture(C.pointerId) && k.releasePointerCapture(C.pointerId), S.current = null, h.current = null, L) {
2019
+ const X = C.currentTarget, H = { originalEvent: C, delta: L };
2020
+ Pr(L, m.swipeDirection, m.swipeThreshold) ? Ee(La, R, H, {
2674
2021
  discrete: !0
2675
- }) : Oe(
2676
- Ci,
2677
- w,
2678
- U,
2022
+ }) : Ee(
2023
+ Da,
2024
+ I,
2025
+ H,
2679
2026
  {
2680
2027
  discrete: !0
2681
2028
  }
2682
- ), Z.addEventListener("click", (ne) => ne.preventDefault(), {
2029
+ ), X.addEventListener("click", (Q) => Q.preventDefault(), {
2683
2030
  once: !0
2684
2031
  });
2685
2032
  }
@@ -2688,439 +2035,279 @@ var [Ti, wi] = an(Ne, {
2688
2035
  )
2689
2036
  }
2690
2037
  ) }),
2691
- v.viewport
2038
+ m.viewport
2692
2039
  ) })
2693
2040
  ] }) : null;
2694
2041
  }
2695
- ), Ei = (e) => {
2696
- const { __scopeToast: t, children: o, ...r } = e, n = Ye(Ne, t), [s, c] = a.useState(!1), [l, u] = a.useState(!1);
2697
- return Ii(() => c(!0)), a.useEffect(() => {
2698
- const d = window.setTimeout(() => u(!0), 1e3);
2042
+ ), $a = (e) => {
2043
+ const { __scopeToast: r, children: t, ...o } = e, n = De(Te, r), [s, u] = a.useState(!1), [c, f] = a.useState(!1);
2044
+ return ja(() => u(!0)), a.useEffect(() => {
2045
+ const d = window.setTimeout(() => f(!0), 1e3);
2699
2046
  return () => window.clearTimeout(d);
2700
- }, []), l ? null : /* @__PURE__ */ i(Xn, { asChild: !0, children: /* @__PURE__ */ i(yr, { ...r, children: s && /* @__PURE__ */ Ie(_e, { children: [
2047
+ }, []), c ? null : /* @__PURE__ */ i(Ko, { asChild: !0, children: /* @__PURE__ */ i(Dr, { ...o, children: s && /* @__PURE__ */ st(at, { children: [
2701
2048
  n.label,
2702
2049
  " ",
2703
- o
2050
+ t
2704
2051
  ] }) }) });
2705
- }, Ri = "ToastTitle", Ho = a.forwardRef(
2706
- (e, t) => {
2707
- const { __scopeToast: o, ...r } = e;
2708
- return /* @__PURE__ */ i(O.div, { ...r, ref: t });
2052
+ }, Ka = "ToastTitle", ir = a.forwardRef(
2053
+ (e, r) => {
2054
+ const { __scopeToast: t, ...o } = e;
2055
+ return /* @__PURE__ */ i(D.div, { ...o, ref: r });
2709
2056
  }
2710
2057
  );
2711
- Ho.displayName = Ri;
2712
- var _i = "ToastDescription", jo = a.forwardRef(
2713
- (e, t) => {
2714
- const { __scopeToast: o, ...r } = e;
2715
- return /* @__PURE__ */ i(O.div, { ...r, ref: t });
2058
+ ir.displayName = Ka;
2059
+ var Ba = "ToastDescription", cr = a.forwardRef(
2060
+ (e, r) => {
2061
+ const { __scopeToast: t, ...o } = e;
2062
+ return /* @__PURE__ */ i(D.div, { ...o, ref: r });
2716
2063
  }
2717
2064
  );
2718
- jo.displayName = _i;
2719
- var ln = "ToastAction", zo = a.forwardRef(
2720
- (e, t) => {
2721
- const { altText: o, ...r } = e;
2722
- return o.trim() ? /* @__PURE__ */ i(dn, { altText: o, asChild: !0, children: /* @__PURE__ */ i(Xe, { ...r, ref: t }) }) : (console.error(
2723
- `Invalid prop \`altText\` supplied to \`${ln}\`. Expected non-empty \`string\`.`
2065
+ cr.displayName = Ba;
2066
+ var fo = "ToastAction", lr = a.forwardRef(
2067
+ (e, r) => {
2068
+ const { altText: t, ...o } = e;
2069
+ return t.trim() ? /* @__PURE__ */ i(mo, { altText: t, asChild: !0, children: /* @__PURE__ */ i(Le, { ...o, ref: r }) }) : (console.error(
2070
+ `Invalid prop \`altText\` supplied to \`${fo}\`. Expected non-empty \`string\`.`
2724
2071
  ), null);
2725
2072
  }
2726
2073
  );
2727
- zo.displayName = ln;
2728
- var un = "ToastClose", Xe = a.forwardRef(
2729
- (e, t) => {
2730
- const { __scopeToast: o, ...r } = e, n = wi(un, o);
2731
- return /* @__PURE__ */ i(dn, { asChild: !0, children: /* @__PURE__ */ i(
2732
- O.button,
2074
+ lr.displayName = fo;
2075
+ var po = "ToastClose", Le = a.forwardRef(
2076
+ (e, r) => {
2077
+ const { __scopeToast: t, ...o } = e, n = Va(po, t);
2078
+ return /* @__PURE__ */ i(mo, { asChild: !0, children: /* @__PURE__ */ i(
2079
+ D.button,
2733
2080
  {
2734
2081
  type: "button",
2735
- ...r,
2736
- ref: t,
2737
- onClick: A(e.onClick, n.onClose)
2082
+ ...o,
2083
+ ref: r,
2084
+ onClick: P(e.onClick, n.onClose)
2738
2085
  }
2739
2086
  ) });
2740
2087
  }
2741
2088
  );
2742
- Xe.displayName = un;
2743
- var dn = a.forwardRef((e, t) => {
2744
- const { __scopeToast: o, altText: r, ...n } = e;
2089
+ Le.displayName = po;
2090
+ var mo = a.forwardRef((e, r) => {
2091
+ const { __scopeToast: t, altText: o, ...n } = e;
2745
2092
  return /* @__PURE__ */ i(
2746
- O.div,
2093
+ D.div,
2747
2094
  {
2748
2095
  "data-radix-toast-announce-exclude": "",
2749
- "data-radix-toast-announce-alt": r || void 0,
2096
+ "data-radix-toast-announce-alt": o || void 0,
2750
2097
  ...n,
2751
- ref: t
2098
+ ref: r
2752
2099
  }
2753
2100
  );
2754
2101
  });
2755
- function fn(e) {
2756
- const t = [];
2757
- return Array.from(e.childNodes).forEach((r) => {
2758
- if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), Mi(r)) {
2759
- const n = r.ariaHidden || r.hidden || r.style.display === "none", s = r.dataset.radixToastAnnounceExclude === "";
2102
+ function vo(e) {
2103
+ const r = [];
2104
+ return Array.from(e.childNodes).forEach((o) => {
2105
+ if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Ha(o)) {
2106
+ const n = o.ariaHidden || o.hidden || o.style.display === "none", s = o.dataset.radixToastAnnounceExclude === "";
2760
2107
  if (!n)
2761
2108
  if (s) {
2762
- const c = r.dataset.radixToastAnnounceAlt;
2763
- c && t.push(c);
2109
+ const u = o.dataset.radixToastAnnounceAlt;
2110
+ u && r.push(u);
2764
2111
  } else
2765
- t.push(...fn(r));
2112
+ r.push(...vo(o));
2766
2113
  }
2767
- }), t;
2114
+ }), r;
2768
2115
  }
2769
- function Oe(e, t, o, { discrete: r }) {
2770
- const n = o.originalEvent.currentTarget, s = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
2771
- t && n.addEventListener(e, t, { once: !0 }), r ? rt(n, s) : n.dispatchEvent(s);
2116
+ function Ee(e, r, t, { discrete: o }) {
2117
+ const n = t.originalEvent.currentTarget, s = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
2118
+ r && n.addEventListener(e, r, { once: !0 }), o ? Bo(n, s) : n.dispatchEvent(s);
2772
2119
  }
2773
- var Cr = (e, t, o = 0) => {
2774
- const r = Math.abs(e.x), n = Math.abs(e.y), s = r > n;
2775
- return t === "left" || t === "right" ? s && r > o : !s && n > o;
2120
+ var Pr = (e, r, t = 0) => {
2121
+ const o = Math.abs(e.x), n = Math.abs(e.y), s = o > n;
2122
+ return r === "left" || r === "right" ? s && o > t : !s && n > t;
2776
2123
  };
2777
- function Ii(e = () => {
2124
+ function ja(e = () => {
2778
2125
  }) {
2779
- const t = ee(e);
2780
- ge(() => {
2781
- let o = 0, r = 0;
2782
- return o = window.requestAnimationFrame(() => r = window.requestAnimationFrame(t)), () => {
2783
- window.cancelAnimationFrame(o), window.cancelAnimationFrame(r);
2126
+ const r = Re(e);
2127
+ rt(() => {
2128
+ let t = 0, o = 0;
2129
+ return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
2130
+ window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
2784
2131
  };
2785
- }, [t]);
2132
+ }, [r]);
2786
2133
  }
2787
- function Mi(e) {
2134
+ function Ha(e) {
2788
2135
  return e.nodeType === e.ELEMENT_NODE;
2789
2136
  }
2790
- function Pi(e) {
2791
- const t = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
2792
- acceptNode: (r) => {
2793
- const n = r.tagName === "INPUT" && r.type === "hidden";
2794
- return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
2137
+ function za(e) {
2138
+ const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
2139
+ acceptNode: (o) => {
2140
+ const n = o.tagName === "INPUT" && o.type === "hidden";
2141
+ return o.disabled || o.hidden || n ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
2795
2142
  }
2796
2143
  });
2797
- for (; o.nextNode(); ) t.push(o.currentNode);
2798
- return t;
2144
+ for (; t.nextNode(); ) r.push(t.currentNode);
2145
+ return r;
2799
2146
  }
2800
- function ot(e) {
2801
- const t = document.activeElement;
2802
- return e.some((o) => o === t ? !0 : (o.focus(), document.activeElement !== t));
2147
+ function $e(e) {
2148
+ const r = document.activeElement;
2149
+ return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
2803
2150
  }
2804
- var xi = $o, Si = Ko, Ai = Bo, Ni = Ho, Fi = jo, Oi = zo, Di = Xe;
2805
- const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2806
- __proto__: null,
2807
- Action: Oi,
2808
- Close: Di,
2809
- Description: Fi,
2810
- Provider: xi,
2811
- Root: Ai,
2812
- Title: Ni,
2813
- Toast: Bo,
2814
- ToastAction: zo,
2815
- ToastClose: Xe,
2816
- ToastDescription: jo,
2817
- ToastProvider: $o,
2818
- ToastTitle: Ho,
2819
- ToastViewport: Ko,
2820
- Viewport: Si,
2821
- createToastScope: pi
2822
- }, Symbol.toStringTag, { value: "Module" }));
2823
- var pn = "Toggle", Ze = a.forwardRef((e, t) => {
2824
- const { pressed: o, defaultPressed: r, onPressedChange: n, ...s } = e, [c, l] = X({
2825
- prop: o,
2826
- onChange: n,
2827
- defaultProp: r ?? !1,
2828
- caller: pn
2829
- });
2830
- return /* @__PURE__ */ i(
2831
- O.button,
2832
- {
2833
- type: "button",
2834
- "aria-pressed": c,
2835
- "data-state": c ? "on" : "off",
2836
- "data-disabled": e.disabled ? "" : void 0,
2837
- ...s,
2838
- ref: t,
2839
- onClick: A(e.onClick, () => {
2840
- e.disabled || l(!c);
2841
- })
2842
- }
2843
- );
2844
- });
2845
- Ze.displayName = pn;
2846
- var Li = Ze;
2847
- const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2151
+ var Ua = nr, Wa = ar, qa = sr, Ya = ir, Xa = cr, Za = lr, Ja = Le;
2152
+ const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2848
2153
  __proto__: null,
2849
- Root: Li,
2850
- Toggle: Ze
2154
+ Action: Za,
2155
+ Close: Ja,
2156
+ Description: Xa,
2157
+ Provider: Ua,
2158
+ Root: qa,
2159
+ Title: Ya,
2160
+ Toast: sr,
2161
+ ToastAction: lr,
2162
+ ToastClose: Le,
2163
+ ToastDescription: cr,
2164
+ ToastProvider: nr,
2165
+ ToastTitle: ir,
2166
+ ToastViewport: ar,
2167
+ Viewport: Wa,
2168
+ createToastScope: Ma
2851
2169
  }, Symbol.toStringTag, { value: "Module" }));
2852
- var fe = "ToggleGroup", [vn, Uo] = oe(fe, [
2853
- ue
2854
- ]), mn = ue(), Je = V.forwardRef((e, t) => {
2855
- const { type: o, ...r } = e;
2856
- if (o === "single")
2857
- return /* @__PURE__ */ i(ki, { ...r, ref: t });
2858
- if (o === "multiple")
2859
- return /* @__PURE__ */ i(Vi, { ...r, ref: t });
2860
- throw new Error(`Missing prop \`type\` expected on \`${fe}\``);
2861
- });
2862
- Je.displayName = fe;
2863
- var [gn, bn] = vn(fe), ki = V.forwardRef((e, t) => {
2864
- const {
2865
- value: o,
2866
- defaultValue: r,
2867
- onValueChange: n = () => {
2868
- },
2869
- ...s
2870
- } = e, [c, l] = X({
2871
- prop: o,
2872
- defaultProp: r ?? "",
2873
- onChange: n,
2874
- caller: fe
2875
- });
2876
- return /* @__PURE__ */ i(
2877
- gn,
2878
- {
2879
- scope: e.__scopeToggleGroup,
2880
- type: "single",
2881
- value: V.useMemo(() => c ? [c] : [], [c]),
2882
- onItemActivate: l,
2883
- onItemDeactivate: V.useCallback(() => l(""), [l]),
2884
- children: /* @__PURE__ */ i(Cn, { ...s, ref: t })
2885
- }
2886
- );
2887
- }), Vi = V.forwardRef((e, t) => {
2888
- const {
2889
- value: o,
2890
- defaultValue: r,
2891
- onValueChange: n = () => {
2892
- },
2893
- ...s
2894
- } = e, [c, l] = X({
2895
- prop: o,
2896
- defaultProp: r ?? [],
2897
- onChange: n,
2898
- caller: fe
2899
- }), u = V.useCallback(
2900
- (f) => l((b = []) => [...b, f]),
2901
- [l]
2902
- ), d = V.useCallback(
2903
- (f) => l((b = []) => b.filter((w) => w !== f)),
2904
- [l]
2905
- );
2906
- return /* @__PURE__ */ i(
2907
- gn,
2908
- {
2909
- scope: e.__scopeToggleGroup,
2910
- type: "multiple",
2911
- value: c,
2912
- onItemActivate: u,
2913
- onItemDeactivate: d,
2914
- children: /* @__PURE__ */ i(Cn, { ...s, ref: t })
2915
- }
2916
- );
2917
- });
2918
- Je.displayName = fe;
2919
- var [Gi, $i] = vn(fe), Cn = V.forwardRef(
2920
- (e, t) => {
2921
- const {
2922
- __scopeToggleGroup: o,
2923
- disabled: r = !1,
2924
- rovingFocus: n = !0,
2925
- orientation: s,
2926
- dir: c,
2927
- loop: l = !0,
2928
- ...u
2929
- } = e, d = mn(o), f = he(c), b = { role: "group", dir: f, ...u };
2930
- return /* @__PURE__ */ i(Gi, { scope: o, rovingFocus: n, disabled: r, children: n ? /* @__PURE__ */ i(
2931
- Be,
2170
+ var ur = "Toolbar", [Qa, es] = se(ur, [
2171
+ de,
2172
+ Lr
2173
+ ]), dr = de(), bo = Lr(), [ts, go] = Qa(ur), fr = a.forwardRef(
2174
+ (e, r) => {
2175
+ const { __scopeToolbar: t, orientation: o = "horizontal", dir: n, loop: s = !0, ...u } = e, c = dr(t), f = Ae(n);
2176
+ return /* @__PURE__ */ i(ts, { scope: t, orientation: o, dir: f, children: /* @__PURE__ */ i(
2177
+ nt,
2932
2178
  {
2933
2179
  asChild: !0,
2934
- ...d,
2935
- orientation: s,
2180
+ ...c,
2181
+ orientation: o,
2936
2182
  dir: f,
2937
- loop: l,
2938
- children: /* @__PURE__ */ i(O.div, { ...b, ref: t })
2939
- }
2940
- ) : /* @__PURE__ */ i(O.div, { ...b, ref: t }) });
2941
- }
2942
- ), Ke = "ToggleGroupItem", Wo = V.forwardRef(
2943
- (e, t) => {
2944
- const o = bn(Ke, e.__scopeToggleGroup), r = $i(Ke, e.__scopeToggleGroup), n = mn(e.__scopeToggleGroup), s = o.value.includes(e.value), c = r.disabled || e.disabled, l = { ...e, pressed: s, disabled: c }, u = V.useRef(null);
2945
- return r.rovingFocus ? /* @__PURE__ */ i(
2946
- xe,
2947
- {
2948
- asChild: !0,
2949
- ...n,
2950
- focusable: !c,
2951
- active: s,
2952
- ref: u,
2953
- children: /* @__PURE__ */ i(hr, { ...l, ref: t })
2954
- }
2955
- ) : /* @__PURE__ */ i(hr, { ...l, ref: t });
2956
- }
2957
- );
2958
- Wo.displayName = Ke;
2959
- var hr = V.forwardRef(
2960
- (e, t) => {
2961
- const { __scopeToggleGroup: o, value: r, ...n } = e, s = bn(Ke, o), c = { role: "radio", "aria-checked": e.pressed, "aria-pressed": void 0 }, l = s.type === "single" ? c : void 0;
2962
- return /* @__PURE__ */ i(
2963
- Ze,
2964
- {
2965
- ...l,
2966
- ...n,
2967
- ref: t,
2968
- onPressedChange: (u) => {
2969
- u ? s.onItemActivate(r) : s.onItemDeactivate(r);
2970
- }
2971
- }
2972
- );
2973
- }
2974
- ), hn = Je, Tn = Wo;
2975
- const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2976
- __proto__: null,
2977
- Item: Tn,
2978
- Root: hn,
2979
- ToggleGroup: Je,
2980
- ToggleGroupItem: Wo,
2981
- createToggleGroupScope: Uo
2982
- }, Symbol.toStringTag, { value: "Module" }));
2983
- var qo = "Toolbar", [Ki, Bi] = oe(qo, [
2984
- ue,
2985
- Uo
2986
- ]), Yo = ue(), wn = Uo(), [Hi, yn] = Ki(qo), Xo = a.forwardRef(
2987
- (e, t) => {
2988
- const { __scopeToolbar: o, orientation: r = "horizontal", dir: n, loop: s = !0, ...c } = e, l = Yo(o), u = he(n);
2989
- return /* @__PURE__ */ i(Hi, { scope: o, orientation: r, dir: u, children: /* @__PURE__ */ i(
2990
- Be,
2991
- {
2992
- asChild: !0,
2993
- ...l,
2994
- orientation: r,
2995
- dir: u,
2996
2183
  loop: s,
2997
2184
  children: /* @__PURE__ */ i(
2998
- O.div,
2185
+ D.div,
2999
2186
  {
3000
2187
  role: "toolbar",
3001
- "aria-orientation": r,
3002
- dir: u,
3003
- ...c,
3004
- ref: t
2188
+ "aria-orientation": o,
2189
+ dir: f,
2190
+ ...u,
2191
+ ref: r
3005
2192
  }
3006
2193
  )
3007
2194
  }
3008
2195
  ) });
3009
2196
  }
3010
2197
  );
3011
- Xo.displayName = qo;
3012
- var En = "ToolbarSeparator", Zo = a.forwardRef(
3013
- (e, t) => {
3014
- const { __scopeToolbar: o, ...r } = e, n = yn(En, o);
2198
+ fr.displayName = ur;
2199
+ var ho = "ToolbarSeparator", pr = a.forwardRef(
2200
+ (e, r) => {
2201
+ const { __scopeToolbar: t, ...o } = e, n = go(ho, t);
3015
2202
  return /* @__PURE__ */ i(
3016
- Zn,
2203
+ io,
3017
2204
  {
3018
2205
  orientation: n.orientation === "horizontal" ? "vertical" : "horizontal",
3019
- ...r,
3020
- ref: t
2206
+ ...o,
2207
+ ref: r
3021
2208
  }
3022
2209
  );
3023
2210
  }
3024
2211
  );
3025
- Zo.displayName = En;
3026
- var ji = "ToolbarButton", Qe = a.forwardRef(
3027
- (e, t) => {
3028
- const { __scopeToolbar: o, ...r } = e, n = Yo(o);
3029
- return /* @__PURE__ */ i(xe, { asChild: !0, ...n, focusable: !e.disabled, children: /* @__PURE__ */ i(O.button, { type: "button", ...r, ref: t }) });
2212
+ pr.displayName = ho;
2213
+ var rs = "ToolbarButton", ke = a.forwardRef(
2214
+ (e, r) => {
2215
+ const { __scopeToolbar: t, ...o } = e, n = dr(t);
2216
+ return /* @__PURE__ */ i(Se, { asChild: !0, ...n, focusable: !e.disabled, children: /* @__PURE__ */ i(D.button, { type: "button", ...o, ref: r }) });
3030
2217
  }
3031
2218
  );
3032
- Qe.displayName = ji;
3033
- var zi = "ToolbarLink", Jo = a.forwardRef(
3034
- (e, t) => {
3035
- const { __scopeToolbar: o, ...r } = e, n = Yo(o);
3036
- return /* @__PURE__ */ i(xe, { asChild: !0, ...n, focusable: !0, children: /* @__PURE__ */ i(
3037
- O.a,
2219
+ ke.displayName = rs;
2220
+ var os = "ToolbarLink", mr = a.forwardRef(
2221
+ (e, r) => {
2222
+ const { __scopeToolbar: t, ...o } = e, n = dr(t);
2223
+ return /* @__PURE__ */ i(Se, { asChild: !0, ...n, focusable: !0, children: /* @__PURE__ */ i(
2224
+ D.a,
3038
2225
  {
3039
- ...r,
3040
- ref: t,
3041
- onKeyDown: A(e.onKeyDown, (s) => {
2226
+ ...o,
2227
+ ref: r,
2228
+ onKeyDown: P(e.onKeyDown, (s) => {
3042
2229
  s.key === " " && s.currentTarget.click();
3043
2230
  })
3044
2231
  }
3045
2232
  ) });
3046
2233
  }
3047
2234
  );
3048
- Jo.displayName = zi;
3049
- var Rn = "ToolbarToggleGroup", Qo = a.forwardRef(
3050
- (e, t) => {
3051
- const { __scopeToolbar: o, ...r } = e, n = yn(Rn, o), s = wn(o);
2235
+ mr.displayName = os;
2236
+ var Co = "ToolbarToggleGroup", vr = a.forwardRef(
2237
+ (e, r) => {
2238
+ const { __scopeToolbar: t, ...o } = e, n = go(Co, t), s = bo(t);
3052
2239
  return /* @__PURE__ */ i(
3053
- hn,
2240
+ jo,
3054
2241
  {
3055
2242
  "data-orientation": n.orientation,
3056
2243
  dir: n.dir,
3057
2244
  ...s,
3058
- ...r,
3059
- ref: t,
2245
+ ...o,
2246
+ ref: r,
3060
2247
  rovingFocus: !1
3061
2248
  }
3062
2249
  );
3063
2250
  }
3064
2251
  );
3065
- Qo.displayName = Rn;
3066
- var Ui = "ToolbarToggleItem", er = a.forwardRef(
3067
- (e, t) => {
3068
- const { __scopeToolbar: o, ...r } = e, n = wn(o), s = { __scopeToolbar: e.__scopeToolbar };
3069
- return /* @__PURE__ */ i(Qe, { asChild: !0, ...s, children: /* @__PURE__ */ i(Tn, { ...n, ...r, ref: t }) });
2252
+ vr.displayName = Co;
2253
+ var ns = "ToolbarToggleItem", br = a.forwardRef(
2254
+ (e, r) => {
2255
+ const { __scopeToolbar: t, ...o } = e, n = bo(t), s = { __scopeToolbar: e.__scopeToolbar };
2256
+ return /* @__PURE__ */ i(ke, { asChild: !0, ...s, children: /* @__PURE__ */ i(Ho, { ...n, ...o, ref: r }) });
3070
2257
  }
3071
2258
  );
3072
- er.displayName = Ui;
3073
- var Wi = Xo, qi = Zo, Yi = Qe, Xi = Jo, Zi = Qo, Ji = er;
3074
- const mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2259
+ br.displayName = ns;
2260
+ var as = fr, ss = pr, is = ke, cs = mr, ls = vr, us = br;
2261
+ const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3075
2262
  __proto__: null,
3076
- Button: Yi,
3077
- Link: Xi,
3078
- Root: Wi,
3079
- Separator: qi,
3080
- ToggleGroup: Zi,
3081
- ToggleItem: Ji,
3082
- Toolbar: Xo,
3083
- ToolbarButton: Qe,
3084
- ToolbarLink: Jo,
3085
- ToolbarSeparator: Zo,
3086
- ToolbarToggleGroup: Qo,
3087
- ToolbarToggleItem: er,
3088
- createToolbarScope: Bi
2263
+ Button: is,
2264
+ Link: cs,
2265
+ Root: as,
2266
+ Separator: ss,
2267
+ ToggleGroup: ls,
2268
+ ToggleItem: us,
2269
+ Toolbar: fr,
2270
+ ToolbarButton: ke,
2271
+ ToolbarLink: mr,
2272
+ ToolbarSeparator: pr,
2273
+ ToolbarToggleGroup: vr,
2274
+ ToolbarToggleItem: br,
2275
+ createToolbarScope: es
3089
2276
  }, Symbol.toStringTag, { value: "Module" }));
3090
2277
  export {
3091
- Cc as AccessibleIcon,
3092
- nc as Accordion,
3093
- hc as AlertDialog,
3094
- Tc as AspectRatio,
3095
- wc as Avatar,
3096
- yc as Checkbox,
3097
- rc as Collapsible,
3098
- Ec as ContextMenu,
3099
- Rc as Dialog,
3100
- _c as Direction,
3101
- Ic as DropdownMenu,
3102
- sc as Form,
3103
- Mc as HoverCard,
3104
- ac as Label,
3105
- ic as Menubar,
3106
- cc as NavigationMenu,
3107
- Pc as Popover,
3108
- xc as Portal,
3109
- dc as Progress,
3110
- Sc as RadioGroup,
3111
- Ac as ScrollArea,
3112
- Nc as Select,
3113
- Fc as Separator,
3114
- Oc as Slider,
3115
- Dc as Slot,
3116
- Lc as Switch,
3117
- kc as Tabs,
3118
- fc as Toast,
3119
- pc as Toggle,
3120
- vc as ToggleGroup,
3121
- mc as Toolbar,
3122
- Vc as Tooltip,
3123
- Gc as VisuallyHidden,
3124
- lc as unstable_OneTimePasswordField,
3125
- uc as unstable_PasswordToggleField
2278
+ As as AccessibleIcon,
2279
+ bs as Accordion,
2280
+ Ss as AlertDialog,
2281
+ xs as AspectRatio,
2282
+ Ms as Avatar,
2283
+ Ps as Checkbox,
2284
+ vs as Collapsible,
2285
+ Fs as ContextMenu,
2286
+ Ns as Dialog,
2287
+ Os as Direction,
2288
+ Ds as DropdownMenu,
2289
+ hs as Form,
2290
+ Ls as HoverCard,
2291
+ gs as Label,
2292
+ Cs as Menubar,
2293
+ ks as NavigationMenu,
2294
+ Vs as Popover,
2295
+ Gs as Portal,
2296
+ $s as Progress,
2297
+ Ks as RadioGroup,
2298
+ Bs as ScrollArea,
2299
+ js as Select,
2300
+ Es as Separator,
2301
+ Hs as Slider,
2302
+ zs as Slot,
2303
+ Us as Switch,
2304
+ Ws as Tabs,
2305
+ ws as Toast,
2306
+ qs as Toggle,
2307
+ Ys as ToggleGroup,
2308
+ Rs as Toolbar,
2309
+ Xs as Tooltip,
2310
+ Zs as VisuallyHidden,
2311
+ Ts as unstable_OneTimePasswordField,
2312
+ ys as unstable_PasswordToggleField
3126
2313
  };