@namuna-nur/ui-kit 1.4.0 → 1.4.1

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,18 +1,17 @@
1
- import { p as s, P as j, q as pt, u as De, v as ke, w as ve, x as R, y as Y, z as B, D as ft, E as vt, F as Ie, G as mt, J as xt, K as Tt, N as ht, O as Me, Q as wt, U as gt, V as yt, W as bt, X as Et, Y as Ct, Z as Pt, _ as Rt, $ as St, a0 as At } from "./Avatar.tokens.js";
1
+ import { p as s, P as S, q as et, u as Ce, v as U, w as tt, x as Pe, y as ce, z as R, D as q, E as rt, F as Re, G as ot, J as nt, K as st, N as at, O as Ne, Q as it, U as ct, V as lt, W as dt, X as ut, Y as pt, Z as ft, _ as vt, $ as mt, a0 as xt } from "./Avatar.tokens.js";
2
2
  import * as n from "react";
3
- import { useState as _t, useEffect as Nt } from "react";
4
- import * as jt from "react-dom";
5
- import { b as Ot, a as P } from "./twMerge.js";
6
- const Dt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 19, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.6 8a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6.5h6a.75.75 0 0 1 .75.75v6A.75.75 0 0 1 7.6 8zm10.5 0a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 12.1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zM1.6 18.5a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6 11h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zm10.5 0a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75z" })), kt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 13, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.45 12.45a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.42.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.28.3.7a1 1 0 0 1-1 1z" })), Se = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M9.73 18.24a1.2 1.2 0 0 1-.85-.35l-4.53-4.53a1.2 1.2 0 0 1 0-1.7 1.2 1.2 0 0 1 1.7 0l3.68 3.69 8.23-8.23a1.2 1.2 0 0 1 1.7 0 1.2 1.2 0 0 1 0 1.7l-9.08 9.07a1.2 1.2 0 0 1-.85.35" })), It = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.36, d: "m7 17.5 10-10M17 17.5 7 7.5" })), Mt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 9.49a1.4 1.4 0 0 0-1.4 1.39v9.73c0 .76.64 1.39 1.4 1.39a1.4 1.4 0 0 0 1.39-1.39v-9.73a1.4 1.4 0 0 0-1.4-1.4M12.37 3c-.5 0-.97.19-1.32.54q-.25.28-.4.6-.14.35-.14.71c0 .49.2.97.54 1.32.69.69 1.95.69 2.63 0a1.84 1.84 0 0 0 .39-2.02q-.14-.34-.39-.61A1.8 1.8 0 0 0 12.37 3" })), Lt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 15.51a1.4 1.4 0 0 1-1.4-1.39V4.4c0-.76.64-1.39 1.4-1.39s1.39.63 1.39 1.39v9.73a1.4 1.4 0 0 1-1.4 1.4M12.37 22c-.5 0-.97-.19-1.32-.54a3 3 0 0 1-.4-.6q-.14-.35-.14-.71c0-.49.2-.97.54-1.32a1.94 1.94 0 0 1 2.63 0 1.84 1.84 0 0 1 .39 2.02q-.14.33-.39.61-.54.53-1.31.54" })), Ft = {
7
- success: /* @__PURE__ */ s.jsx(Se, { className: "text-success-10 fill-success-10" }),
8
- danger: /* @__PURE__ */ s.jsx(It, { className: "text-danger-10 fill-danger-10" }),
9
- info: /* @__PURE__ */ s.jsx(Mt, { className: "text-info-10 fill-info-10" }),
10
- warning: /* @__PURE__ */ s.jsx(Lt, { className: "text-sidebar-20 fill-sidebar-20" }),
11
- default: /* @__PURE__ */ s.jsx(Se, { className: "text-success-10 fill-success-10" })
3
+ import * as ht from "react-dom";
4
+ import { b as wt, a as P } from "./twMerge.js";
5
+ const Tt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 19, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.6 8a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6.5h6a.75.75 0 0 1 .75.75v6A.75.75 0 0 1 7.6 8zm10.5 0a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 12.1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zM1.6 18.5a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6 11h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zm10.5 0a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75z" })), gt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 13, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.45 12.45a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.42.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.28.3.7a1 1 0 0 1-1 1z" })), Te = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M9.73 18.24a1.2 1.2 0 0 1-.85-.35l-4.53-4.53a1.2 1.2 0 0 1 0-1.7 1.2 1.2 0 0 1 1.7 0l3.68 3.69 8.23-8.23a1.2 1.2 0 0 1 1.7 0 1.2 1.2 0 0 1 0 1.7l-9.08 9.07a1.2 1.2 0 0 1-.85.35" })), yt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.36, d: "m7 17.5 10-10M17 17.5 7 7.5" })), bt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 9.49a1.4 1.4 0 0 0-1.4 1.39v9.73c0 .76.64 1.39 1.4 1.39a1.4 1.4 0 0 0 1.39-1.39v-9.73a1.4 1.4 0 0 0-1.4-1.4M12.37 3c-.5 0-.97.19-1.32.54q-.25.28-.4.6-.14.35-.14.71c0 .49.2.97.54 1.32.69.69 1.95.69 2.63 0a1.84 1.84 0 0 0 .39-2.02q-.14-.34-.39-.61A1.8 1.8 0 0 0 12.37 3" })), Et = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 15.51a1.4 1.4 0 0 1-1.4-1.39V4.4c0-.76.64-1.39 1.4-1.39s1.39.63 1.39 1.39v9.73a1.4 1.4 0 0 1-1.4 1.4M12.37 22c-.5 0-.97-.19-1.32-.54a3 3 0 0 1-.4-.6q-.14-.35-.14-.71c0-.49.2-.97.54-1.32a1.94 1.94 0 0 1 2.63 0 1.84 1.84 0 0 1 .39 2.02q-.14.33-.39.61-.54.53-1.31.54" })), Ct = {
6
+ success: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" }),
7
+ danger: /* @__PURE__ */ s.jsx(yt, { className: "text-danger-10 fill-danger-10" }),
8
+ info: /* @__PURE__ */ s.jsx(bt, { className: "text-info-10 fill-info-10" }),
9
+ warning: /* @__PURE__ */ s.jsx(Et, { className: "text-sidebar-20 fill-sidebar-20" }),
10
+ default: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" })
12
11
  };
