@la-batcave/ui 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +95 -0
  2. package/dist/Alert.d.ts +27 -0
  3. package/dist/Alert.js +56 -0
  4. package/dist/Avatar.d.ts +20 -0
  5. package/dist/Avatar.js +40 -0
  6. package/dist/Badge.d.ts +56 -0
  7. package/dist/Badge.js +74 -0
  8. package/dist/Button.d.ts +53 -0
  9. package/dist/Button.js +66 -0
  10. package/dist/Card.d.ts +18 -0
  11. package/dist/Card.js +98 -0
  12. package/dist/CodeBlock.d.ts +45 -0
  13. package/dist/CodeBlock.js +306 -0
  14. package/dist/Collapse.d.ts +58 -0
  15. package/dist/Collapse.js +89 -0
  16. package/dist/Combobox.d.ts +44 -0
  17. package/dist/Combobox.js +409 -0
  18. package/dist/DarkMode.d.ts +59 -0
  19. package/dist/DarkMode.js +56 -0
  20. package/dist/DatePicker.d.ts +48 -0
  21. package/dist/DatePicker.js +2954 -0
  22. package/dist/Dialog.d.ts +119 -0
  23. package/dist/Dialog.js +337 -0
  24. package/dist/Drawer.d.ts +28 -0
  25. package/dist/Drawer.js +1126 -0
  26. package/dist/Dropdown.d.ts +23 -0
  27. package/dist/Dropdown.js +247 -0
  28. package/dist/EasyForm.d.ts +138 -0
  29. package/dist/EasyForm.js +286 -0
  30. package/dist/HoverCard.d.ts +10 -0
  31. package/dist/HoverCard.js +195 -0
  32. package/dist/Input.d.ts +230 -0
  33. package/dist/Input.js +2216 -0
  34. package/dist/LogViewer.d.ts +57 -0
  35. package/dist/LogViewer.js +120 -0
  36. package/dist/Menubar.d.ts +32 -0
  37. package/dist/Menubar.js +398 -0
  38. package/dist/Navbar.d.ts +20 -0
  39. package/dist/Navbar.js +31 -0
  40. package/dist/Pagination.d.ts +78 -0
  41. package/dist/Pagination.js +106 -0
  42. package/dist/Popover.d.ts +11 -0
  43. package/dist/Popover.js +28 -0
  44. package/dist/ProgressBar.d.ts +35 -0
  45. package/dist/ProgressBar.js +210 -0
  46. package/dist/Resizable.d.ts +23 -0
  47. package/dist/Resizable.js +1532 -0
  48. package/dist/Separator.d.ts +4 -0
  49. package/dist/Separator.js +46 -0
  50. package/dist/Sheet.d.ts +29 -0
  51. package/dist/Sheet.js +104 -0
  52. package/dist/Sidebar.d.ts +117 -0
  53. package/dist/Sidebar.js +237 -0
  54. package/dist/Skeleton.d.ts +57 -0
  55. package/dist/Skeleton.js +47 -0
  56. package/dist/Table.d.ts +71 -0
  57. package/dist/Table.js +94 -0
  58. package/dist/Tabs.d.ts +76 -0
  59. package/dist/Tabs.js +202 -0
  60. package/dist/Toast.d.ts +54 -0
  61. package/dist/Toast.js +827 -0
  62. package/dist/Tooltip.d.ts +29 -0
  63. package/dist/Tooltip.js +352 -0
  64. package/dist/Typography.d.ts +101 -0
  65. package/dist/Typography.js +123 -0
  66. package/dist/Widget.d.ts +133 -0
  67. package/dist/Widget.js +207 -0
  68. package/dist/_shared/Combination-D_l4PLF_.js +676 -0
  69. package/dist/_shared/index-B03TCNO5.js +142 -0
  70. package/dist/_shared/index-B1f-hyuh.js +31 -0
  71. package/dist/_shared/index-BC7vfx-u.js +13 -0
  72. package/dist/_shared/index-BrLJJgkl.js +67 -0
  73. package/dist/_shared/index-C0gNQvxa.js +269 -0
  74. package/dist/_shared/index-C3aZemLI.js +268 -0
  75. package/dist/_shared/index-CXeb1OMI.js +198 -0
  76. package/dist/_shared/index-CukUn3R0.js +626 -0
  77. package/dist/_shared/index-DLcqcWxM.js +29 -0
  78. package/dist/_shared/index-DlSuDb9N.js +283 -0
  79. package/dist/_shared/index-V-Ajw7Ac.js +79 -0
  80. package/dist/_shared/index-uPOYJZpG.js +34 -0
  81. package/dist/_shared/index-uu9PT5Nu.js +1588 -0
  82. package/dist/_shared/utils-eGXXUFl7.js +2935 -0
  83. package/dist/backgrounds/Aurora.d.ts +7 -0
  84. package/dist/backgrounds/Aurora.js +126 -0
  85. package/dist/backgrounds/Iridescence.d.ts +7 -0
  86. package/dist/backgrounds/Iridescence.js +77 -0
  87. package/dist/backgrounds/Lightning.d.ts +8 -0
  88. package/dist/backgrounds/Lightning.js +75 -0
  89. package/dist/backgrounds/LiquidChrome.d.ts +9 -0
  90. package/dist/backgrounds/LiquidChrome.js +89 -0
  91. package/dist/backgrounds/Particles.d.ts +15 -0
  92. package/dist/backgrounds/Particles.js +137 -0
  93. package/dist/backgrounds/PixelSnow.d.ts +9 -0
  94. package/dist/backgrounds/PixelSnow.js +52 -0
  95. package/dist/backgrounds/Silk.d.ts +8 -0
  96. package/dist/backgrounds/Silk.js +92 -0
  97. package/dist/backgrounds/Squares.d.ts +9 -0
  98. package/dist/backgrounds/Squares.js +75 -0
  99. package/dist/backgrounds/Threads.d.ts +7 -0
  100. package/dist/backgrounds/Threads.js +110 -0
  101. package/dist/backgrounds/Waves.d.ts +14 -0
  102. package/dist/backgrounds/Waves.js +139 -0
  103. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  104. package/dist/index.css +1 -0
  105. package/dist/index.d.ts +2 -0
  106. package/dist/index.js +4 -0
  107. package/package.json +318 -0
