@gv-tech/ui-web 2.15.0 → 2.15.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.
- package/dist/chart.cjs +4 -13
- package/dist/chart.mjs +101 -4316
- package/dist/drawer.cjs +1 -3
- package/dist/drawer.mjs +41 -1072
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +47 -331
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +52 -0
- package/dist/index.mjs +24 -23
- package/dist/search.cjs +1 -1
- package/dist/search.mjs +51 -38
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.mjs +9 -748
- package/dist/theme-provider.cjs +1 -1
- package/dist/theme-provider.mjs +4 -4
- package/dist/theme-toggle-B4VZTDpe.js +1 -0
- package/dist/theme-toggle-WtPW9UZi.mjs +79 -0
- package/dist/theme-toggle.cjs +1 -1
- package/dist/theme-toggle.mjs +7 -76
- package/package.json +2 -1
- package/src/index.ts +3 -0
- package/src/search.tsx +15 -4
- package/dist/index-CsjrqSSN.js +0 -1
- package/dist/index-DAWHN3cH.mjs +0 -85
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as r } from "./utils-B6yFEsav.mjs";
|
|
3
3
|
import { Accordion as a, AccordionContent as n, AccordionItem as i, AccordionTrigger as l } from "./accordion.mjs";
|
|
4
|
-
import { Alert as
|
|
4
|
+
import { Alert as u, AlertDescription as m, AlertTitle as g } from "./alert.mjs";
|
|
5
5
|
import { AlertDialog as x, AlertDialogAction as d, AlertDialogCancel as s, AlertDialogContent as T, AlertDialogDescription as b, AlertDialogFooter as c, AlertDialogHeader as D, AlertDialogOverlay as M, AlertDialogPortal as f, AlertDialogTitle as S, AlertDialogTrigger as h } from "./alert-dialog.mjs";
|
|
6
6
|
import { AspectRatio as v } from "./aspect-ratio.mjs";
|
|
7
7
|
import { Avatar as A, AvatarFallback as I, AvatarImage as F } from "./avatar.mjs";
|
|
@@ -11,19 +11,19 @@ import { Button as U, buttonVariants as j } from "./button.mjs";
|
|
|
11
11
|
import { Calendar as J, CalendarDayButton as K } from "./calendar.mjs";
|
|
12
12
|
import { Card as W, CardContent as X, CardDescription as Y, CardFooter as Z, CardHeader as _, CardTitle as $ } from "./card.mjs";
|
|
13
13
|
import { Carousel as oe, CarouselContent as re, CarouselItem as te, CarouselNext as ae, CarouselPrevious as ne } from "./carousel.mjs";
|
|
14
|
-
import { ChartContainer as le, ChartLegend as pe, ChartLegendContent as
|
|
14
|
+
import { ChartContainer as le, ChartLegend as pe, ChartLegendContent as ue, ChartStyle as me, ChartTooltip as ge, ChartTooltipContent as Ce } from "./chart.mjs";
|
|
15
15
|
import { Checkbox as de } from "./checkbox.mjs";
|
|
16
16
|
import { Collapsible as Te, CollapsibleContent as be, CollapsibleTrigger as ce } from "./collapsible.mjs";
|
|
17
17
|
import { Command as Me, CommandDialog as fe, CommandEmpty as Se, CommandGroup as he, CommandInput as we, CommandItem as ve, CommandList as Pe, CommandSeparator as Ae, CommandShortcut as Ie } from "./command.mjs";
|
|
18
18
|
import { ContextMenu as Le, ContextMenuCheckboxItem as Be, ContextMenuContent as Ge, ContextMenuGroup as Re, ContextMenuItem as He, ContextMenuLabel as Ne, ContextMenuPortal as ke, ContextMenuRadioGroup as ye, ContextMenuRadioItem as Ve, ContextMenuSeparator as Oe, ContextMenuShortcut as ze, ContextMenuSub as Ee, ContextMenuSubContent as Ue, ContextMenuSubTrigger as je, ContextMenuTrigger as qe } from "./context-menu.mjs";
|
|
19
19
|
import { Dialog as Ke, DialogClose as Qe, DialogContent as We, DialogDescription as Xe, DialogFooter as Ye, DialogHeader as Ze, DialogOverlay as _e, DialogPortal as $e, DialogTitle as eo, DialogTrigger as oo } from "./dialog.mjs";
|
|
20
|
-
import { Drawer as to, DrawerClose as ao, DrawerContent as no, DrawerDescription as io, DrawerFooter as lo, DrawerHeader as po, DrawerOverlay as
|
|
20
|
+
import { Drawer as to, DrawerClose as ao, DrawerContent as no, DrawerDescription as io, DrawerFooter as lo, DrawerHeader as po, DrawerOverlay as uo, DrawerPortal as mo, DrawerTitle as go, DrawerTrigger as Co } from "./drawer.mjs";
|
|
21
21
|
import { DropdownMenu as so, DropdownMenuCheckboxItem as To, DropdownMenuContent as bo, DropdownMenuGroup as co, DropdownMenuItem as Do, DropdownMenuLabel as Mo, DropdownMenuPortal as fo, DropdownMenuRadioGroup as So, DropdownMenuRadioItem as ho, DropdownMenuSeparator as wo, DropdownMenuShortcut as vo, DropdownMenuSub as Po, DropdownMenuSubContent as Ao, DropdownMenuSubTrigger as Io, DropdownMenuTrigger as Fo } from "./dropdown-menu.mjs";
|
|
22
22
|
import { Form as Bo, FormControl as Go, FormDescription as Ro, FormField as Ho, FormItem as No, FormLabel as ko, FormMessage as yo, useFormField as Vo } from "./form.mjs";
|
|
23
23
|
import { HoverCard as zo, HoverCardContent as Eo, HoverCardTrigger as Uo } from "./hover-card.mjs";
|
|
24
24
|
import { Input as qo } from "./input.mjs";
|
|
25
25
|
import { Label as Ko } from "./label.mjs";
|
|
26
|
-
import { Menubar as Wo, MenubarCheckboxItem as Xo, MenubarContent as Yo, MenubarGroup as Zo, MenubarItem as _o, MenubarLabel as $o, MenubarMenu as er, MenubarPortal as or, MenubarRadioGroup as rr, MenubarRadioItem as tr, MenubarSeparator as ar, MenubarShortcut as nr, MenubarSub as ir, MenubarSubContent as lr, MenubarSubTrigger as pr, MenubarTrigger as
|
|
26
|
+
import { Menubar as Wo, MenubarCheckboxItem as Xo, MenubarContent as Yo, MenubarGroup as Zo, MenubarItem as _o, MenubarLabel as $o, MenubarMenu as er, MenubarPortal as or, MenubarRadioGroup as rr, MenubarRadioItem as tr, MenubarSeparator as ar, MenubarShortcut as nr, MenubarSub as ir, MenubarSubContent as lr, MenubarSubTrigger as pr, MenubarTrigger as ur } from "./menubar.mjs";
|
|
27
27
|
import { NavigationMenu as gr, NavigationMenuContent as Cr, NavigationMenuIndicator as xr, NavigationMenuItem as dr, NavigationMenuLink as sr, NavigationMenuList as Tr, NavigationMenuTrigger as br, NavigationMenuViewport as cr, navigationMenuTriggerStyle as Dr } from "./navigation-menu.mjs";
|
|
28
28
|
import { Pagination as fr, PaginationContent as Sr, PaginationEllipsis as hr, PaginationItem as wr, PaginationLink as vr, PaginationNext as Pr, PaginationPrevious as Ar } from "./pagination.mjs";
|
|
29
29
|
import { Popover as Fr, PopoverAnchor as Lr, PopoverContent as Br, PopoverTrigger as Gr } from "./popover.mjs";
|
|
@@ -34,7 +34,7 @@ import { ScrollArea as jr, ScrollBar as qr } from "./scroll-area.mjs";
|
|
|
34
34
|
import { Search as Kr, SearchTrigger as Qr } from "./search.mjs";
|
|
35
35
|
import { Select as Xr, SelectContent as Yr, SelectGroup as Zr, SelectItem as _r, SelectLabel as $r, SelectScrollDownButton as et, SelectScrollUpButton as ot, SelectSeparator as rt, SelectTrigger as tt, SelectValue as at } from "./select.mjs";
|
|
36
36
|
import { Separator as it } from "./separator.mjs";
|
|
37
|
-
import { Sheet as pt, SheetClose as
|
|
37
|
+
import { Sheet as pt, SheetClose as ut, SheetContent as mt, SheetDescription as gt, SheetFooter as Ct, SheetHeader as xt, SheetOverlay as dt, SheetPortal as st, SheetTitle as Tt, SheetTrigger as bt } from "./sheet.mjs";
|
|
38
38
|
import { Skeleton as Dt } from "./skeleton.mjs";
|
|
39
39
|
import { Slider as ft } from "./slider.mjs";
|
|
40
40
|
import { Toaster as ht } from "./sonner.mjs";
|
|
@@ -47,17 +47,17 @@ import { Toggle as Kt } from "./toggle.mjs";
|
|
|
47
47
|
import { ToggleGroup as Wt, ToggleGroupItem as Xt } from "./toggle-group.mjs";
|
|
48
48
|
import { Tooltip as Zt, TooltipContent as _t, TooltipProvider as $t, TooltipTrigger as ea } from "./tooltip.mjs";
|
|
49
49
|
import { Toast as ra, ToastAction as ta, ToastClose as aa, ToastDescription as na, ToastProvider as ia, ToastTitle as la, ToastViewport as pa } from "./toast.mjs";
|
|
50
|
-
import { ThemeProvider as
|
|
51
|
-
import {
|
|
52
|
-
import { T as
|
|
53
|
-
import { toggleVariants as
|
|
50
|
+
import { ThemeProvider as ma } from "./theme-provider.mjs";
|
|
51
|
+
import { T as Ca, u as xa } from "./theme-toggle-WtPW9UZi.mjs";
|
|
52
|
+
import { T as sa, t as Ta, u as ba } from "./toaster-k5DnQSsh.mjs";
|
|
53
|
+
import { toggleVariants as Da } from "@gv-tech/ui-core";
|
|
54
54
|
export {
|
|
55
55
|
a as Accordion,
|
|
56
56
|
n as AccordionContent,
|
|
57
57
|
i as AccordionItem,
|
|
58
58
|
l as AccordionTrigger,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
u as Alert,
|
|
60
|
+
m as AlertDescription,
|
|
61
61
|
x as AlertDialog,
|
|
62
62
|
d as AlertDialogAction,
|
|
63
63
|
s as AlertDialogCancel,
|
|
@@ -98,8 +98,8 @@ export {
|
|
|
98
98
|
ne as CarouselPrevious,
|
|
99
99
|
le as ChartContainer,
|
|
100
100
|
pe as ChartLegend,
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
ue as ChartLegendContent,
|
|
102
|
+
me as ChartStyle,
|
|
103
103
|
ge as ChartTooltip,
|
|
104
104
|
Ce as ChartTooltipContent,
|
|
105
105
|
de as Checkbox,
|
|
@@ -146,8 +146,8 @@ export {
|
|
|
146
146
|
io as DrawerDescription,
|
|
147
147
|
lo as DrawerFooter,
|
|
148
148
|
po as DrawerHeader,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
uo as DrawerOverlay,
|
|
150
|
+
mo as DrawerPortal,
|
|
151
151
|
go as DrawerTitle,
|
|
152
152
|
Co as DrawerTrigger,
|
|
153
153
|
so as DropdownMenu,
|
|
@@ -192,7 +192,7 @@ export {
|
|
|
192
192
|
ir as MenubarSub,
|
|
193
193
|
lr as MenubarSubContent,
|
|
194
194
|
pr as MenubarSubTrigger,
|
|
195
|
-
|
|
195
|
+
ur as MenubarTrigger,
|
|
196
196
|
gr as NavigationMenu,
|
|
197
197
|
Cr as NavigationMenuContent,
|
|
198
198
|
xr as NavigationMenuIndicator,
|
|
@@ -234,8 +234,8 @@ export {
|
|
|
234
234
|
at as SelectValue,
|
|
235
235
|
it as Separator,
|
|
236
236
|
pt as Sheet,
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
ut as SheetClose,
|
|
238
|
+
mt as SheetContent,
|
|
239
239
|
gt as SheetDescription,
|
|
240
240
|
Ct as SheetFooter,
|
|
241
241
|
xt as SheetHeader,
|
|
@@ -261,7 +261,7 @@ export {
|
|
|
261
261
|
Ot as TabsTrigger,
|
|
262
262
|
Et as Text,
|
|
263
263
|
qt as Textarea,
|
|
264
|
-
|
|
264
|
+
ma as ThemeProvider,
|
|
265
265
|
Ca as ThemeToggle,
|
|
266
266
|
ra as Toast,
|
|
267
267
|
ta as ToastAction,
|
|
@@ -270,7 +270,7 @@ export {
|
|
|
270
270
|
ia as ToastProvider,
|
|
271
271
|
la as ToastTitle,
|
|
272
272
|
pa as ToastViewport,
|
|
273
|
-
|
|
273
|
+
sa as Toaster,
|
|
274
274
|
Kt as Toggle,
|
|
275
275
|
Wt as ToggleGroup,
|
|
276
276
|
Xt as ToggleGroupItem,
|
|
@@ -283,8 +283,9 @@ export {
|
|
|
283
283
|
r as cn,
|
|
284
284
|
Dr as navigationMenuTriggerStyle,
|
|
285
285
|
Ut as textVariants,
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
Ta as toast,
|
|
287
|
+
Da as toggleVariants,
|
|
288
288
|
Vo as useFormField,
|
|
289
|
-
|
|
289
|
+
xa as useTheme,
|
|
290
|
+
ba as useToast
|
|
290
291
|
};
|
package/dist/search.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),p=require("lucide-react"),h=require("react"),j=require("./button.cjs"),g=require("./command.cjs"),u=require("./utils-IjLH3w2e.js");function y(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return s.default=t,Object.freeze(s)}const d=y(h);function b({children:t,open:s,onOpenChange:e}){const[r,x]=d.useState(!1),a=s!==void 0,i=a?s:r,l=d.useCallback(o=>{let n;typeof o=="function"?n=o(i):n=o,a?e?.(n):x(n)},[a,i,e]);return d.useEffect(()=>{const o=n=>{n.key==="k"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),l(f=>!f))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[l]),c.jsxRuntimeExports.jsx(g.CommandDialog,{open:i,onOpenChange:l,children:t})}const m=d.forwardRef(({className:t,placeholder:s,variant:e="default",responsive:r=!1,...x},a)=>{const l=s||(e==="compact"?"Search...":"Search docs...");return c.jsxRuntimeExports.jsxs(j.Button,{variant:"outline",className:u.cn("text-muted-foreground relative h-9 text-sm transition-all transition-colors",e==="default"?"w-full justify-start pr-12":u.cn("w-9 justify-center px-0",r&&"2xl:w-48 2xl:justify-start 2xl:px-3 2xl:pr-12"),t),ref:a,...x,children:[c.jsxRuntimeExports.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsxRuntimeExports.jsx(p.Search,{className:"h-4 w-4 shrink-0"}),c.jsxRuntimeExports.jsx("span",{className:u.cn("truncate",e==="compact"&&(r?"hidden 2xl:inline":"hidden")),children:l})]}),c.jsxRuntimeExports.jsxs("kbd",{className:u.cn("bg-muted pointer-events-none absolute top-1.5 right-1.5 hidden h-6 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none",e==="default"&&"sm:flex",e==="compact"&&r&&"2xl:flex"),children:[c.jsxRuntimeExports.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]})});m.displayName="SearchTrigger";exports.Search=b;exports.SearchTrigger=m;
|
package/dist/search.mjs
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as
|
|
2
|
+
import { j as n } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import { Search as u } from "lucide-react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as d from "react";
|
|
5
5
|
import { Button as x } from "./button.mjs";
|
|
6
6
|
import { CommandDialog as h } from "./command.mjs";
|
|
7
|
-
import { c as
|
|
8
|
-
function
|
|
9
|
-
const [
|
|
10
|
-
(
|
|
7
|
+
import { c as i } from "./utils-B6yFEsav.mjs";
|
|
8
|
+
function N({ children: m, open: l, onOpenChange: t }) {
|
|
9
|
+
const [o, f] = d.useState(!1), r = l !== void 0, c = r ? l : o, a = d.useCallback(
|
|
10
|
+
(s) => {
|
|
11
11
|
let e;
|
|
12
|
-
typeof
|
|
12
|
+
typeof s == "function" ? e = s(c) : e = s, r ? t?.(e) : f(e);
|
|
13
13
|
},
|
|
14
|
-
[
|
|
14
|
+
[r, c, t]
|
|
15
15
|
);
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
e.key === "k" && (e.metaKey || e.ctrlKey) && (e.preventDefault(),
|
|
16
|
+
return d.useEffect(() => {
|
|
17
|
+
const s = (e) => {
|
|
18
|
+
e.key === "k" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), a((p) => !p));
|
|
19
19
|
};
|
|
20
|
-
return document.addEventListener("keydown",
|
|
21
|
-
}, [
|
|
20
|
+
return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
|
|
21
|
+
}, [a]), /* @__PURE__ */ n.jsx(h, { open: c, onOpenChange: a, children: m });
|
|
22
22
|
}
|
|
23
|
-
const j =
|
|
24
|
-
({ className:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
const j = d.forwardRef(
|
|
24
|
+
({ className: m, placeholder: l, variant: t = "default", responsive: o = !1, ...f }, r) => {
|
|
25
|
+
const a = l || (t === "compact" ? "Search..." : "Search docs...");
|
|
26
|
+
return /* @__PURE__ */ n.jsxs(
|
|
27
|
+
x,
|
|
28
|
+
{
|
|
29
|
+
variant: "outline",
|
|
30
|
+
className: i(
|
|
31
|
+
"text-muted-foreground relative h-9 text-sm transition-all transition-colors",
|
|
32
|
+
t === "default" ? "w-full justify-start pr-12" : i("w-9 justify-center px-0", o && "2xl:w-48 2xl:justify-start 2xl:px-3 2xl:pr-12"),
|
|
33
|
+
m
|
|
34
|
+
),
|
|
35
|
+
ref: r,
|
|
36
|
+
...f,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ n.jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
39
|
+
/* @__PURE__ */ n.jsx(u, { className: "h-4 w-4 shrink-0" }),
|
|
40
|
+
/* @__PURE__ */ n.jsx("span", { className: i("truncate", t === "compact" && (o ? "hidden 2xl:inline" : "hidden")), children: a })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ n.jsxs(
|
|
43
|
+
"kbd",
|
|
44
|
+
{
|
|
45
|
+
className: i(
|
|
46
|
+
"bg-muted pointer-events-none absolute top-1.5 right-1.5 hidden h-6 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none",
|
|
47
|
+
t === "default" && "sm:flex",
|
|
48
|
+
t === "compact" && o && "2xl:flex"
|
|
49
|
+
),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-xs", children: "⌘" }),
|
|
52
|
+
"K"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
47
60
|
);
|
|
48
61
|
j.displayName = "SearchTrigger";
|
|
49
62
|
export {
|
|
50
|
-
|
|
63
|
+
N as Search,
|
|
51
64
|
j as SearchTrigger
|
|
52
65
|
};
|
package/dist/sonner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ut=require("./jsx-runtime-nZSsnGb7.js"),Xt=require("./index-CsjrqSSN.js"),a=require("react"),Wt=require("react-dom");function qt(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",o.appendChild(e),e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}const Kt=r=>{switch(r){case"success":return Jt;case"info":return te;case"warning":return Zt;case"error":return ee;default:return null}},Gt=Array(12).fill(0),Qt=({visible:r,className:o})=>a.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},a.createElement("div",{className:"sonner-spinner"},Gt.map((e,s)=>a.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Jt=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),Zt=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},a.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),te=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),ee=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),ae=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),oe=()=>{const[r,o]=a.useState(document.hidden);return a.useEffect(()=>{const e=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),r};let wt=1;class se{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const e=this.subscribers.indexOf(o);this.subscribers.splice(e,1)}),this.publish=o=>{this.subscribers.forEach(e=>e(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var e;const{message:s,...C}=o,u=typeof o?.id=="number"||((e=o.id)==null?void 0:e.length)>0?o.id:wt++,g=this.toasts.find(b=>b.id===u),_=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),g?this.toasts=this.toasts.map(b=>b.id===u?(this.publish({...b,...o,id:u,title:s}),{...b,...o,id:u,dismissible:_,title:s}):b):this.addToast({title:s,...C,dismissible:_,id:u}),u},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:o,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(s=>s({id:e.id,dismiss:!0}))}),o),this.message=(o,e)=>this.create({...e,message:o}),this.error=(o,e)=>this.create({...e,message:o,type:"error"}),this.success=(o,e)=>this.create({...e,type:"success",message:o}),this.info=(o,e)=>this.create({...e,type:"info",message:o}),this.warning=(o,e)=>this.create({...e,type:"warning",message:o}),this.loading=(o,e)=>this.create({...e,type:"loading",message:o}),this.promise=(o,e)=>{if(!e)return;let s;e.loading!==void 0&&(s=this.create({...e,promise:o,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const C=Promise.resolve(o instanceof Function?o():o);let u=s!==void 0,g;const _=C.then(async i=>{if(g=["resolve",i],a.isValidElement(i))u=!1,this.create({id:s,type:"default",message:i});else if(re(i)&&!i.ok){u=!1;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:{message:t};this.create({id:s,type:"error",description:w,...E})}else if(i instanceof Error){u=!1;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:{message:t};this.create({id:s,type:"error",description:w,...E})}else if(e.success!==void 0){u=!1;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:{message:t};this.create({id:s,type:"success",description:w,...E})}}).catch(async i=>{if(g=["reject",i],e.error!==void 0){u=!1;const T=typeof e.error=="function"?await e.error(i):e.error,t=typeof e.description=="function"?await e.description(i):e.description,H=typeof T=="object"&&!a.isValidElement(T)?T:{message:T};this.create({id:s,type:"error",description:t,...H})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),e.finally==null||e.finally.call(e)}),b=()=>new Promise((i,T)=>_.then(()=>g[0]==="reject"?T(g[1]):i(g[1])).catch(T));return typeof s!="string"&&typeof s!="number"?{unwrap:b}:Object.assign(s,{unwrap:b})},this.custom=(o,e)=>{const s=e?.id||wt++;return this.create({jsx:o(s),id:s,...e}),s},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const S=new se,ne=(r,o)=>{const e=o?.id||wt++;return S.addToast({title:r,...o,id:e}),e},re=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",ie=ne,le=()=>S.toasts,de=()=>S.getActiveToasts();Object.assign(ie,{success:S.success,info:S.info,warning:S.warning,error:S.error,custom:S.custom,message:S.message,promise:S.promise,dismiss:S.dismiss,loading:S.loading},{getHistory:le,getToasts:de});qt("[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%)}");function mt(r){return r.label!==void 0}const ce=3,ue="24px",fe="16px",Mt=4e3,me=356,pe=14,ge=45,he=200;function O(...r){return r.filter(Boolean).join(" ")}function be(r){const[o,e]=r.split("-"),s=[];return o&&s.push(o),e&&s.push(e),s}const ve=r=>{var o,e,s,C,u,g,_,b,i;const{invert:T,toast:t,unstyled:w,interacting:H,setHeights:E,visibleToasts:pt,heights:U,index:d,toasts:ot,expanded:X,removeToast:st,defaultRichColors:gt,closeButton:j,style:Z,cancelButtonStyle:Y,actionButtonStyle:ht,className:nt="",descriptionClassName:bt="",duration:tt,position:A,gap:rt,expandByDefault:et,classNames:c,icons:v,closeButtonAriaLabel:P="Close toast"}=r,[$,B]=a.useState(null),[F,it]=a.useState(null),[l,p]=a.useState(!1),[m,R]=a.useState(!1),[W,f]=a.useState(!1),[q,lt]=a.useState(!1),[dt,K]=a.useState(!1),[Ct,vt]=a.useState(0),[At,Et]=a.useState(0),at=a.useRef(t.duration||tt||Mt),Tt=a.useRef(null),z=a.useRef(null),Ot=d===0,Ht=d+1<=pt,N=t.type,G=t.dismissible!==!1,jt=t.className||"",zt=t.descriptionClassName||"",ct=a.useMemo(()=>U.findIndex(n=>n.toastId===t.id)||0,[U,t.id]),Pt=a.useMemo(()=>{var n;return(n=t.closeButton)!=null?n:j},[t.closeButton,j]),St=a.useMemo(()=>t.duration||tt||Mt,[t.duration,tt]),yt=a.useRef(0),Q=a.useRef(0),Nt=a.useRef(0),J=a.useRef(null),[Lt,Yt]=A.split("-"),kt=a.useMemo(()=>U.reduce((n,h,x)=>x>=ct?n:n+h.height,0),[U,ct]),_t=oe(),$t=t.invert||T,xt=N==="loading";Q.current=a.useMemo(()=>ct*rt+kt,[ct,kt]),a.useEffect(()=>{at.current=St},[St]),a.useEffect(()=>{p(!0)},[]),a.useEffect(()=>{const n=z.current;if(n){const h=n.getBoundingClientRect().height;return Et(h),E(x=>[{toastId:t.id,height:h,position:t.position},...x]),()=>E(x=>x.filter(k=>k.toastId!==t.id))}},[E,t.id]),a.useLayoutEffect(()=>{if(!l)return;const n=z.current,h=n.style.height;n.style.height="auto";const x=n.getBoundingClientRect().height;n.style.height=h,Et(x),E(k=>k.find(y=>y.toastId===t.id)?k.map(y=>y.toastId===t.id?{...y,height:x}:y):[{toastId:t.id,height:x,position:t.position},...k])},[l,t.title,t.description,E,t.id,t.jsx,t.action,t.cancel]);const L=a.useCallback(()=>{R(!0),vt(Q.current),E(n=>n.filter(h=>h.toastId!==t.id)),setTimeout(()=>{st(t)},he)},[t,st,E,Q]);a.useEffect(()=>{if(t.promise&&N==="loading"||t.duration===1/0||t.type==="loading")return;let n;return X||H||_t?(()=>{if(Nt.current<yt.current){const k=new Date().getTime()-yt.current;at.current=at.current-k}Nt.current=new Date().getTime()})():at.current!==1/0&&(yt.current=new Date().getTime(),n=setTimeout(()=>{t.onAutoClose==null||t.onAutoClose.call(t,t),L()},at.current)),()=>clearTimeout(n)},[X,H,t,N,_t,L]),a.useEffect(()=>{t.delete&&(L(),t.onDismiss==null||t.onDismiss.call(t,t))},[L,t.delete]);function Ft(){var n;if(v?.loading){var h;return a.createElement("div",{className:O(c?.loader,t==null||(h=t.classNames)==null?void 0:h.loader,"sonner-loader"),"data-visible":N==="loading"},v.loading)}return a.createElement(Qt,{className:O(c?.loader,t==null||(n=t.classNames)==null?void 0:n.loader),visible:N==="loading"})}const Vt=t.icon||v?.[N]||Kt(N);var Rt,Dt;return a.createElement("li",{tabIndex:0,ref:z,className:O(nt,jt,c?.toast,t==null||(o=t.classNames)==null?void 0:o.toast,c?.default,c?.[N],t==null||(e=t.classNames)==null?void 0:e[N]),"data-sonner-toast":"","data-rich-colors":(Rt=t.richColors)!=null?Rt:gt,"data-styled":!(t.jsx||t.unstyled||w),"data-mounted":l,"data-promise":!!t.promise,"data-swiped":dt,"data-removed":m,"data-visible":Ht,"data-y-position":Lt,"data-x-position":Yt,"data-index":d,"data-front":Ot,"data-swiping":W,"data-dismissible":G,"data-type":N,"data-invert":$t,"data-swipe-out":q,"data-swipe-direction":F,"data-expanded":!!(X||et&&l),"data-testid":t.testId,style:{"--index":d,"--toasts-before":d,"--z-index":ot.length-d,"--offset":`${m?Ct:Q.current}px`,"--initial-height":et?"auto":`${At}px`,...Z,...t.style},onDragEnd:()=>{f(!1),B(null),J.current=null},onPointerDown:n=>{n.button!==2&&(xt||!G||(Tt.current=new Date,vt(Q.current),n.target.setPointerCapture(n.pointerId),n.target.tagName!=="BUTTON"&&(f(!0),J.current={x:n.clientX,y:n.clientY})))},onPointerUp:()=>{var n,h,x;if(q||!G)return;J.current=null;const k=Number(((n=z.current)==null?void 0:n.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((h=z.current)==null?void 0:h.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),y=new Date().getTime()-((x=Tt.current)==null?void 0:x.getTime()),D=$==="x"?k:ut,ft=Math.abs(D)/y;if(Math.abs(D)>=ge||ft>.11){vt(Q.current),t.onDismiss==null||t.onDismiss.call(t,t),it($==="x"?k>0?"right":"left":ut>0?"down":"up"),L(),lt(!0);return}else{var M,I;(M=z.current)==null||M.style.setProperty("--swipe-amount-x","0px"),(I=z.current)==null||I.style.setProperty("--swipe-amount-y","0px")}K(!1),f(!1),B(null)},onPointerMove:n=>{var h,x,k;if(!J.current||!G||((h=window.getSelection())==null?void 0:h.toString().length)>0)return;const y=n.clientY-J.current.y,D=n.clientX-J.current.x;var ft;const M=(ft=r.swipeDirections)!=null?ft:be(A);!$&&(Math.abs(D)>1||Math.abs(y)>1)&&B(Math.abs(D)>Math.abs(y)?"x":"y");let I={x:0,y:0};const Bt=V=>1/(1.5+Math.abs(V)/20);if($==="y"){if(M.includes("top")||M.includes("bottom"))if(M.includes("top")&&y<0||M.includes("bottom")&&y>0)I.y=y;else{const V=y*Bt(y);I.y=Math.abs(V)<Math.abs(y)?V:y}}else if($==="x"&&(M.includes("left")||M.includes("right")))if(M.includes("left")&&D<0||M.includes("right")&&D>0)I.x=D;else{const V=D*Bt(D);I.x=Math.abs(V)<Math.abs(D)?V:D}(Math.abs(I.x)>0||Math.abs(I.y)>0)&&K(!0),(x=z.current)==null||x.style.setProperty("--swipe-amount-x",`${I.x}px`),(k=z.current)==null||k.style.setProperty("--swipe-amount-y",`${I.y}px`)}},Pt&&!t.jsx&&N!=="loading"?a.createElement("button",{"aria-label":P,"data-disabled":xt,"data-close-button":!0,onClick:xt||!G?()=>{}:()=>{L(),t.onDismiss==null||t.onDismiss.call(t,t)},className:O(c?.closeButton,t==null||(s=t.classNames)==null?void 0:s.closeButton)},(Dt=v?.close)!=null?Dt:ae):null,(N||t.icon||t.promise)&&t.icon!==null&&(v?.[N]!==null||t.icon)?a.createElement("div",{"data-icon":"",className:O(c?.icon,t==null||(C=t.classNames)==null?void 0:C.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Ft():null,t.type!=="loading"?Vt:null):null,a.createElement("div",{"data-content":"",className:O(c?.content,t==null||(u=t.classNames)==null?void 0:u.content)},a.createElement("div",{"data-title":"",className:O(c?.title,t==null||(g=t.classNames)==null?void 0:g.title)},t.jsx?t.jsx:typeof t.title=="function"?t.title():t.title),t.description?a.createElement("div",{"data-description":"",className:O(bt,zt,c?.description,t==null||(_=t.classNames)==null?void 0:_.description)},typeof t.description=="function"?t.description():t.description):null),a.isValidElement(t.cancel)?t.cancel:t.cancel&&mt(t.cancel)?a.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||Y,onClick:n=>{mt(t.cancel)&&G&&(t.cancel.onClick==null||t.cancel.onClick.call(t.cancel,n),L())},className:O(c?.cancelButton,t==null||(b=t.classNames)==null?void 0:b.cancelButton)},t.cancel.label):null,a.isValidElement(t.action)?t.action:t.action&&mt(t.action)?a.createElement("button",{"data-button":!0,"data-action":!0,style:t.actionButtonStyle||ht,onClick:n=>{mt(t.action)&&(t.action.onClick==null||t.action.onClick.call(t.action,n),!n.defaultPrevented&&L())},className:O(c?.actionButton,t==null||(i=t.classNames)==null?void 0:i.actionButton)},t.action.label):null)};function It(){if(typeof window>"u"||typeof document>"u")return"ltr";const r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function ye(r,o){const e={};return[r,o].forEach((s,C)=>{const u=C===1,g=u?"--mobile-offset":"--offset",_=u?fe:ue;function b(i){["top","right","bottom","left"].forEach(T=>{e[`${g}-${T}`]=typeof i=="number"?`${i}px`:i})}typeof s=="number"||typeof s=="string"?b(s):typeof s=="object"?["top","right","bottom","left"].forEach(i=>{s[i]===void 0?e[`${g}-${i}`]=_:e[`${g}-${i}`]=typeof s[i]=="number"?`${s[i]}px`:s[i]}):b(_)}),e}const xe=a.forwardRef(function(o,e){const{id:s,invert:C,position:u="bottom-right",hotkey:g=["altKey","KeyT"],expand:_,closeButton:b,className:i,offset:T,mobileOffset:t,theme:w="light",richColors:H,duration:E,style:pt,visibleToasts:U=ce,toastOptions:d,dir:ot=It(),gap:X=pe,icons:st,containerAriaLabel:gt="Notifications"}=o,[j,Z]=a.useState([]),Y=a.useMemo(()=>s?j.filter(l=>l.toasterId===s):j.filter(l=>!l.toasterId),[j,s]),ht=a.useMemo(()=>Array.from(new Set([u].concat(Y.filter(l=>l.position).map(l=>l.position)))),[Y,u]),[nt,bt]=a.useState([]),[tt,A]=a.useState(!1),[rt,et]=a.useState(!1),[c,v]=a.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),P=a.useRef(null),$=g.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=a.useRef(null),F=a.useRef(!1),it=a.useCallback(l=>{Z(p=>{var m;return(m=p.find(R=>R.id===l.id))!=null&&m.delete||S.dismiss(l.id),p.filter(({id:R})=>R!==l.id)})},[]);return a.useEffect(()=>S.subscribe(l=>{if(l.dismiss){requestAnimationFrame(()=>{Z(p=>p.map(m=>m.id===l.id?{...m,delete:!0}:m))});return}setTimeout(()=>{Wt.flushSync(()=>{Z(p=>{const m=p.findIndex(R=>R.id===l.id);return m!==-1?[...p.slice(0,m),{...p[m],...l},...p.slice(m+1)]:[l,...p]})})})}),[j]),a.useEffect(()=>{if(w!=="system"){v(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?v("dark"):v("light")),typeof window>"u")return;const l=window.matchMedia("(prefers-color-scheme: dark)");try{l.addEventListener("change",({matches:p})=>{v(p?"dark":"light")})}catch{l.addListener(({matches:m})=>{try{v(m?"dark":"light")}catch(R){console.error(R)}})}},[w]),a.useEffect(()=>{j.length<=1&&A(!1)},[j]),a.useEffect(()=>{const l=p=>{var m;if(g.every(f=>p[f]||p.code===f)){var W;A(!0),(W=P.current)==null||W.focus()}p.code==="Escape"&&(document.activeElement===P.current||(m=P.current)!=null&&m.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[g]),a.useEffect(()=>{if(P.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,F.current=!1)}},[P.current]),a.createElement("section",{ref:e,"aria-label":`${gt} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ht.map((l,p)=>{var m;const[R,W]=l.split("-");return Y.length?a.createElement("ol",{key:l,dir:ot==="auto"?It():ot,tabIndex:-1,ref:P,className:i,"data-sonner-toaster":!0,"data-sonner-theme":c,"data-y-position":R,"data-x-position":W,style:{"--front-toast-height":`${((m=nt[0])==null?void 0:m.height)||0}px`,"--width":`${me}px`,"--gap":`${X}px`,...pt,...ye(T,t)},onBlur:f=>{F.current&&!f.currentTarget.contains(f.relatedTarget)&&(F.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:f=>{f.target instanceof HTMLElement&&f.target.dataset.dismissible==="false"||F.current||(F.current=!0,B.current=f.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{rt||A(!1)},onDragEnd:()=>A(!1),onPointerDown:f=>{f.target instanceof HTMLElement&&f.target.dataset.dismissible==="false"||et(!0)},onPointerUp:()=>et(!1)},Y.filter(f=>!f.position&&p===0||f.position===l).map((f,q)=>{var lt,dt;return a.createElement(ve,{key:f.id,icons:st,index:q,toast:f,defaultRichColors:H,duration:(lt=d?.duration)!=null?lt:E,className:d?.className,descriptionClassName:d?.descriptionClassName,invert:C,visibleToasts:U,closeButton:(dt=d?.closeButton)!=null?dt:b,interacting:rt,position:l,style:d?.style,unstyled:d?.unstyled,classNames:d?.classNames,cancelButtonStyle:d?.cancelButtonStyle,actionButtonStyle:d?.actionButtonStyle,closeButtonAriaLabel:d?.closeButtonAriaLabel,removeToast:it,toasts:Y.filter(K=>K.position==f.position),heights:nt.filter(K=>K.position==f.position),setHeights:bt,expandByDefault:_,gap:X,expanded:tt,swipeDirections:o.swipeDirections})})):null}))}),we=({...r})=>{const{theme:o="system"}=Xt.z();return Ut.jsxRuntimeExports.jsx(xe,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...r})};exports.Toaster=we;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.js"),r=require("next-themes"),s=require("sonner"),u=({...t})=>{const{theme:o="system"}=r.useTheme();return e.jsxRuntimeExports.jsx(s.Toaster,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};exports.Toaster=u;
|