13
- var Vt = "VisuallyHidden", Q = n.forwardRef(
12
+ var Pt = "VisuallyHidden", G = n.forwardRef(
14
13
  (e, r) => /* @__PURE__ */ s.jsx(
15
- j.span,
14
+ S.span,
16
15
  {
17
16
  ...e,
18
17
  ref: r,
@@ -33,134 +32,103 @@ var Vt = "VisuallyHidden", Q = n.forwardRef(
33
32
  }
34
33
  )
35
34
  );
36
- Q.displayName = Vt;
37
- var $t = Q, me = "ToastProvider", [xe, Ht, Kt] = pt("Toast"), [Le, Yr] = De("Toast", [Kt]), [Wt, J] = Le(me), Fe = (e) => {
38
- const {
39
- __scopeToast: r,
40
- label: t = "Notification",
41
- duration: o = 5e3,
42
- swipeDirection: a = "right",
43
- swipeThreshold: i = 50,
44
- children: l
45
- } = e, [v, d] = n.useState(null), [c, p] = n.useState(0), m = n.useRef(!1), w = n.useRef(!1);
46
- return t.trim() || console.error(
47
- `Invalid prop \`label\` supplied to \`${me}\`. Expected non-empty \`string\`.`
48
- ), /* @__PURE__ */ s.jsx(xe.Provider, { scope: r, children: /* @__PURE__ */ s.jsx(
49
- Wt,
50
- {
51
- scope: r,
52
- label: t,
53
- duration: o,
54
- swipeDirection: a,
55
- swipeThreshold: i,
56
- toastCount: c,
57
- viewport: v,
58
- onViewportChange: d,
59
- onToastAdd: n.useCallback(() => p((h) => h + 1), []),
60
- onToastRemove: n.useCallback(() => p((h) => h - 1), []),
61
- isFocusedToastEscapeKeyDownRef: m,
62
- isClosePausedRef: w,
63
- children: l
64
- }
65
- ) });
66
- };
67
- Fe.displayName = me;
68
- var Ve = "ToastViewport", zt = ["F8"], le = "toast.viewportPause", de = "toast.viewportResume", $e = n.forwardRef(
35
+ G.displayName = Pt;
36
+ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toast", [At]), [Ar, X] = Ae(Nt), ke = "ToastViewport", kt = ["F8"], oe = "toast.viewportPause", ne = "toast.viewportResume", Se = n.forwardRef(
69
37
  (e, r) => {
70
38
  const {
71
39
  __scopeToast: t,
72
- hotkey: o = zt,
40
+ hotkey: o = kt,
73
41
  label: a = "Notifications ({hotkey})",
74
- ...i
75
- } = e, l = J(Ve, t), v = Ht(t), d = n.useRef(null), c = n.useRef(null), p = n.useRef(null), m = n.useRef(null), w = B(r, m, l.onViewportChange), h = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
42
+ ...c
43
+ } = e, l = X(ke, t), m = jt(t), u = n.useRef(null), i = n.useRef(null), p = n.useRef(null), x = n.useRef(null), g = U(r, x, l.onViewportChange), w = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
76
44
  n.useEffect(() => {
77
- const u = (b) => {
78
- var g;
79
- o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((g = m.current) == null || g.focus());
45
+ const d = (b) => {
46
+ var T;
47
+ o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((T = x.current) == null || T.focus());
80
48
  };
81
- return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
49
+ return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
82
50
  }, [o]), n.useEffect(() => {
83
- const u = d.current, b = m.current;
84
- if (y && u && b) {
85
- const T = () => {
51
+ const d = u.current, b = x.current;
52
+ if (y && d && b) {
53
+ const h = () => {
86
54
  if (!l.isClosePausedRef.current) {
87
- const S = new CustomEvent(le);
88
- b.dispatchEvent(S), l.isClosePausedRef.current = !0;
55
+ const N = new CustomEvent(oe);
56
+ b.dispatchEvent(N), l.isClosePausedRef.current = !0;
89
57
  }
90
- }, g = () => {
58
+ }, T = () => {
91
59
  if (l.isClosePausedRef.current) {
92
- const S = new CustomEvent(de);
93
- b.dispatchEvent(S), l.isClosePausedRef.current = !1;
60
+ const N = new CustomEvent(ne);
61
+ b.dispatchEvent(N), l.isClosePausedRef.current = !1;
94
62
  }
95
- }, E = (S) => {
96
- !u.contains(S.relatedTarget) && g();
63
+ }, E = (N) => {
64
+ !d.contains(N.relatedTarget) && T();
97
65
  }, C = () => {
98
- u.contains(document.activeElement) || g();
66
+ d.contains(document.activeElement) || T();
99
67
  };
100
- return u.addEventListener("focusin", T), u.addEventListener("focusout", E), u.addEventListener("pointermove", T), u.addEventListener("pointerleave", C), window.addEventListener("blur", T), window.addEventListener("focus", g), () => {
101
- u.removeEventListener("focusin", T), u.removeEventListener("focusout", E), u.removeEventListener("pointermove", T), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", T), window.removeEventListener("focus", g);
68
+ return d.addEventListener("focusin", h), d.addEventListener("focusout", E), d.addEventListener("pointermove", h), d.addEventListener("pointerleave", C), window.addEventListener("blur", h), window.addEventListener("focus", T), () => {
69
+ d.removeEventListener("focusin", h), d.removeEventListener("focusout", E), d.removeEventListener("pointermove", h), d.removeEventListener("pointerleave", C), window.removeEventListener("blur", h), window.removeEventListener("focus", T);
102
70
  };
103
71
  }
104
72
  }, [y, l.isClosePausedRef]);
105
73
  const f = n.useCallback(
106
- ({ tabbingDirection: u }) => {
107
- const T = v().map((g) => {
108
- const E = g.ref.current, C = [E, ...or(E)];
109
- return u === "forwards" ? C : C.reverse();
74
+ ({ tabbingDirection: d }) => {
75
+ const h = m().map((T) => {
76
+ const E = T.ref.current, C = [E, ...Wt(E)];
77
+ return d === "forwards" ? C : C.reverse();
110
78
  });
111
- return (u === "forwards" ? T.reverse() : T).flat();
79
+ return (d === "forwards" ? h.reverse() : h).flat();
112
80
  },
113
- [v]
81
+ [m]
114
82
  );
115
83
  return n.useEffect(() => {
116
- const u = m.current;
117
- if (u) {
118
- const b = (T) => {
119
- var C, S, _;
120
- const g = T.altKey || T.ctrlKey || T.metaKey;
121
- if (T.key === "Tab" && !g) {
122
- const F = document.activeElement, I = T.shiftKey;
123
- if (T.target === u && I) {
124
- (C = c.current) == null || C.focus();
84
+ const d = x.current;
85
+ if (d) {
86
+ const b = (h) => {
87
+ var C, N, A;
88
+ const T = h.altKey || h.ctrlKey || h.metaKey;
89
+ if (h.key === "Tab" && !T) {
90
+ const F = document.activeElement, O = h.shiftKey;
91
+ if (h.target === d && O) {
92
+ (C = i.current) == null || C.focus();
125
93
  return;
126
94
  }
127
- const O = f({ tabbingDirection: I ? "backwards" : "forwards" }), W = O.findIndex((x) => x === F);
128
- se(O.slice(W + 1)) ? T.preventDefault() : I ? (S = c.current) == null || S.focus() : (_ = p.current) == null || _.focus();
95
+ const _ = f({ tabbingDirection: O ? "backwards" : "forwards" }), H = _.findIndex((v) => v === F);
96
+ te(_.slice(H + 1)) ? h.preventDefault() : O ? (N = i.current) == null || N.focus() : (A = p.current) == null || A.focus();
129
97
  }
130
98
  };
131
- return u.addEventListener("keydown", b), () => u.removeEventListener("keydown", b);
99
+ return d.addEventListener("keydown", b), () => d.removeEventListener("keydown", b);
132
100
  }
133
- }, [v, f]), /* @__PURE__ */ s.jsxs(
134
- ft,
101
+ }, [m, f]), /* @__PURE__ */ s.jsxs(
102
+ tt,
135
103
  {
136
- ref: d,
104
+ ref: u,
137
105
  role: "region",
138
- "aria-label": a.replace("{hotkey}", h),
106
+ "aria-label": a.replace("{hotkey}", w),
139
107
  tabIndex: -1,
140
108
  style: { pointerEvents: y ? void 0 : "none" },
141
109
  children: [
142
110
  y && /* @__PURE__ */ s.jsx(
143
- ue,
111
+ se,
144
112
  {
145
- ref: c,
113
+ ref: i,
146
114
  onFocusFromOutsideViewport: () => {
147
- const u = f({
115
+ const d = f({
148
116
  tabbingDirection: "forwards"
149
117
  });
150
- se(u);
118
+ te(d);
151
119
  }
152
120
  }
153
121
  ),
154
- /* @__PURE__ */ s.jsx(xe.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(j.ol, { tabIndex: -1, ...i, ref: w }) }),
122
+ /* @__PURE__ */ s.jsx(je.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(S.ol, { tabIndex: -1, ...c, ref: g }) }),
155
123
  y && /* @__PURE__ */ s.jsx(
156
- ue,
124
+ se,
157
125
  {
158
126
  ref: p,
159
127
  onFocusFromOutsideViewport: () => {
160
- const u = f({
128
+ const d = f({
161
129
  tabbingDirection: "backwards"
162
130
  });
163
- se(u);
131
+ te(d);
164
132
  }
165
133
  }
166
134
  )
@@ -169,12 +137,12 @@ var Ve = "ToastViewport", zt = ["F8"], le = "toast.viewportPause", de = "toast.v
169
137
  );
170
138
  }
171
139
  );
172
- $e.displayName = Ve;
173
- var He = "ToastFocusProxy", ue = n.forwardRef(
140
+ Se.displayName = ke;
141
+ var _e = "ToastFocusProxy", se = n.forwardRef(
174
142
  (e, r) => {
175
- const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, i = J(He, t);
143
+ const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, c = X(_e, t);
176
144
  return /* @__PURE__ */ s.jsx(
177
- Q,
145
+ G,
178
146
  {
179
147
  "aria-hidden": !0,
180
148
  tabIndex: 0,
@@ -182,155 +150,155 @@ var He = "ToastFocusProxy", ue = n.forwardRef(
182
150
  ref: r,
183
151
  style: { position: "fixed" },
184
152
  onFocus: (l) => {
185
- var c;
186
- const v = l.relatedTarget;
187
- !((c = i.viewport) != null && c.contains(v)) && o();
153
+ var i;
154
+ const m = l.relatedTarget;
155
+ !((i = c.viewport) != null && i.contains(m)) && o();
188
156
  }
189
157
  }
190
158
  );
191
159
  }
192
160
  );
193
- ue.displayName = He;
194
- var Z = "Toast", Ut = "toast.swipeStart", qt = "toast.swipeMove", Gt = "toast.swipeCancel", Xt = "toast.swipeEnd", Ke = n.forwardRef(
161
+ se.displayName = _e;
162
+ var Y = "Toast", St = "toast.swipeStart", _t = "toast.swipeMove", Dt = "toast.swipeCancel", Ot = "toast.swipeEnd", De = n.forwardRef(
195
163
  (e, r) => {
196
- const { forceMount: t, open: o, defaultOpen: a, onOpenChange: i, ...l } = e, [v = !0, d] = ke({
164
+ const { forceMount: t, open: o, defaultOpen: a, onOpenChange: c, ...l } = e, [m = !0, u] = Pe({
197
165
  prop: o,
198
166
  defaultProp: a,
199
- onChange: i
167
+ onChange: c
200
168
  });
201
- return /* @__PURE__ */ s.jsx(ve, { present: t || v, children: /* @__PURE__ */ s.jsx(
202
- Qt,
169
+ return /* @__PURE__ */ s.jsx(ce, { present: t || m, children: /* @__PURE__ */ s.jsx(
170
+ Ft,
203
171
  {
204
- open: v,
172
+ open: m,
205
173
  ...l,
206
174
  ref: r,
207
- onClose: () => d(!1),
208
- onPause: Y(e.onPause),
209
- onResume: Y(e.onResume),
210
- onSwipeStart: R(e.onSwipeStart, (c) => {
211
- c.currentTarget.setAttribute("data-swipe", "start");
175
+ onClose: () => u(!1),
176
+ onPause: q(e.onPause),
177
+ onResume: q(e.onResume),
178
+ onSwipeStart: R(e.onSwipeStart, (i) => {
179
+ i.currentTarget.setAttribute("data-swipe", "start");
212
180
  }),
213
- onSwipeMove: R(e.onSwipeMove, (c) => {
214
- const { x: p, y: m } = c.detail.delta;
215
- c.currentTarget.setAttribute("data-swipe", "move"), c.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${p}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${m}px`);
181
+ onSwipeMove: R(e.onSwipeMove, (i) => {
182
+ const { x: p, y: x } = i.detail.delta;
183
+ i.currentTarget.setAttribute("data-swipe", "move"), i.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${x}px`);
216
184
  }),
217
- onSwipeCancel: R(e.onSwipeCancel, (c) => {
218
- c.currentTarget.setAttribute("data-swipe", "cancel"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
185
+ onSwipeCancel: R(e.onSwipeCancel, (i) => {
186
+ i.currentTarget.setAttribute("data-swipe", "cancel"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
219
187
  }),
220
- onSwipeEnd: R(e.onSwipeEnd, (c) => {
221
- const { x: p, y: m } = c.detail.delta;
222
- c.currentTarget.setAttribute("data-swipe", "end"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${p}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), d(!1);
188
+ onSwipeEnd: R(e.onSwipeEnd, (i) => {
189
+ const { x: p, y: x } = i.detail.delta;
190
+ i.currentTarget.setAttribute("data-swipe", "end"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${x}px`), u(!1);
223
191
  })
224
192
  }
225
193
  ) });
226
194
  }
227
195
  );
228
- Ke.displayName = Z;
229
- var [Yt, Bt] = Le(Z, {
196
+ De.displayName = Y;
197
+ var [Lt, It] = Ae(Y, {
230
198
  onClose() {
231
199
  }
232
- }), Qt = n.forwardRef(
200
+ }), Ft = n.forwardRef(
233
201
  (e, r) => {
234
202
  const {
235
203
  __scopeToast: t,
236
204
  type: o = "foreground",
237
205
  duration: a,
238
- open: i,
206
+ open: c,
239
207
  onClose: l,
240
- onEscapeKeyDown: v,
241
- onPause: d,
242
- onResume: c,
208
+ onEscapeKeyDown: m,
209
+ onPause: u,
210
+ onResume: i,
243
211
  onSwipeStart: p,
244
- onSwipeMove: m,
245
- onSwipeCancel: w,
246
- onSwipeEnd: h,
212
+ onSwipeMove: x,
213
+ onSwipeCancel: g,
214
+ onSwipeEnd: w,
247
215
  ...y
248
- } = e, f = J(Z, t), [u, b] = n.useState(null), T = B(r, (x) => b(x)), g = n.useRef(null), E = n.useRef(null), C = a || f.duration, S = n.useRef(0), _ = n.useRef(C), F = n.useRef(0), { onToastAdd: I, onToastRemove: oe } = f, M = Y(() => {
249
- var A;
250
- (u == null ? void 0 : u.contains(document.activeElement)) && ((A = f.viewport) == null || A.focus()), l();
251
- }), O = n.useCallback(
252
- (x) => {
253
- !x || x === 1 / 0 || (window.clearTimeout(F.current), S.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(M, x));
216
+ } = e, f = X(Y, t), [d, b] = n.useState(null), h = U(r, (v) => b(v)), T = n.useRef(null), E = n.useRef(null), C = a || f.duration, N = n.useRef(0), A = n.useRef(C), F = n.useRef(0), { onToastAdd: O, onToastRemove: Z } = f, L = q(() => {
217
+ var j;
218
+ (d == null ? void 0 : d.contains(document.activeElement)) && ((j = f.viewport) == null || j.focus()), l();
219
+ }), _ = n.useCallback(
220
+ (v) => {
221
+ !v || v === 1 / 0 || (window.clearTimeout(F.current), N.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(L, v));
254
222
  },
255
- [M]
223
+ [L]
256
224
  );
257
225
  n.useEffect(() => {
258
- const x = f.viewport;
259
- if (x) {
260
- const A = () => {
261
- O(_.current), c == null || c();
262
- }, N = () => {
263
- const V = (/* @__PURE__ */ new Date()).getTime() - S.current;
264
- _.current = _.current - V, window.clearTimeout(F.current), d == null || d();
226
+ const v = f.viewport;
227
+ if (v) {
228
+ const j = () => {
229
+ _(A.current), i == null || i();
230
+ }, k = () => {
231
+ const M = (/* @__PURE__ */ new Date()).getTime() - N.current;
232
+ A.current = A.current - M, window.clearTimeout(F.current), u == null || u();
265
233
  };
266
- return x.addEventListener(le, N), x.addEventListener(de, A), () => {
267
- x.removeEventListener(le, N), x.removeEventListener(de, A);
234
+ return v.addEventListener(oe, k), v.addEventListener(ne, j), () => {
235
+ v.removeEventListener(oe, k), v.removeEventListener(ne, j);
268
236
  };
269
237
  }
270
- }, [f.viewport, C, d, c, O]), n.useEffect(() => {
271
- i && !f.isClosePausedRef.current && O(C);
272
- }, [i, C, f.isClosePausedRef, O]), n.useEffect(() => (I(), () => oe()), [I, oe]);
273
- const W = n.useMemo(() => u ? Ye(u) : null, [u]);
238
+ }, [f.viewport, C, u, i, _]), n.useEffect(() => {
239
+ c && !f.isClosePausedRef.current && _(C);
240
+ }, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (O(), () => Z()), [O, Z]);
241
+ const H = n.useMemo(() => d ? $e(d) : null, [d]);
274
242
  return f.viewport ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
275
- W && /* @__PURE__ */ s.jsx(
276
- Jt,
243
+ H && /* @__PURE__ */ s.jsx(
244
+ Mt,
277
245
  {
278
246
  __scopeToast: t,
279
247
  role: "status",
280
248
  "aria-live": o === "foreground" ? "assertive" : "polite",
281
249
  "aria-atomic": !0,
282
- children: W
250
+ children: H
283
251
  }
284
252
  ),
285
- /* @__PURE__ */ s.jsx(Yt, { scope: t, onClose: M, children: jt.createPortal(
286
- /* @__PURE__ */ s.jsx(xe.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
287
- vt,
253
+ /* @__PURE__ */ s.jsx(Lt, { scope: t, onClose: L, children: ht.createPortal(
254
+ /* @__PURE__ */ s.jsx(je.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
255
+ rt,
288
256
  {
289
257
  asChild: !0,
290
- onEscapeKeyDown: R(v, () => {
291
- f.isFocusedToastEscapeKeyDownRef.current || M(), f.isFocusedToastEscapeKeyDownRef.current = !1;
258
+ onEscapeKeyDown: R(m, () => {
259
+ f.isFocusedToastEscapeKeyDownRef.current || L(), f.isFocusedToastEscapeKeyDownRef.current = !1;
292
260
  }),
293
261
  children: /* @__PURE__ */ s.jsx(
294
- j.li,
262
+ S.li,
295
263
  {
296
264
  role: "status",
297
265
  "aria-live": "off",
298
266
  "aria-atomic": !0,
299
267
  tabIndex: 0,
300
- "data-state": i ? "open" : "closed",
268
+ "data-state": c ? "open" : "closed",
301
269
  "data-swipe-direction": f.swipeDirection,
302
270
  ...y,
303
- ref: T,
271
+ ref: h,
304
272
  style: { userSelect: "none", touchAction: "none", ...e.style },
305
- onKeyDown: R(e.onKeyDown, (x) => {
306
- x.key === "Escape" && (v == null || v(x.nativeEvent), x.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, M()));
273
+ onKeyDown: R(e.onKeyDown, (v) => {
274
+ v.key === "Escape" && (m == null || m(v.nativeEvent), v.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, L()));
307
275
  }),
308
- onPointerDown: R(e.onPointerDown, (x) => {
309
- x.button === 0 && (g.current = { x: x.clientX, y: x.clientY });
276
+ onPointerDown: R(e.onPointerDown, (v) => {
277
+ v.button === 0 && (T.current = { x: v.clientX, y: v.clientY });
310
278
  }),
311
- onPointerMove: R(e.onPointerMove, (x) => {
312
- if (!g.current) return;
313
- const A = x.clientX - g.current.x, N = x.clientY - g.current.y, V = !!E.current, $ = ["left", "right"].includes(f.swipeDirection), z = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, dt = $ ? z(0, A) : 0, ut = $ ? 0 : z(0, N), ne = x.pointerType === "touch" ? 10 : 2, U = { x: dt, y: ut }, Re = { originalEvent: x, delta: U };
314
- V ? (E.current = U, q(qt, m, Re, {
279
+ onPointerMove: R(e.onPointerMove, (v) => {
280
+ if (!T.current) return;
281
+ const j = v.clientX - T.current.x, k = v.clientY - T.current.y, M = !!E.current, V = ["left", "right"].includes(f.swipeDirection), K = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, Qe = V ? K(0, j) : 0, Ze = V ? 0 : K(0, k), ee = v.pointerType === "touch" ? 10 : 2, W = { x: Qe, y: Ze }, we = { originalEvent: v, delta: W };
282
+ M ? (E.current = W, z(_t, x, we, {
315
283
  discrete: !1
316
- })) : Ae(U, f.swipeDirection, ne) ? (E.current = U, q(Ut, p, Re, {
284
+ })) : ge(W, f.swipeDirection, ee) ? (E.current = W, z(St, p, we, {
317
285
  discrete: !1
318
- }), x.target.setPointerCapture(x.pointerId)) : (Math.abs(A) > ne || Math.abs(N) > ne) && (g.current = null);
286
+ }), v.target.setPointerCapture(v.pointerId)) : (Math.abs(j) > ee || Math.abs(k) > ee) && (T.current = null);
319
287
  }),
320
- onPointerUp: R(e.onPointerUp, (x) => {
321
- const A = E.current, N = x.target;
322
- if (N.hasPointerCapture(x.pointerId) && N.releasePointerCapture(x.pointerId), E.current = null, g.current = null, A) {
323
- const V = x.currentTarget, $ = { originalEvent: x, delta: A };
324
- Ae(A, f.swipeDirection, f.swipeThreshold) ? q(Xt, h, $, {
288
+ onPointerUp: R(e.onPointerUp, (v) => {
289
+ const j = E.current, k = v.target;
290
+ if (k.hasPointerCapture(v.pointerId) && k.releasePointerCapture(v.pointerId), E.current = null, T.current = null, j) {
291
+ const M = v.currentTarget, V = { originalEvent: v, delta: j };
292
+ ge(j, f.swipeDirection, f.swipeThreshold) ? z(Ot, w, V, {
325
293
  discrete: !0
326
- }) : q(
327
- Gt,
328
- w,
329
- $,
294
+ }) : z(
295
+ Dt,
296
+ g,
297
+ V,
330
298
  {
331
299
  discrete: !0
332
300
  }
333
- ), V.addEventListener("click", (z) => z.preventDefault(), {
301
+ ), M.addEventListener("click", (K) => K.preventDefault(), {
334
302
  once: !0
335
303
  });
336
304
  }
@@ -343,44 +311,44 @@ var [Yt, Bt] = Le(Z, {
343
311
  ) })
344
312
  ] }) : null;
345
313
  }
346
- ), Jt = (e) => {
347
- const { __scopeToast: r, children: t, ...o } = e, a = J(Z, r), [i, l] = n.useState(!1), [v, d] = n.useState(!1);
348
- return tr(() => l(!0)), n.useEffect(() => {
349
- const c = window.setTimeout(() => d(!0), 1e3);
350
- return () => window.clearTimeout(c);
351
- }, []), v ? null : /* @__PURE__ */ s.jsx(Ie, { asChild: !0, children: /* @__PURE__ */ s.jsx(Q, { ...o, children: i && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
314
+ ), Mt = (e) => {
315
+ const { __scopeToast: r, children: t, ...o } = e, a = X(Y, r), [c, l] = n.useState(!1), [m, u] = n.useState(!1);
316
+ return Ht(() => l(!0)), n.useEffect(() => {
317
+ const i = window.setTimeout(() => u(!0), 1e3);
318
+ return () => window.clearTimeout(i);
319
+ }, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(G, { ...o, children: c && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
352
320
  a.label,
353
321
  " ",
354
322
  t
355
323
  ] }) }) });
356
- }, Zt = "ToastTitle", We = n.forwardRef(
324
+ }, Vt = "ToastTitle", Oe = n.forwardRef(
357
325
  (e, r) => {
358
326
  const { __scopeToast: t, ...o } = e;
359
- return /* @__PURE__ */ s.jsx(j.div, { ...o, ref: r });
327
+ return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
360
328
  }
361
329
  );
362
- We.displayName = Zt;
363
- var er = "ToastDescription", ze = n.forwardRef(
330
+ Oe.displayName = Vt;
331
+ var $t = "ToastDescription", Le = n.forwardRef(
364
332
  (e, r) => {
365
333
  const { __scopeToast: t, ...o } = e;
366
- return /* @__PURE__ */ s.jsx(j.div, { ...o, ref: r });
334
+ return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
367
335
  }
368
336
  );
369
- ze.displayName = er;
370
- var Ue = "ToastAction", qe = n.forwardRef(
337
+ Le.displayName = $t;
338
+ var Ie = "ToastAction", Fe = n.forwardRef(
371
339
  (e, r) => {
372
340
  const { altText: t, ...o } = e;
373
- return t.trim() ? /* @__PURE__ */ s.jsx(Xe, { altText: t, asChild: !0, children: /* @__PURE__ */ s.jsx(Te, { ...o, ref: r }) }) : (console.error(
374
- `Invalid prop \`altText\` supplied to \`${Ue}\`. Expected non-empty \`string\`.`
341
+ return t.trim() ? /* @__PURE__ */ s.jsx(Ve, { altText: t, asChild: !0, children: /* @__PURE__ */ s.jsx(le, { ...o, ref: r }) }) : (console.error(
342
+ `Invalid prop \`altText\` supplied to \`${Ie}\`. Expected non-empty \`string\`.`
375
343
  ), null);
376
344
  }
377
345
  );
378
- qe.displayName = Ue;
379
- var Ge = "ToastClose", Te = n.forwardRef(
346
+ Fe.displayName = Ie;
347
+ var Me = "ToastClose", le = n.forwardRef(
380
348
  (e, r) => {
381
- const { __scopeToast: t, ...o } = e, a = Bt(Ge, t);
382
- return /* @__PURE__ */ s.jsx(Xe, { asChild: !0, children: /* @__PURE__ */ s.jsx(
383
- j.button,
349
+ const { __scopeToast: t, ...o } = e, a = It(Me, t);
350
+ return /* @__PURE__ */ s.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ s.jsx(
351
+ S.button,
384
352
  {
385
353
  type: "button",
386
354
  ...o,
@@ -390,11 +358,11 @@ var Ge = "ToastClose", Te = n.forwardRef(
390
358
  ) });
391
359
  }
392
360
  );
393
- Te.displayName = Ge;
394
- var Xe = n.forwardRef((e, r) => {
361
+ le.displayName = Me;
362
+ var Ve = n.forwardRef((e, r) => {
395
363
  const { __scopeToast: t, altText: o, ...a } = e;
396
364
  return /* @__PURE__ */ s.jsx(
397
- j.div,
365
+ S.div,
398
366
  {
399
367
  "data-radix-toast-announce-exclude": "",
400
368
  "data-radix-toast-announce-alt": o || void 0,
@@ -403,42 +371,42 @@ var Xe = n.forwardRef((e, r) => {
403
371
  }
404
372
  );
405
373
  });
406
- function Ye(e) {
374
+ function $e(e) {
407
375
  const r = [];
408
376
  return Array.from(e.childNodes).forEach((o) => {
409
- if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), rr(o)) {
410
- const a = o.ariaHidden || o.hidden || o.style.display === "none", i = o.dataset.radixToastAnnounceExclude === "";
377
+ if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Kt(o)) {
378
+ const a = o.ariaHidden || o.hidden || o.style.display === "none", c = o.dataset.radixToastAnnounceExclude === "";
411
379
  if (!a)
412
- if (i) {
380
+ if (c) {
413
381
  const l = o.dataset.radixToastAnnounceAlt;
414
382
  l && r.push(l);
415
383
  } else
416
- r.push(...Ye(o));
384
+ r.push(...$e(o));
417
385
  }
418
386
  }), r;
419
387
  }
420
- function q(e, r, t, { discrete: o }) {
421
- const a = t.originalEvent.currentTarget, i = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
422
- r && a.addEventListener(e, r, { once: !0 }), o ? mt(a, i) : a.dispatchEvent(i);
388
+ function z(e, r, t, { discrete: o }) {
389
+ const a = t.originalEvent.currentTarget, c = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
390
+ r && a.addEventListener(e, r, { once: !0 }), o ? ot(a, c) : a.dispatchEvent(c);
423
391
  }
424
- var Ae = (e, r, t = 0) => {
425
- const o = Math.abs(e.x), a = Math.abs(e.y), i = o > a;
426
- return r === "left" || r === "right" ? i && o > t : !i && a > t;
392
+ var ge = (e, r, t = 0) => {
393
+ const o = Math.abs(e.x), a = Math.abs(e.y), c = o > a;
394
+ return r === "left" || r === "right" ? c && o > t : !c && a > t;
427
395
  };
428
- function tr(e = () => {
396
+ function Ht(e = () => {
429
397
  }) {
430
- const r = Y(e);
431
- xt(() => {
398
+ const r = q(e);
399
+ nt(() => {
432
400
  let t = 0, o = 0;
433
401
  return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
434
402
  window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
435
403
  };
436
404
  }, [r]);
437
405
  }
438
- function rr(e) {
406
+ function Kt(e) {
439
407
  return e.nodeType === e.ELEMENT_NODE;
440
408
  }
441
- function or(e) {
409
+ function Wt(e) {
442
410
  const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
443
411
  acceptNode: (o) => {
444
412
  const a = o.tagName === "INPUT" && o.type === "hidden";
@@ -448,130 +416,42 @@ function or(e) {
448
416
  for (; t.nextNode(); ) r.push(t.currentNode);
449
417
  return r;
450
418
  }
451
- function se(e) {
419
+ function te(e) {
452
420
  const r = document.activeElement;
453
421
  return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
454
422
  }
455
- var nr = Fe, Be = $e, Qe = Ke, Je = We, Ze = ze, et = qe, tt = Te;
456
- const _e = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ne = Ot, sr = (e, r) => (t) => {
423
+ var He = Se, Ke = De, We = Oe, ze = Le, qe = Fe, Ue = le;
424
+ const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, zt = (e, r) => (t) => {
457
425
  var o;
458
- if ((r == null ? void 0 : r.variants) == null) return Ne(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
459
- const { variants: a, defaultVariants: i } = r, l = Object.keys(a).map((c) => {
460
- const p = t == null ? void 0 : t[c], m = i == null ? void 0 : i[c];
426
+ if ((r == null ? void 0 : r.variants) == null) return be(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
427
+ const { variants: a, defaultVariants: c } = r, l = Object.keys(a).map((i) => {
428
+ const p = t == null ? void 0 : t[i], x = c == null ? void 0 : c[i];
461
429
  if (p === null) return null;
462
- const w = _e(p) || _e(m);
463
- return a[c][w];
464
- }), v = t && Object.entries(t).reduce((c, p) => {
465
- let [m, w] = p;
466
- return w === void 0 || (c[m] = w), c;
467
- }, {}), d = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((c, p) => {
468
- let { class: m, className: w, ...h } = p;
469
- return Object.entries(h).every((y) => {
470
- let [f, u] = y;
471
- return Array.isArray(u) ? u.includes({
472
- ...i,
473
- ...v
430
+ const g = ye(p) || ye(x);
431
+ return a[i][g];
432
+ }), m = t && Object.entries(t).reduce((i, p) => {
433
+ let [x, g] = p;
434
+ return g === void 0 || (i[x] = g), i;
435
+ }, {}), u = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((i, p) => {
436
+ let { class: x, className: g, ...w } = p;
437
+ return Object.entries(w).every((y) => {
438
+ let [f, d] = y;
439
+ return Array.isArray(d) ? d.includes({
440
+ ...c,
441
+ ...m
474
442
  }[f]) : {
475
- ...i,
476
- ...v
477
- }[f] === u;
443
+ ...c,
444
+ ...m
445
+ }[f] === d;
478
446
  }) ? [
479
- ...c,
480
- m,
481
- w
482
- ] : c;
447
+ ...i,
448
+ x,
449
+ g
450
+ ] : i;
483
451
  }, []);
484
- return Ne(e, l, d, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
485
- }, ar = 1, ir = 1e6;
486
- var k = /* @__PURE__ */ ((e) => (e.ADD_TOAST = "ADD_TOAST", e.UPDATE_TOAST = "UPDATE_TOAST", e.DISMISS_TOAST = "DISMISS_TOAST", e.REMOVE_TOAST = "REMOVE_TOAST", e))(k || {});
487
- let ae = 0;
488
- const cr = () => (ae = (ae + 1) % Number.MAX_SAFE_INTEGER, ae.toString()), ie = /* @__PURE__ */ new Map(), je = (e) => {
489
- if (ie.has(e))
490
- return;
491
- const r = setTimeout(() => {
492
- ie.delete(e), H({
493
- type: k.REMOVE_TOAST,
494
- toastId: e
495
- });
496
- }, ir);
497
- ie.set(e, r);
498
- }, lr = (e, r) => {
499
- switch (r.type) {
500
- case "ADD_TOAST":
501
- return {
502
- ...e,
503
- toasts: [r.toast, ...e.toasts].slice(0, ar)
504
- };
505
- case "UPDATE_TOAST":
506
- return {
507
- ...e,
508
- toasts: e.toasts.map(
509
- (t) => t.id === r.toast.id ? { ...t, ...r.toast } : t
510
- )
511
- };
512
- case "DISMISS_TOAST": {
513
- const { toastId: t } = r;
514
- return t ? je(t) : e.toasts.forEach((o) => {
515
- je(o.id);
516
- }), {
517
- ...e,
518
- toasts: e.toasts.map(
519
- (o) => o.id === t || t === void 0 ? {
520
- ...o,
521
- open: !1
522
- } : o
523
- )
524
- };
525
- }
526
- case k.REMOVE_TOAST:
527
- return r.toastId === void 0 ? {
528
- ...e,
529
- toasts: []
530
- } : {
531
- ...e,
532
- toasts: e.toasts.filter((t) => t.id !== r.toastId)
533
- };
534
- default:
535
- return e;
536
- }
537
- }, G = [];
538
- let X = { toasts: [] };
539
- const H = (e) => {
540
- X = lr(X, e), G.forEach((r) => {
541
- r(X);
542
- });
543
- }, dr = ({ ...e }) => {
544
- const r = cr(), t = (a) => H({
545
- type: k.UPDATE_TOAST,
546
- toast: { ...a, id: r }
547
- }), o = () => H({ type: k.DISMISS_TOAST, toastId: r });
548
- return H({
549
- type: k.ADD_TOAST,
550
- toast: {
551
- ...e,
552
- id: r,
553
- open: !0,
554
- onOpenChange: (a) => {
555
- a || o();
556
- }
557
- }
558
- }), {
559
- id: r,
560
- dismiss: o,
561
- update: t
562
- };
563
- }, ur = () => {
564
- const [e, r] = _t(X);
565
- return Nt(() => (G.push(r), () => {
566
- const t = G.indexOf(r);
567
- t > -1 && G.splice(t, 1);
568
- }), [e]), {
569
- ...e,
570
- toast: dr,
571
- dismiss: (t) => H({ type: k.DISMISS_TOAST, toastId: t })
572
- };
573
- }, pr = nr, rt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
574
- Be,
452
+ return be(e, l, u, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
453
+ }, qt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
454
+ He,
575
455
  {
576
456
  ref: t,
577
457
  className: P(
@@ -581,8 +461,8 @@ const H = (e) => {
581
461
  ...r
582
462
  }
583
463
  ));
584
- rt.displayName = Be.displayName;
585
- const fr = sr(
464
+ qt.displayName = He.displayName;
465
+ const Ut = zt(
586
466
  "group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden py-3 px-[15px] transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-neutral-800",
587
467
  {
588
468
  variants: {
@@ -598,17 +478,17 @@ const fr = sr(
598
478
  variant: "default"
599
479
  }
600
480
  }
601
- ), ot = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
602
- Qe,
481
+ ), Gt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
482
+ Ke,
603
483
  {
604
484
  ref: o,
605
- className: P(fr({ variant: r }), e),
485
+ className: P(Ut({ variant: r }), e),
606
486
  ...t
607
487
  }
608
488
  ));
609
- ot.displayName = Qe.displayName;
610
- const vr = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
611
- et,
489
+ Gt.displayName = Ke.displayName;
490
+ const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
491
+ qe,
612
492
  {
613
493
  ref: t,
614
494
  className: P(
@@ -618,9 +498,9 @@ const vr = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
618
498
  ...r
619
499
  }
620
500
  ));
621
- vr.displayName = et.displayName;
622
- const nt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
623
- tt,
501
+ Xt.displayName = qe.displayName;
502
+ const Yt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
503
+ Ue,
624
504
  {
625
505
  ref: o,
626
506
  className: P(
@@ -629,47 +509,29 @@ const nt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__
629
509
  ),
630
510
  "toast-close": "",
631
511
  ...t,
632
- children: /* @__PURE__ */ s.jsx(Tt, { className: P(`size-4 text-${r}-10`) })
512
+ children: /* @__PURE__ */ s.jsx(st, { className: P(`size-4 text-${r}-10`) })
633
513
  }
634
514
  ));
635
- nt.displayName = tt.displayName;
636
- const st = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
637
- Je,
515
+ Yt.displayName = Ue.displayName;
516
+ const Ge = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
517
+ We,
638
518
  {
639
519
  ref: t,
640
520
  className: P("text-base font-semibold [&+div]:text-xs", e),
641
521
  ...r
642
522
  }
643
523
  ));
644
- st.displayName = Je.displayName;
645
- const at = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
646
- Ze,
524
+ Ge.displayName = We.displayName;
525
+ const Xe = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
526
+ ze,
647
527
  {
648
528
  ref: t,
649
529
  className: P("text-xs font-normal opacity-90", e),
650
530
  ...r
651
531
  }
652
532
  ));
653
- at.displayName = Ze.displayName;
654
- const Br = ({ duration: e = 5 }) => {
655
- const { toasts: r } = ur();
656
- return /* @__PURE__ */ s.jsxs(pr, { children: [
657
- r.map(({ id: t, title: o, description: a, action: i, ...l }) => /* @__PURE__ */ s.jsxs(ot, { duration: e * 1e3, ...l, children: [
658
- /* @__PURE__ */ s.jsx("div", { className: "grid gap-1", children: /* @__PURE__ */ s.jsx(
659
- mr,
660
- {
661
- withIcon: l.withIcon,
662
- type: l.variant,
663
- title: o,
664
- description: a
665
- }
666
- ) }),
667
- i,
668
- /* @__PURE__ */ s.jsx(nt, { variant: l.variant })
669
- ] }, t)),
670
- /* @__PURE__ */ s.jsx(rt, {})
671
- ] });
672
- }, mr = ({
533
+ Xe.displayName = ze.displayName;
534
+ const kr = ({
673
535
  type: e = "info",
674
536
  title: r,
675
537
  description: t,
@@ -682,16 +544,16 @@ const Br = ({ duration: e = 5 }) => {
682
544
  "flex items-center gap-1.5"
683
545
  ),
684
546
  children: [
685
- o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ft[e] }),
547
+ o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ct[e] }),
686
548
  /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col", children: [
687
- /* @__PURE__ */ s.jsx(st, { className: o ? "text-left" : "text-center", children: r }),
688
- /* @__PURE__ */ s.jsx(at, { className: o ? "text-left" : "text-center", children: t })
549
+ /* @__PURE__ */ s.jsx(Ge, { className: o ? "text-left" : "text-center", children: r }),
550
+ /* @__PURE__ */ s.jsx(Xe, { className: o ? "text-left" : "text-center", children: t })
689
551
  ] })
690
552
  ]
691
553
  }
692
- ), { Root: xr, Thumb: Tr } = ht, Qr = n.forwardRef(({ classNames: e, ...r }, t) => {
554
+ ), { Root: Bt, Thumb: Jt } = at, Sr = n.forwardRef(({ classNames: e, ...r }, t) => {
693
555
  const o = r.checked ?? !1;
694
- return /* @__PURE__ */ s.jsxs(xr, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
556
+ return /* @__PURE__ */ s.jsxs(Bt, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
695
557
  /* @__PURE__ */ s.jsx(
696
558
  "div",
697
559
  {
@@ -701,7 +563,7 @@ const Br = ({ duration: e = 5 }) => {
701
563
  !o && D.iconWrapper.checked
702
564
  ),
703
565
  children: /* @__PURE__ */ s.jsx(
704
- kt,
566
+ gt,
705
567
  {
706
568
  "data-testid": "list-icon",
707
569
  className: P(o ? "fill-dark-30/25" : "fill-dark-30/[.80]")
@@ -718,7 +580,7 @@ const Br = ({ duration: e = 5 }) => {
718
580
  o && D.iconWrapper.checked
719
581
  ),
720
582
  children: /* @__PURE__ */ s.jsx(
721
- Dt,
583
+ Tt,
722
584
  {
723
585
  "data-testid": "grid-icon",
724
586
  className: P(o ? "fill-dark-30/[.80]" : "fill-dark-30/25")
@@ -727,7 +589,7 @@ const Br = ({ duration: e = 5 }) => {
727
589
  }
728
590
  ),
729
591
  /* @__PURE__ */ s.jsx("div", { className: P(D.borderLine) }),
730
- /* @__PURE__ */ s.jsx(Tr, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
592
+ /* @__PURE__ */ s.jsx(Jt, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
731
593
  ] });
732
594
  }), D = {
733
595
  base: "group relative inline-flex w-20 h-[38px] shrink-0 cursor-pointer items-center bg-gray-50 rounded-[10px] transition-colors duration-200 transition-colors",
@@ -738,84 +600,84 @@ const Br = ({ duration: e = 5 }) => {
738
600
  },
739
601
  borderLine: "pointer-events-none absolute z-0 left-0 top-0 w-full h-full group-hover:border group-hover:border-primary-20/[.30] rounded-[10px] transition-colors duration-200"
740
602
  };
741
- var [ee, hr] = De("Tooltip", [
742
- Me
743
- ]), te = Me(), it = "TooltipProvider", wr = 700, pe = "tooltip.open", [gr, he] = ee(it), we = (e) => {
603
+ var [B, Qt] = Ce("Tooltip", [
604
+ Ne
605
+ ]), J = Ne(), Ye = "TooltipProvider", Zt = 700, ae = "tooltip.open", [er, de] = B(Ye), ue = (e) => {
744
606
  const {
745
607
  __scopeTooltip: r,
746
- delayDuration: t = wr,
608
+ delayDuration: t = Zt,
747
609
  skipDelayDuration: o = 300,
748
610
  disableHoverableContent: a = !1,
749
- children: i
750
- } = e, [l, v] = n.useState(!0), d = n.useRef(!1), c = n.useRef(0);
611
+ children: c
612
+ } = e, [l, m] = n.useState(!0), u = n.useRef(!1), i = n.useRef(0);
751
613
  return n.useEffect(() => {
752
- const p = c.current;
614
+ const p = i.current;
753
615
  return () => window.clearTimeout(p);
754
616
  }, []), /* @__PURE__ */ s.jsx(
755
- gr,
617
+ er,
756
618
  {
757
619
  scope: r,
758
620
  isOpenDelayed: l,
759
621
  delayDuration: t,
760
622
  onOpen: n.useCallback(() => {
761
- window.clearTimeout(c.current), v(!1);
623
+ window.clearTimeout(i.current), m(!1);
762
624
  }, []),
763
625
  onClose: n.useCallback(() => {
764
- window.clearTimeout(c.current), c.current = window.setTimeout(
765
- () => v(!0),
626
+ window.clearTimeout(i.current), i.current = window.setTimeout(
627
+ () => m(!0),
766
628
  o
767
629
  );
768
630
  }, [o]),
769
- isPointerInTransitRef: d,
631
+ isPointerInTransitRef: u,
770
632
  onPointerInTransitChange: n.useCallback((p) => {
771
- d.current = p;
633
+ u.current = p;
772
634
  }, []),
773
635
  disableHoverableContent: a,
774
- children: i
636
+ children: c
775
637
  }
776
638
  );
777
639
  };
778
- we.displayName = it;
779
- var re = "Tooltip", [yr, K] = ee(re), ge = (e) => {
640
+ ue.displayName = Ye;
641
+ var Q = "Tooltip", [tr, $] = B(Q), pe = (e) => {
780
642
  const {
781
643
  __scopeTooltip: r,
782
644
  children: t,
783
645
  open: o,
784
646
  defaultOpen: a = !1,
785
- onOpenChange: i,
647
+ onOpenChange: c,
786
648
  disableHoverableContent: l,
787
- delayDuration: v
788
- } = e, d = he(re, e.__scopeTooltip), c = te(r), [p, m] = n.useState(null), w = gt(), h = n.useRef(0), y = l ?? d.disableHoverableContent, f = v ?? d.delayDuration, u = n.useRef(!1), [b = !1, T] = ke({
649
+ delayDuration: m
650
+ } = e, u = de(Q, e.__scopeTooltip), i = J(r), [p, x] = n.useState(null), g = ct(), w = n.useRef(0), y = l ?? u.disableHoverableContent, f = m ?? u.delayDuration, d = n.useRef(!1), [b = !1, h] = Pe({
789
651
  prop: o,
790
652
  defaultProp: a,
791
- onChange: (_) => {
792
- _ ? (d.onOpen(), document.dispatchEvent(new CustomEvent(pe))) : d.onClose(), i == null || i(_);
653
+ onChange: (A) => {
654
+ A ? (u.onOpen(), document.dispatchEvent(new CustomEvent(ae))) : u.onClose(), c == null || c(A);
793
655
  }
794
- }), g = n.useMemo(() => b ? u.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
795
- window.clearTimeout(h.current), h.current = 0, u.current = !1, T(!0);
796
- }, [T]), C = n.useCallback(() => {
797
- window.clearTimeout(h.current), h.current = 0, T(!1);
798
- }, [T]), S = n.useCallback(() => {
799
- window.clearTimeout(h.current), h.current = window.setTimeout(() => {
800
- u.current = !0, T(!0), h.current = 0;
656
+ }), T = n.useMemo(() => b ? d.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
657
+ window.clearTimeout(w.current), w.current = 0, d.current = !1, h(!0);
658
+ }, [h]), C = n.useCallback(() => {
659
+ window.clearTimeout(w.current), w.current = 0, h(!1);
660
+ }, [h]), N = n.useCallback(() => {
661
+ window.clearTimeout(w.current), w.current = window.setTimeout(() => {
662
+ d.current = !0, h(!0), w.current = 0;
801
663
  }, f);
802
- }, [f, T]);
664
+ }, [f, h]);
803
665
  return n.useEffect(() => () => {
804
- h.current && (window.clearTimeout(h.current), h.current = 0);
805
- }, []), /* @__PURE__ */ s.jsx(yt, { ...c, children: /* @__PURE__ */ s.jsx(
806
- yr,
666
+ w.current && (window.clearTimeout(w.current), w.current = 0);
667
+ }, []), /* @__PURE__ */ s.jsx(lt, { ...i, children: /* @__PURE__ */ s.jsx(
668
+ tr,
807
669
  {
808
670
  scope: r,
809
- contentId: w,
671
+ contentId: g,
810
672
  open: b,
811
- stateAttribute: g,
673
+ stateAttribute: T,
812
674
  trigger: p,
813
- onTriggerChange: m,
675
+ onTriggerChange: x,
814
676
  onTriggerEnter: n.useCallback(() => {
815
- d.isOpenDelayed ? S() : E();
816
- }, [d.isOpenDelayed, S, E]),
677
+ u.isOpenDelayed ? N() : E();
678
+ }, [u.isOpenDelayed, N, E]),
817
679
  onTriggerLeave: n.useCallback(() => {
818
- y ? C() : (window.clearTimeout(h.current), h.current = 0);
680
+ y ? C() : (window.clearTimeout(w.current), w.current = 0);
819
681
  }, [C, y]),
820
682
  onOpen: E,
821
683
  onClose: C,
@@ -824,28 +686,28 @@ var re = "Tooltip", [yr, K] = ee(re), ge = (e) => {
824
686
  }
825
687
  ) });
826
688
  };
827
- ge.displayName = re;
828
- var fe = "TooltipTrigger", ye = n.forwardRef(
689
+ pe.displayName = Q;
690
+ var ie = "TooltipTrigger", fe = n.forwardRef(
829
691
  (e, r) => {
830
- const { __scopeTooltip: t, ...o } = e, a = K(fe, t), i = he(fe, t), l = te(t), v = n.useRef(null), d = B(r, v, a.onTriggerChange), c = n.useRef(!1), p = n.useRef(!1), m = n.useCallback(() => c.current = !1, []);
831
- return n.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ s.jsx(bt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
832
- j.button,
692
+ const { __scopeTooltip: t, ...o } = e, a = $(ie, t), c = de(ie, t), l = J(t), m = n.useRef(null), u = U(r, m, a.onTriggerChange), i = n.useRef(!1), p = n.useRef(!1), x = n.useCallback(() => i.current = !1, []);
693
+ return n.useEffect(() => () => document.removeEventListener("pointerup", x), [x]), /* @__PURE__ */ s.jsx(dt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
694
+ S.button,
833
695
  {
834
696
  "aria-describedby": a.open ? a.contentId : void 0,
835
697
  "data-state": a.stateAttribute,
836
698
  ...o,
837
- ref: d,
838
- onPointerMove: R(e.onPointerMove, (w) => {
839
- w.pointerType !== "touch" && !p.current && !i.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
699
+ ref: u,
700
+ onPointerMove: R(e.onPointerMove, (g) => {
701
+ g.pointerType !== "touch" && !p.current && !c.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
840
702
  }),
841
703
  onPointerLeave: R(e.onPointerLeave, () => {
842
704
  a.onTriggerLeave(), p.current = !1;
843
705
  }),
844
706
  onPointerDown: R(e.onPointerDown, () => {
845
- c.current = !0, document.addEventListener("pointerup", m, { once: !0 });
707
+ i.current = !0, document.addEventListener("pointerup", x, { once: !0 });
846
708
  }),
847
709
  onFocus: R(e.onFocus, () => {
848
- c.current || a.onOpen();
710
+ i.current || a.onOpen();
849
711
  }),
850
712
  onBlur: R(e.onBlur, a.onClose),
851
713
  onClick: R(e.onClick, a.onClose)
@@ -853,81 +715,81 @@ var fe = "TooltipTrigger", ye = n.forwardRef(
853
715
  ) });
854
716
  }
855
717
  );
856
- ye.displayName = fe;
857
- var be = "TooltipPortal", [br, Er] = ee(be, {
718
+ fe.displayName = ie;
719
+ var ve = "TooltipPortal", [rr, or] = B(ve, {
858
720
  forceMount: void 0
859
- }), Ee = (e) => {
860
- const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, i = K(be, r);
861
- return /* @__PURE__ */ s.jsx(br, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ve, { present: t || i.open, children: /* @__PURE__ */ s.jsx(Ie, { asChild: !0, container: a, children: o }) }) });
721
+ }), me = (e) => {
722
+ const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c = $(ve, r);
723
+ return /* @__PURE__ */ s.jsx(rr, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ce, { present: t || c.open, children: /* @__PURE__ */ s.jsx(Re, { asChild: !0, container: a, children: o }) }) });
862
724
  };
863
- Ee.displayName = be;
864
- var L = "TooltipContent", Ce = n.forwardRef(
725
+ me.displayName = ve;
726
+ var I = "TooltipContent", xe = n.forwardRef(
865
727
  (e, r) => {
866
- const t = Er(L, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...i } = e, l = K(L, e.__scopeTooltip);
867
- return /* @__PURE__ */ s.jsx(ve, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(ct, { side: a, ...i, ref: r }) : /* @__PURE__ */ s.jsx(Cr, { side: a, ...i, ref: r }) });
728
+ const t = or(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l = $(I, e.__scopeTooltip);
729
+ return /* @__PURE__ */ s.jsx(ce, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(Be, { side: a, ...c, ref: r }) : /* @__PURE__ */ s.jsx(nr, { side: a, ...c, ref: r }) });
868
730
  }
869
- ), Cr = n.forwardRef((e, r) => {
870
- const t = K(L, e.__scopeTooltip), o = he(L, e.__scopeTooltip), a = n.useRef(null), i = B(r, a), [l, v] = n.useState(null), { trigger: d, onClose: c } = t, p = a.current, { onPointerInTransitChange: m } = o, w = n.useCallback(() => {
871
- v(null), m(!1);
872
- }, [m]), h = n.useCallback(
731
+ ), nr = n.forwardRef((e, r) => {
732
+ const t = $(I, e.__scopeTooltip), o = de(I, e.__scopeTooltip), a = n.useRef(null), c = U(r, a), [l, m] = n.useState(null), { trigger: u, onClose: i } = t, p = a.current, { onPointerInTransitChange: x } = o, g = n.useCallback(() => {
733
+ m(null), x(!1);
734
+ }, [x]), w = n.useCallback(
873
735
  (y, f) => {
874
- const u = y.currentTarget, b = { x: y.clientX, y: y.clientY }, T = Sr(b, u.getBoundingClientRect()), g = Ar(b, T), E = _r(f.getBoundingClientRect()), C = jr([...g, ...E]);
875
- v(C), m(!0);
736
+ const d = y.currentTarget, b = { x: y.clientX, y: y.clientY }, h = ir(b, d.getBoundingClientRect()), T = cr(b, h), E = lr(f.getBoundingClientRect()), C = ur([...T, ...E]);
737
+ m(C), x(!0);
876
738
  },
877
- [m]
739
+ [x]
878
740
  );
879
- return n.useEffect(() => () => w(), [w]), n.useEffect(() => {
880
- if (d && p) {
881
- const y = (u) => h(u, p), f = (u) => h(u, d);
882
- return d.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
883
- d.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
741
+ return n.useEffect(() => () => g(), [g]), n.useEffect(() => {
742
+ if (u && p) {
743
+ const y = (d) => w(d, p), f = (d) => w(d, u);
744
+ return u.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
745
+ u.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
884
746
  };
885
747
  }
886
- }, [d, p, h, w]), n.useEffect(() => {
748
+ }, [u, p, w, g]), n.useEffect(() => {
887
749
  if (l) {
888
750
  const y = (f) => {
889
- const u = f.target, b = { x: f.clientX, y: f.clientY }, T = (d == null ? void 0 : d.contains(u)) || (p == null ? void 0 : p.contains(u)), g = !Nr(b, l);
890
- T ? w() : g && (w(), c());
751
+ const d = f.target, b = { x: f.clientX, y: f.clientY }, h = (u == null ? void 0 : u.contains(d)) || (p == null ? void 0 : p.contains(d)), T = !dr(b, l);
752
+ h ? g() : T && (g(), i());
891
753
  };
892
754
  return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
893
755
  }
894
- }, [d, p, l, c, w]), /* @__PURE__ */ s.jsx(ct, { ...e, ref: i });
895
- }), [Pr, Rr] = ee(re, { isInside: !1 }), ct = n.forwardRef(
756
+ }, [u, p, l, i, g]), /* @__PURE__ */ s.jsx(Be, { ...e, ref: c });
757
+ }), [sr, ar] = B(Q, { isInside: !1 }), Be = n.forwardRef(
896
758
  (e, r) => {
897
759
  const {
898
760
  __scopeTooltip: t,
899
761
  children: o,
900
762
  "aria-label": a,
901
- onEscapeKeyDown: i,
763
+ onEscapeKeyDown: c,
902
764
  onPointerDownOutside: l,
903
- ...v
904
- } = e, d = K(L, t), c = te(t), { onClose: p } = d;
905
- return n.useEffect(() => (document.addEventListener(pe, p), () => document.removeEventListener(pe, p)), [p]), n.useEffect(() => {
906
- if (d.trigger) {
907
- const m = (w) => {
908
- const h = w.target;
909
- h != null && h.contains(d.trigger) && p();
765
+ ...m
766
+ } = e, u = $(I, t), i = J(t), { onClose: p } = u;
767
+ return n.useEffect(() => (document.addEventListener(ae, p), () => document.removeEventListener(ae, p)), [p]), n.useEffect(() => {
768
+ if (u.trigger) {
769
+ const x = (g) => {
770
+ const w = g.target;
771
+ w != null && w.contains(u.trigger) && p();
910
772
  };
911
- return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
773
+ return window.addEventListener("scroll", x, { capture: !0 }), () => window.removeEventListener("scroll", x, { capture: !0 });
912
774
  }
913
- }, [d.trigger, p]), /* @__PURE__ */ s.jsx(
914
- Et,
775
+ }, [u.trigger, p]), /* @__PURE__ */ s.jsx(
776
+ ut,
915
777
  {
916
778
  asChild: !0,
917
779
  disableOutsidePointerEvents: !1,
918
- onEscapeKeyDown: i,
780
+ onEscapeKeyDown: c,
919
781
  onPointerDownOutside: l,
920
- onFocusOutside: (m) => m.preventDefault(),
782
+ onFocusOutside: (x) => x.preventDefault(),
921
783
  onDismiss: p,
922
784
  children: /* @__PURE__ */ s.jsxs(
923
- Ct,
785
+ pt,
924
786
  {
925
- "data-state": d.stateAttribute,
926
- ...c,
927
- ...v,
787
+ "data-state": u.stateAttribute,
788
+ ...i,
789
+ ...m,
928
790
  ref: r,
929
791
  style: {
930
- ...v.style,
792
+ ...m.style,
931
793
  "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
932
794
  "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
933
795
  "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
@@ -935,8 +797,8 @@ var L = "TooltipContent", Ce = n.forwardRef(
935
797
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
936
798
  },
937
799
  children: [
938
- /* @__PURE__ */ s.jsx(Pt, { children: o }),
939
- /* @__PURE__ */ s.jsx(Pr, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx($t, { id: d.contentId, role: "tooltip", children: a || o }) })
800
+ /* @__PURE__ */ s.jsx(ft, { children: o }),
801
+ /* @__PURE__ */ s.jsx(sr, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx(Rt, { id: u.contentId, role: "tooltip", children: a || o }) })
940
802
  ]
941
803
  }
942
804
  )
@@ -944,21 +806,21 @@ var L = "TooltipContent", Ce = n.forwardRef(
944
806
  );
945
807
  }
946
808
  );
947
- Ce.displayName = L;
948
- var lt = "TooltipArrow", Pe = n.forwardRef(
809
+ xe.displayName = I;
810
+ var Je = "TooltipArrow", he = n.forwardRef(
949
811
  (e, r) => {
950
- const { __scopeTooltip: t, ...o } = e, a = te(t);
951
- return Rr(
952
- lt,
812
+ const { __scopeTooltip: t, ...o } = e, a = J(t);
813
+ return ar(
814
+ Je,
953
815
  t
954
- ).isInside ? null : /* @__PURE__ */ s.jsx(wt, { ...a, ...o, ref: r });
816
+ ).isInside ? null : /* @__PURE__ */ s.jsx(it, { ...a, ...o, ref: r });
955
817
  }
956
818
  );
957
- Pe.displayName = lt;
958
- function Sr(e, r) {
959
- const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), i = Math.abs(r.left - e.x);
960
- switch (Math.min(t, o, a, i)) {
961
- case i:
819
+ he.displayName = Je;
820
+ function ir(e, r) {
821
+ const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), c = Math.abs(r.left - e.x);
822
+ switch (Math.min(t, o, a, c)) {
823
+ case c:
962
824
  return "left";
963
825
  case a:
964
826
  return "right";
@@ -970,7 +832,7 @@ function Sr(e, r) {
970
832
  throw new Error("unreachable");
971
833
  }
972
834
  }
973
- function Ar(e, r, t = 5) {
835
+ function cr(e, r, t = 5) {
974
836
  const o = [];
975
837
  switch (r) {
976
838
  case "top":
@@ -1000,7 +862,7 @@ function Ar(e, r, t = 5) {
1000
862
  }
1001
863
  return o;
1002
864
  }
1003
- function _r(e) {
865
+ function lr(e) {
1004
866
  const { top: r, right: t, bottom: o, left: a } = e;
1005
867
  return [
1006
868
  { x: a, y: r },
@@ -1009,27 +871,27 @@ function _r(e) {
1009
871
  { x: a, y: o }
1010
872
  ];
1011
873
  }
1012
- function Nr(e, r) {
874
+ function dr(e, r) {
1013
875
  const { x: t, y: o } = e;
1014
876
  let a = !1;
1015
- for (let i = 0, l = r.length - 1; i < r.length; l = i++) {
1016
- const v = r[i].x, d = r[i].y, c = r[l].x, p = r[l].y;
1017
- d > o != p > o && t < (c - v) * (o - d) / (p - d) + v && (a = !a);
877
+ for (let c = 0, l = r.length - 1; c < r.length; l = c++) {
878
+ const m = r[c].x, u = r[c].y, i = r[l].x, p = r[l].y;
879
+ u > o != p > o && t < (i - m) * (o - u) / (p - u) + m && (a = !a);
1018
880
  }
1019
881
  return a;
1020
882
  }
1021
- function jr(e) {
883
+ function ur(e) {
1022
884
  const r = e.slice();
1023
- return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), Or(r);
885
+ return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), pr(r);
1024
886
  }
1025
- function Or(e) {
887
+ function pr(e) {
1026
888
  if (e.length <= 1) return e.slice();
1027
889
  const r = [];
1028
890
  for (let o = 0; o < e.length; o++) {
1029
891
  const a = e[o];
1030
892
  for (; r.length >= 2; ) {
1031
- const i = r[r.length - 1], l = r[r.length - 2];
1032
- if ((i.x - l.x) * (a.y - l.y) >= (i.y - l.y) * (a.x - l.x)) r.pop();
893
+ const c = r[r.length - 1], l = r[r.length - 2];
894
+ if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) r.pop();
1033
895
  else break;
1034
896
  }
1035
897
  r.push(a);
@@ -1039,53 +901,53 @@ function Or(e) {
1039
901
  for (let o = e.length - 1; o >= 0; o--) {
1040
902
  const a = e[o];
1041
903
  for (; t.length >= 2; ) {
1042
- const i = t[t.length - 1], l = t[t.length - 2];
1043
- if ((i.x - l.x) * (a.y - l.y) >= (i.y - l.y) * (a.x - l.x)) t.pop();
904
+ const c = t[t.length - 1], l = t[t.length - 2];
905
+ if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) t.pop();
1044
906
  else break;
1045
907
  }
1046
908
  t.push(a);
1047
909
  }
1048
910
  return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
1049
911
  }
1050
- var Dr = we, kr = ge, Ir = ye, Mr = Ee, Lr = Ce, Fr = Pe;
1051
- const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
912
+ var fr = ue, vr = pe, mr = fe, xr = me, hr = xe, wr = he;
913
+ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1052
914
  __proto__: null,
1053
- Arrow: Fr,
1054
- Content: Lr,
1055
- Portal: Mr,
1056
- Provider: Dr,
1057
- Root: kr,
1058
- Tooltip: ge,
1059
- TooltipArrow: Pe,
1060
- TooltipContent: Ce,
1061
- TooltipPortal: Ee,
1062
- TooltipProvider: we,
1063
- TooltipTrigger: ye,
1064
- Trigger: Ir,
1065
- createTooltipScope: hr
1066
- }, Symbol.toStringTag, { value: "Module" })), { Provider: $r, Root: Hr, Trigger: Kr, Portal: Wr, Content: zr, Arrow: Ur } = Vr, Jr = ({
915
+ Arrow: wr,
916
+ Content: hr,
917
+ Portal: xr,
918
+ Provider: fr,
919
+ Root: vr,
920
+ Tooltip: pe,
921
+ TooltipArrow: he,
922
+ TooltipContent: xe,
923
+ TooltipPortal: me,
924
+ TooltipProvider: ue,
925
+ TooltipTrigger: fe,
926
+ Trigger: mr,
927
+ createTooltipScope: Qt
928
+ }, Symbol.toStringTag, { value: "Module" })), { Provider: gr, Root: yr, Trigger: br, Portal: Er, Content: Cr, Arrow: Pr } = Tr, _r = ({
1067
929
  children: e,
1068
930
  className: r,
1069
931
  defaultOpen: t,
1070
932
  side: o,
1071
933
  content: a,
1072
- delayDuration: i = 0,
934
+ delayDuration: c = 0,
1073
935
  isDisabled: l = !1
1074
- }) => /* @__PURE__ */ s.jsx($r, { children: /* @__PURE__ */ s.jsxs(Hr, { defaultOpen: t, delayDuration: i, children: [
1075
- /* @__PURE__ */ s.jsx(Kr, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
1076
- !l && /* @__PURE__ */ s.jsx(Wr, { children: /* @__PURE__ */ s.jsxs(
1077
- zr,
936
+ }) => /* @__PURE__ */ s.jsx(gr, { children: /* @__PURE__ */ s.jsxs(yr, { defaultOpen: t, delayDuration: c, children: [
937
+ /* @__PURE__ */ s.jsx(br, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
938
+ !l && /* @__PURE__ */ s.jsx(Er, { children: /* @__PURE__ */ s.jsxs(
939
+ Cr,
1078
940
  {
1079
941
  side: o,
1080
942
  sideOffset: 5,
1081
- className: P(Oe.content, r),
943
+ className: P(Ee.content, r),
1082
944
  children: [
1083
945
  a,
1084
- /* @__PURE__ */ s.jsx(Ur, { className: Oe.arrow })
946
+ /* @__PURE__ */ s.jsx(Pr, { className: Ee.arrow })
1085
947
  ]
1086
948
  }
1087
949
  ) })
1088
- ] }) }), Oe = {
950
+ ] }) }), Ee = {
1089
951
  content: P(
1090
952
  "font-mono select-none w-auto h-auto max-size-32 rounded-[5px] bg-dark-30 px-4 py-2 text-[10px] text-start leading-none text-sidebar-10 z-50",
1091
953
  "animate-tooltipFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade",
@@ -1094,42 +956,41 @@ const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1094
956
  "data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade"
1095
957
  ),
1096
958
  arrow: "fill-dark-30"
1097
- }, Zr = ({
959
+ }, Dr = ({
1098
960
  value: e,
1099
961
  onValueChange: r,
1100
962
  classNames: t = {},
1101
963
  count: o = 3,
1102
964
  ...a
1103
- }) => /* @__PURE__ */ s.jsx(Rt, { value: e, onValueChange: r, children: /* @__PURE__ */ s.jsx(
1104
- St,
965
+ }) => /* @__PURE__ */ s.jsx(vt, { value: e, onValueChange: r, children: /* @__PURE__ */ s.jsx(
966
+ mt,
1105
967
  {
1106
- className: P(ce.container, t.container),
968
+ className: P(re.container, t.container),
1107
969
  ...a,
1108
- children: Array.from({ length: o }).map((i, l) => /* @__PURE__ */ s.jsx(
1109
- At,
970
+ children: Array.from({ length: o }).map((c, l) => /* @__PURE__ */ s.jsx(
971
+ xt,
1110
972
  {
1111
973
  value: String(l),
1112
974
  className: P(
1113
- ce.dot,
1114
- l <= Number(e) && ce.dotActive,
975
+ re.dot,
976
+ l <= Number(e) && re.dotActive,
1115
977
  t.trigger
1116
978
  )
1117
979
  },
1118
980
  l
1119
981
  ))
1120
982
  }
1121
- ) }), ce = {
983
+ ) }), re = {
1122
984
  container: "flex items-center gap-1",
1123
985
  dot: "size-2 rounded-full bg-dark-30/[.20] transition-colors focus:outline-none focus:ring-offset-0 focus:ring-primary-10",
1124
986
  dotActive: "bg-primary-10"
1125
987
  };
1126
988
  export {
1127
- mr as N,
1128
- Qr as S,
1129
- Br as T,
1130
- Jr as a,
1131
- Zr as b,
1132
- ce as c,
989
+ kr as N,
990
+ Sr as S,
991
+ _r as T,
992
+ Dr as a,
993
+ re as b,
1133
994
  D as s,
1134
- Oe as t
995
+ Ee as t
1135
996
  };