package/dist/Toast.js ADDED
@@ -0,0 +1,827 @@
1
+ "use client";
2
+ import { jsx as H, jsxs as Ct } from "react/jsx-runtime";
3
+ import * as Gt from "react";
4
+ import a from "react";
5
+ import Qt from "react-dom";
6
+ import { X as Jt, Info as Zt, AlertTriangle as te, XCircle as ee, CheckCircle as ae } from "lucide-react";
7
+ import { c as Ht } from "./_shared/utils-eGXXUFl7.js";
8
+ function oe(n) {
9
+ if (typeof document > "u") return;
10
+ let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
11
+ e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = n : e.appendChild(document.createTextNode(n));
12
+ }
13
+ const se = (n) => {
14
+ switch (n) {
15
+ case "success":
16
+ return ie;
17
+ case "info":
18
+ return de;
19
+ case "warning":
20
+ return le;
21
+ case "error":
22
+ return ce;
23
+ default:
24
+ return null;
25
+ }
26
+ }, ne = Array(12).fill(0), re = ({ visible: n, className: o }) => /* @__PURE__ */ a.createElement("div", {
27
+ className: [
28
+ "sonner-loading-wrapper",
29
+ o
30
+ ].filter(Boolean).join(" "),
31
+ "data-visible": n
32
+ }, /* @__PURE__ */ a.createElement("div", {
33
+ className: "sonner-spinner"
34
+ }, ne.map((e, s) => /* @__PURE__ */ a.createElement("div", {
35
+ className: "sonner-loading-bar",
36
+ key: `spinner-bar-${s}`
37
+ })))), ie = /* @__PURE__ */ a.createElement("svg", {
38
+ xmlns: "http://www.w3.org/2000/svg",
39
+ viewBox: "0 0 20 20",
40
+ fill: "currentColor",
41
+ height: "20",
42
+ width: "20"
43
+ }, /* @__PURE__ */ a.createElement("path", {
44
+ fillRule: "evenodd",
45
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
46
+ clipRule: "evenodd"
47
+ })), le = /* @__PURE__ */ a.createElement("svg", {
48
+ xmlns: "http://www.w3.org/2000/svg",
49
+ viewBox: "0 0 24 24",
50
+ fill: "currentColor",
51
+ height: "20",
52
+ width: "20"
53
+ }, /* @__PURE__ */ a.createElement("path", {
54
+ fillRule: "evenodd",
55
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
56
+ clipRule: "evenodd"
57
+ })), de = /* @__PURE__ */ a.createElement("svg", {
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ viewBox: "0 0 20 20",
60
+ fill: "currentColor",
61
+ height: "20",
62
+ width: "20"
63
+ }, /* @__PURE__ */ a.createElement("path", {
64
+ fillRule: "evenodd",
65
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
66
+ clipRule: "evenodd"
67
+ })), ce = /* @__PURE__ */ a.createElement("svg", {
68
+ xmlns: "http://www.w3.org/2000/svg",
69
+ viewBox: "0 0 20 20",
70
+ fill: "currentColor",
71
+ height: "20",
72
+ width: "20"
73
+ }, /* @__PURE__ */ a.createElement("path", {
74
+ fillRule: "evenodd",
75
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
76
+ clipRule: "evenodd"
77
+ })), ue = /* @__PURE__ */ a.createElement("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: "12",
80
+ height: "12",
81
+ viewBox: "0 0 24 24",
82
+ fill: "none",
83
+ stroke: "currentColor",
84
+ strokeWidth: "1.5",
85
+ strokeLinecap: "round",
86
+ strokeLinejoin: "round"
87
+ }, /* @__PURE__ */ a.createElement("line", {
88
+ x1: "18",
89
+ y1: "6",
90
+ x2: "6",
91
+ y2: "18"
92
+ }), /* @__PURE__ */ a.createElement("line", {
93
+ x1: "6",
94
+ y1: "6",
95
+ x2: "18",
96
+ y2: "18"
97
+ })), fe = () => {
98
+ const [n, o] = a.useState(document.hidden);
99
+ return a.useEffect(() => {
100
+ const e = () => {
101
+ o(document.hidden);
102
+ };
103
+ return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
104
+ }, []), n;
105
+ };
106
+ let Tt = 1;
107
+ class me {
108
+ constructor() {
109
+ this.subscribe = (o) => (this.subscribers.push(o), () => {
110
+ const e = this.subscribers.indexOf(o);
111
+ this.subscribers.splice(e, 1);
112
+ }), this.publish = (o) => {
113
+ this.subscribers.forEach((e) => e(o));
114
+ }, this.addToast = (o) => {
115
+ this.publish(o), this.toasts = [
116
+ ...this.toasts,
117
+ o
118
+ ];
119
+ }, this.create = (o) => {
120
+ var e;
121
+ const { message: s, ...T } = o, d = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : Tt++, g = this.toasts.find((h) => h.id === d), N = o.dismissible === void 0 ? !0 : o.dismissible;
122
+ return this.dismissedToasts.has(d) && this.dismissedToasts.delete(d), g ? this.toasts = this.toasts.map((h) => h.id === d ? (this.publish({
123
+ ...h,
124
+ ...o,
125
+ id: d,
126
+ title: s
127
+ }), {
128
+ ...h,
129
+ ...o,
130
+ id: d,
131
+ dismissible: N,
132
+ title: s
133
+ }) : h) : this.addToast({
134
+ title: s,
135
+ ...T,
136
+ dismissible: N,
137
+ id: d
138
+ }), d;
139
+ }, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
140
+ id: o,
141
+ dismiss: !0
142
+ })))) : this.toasts.forEach((e) => {
143
+ this.subscribers.forEach((s) => s({
144
+ id: e.id,
145
+ dismiss: !0
146
+ }));
147
+ }), o), this.message = (o, e) => this.create({
148
+ ...e,
149
+ message: o
150
+ }), this.error = (o, e) => this.create({
151
+ ...e,
152
+ message: o,
153
+ type: "error"
154
+ }), this.success = (o, e) => this.create({
155
+ ...e,
156
+ type: "success",
157
+ message: o
158
+ }), this.info = (o, e) => this.create({
159
+ ...e,
160
+ type: "info",
161
+ message: o
162
+ }), this.warning = (o, e) => this.create({
163
+ ...e,
164
+ type: "warning",
165
+ message: o
166
+ }), this.loading = (o, e) => this.create({
167
+ ...e,
168
+ type: "loading",
169
+ message: o
170
+ }), this.promise = (o, e) => {
171
+ if (!e)
172
+ return;
173
+ let s;
174
+ e.loading !== void 0 && (s = this.create({
175
+ ...e,
176
+ promise: o,
177
+ type: "loading",
178
+ message: e.loading,
179
+ description: typeof e.description != "function" ? e.description : void 0
180
+ }));
181
+ const T = Promise.resolve(o instanceof Function ? o() : o);
182
+ let d = s !== void 0, g;
183
+ const N = T.then(async (i) => {
184
+ if (g = [
185
+ "resolve",
186
+ i
187
+ ], a.isValidElement(i))
188
+ d = !1, this.create({
189
+ id: s,
190
+ type: "default",
191
+ message: i
192
+ });
193
+ else if (ge(i) && !i.ok) {
194
+ d = !1;
195
+ const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, w = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
196
+ message: t
197
+ };
198
+ this.create({
199
+ id: s,
200
+ type: "error",
201
+ description: w,
202
+ ...E
203
+ });
204
+ } else if (i instanceof Error) {
205
+ d = !1;
206
+ const t = typeof e.error == "function" ? await e.error(i) : e.error, w = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
207
+ message: t
208
+ };
209
+ this.create({
210
+ id: s,
211
+ type: "error",
212
+ description: w,
213
+ ...E
214
+ });
215
+ } else if (e.success !== void 0) {
216
+ d = !1;
217
+ const t = typeof e.success == "function" ? await e.success(i) : e.success, w = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
218
+ message: t
219
+ };
220
+ this.create({
221
+ id: s,
222
+ type: "success",
223
+ description: w,
224
+ ...E
225
+ });
226
+ }
227
+ }).catch(async (i) => {
228
+ if (g = [
229
+ "reject",
230
+ i
231
+ ], e.error !== void 0) {
232
+ d = !1;
233
+ const k = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, j = typeof k == "object" && !a.isValidElement(k) ? k : {
234
+ message: k
235
+ };
236
+ this.create({
237
+ id: s,
238
+ type: "error",
239
+ description: t,
240
+ ...j
241
+ });
242
+ }
243
+ }).finally(() => {
244
+ d && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
245
+ }), h = () => new Promise((i, k) => N.then(() => g[0] === "reject" ? k(g[1]) : i(g[1])).catch(k));
246
+ return typeof s != "string" && typeof s != "number" ? {
247
+ unwrap: h
248
+ } : Object.assign(s, {
249
+ unwrap: h
250
+ });
251
+ }, this.custom = (o, e) => {
252
+ const s = e?.id || Tt++;
253
+ return this.create({
254
+ jsx: o(s),
255
+ id: s,
256
+ ...e
257
+ }), s;
258
+ }, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
259
+ }
260
+ }
261
+ const S = new me(), pe = (n, o) => {
262
+ const e = o?.id || Tt++;
263
+ return S.addToast({
264
+ title: n,
265
+ ...o,
266
+ id: e
267
+ }), e;
268
+ }, ge = (n) => n && typeof n == "object" && "ok" in n && typeof n.ok == "boolean" && "status" in n && typeof n.status == "number", he = pe, be = () => S.toasts, ve = () => S.getActiveToasts(), jt = Object.assign(he, {
269
+ success: S.success,
270
+ info: S.info,
271
+ warning: S.warning,
272
+ error: S.error,
273
+ custom: S.custom,
274
+ message: S.message,
275
+ promise: S.promise,
276
+ dismiss: S.dismiss,
277
+ loading: S.loading
278
+ }, {
279
+ getHistory: be,
280
+ getToasts: ve
281
+ });
282
+ oe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
283
+ function pt(n) {
284
+ return n.label !== void 0;
285
+ }
286
+ const ye = 3, xe = "24px", we = "16px", At = 4e3, Ee = 356, Te = 14, Ne = 45, ke = 200;
287
+ function z(...n) {
288
+ return n.filter(Boolean).join(" ");
289
+ }
290
+ function Se(n) {
291
+ const [o, e] = n.split("-"), s = [];
292
+ return o && s.push(o), e && s.push(e), s;
293
+ }
294
+ const _e = (n) => {
295
+ var o, e, s, T, d, g, N, h, i;
296
+ const { invert: k, toast: t, unstyled: w, interacting: j, setHeights: E, visibleToasts: ht, heights: U, index: c, toasts: st, expanded: W, removeToast: nt, defaultRichColors: bt, closeButton: P, style: tt, cancelButtonStyle: $, actionButtonStyle: vt, className: rt = "", descriptionClassName: yt = "", duration: et, position: A, gap: it, expandByDefault: at, classNames: u, icons: v, closeButtonAriaLabel: O = "Close toast" } = n, [F, M] = a.useState(null), [V, lt] = a.useState(null), [l, p] = a.useState(!1), [m, R] = a.useState(!1), [K, f] = a.useState(!1), [q, dt] = a.useState(!1), [ct, G] = a.useState(!1), [Pt, xt] = a.useState(0), [Lt, Nt] = a.useState(0), ot = a.useRef(t.duration || et || At), kt = a.useRef(null), L = a.useRef(null), Ot = c === 0, Yt = c + 1 <= ht, _ = t.type, Q = t.dismissible !== !1, $t = t.className || "", Ft = t.descriptionClassName || "", ut = a.useMemo(() => U.findIndex((r) => r.toastId === t.id) || 0, [
297
+ U,
298
+ t.id
299
+ ]), Vt = a.useMemo(() => {
300
+ var r;
301
+ return (r = t.closeButton) != null ? r : P;
302
+ }, [
303
+ t.closeButton,
304
+ P
305
+ ]), St = a.useMemo(() => t.duration || et || At, [
306
+ t.duration,
307
+ et
308
+ ]), wt = a.useRef(0), J = a.useRef(0), _t = a.useRef(0), Z = a.useRef(null), [Xt, Ut] = A.split("-"), Dt = a.useMemo(() => U.reduce((r, b, x) => x >= ut ? r : r + b.height, 0), [
309
+ U,
310
+ ut
311
+ ]), Rt = fe(), Wt = t.invert || k, Et = _ === "loading";
312
+ J.current = a.useMemo(() => ut * it + Dt, [
313
+ ut,
314
+ Dt
315
+ ]), a.useEffect(() => {
316
+ ot.current = St;
317
+ }, [
318
+ St
319
+ ]), a.useEffect(() => {
320
+ p(!0);
321
+ }, []), a.useEffect(() => {
322
+ const r = L.current;
323
+ if (r) {
324
+ const b = r.getBoundingClientRect().height;
325
+ return Nt(b), E((x) => [
326
+ {
327
+ toastId: t.id,
328
+ height: b,
329
+ position: t.position
330
+ },
331
+ ...x
332
+ ]), () => E((x) => x.filter((D) => D.toastId !== t.id));
333
+ }
334
+ }, [
335
+ E,
336
+ t.id
337
+ ]), a.useLayoutEffect(() => {
338
+ if (!l) return;
339
+ const r = L.current, b = r.style.height;
340
+ r.style.height = "auto";
341
+ const x = r.getBoundingClientRect().height;
342
+ r.style.height = b, Nt(x), E((D) => D.find((y) => y.toastId === t.id) ? D.map((y) => y.toastId === t.id ? {
343
+ ...y,
344
+ height: x
345
+ } : y) : [
346
+ {
347
+ toastId: t.id,
348
+ height: x,
349
+ position: t.position
350
+ },
351
+ ...D
352
+ ]);
353
+ }, [
354
+ l,
355
+ t.title,
356
+ t.description,
357
+ E,
358
+ t.id,
359
+ t.jsx,
360
+ t.action,
361
+ t.cancel
362
+ ]);
363
+ const Y = a.useCallback(() => {
364
+ R(!0), xt(J.current), E((r) => r.filter((b) => b.toastId !== t.id)), setTimeout(() => {
365
+ nt(t);
366
+ }, ke);
367
+ }, [
368
+ t,
369
+ nt,
370
+ E,
371
+ J
372
+ ]);
373
+ a.useEffect(() => {
374
+ if (t.promise && _ === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
375
+ let r;
376
+ return W || j || Rt ? (() => {
377
+ if (_t.current < wt.current) {
378
+ const D = (/* @__PURE__ */ new Date()).getTime() - wt.current;
379
+ ot.current = ot.current - D;
380
+ }
381
+ _t.current = (/* @__PURE__ */ new Date()).getTime();
382
+ })() : ot.current !== 1 / 0 && (wt.current = (/* @__PURE__ */ new Date()).getTime(), r = setTimeout(() => {
383
+ t.onAutoClose == null || t.onAutoClose.call(t, t), Y();
384
+ }, ot.current)), () => clearTimeout(r);
385
+ }, [
386
+ W,
387
+ j,
388
+ t,
389
+ _,
390
+ Rt,
391
+ Y
392
+ ]), a.useEffect(() => {
393
+ t.delete && (Y(), t.onDismiss == null || t.onDismiss.call(t, t));
394
+ }, [
395
+ Y,
396
+ t.delete
397
+ ]);
398
+ function Kt() {
399
+ var r;
400
+ if (v?.loading) {
401
+ var b;
402
+ return /* @__PURE__ */ a.createElement("div", {
403
+ className: z(u?.loader, t == null || (b = t.classNames) == null ? void 0 : b.loader, "sonner-loader"),
404
+ "data-visible": _ === "loading"
405
+ }, v.loading);
406
+ }
407
+ return /* @__PURE__ */ a.createElement(re, {
408
+ className: z(u?.loader, t == null || (r = t.classNames) == null ? void 0 : r.loader),
409
+ visible: _ === "loading"
410
+ });
411
+ }
412
+ const qt = t.icon || v?.[_] || se(_);
413
+ var Bt, Mt;
414
+ return /* @__PURE__ */ a.createElement("li", {
415
+ tabIndex: 0,
416
+ ref: L,
417
+ className: z(rt, $t, u?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, u?.default, u?.[_], t == null || (e = t.classNames) == null ? void 0 : e[_]),
418
+ "data-sonner-toast": "",
419
+ "data-rich-colors": (Bt = t.richColors) != null ? Bt : bt,
420
+ "data-styled": !(t.jsx || t.unstyled || w),
421
+ "data-mounted": l,
422
+ "data-promise": !!t.promise,
423
+ "data-swiped": ct,
424
+ "data-removed": m,
425
+ "data-visible": Yt,
426
+ "data-y-position": Xt,
427
+ "data-x-position": Ut,
428
+ "data-index": c,
429
+ "data-front": Ot,
430
+ "data-swiping": K,
431
+ "data-dismissible": Q,
432
+ "data-type": _,
433
+ "data-invert": Wt,
434
+ "data-swipe-out": q,
435
+ "data-swipe-direction": V,
436
+ "data-expanded": !!(W || at && l),
437
+ "data-testid": t.testId,
438
+ style: {
439
+ "--index": c,
440
+ "--toasts-before": c,
441
+ "--z-index": st.length - c,
442
+ "--offset": `${m ? Pt : J.current}px`,
443
+ "--initial-height": at ? "auto" : `${Lt}px`,
444
+ ...tt,
445
+ ...t.style
446
+ },
447
+ onDragEnd: () => {
448
+ f(!1), M(null), Z.current = null;
449
+ },
450
+ onPointerDown: (r) => {
451
+ r.button !== 2 && (Et || !Q || (kt.current = /* @__PURE__ */ new Date(), xt(J.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (f(!0), Z.current = {
452
+ x: r.clientX,
453
+ y: r.clientY
454
+ })));
455
+ },
456
+ onPointerUp: () => {
457
+ var r, b, x;
458
+ if (q || !Q) return;
459
+ Z.current = null;
460
+ const D = Number(((r = L.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ft = Number(((b = L.current) == null ? void 0 : b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((x = kt.current) == null ? void 0 : x.getTime()), B = F === "x" ? D : ft, mt = Math.abs(B) / y;
461
+ if (Math.abs(B) >= Ne || mt > 0.11) {
462
+ xt(J.current), t.onDismiss == null || t.onDismiss.call(t, t), lt(F === "x" ? D > 0 ? "right" : "left" : ft > 0 ? "down" : "up"), Y(), dt(!0);
463
+ return;
464
+ } else {
465
+ var I, C;
466
+ (I = L.current) == null || I.style.setProperty("--swipe-amount-x", "0px"), (C = L.current) == null || C.style.setProperty("--swipe-amount-y", "0px");
467
+ }
468
+ G(!1), f(!1), M(null);
469
+ },
470
+ onPointerMove: (r) => {
471
+ var b, x, D;
472
+ if (!Z.current || !Q || ((b = window.getSelection()) == null ? void 0 : b.toString().length) > 0) return;
473
+ const y = r.clientY - Z.current.y, B = r.clientX - Z.current.x;
474
+ var mt;
475
+ const I = (mt = n.swipeDirections) != null ? mt : Se(A);
476
+ !F && (Math.abs(B) > 1 || Math.abs(y) > 1) && M(Math.abs(B) > Math.abs(y) ? "x" : "y");
477
+ let C = {
478
+ x: 0,
479
+ y: 0
480
+ };
481
+ const It = (X) => 1 / (1.5 + Math.abs(X) / 20);
482
+ if (F === "y") {
483
+ if (I.includes("top") || I.includes("bottom"))
484
+ if (I.includes("top") && y < 0 || I.includes("bottom") && y > 0)
485
+ C.y = y;
486
+ else {
487
+ const X = y * It(y);
488
+ C.y = Math.abs(X) < Math.abs(y) ? X : y;
489
+ }
490
+ } else if (F === "x" && (I.includes("left") || I.includes("right")))
491
+ if (I.includes("left") && B < 0 || I.includes("right") && B > 0)
492
+ C.x = B;
493
+ else {
494
+ const X = B * It(B);
495
+ C.x = Math.abs(X) < Math.abs(B) ? X : B;
496
+ }
497
+ (Math.abs(C.x) > 0 || Math.abs(C.y) > 0) && G(!0), (x = L.current) == null || x.style.setProperty("--swipe-amount-x", `${C.x}px`), (D = L.current) == null || D.style.setProperty("--swipe-amount-y", `${C.y}px`);
498
+ }
499
+ }, Vt && !t.jsx && _ !== "loading" ? /* @__PURE__ */ a.createElement("button", {
500
+ "aria-label": O,
501
+ "data-disabled": Et,
502
+ "data-close-button": !0,
503
+ onClick: Et || !Q ? () => {
504
+ } : () => {
505
+ Y(), t.onDismiss == null || t.onDismiss.call(t, t);
506
+ },
507
+ className: z(u?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
508
+ }, (Mt = v?.close) != null ? Mt : ue) : null, (_ || t.icon || t.promise) && t.icon !== null && (v?.[_] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
509
+ "data-icon": "",
510
+ className: z(u?.icon, t == null || (T = t.classNames) == null ? void 0 : T.icon)
511
+ }, t.promise || t.type === "loading" && !t.icon ? t.icon || Kt() : null, t.type !== "loading" ? qt : null) : null, /* @__PURE__ */ a.createElement("div", {
512
+ "data-content": "",
513
+ className: z(u?.content, t == null || (d = t.classNames) == null ? void 0 : d.content)
514
+ }, /* @__PURE__ */ a.createElement("div", {
515
+ "data-title": "",
516
+ className: z(u?.title, t == null || (g = t.classNames) == null ? void 0 : g.title)
517
+ }, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
518
+ "data-description": "",
519
+ className: z(yt, Ft, u?.description, t == null || (N = t.classNames) == null ? void 0 : N.description)
520
+ }, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && pt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
521
+ "data-button": !0,
522
+ "data-cancel": !0,
523
+ style: t.cancelButtonStyle || $,
524
+ onClick: (r) => {
525
+ pt(t.cancel) && Q && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, r), Y());
526
+ },
527
+ className: z(u?.cancelButton, t == null || (h = t.classNames) == null ? void 0 : h.cancelButton)
528
+ }, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && pt(t.action) ? /* @__PURE__ */ a.createElement("button", {
529
+ "data-button": !0,
530
+ "data-action": !0,
531
+ style: t.actionButtonStyle || vt,
532
+ onClick: (r) => {
533
+ pt(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, r), !r.defaultPrevented && Y());
534
+ },
535
+ className: z(u?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
536
+ }, t.action.label) : null);
537
+ };
538
+ function zt() {
539
+ if (typeof window > "u" || typeof document > "u") return "ltr";
540
+ const n = document.documentElement.getAttribute("dir");
541
+ return n === "auto" || !n ? window.getComputedStyle(document.documentElement).direction : n;
542
+ }
543
+ function De(n, o) {
544
+ const e = {};
545
+ return [
546
+ n,
547
+ o
548
+ ].forEach((s, T) => {
549
+ const d = T === 1, g = d ? "--mobile-offset" : "--offset", N = d ? we : xe;
550
+ function h(i) {
551
+ [
552
+ "top",
553
+ "right",
554
+ "bottom",
555
+ "left"
556
+ ].forEach((k) => {
557
+ e[`${g}-${k}`] = typeof i == "number" ? `${i}px` : i;
558
+ });
559
+ }
560
+ typeof s == "number" || typeof s == "string" ? h(s) : typeof s == "object" ? [
561
+ "top",
562
+ "right",
563
+ "bottom",
564
+ "left"
565
+ ].forEach((i) => {
566
+ s[i] === void 0 ? e[`${g}-${i}`] = N : e[`${g}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
567
+ }) : h(N);
568
+ }), e;
569
+ }
570
+ const Re = /* @__PURE__ */ a.forwardRef(function(o, e) {
571
+ const { id: s, invert: T, position: d = "bottom-right", hotkey: g = [
572
+ "altKey",
573
+ "KeyT"
574
+ ], expand: N, closeButton: h, className: i, offset: k, mobileOffset: t, theme: w = "light", richColors: j, duration: E, style: ht, visibleToasts: U = ye, toastOptions: c, dir: st = zt(), gap: W = Te, icons: nt, containerAriaLabel: bt = "Notifications" } = o, [P, tt] = a.useState([]), $ = a.useMemo(() => s ? P.filter((l) => l.toasterId === s) : P.filter((l) => !l.toasterId), [
575
+ P,
576
+ s
577
+ ]), vt = a.useMemo(() => Array.from(new Set([
578
+ d
579
+ ].concat($.filter((l) => l.position).map((l) => l.position)))), [
580
+ $,
581
+ d
582
+ ]), [rt, yt] = a.useState([]), [et, A] = a.useState(!1), [it, at] = a.useState(!1), [u, v] = a.useState(w !== "system" ? w : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), O = a.useRef(null), F = g.join("+").replace(/Key/g, "").replace(/Digit/g, ""), M = a.useRef(null), V = a.useRef(!1), lt = a.useCallback((l) => {
583
+ tt((p) => {
584
+ var m;
585
+ return (m = p.find((R) => R.id === l.id)) != null && m.delete || S.dismiss(l.id), p.filter(({ id: R }) => R !== l.id);
586
+ });
587
+ }, []);
588
+ return a.useEffect(() => S.subscribe((l) => {
589
+ if (l.dismiss) {
590
+ requestAnimationFrame(() => {
591
+ tt((p) => p.map((m) => m.id === l.id ? {
592
+ ...m,
593
+ delete: !0
594
+ } : m));
595
+ });
596
+ return;
597
+ }
598
+ setTimeout(() => {
599
+ Qt.flushSync(() => {
600
+ tt((p) => {
601
+ const m = p.findIndex((R) => R.id === l.id);
602
+ return m !== -1 ? [
603
+ ...p.slice(0, m),
604
+ {
605
+ ...p[m],
606
+ ...l
607
+ },
608
+ ...p.slice(m + 1)
609
+ ] : [
610
+ l,
611
+ ...p
612
+ ];
613
+ });
614
+ });
615
+ });
616
+ }), [
617
+ P
618
+ ]), a.useEffect(() => {
619
+ if (w !== "system") {
620
+ v(w);
621
+ return;
622
+ }
623
+ if (w === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? v("dark") : v("light")), typeof window > "u") return;
624
+ const l = window.matchMedia("(prefers-color-scheme: dark)");
625
+ try {
626
+ l.addEventListener("change", ({ matches: p }) => {
627
+ v(p ? "dark" : "light");
628
+ });
629
+ } catch {
630
+ l.addListener(({ matches: m }) => {
631
+ try {
632
+ v(m ? "dark" : "light");
633
+ } catch (R) {
634
+ console.error(R);
635
+ }
636
+ });
637
+ }
638
+ }, [
639
+ w
640
+ ]), a.useEffect(() => {
641
+ P.length <= 1 && A(!1);
642
+ }, [
643
+ P
644
+ ]), a.useEffect(() => {
645
+ const l = (p) => {
646
+ var m;
647
+ if (g.every((f) => p[f] || p.code === f)) {
648
+ var K;
649
+ A(!0), (K = O.current) == null || K.focus();
650
+ }
651
+ p.code === "Escape" && (document.activeElement === O.current || (m = O.current) != null && m.contains(document.activeElement)) && A(!1);
652
+ };
653
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
654
+ }, [
655
+ g
656
+ ]), a.useEffect(() => {
657
+ if (O.current)
658
+ return () => {
659
+ M.current && (M.current.focus({
660
+ preventScroll: !0
661
+ }), M.current = null, V.current = !1);
662
+ };
663
+ }, [
664
+ O.current
665
+ ]), // Remove item from normal navigation flow, only available via hotkey
666
+ /* @__PURE__ */ a.createElement("section", {
667
+ ref: e,
668
+ "aria-label": `${bt} ${F}`,
669
+ tabIndex: -1,
670
+ "aria-live": "polite",
671
+ "aria-relevant": "additions text",
672
+ "aria-atomic": "false",
673
+ suppressHydrationWarning: !0
674
+ }, vt.map((l, p) => {
675
+ var m;
676
+ const [R, K] = l.split("-");
677
+ return $.length ? /* @__PURE__ */ a.createElement("ol", {
678
+ key: l,
679
+ dir: st === "auto" ? zt() : st,
680
+ tabIndex: -1,
681
+ ref: O,
682
+ className: i,
683
+ "data-sonner-toaster": !0,
684
+ "data-sonner-theme": u,
685
+ "data-y-position": R,
686
+ "data-x-position": K,
687
+ style: {
688
+ "--front-toast-height": `${((m = rt[0]) == null ? void 0 : m.height) || 0}px`,
689
+ "--width": `${Ee}px`,
690
+ "--gap": `${W}px`,
691
+ ...ht,
692
+ ...De(k, t)
693
+ },
694
+ onBlur: (f) => {
695
+ V.current && !f.currentTarget.contains(f.relatedTarget) && (V.current = !1, M.current && (M.current.focus({
696
+ preventScroll: !0
697
+ }), M.current = null));
698
+ },
699
+ onFocus: (f) => {
700
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || V.current || (V.current = !0, M.current = f.relatedTarget);
701
+ },
702
+ onMouseEnter: () => A(!0),
703
+ onMouseMove: () => A(!0),
704
+ onMouseLeave: () => {
705
+ it || A(!1);
706
+ },
707
+ onDragEnd: () => A(!1),
708
+ onPointerDown: (f) => {
709
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || at(!0);
710
+ },
711
+ onPointerUp: () => at(!1)
712
+ }, $.filter((f) => !f.position && p === 0 || f.position === l).map((f, q) => {
713
+ var dt, ct;
714
+ return /* @__PURE__ */ a.createElement(_e, {
715
+ key: f.id,
716
+ icons: nt,
717
+ index: q,
718
+ toast: f,
719
+ defaultRichColors: j,
720
+ duration: (dt = c?.duration) != null ? dt : E,
721
+ className: c?.className,
722
+ descriptionClassName: c?.descriptionClassName,
723
+ invert: T,
724
+ visibleToasts: U,
725
+ closeButton: (ct = c?.closeButton) != null ? ct : h,
726
+ interacting: it,
727
+ position: l,
728
+ style: c?.style,
729
+ unstyled: c?.unstyled,
730
+ classNames: c?.classNames,
731
+ cancelButtonStyle: c?.cancelButtonStyle,
732
+ actionButtonStyle: c?.actionButtonStyle,
733
+ closeButtonAriaLabel: c?.closeButtonAriaLabel,
734
+ removeToast: lt,
735
+ toasts: $.filter((G) => G.position == f.position),
736
+ heights: rt.filter((G) => G.position == f.position),
737
+ setHeights: yt,
738
+ expandByDefault: N,
739
+ gap: W,
740
+ expanded: et,
741
+ swipeDirections: o.swipeDirections
742
+ });
743
+ })) : null;
744
+ }));
745
+ });
746
+ function Pe({ position: n = "bottom-right", className: o, ...e }) {
747
+ return /* @__PURE__ */ H(
748
+ Re,
749
+ {
750
+ position: n,
751
+ className: Ht("toaster group", o),
752
+ ...e
753
+ }
754
+ );
755
+ }
756
+ const Be = {
757
+ success: {
758
+ icon: /* @__PURE__ */ H(ae, { size: 18, className: "text-success shrink-0" }),
759
+ border: "border-l-success"
760
+ },
761
+ error: {
762
+ icon: /* @__PURE__ */ H(ee, { size: 18, className: "text-destructive shrink-0" }),
763
+ border: "border-l-destructive"
764
+ },
765
+ warning: {
766
+ icon: /* @__PURE__ */ H(te, { size: 18, className: "text-warning shrink-0" }),
767
+ border: "border-l-warning"
768
+ },
769
+ info: {
770
+ icon: /* @__PURE__ */ H(Zt, { size: 18, className: "text-info shrink-0" }),
771
+ border: "border-l-info"
772
+ }
773
+ };
774
+ function Me({ id: n, variant: o, title: e, message: s, icon: T }) {
775
+ const d = Be[o];
776
+ return /* @__PURE__ */ Ct(
777
+ "div",
778
+ {
779
+ className: Ht(
780
+ "flex items-center gap-3 blurred-bg border border-border rounded-lg shadow-lg text-sm px-4 py-3 w-[356px] border-l-3",
781
+ d.border
782
+ ),
783
+ children: [
784
+ T || d.icon,
785
+ /* @__PURE__ */ Ct("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [
786
+ e && /* @__PURE__ */ H("p", { className: "text-foreground font-medium", children: e }),
787
+ /* @__PURE__ */ H("p", { className: "text-muted-foreground", children: s })
788
+ ] }),
789
+ /* @__PURE__ */ H(
790
+ "button",
791
+ {
792
+ onClick: () => jt.dismiss(n),
793
+ className: "text-muted-foreground hover:text-foreground shrink-0 cursor-pointer flex items-center",
794
+ children: /* @__PURE__ */ H(Jt, { size: 14 })
795
+ }
796
+ )
797
+ ]
798
+ }
799
+ );
800
+ }
801
+ function gt(n, o) {
802
+ const s = typeof o == "object" && o !== null && !Gt.isValidElement(o) ? o : void 0, T = s?.title, d = s ? s.message : o, g = s?.icon, N = s?.duration;
803
+ return jt.custom(
804
+ (h) => /* @__PURE__ */ H(
805
+ Me,
806
+ {
807
+ id: h,
808
+ variant: n,
809
+ title: T,
810
+ message: d,
811
+ icon: g
812
+ }
813
+ ),
814
+ { duration: N }
815
+ );
816
+ }
817
+ const Le = {
818
+ success: (n) => gt("success", n),
819
+ error: (n) => gt("error", n),
820
+ warning: (n) => gt("warning", n),
821
+ info: (n) => gt("info", n)
822
+ };
823
+ export {
824
+ Pe as ToastProvider,
825
+ Le as btcvToast,
826
+ Le as toast
827
+ };