@reeverdev/ui 0.2.111 → 0.2.112

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as W from'react';import {createContext,useContext,useCallback,useState,useEffect,useRef,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,Circle,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Calendar,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,RefreshCw,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Undo,Redo,Heading1,Heading2,Heading3,Bold,Italic,Underline,Strikethrough,List,ListOrdered,AlignLeft,AlignCenter,AlignRight,Quote,Code,Link,Unlink,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,ArrowRight,Hash,User,Settings,Bell,CheckCircle,Trash2,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,XCircle,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as Ya from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {format,getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {HexColorPicker,HexColorInput}from'react-colorful';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import BN from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import jN from'@tiptap/starter-kit';import XN from'@tiptap/extension-link';import qN from'@tiptap/extension-underline';import ZN from'@tiptap/extension-text-align';import QN from'@tiptap/extension-placeholder';import xk,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import kk from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';import Ho from'canvas-confetti';function u(...e){return twMerge(clsx(e))}var VR=cva("relative w-full p-4",{variants:{variant:{solid:"border",bordered:"border bg-transparent",flat:""},type:{default:"",success:"",warning:"",error:""},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",type:"default",className:"!border-primary bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"bordered",type:"default",className:"!border-primary text-primary [&>svg]:text-primary"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"!border-green-600 bg-green-600 text-white dark:!border-green-500 dark:bg-green-500 [&>svg]:text-white"},{variant:"bordered",type:"success",className:"!border-green-600 text-green-600 dark:!border-green-500 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"!border-amber-600 bg-amber-600 text-white dark:!border-amber-500 dark:bg-amber-500 [&>svg]:text-white"},{variant:"bordered",type:"warning",className:"!border-amber-600 text-amber-600 dark:!border-amber-500 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"!border-red-600 bg-red-600 text-white dark:!border-red-500 dark:bg-red-500 [&>svg]:text-white"},{variant:"bordered",type:"error",className:"!border-red-600 text-red-600 dark:!border-red-500 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",radius:"md"}}),AR={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},zR=W.forwardRef(({className:e,variant:t="solid",type:n="default",radius:r="md",icon:o,hideIcon:a=false,endContent:s,children:i,...l},c)=>{let d=AR[n],m=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:u(VR({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[m&&f&&jsx("span",{className:"mt-0.5 shrink-0",children:f}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});zR.displayName="Alert";var OR=W.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:u("mb-1 font-medium leading-none tracking-tight",e),...t}));OR.displayName="AlertTitle";var BR=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("text-sm [&_p]:leading-relaxed",e),...t}));BR.displayName="AlertDescription";var FR=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border-2"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"",md:"",lg:""},placement:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white dark:bg-green-500"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white dark:bg-amber-500"},{variant:"solid",color:"danger",className:"bg-red-600 text-white dark:bg-red-500"},{variant:"solid",color:"info",className:"bg-blue-600 text-white dark:bg-blue-500"},{variant:"bordered",color:"default",className:"bg-white border-zinc-800 text-zinc-800 dark:bg-zinc-900 dark:border-zinc-200 dark:text-zinc-200"},{variant:"bordered",color:"success",className:"bg-white border-green-600 text-green-600 dark:bg-zinc-900 dark:border-green-500 dark:text-green-500"},{variant:"bordered",color:"warning",className:"bg-white border-amber-600 text-amber-600 dark:bg-zinc-900 dark:border-amber-500 dark:text-amber-500"},{variant:"bordered",color:"danger",className:"bg-white border-red-600 text-red-600 dark:bg-zinc-900 dark:border-red-500 dark:text-red-500"},{variant:"bordered",color:"info",className:"bg-white border-blue-600 text-blue-600 dark:bg-zinc-900 dark:border-blue-500 dark:text-blue-500"},{size:"sm",className:"min-w-4 h-4 text-[10px] px-1"},{size:"md",className:"min-w-5 h-5 text-xs px-1"},{size:"lg",className:"min-w-6 h-6 text-sm px-1.5"}],defaultVariants:{variant:"solid",color:"default",size:"md",placement:"top-right"}}),KR={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},GR=W.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,...l},c)=>jsxs("div",{ref:c,className:u("relative inline-flex",e),...l,children:[t,jsx("span",{className:u(FR({variant:r,color:o,size:i?void 0:a,placement:s}),i&&KR[a||"md"],i&&"min-w-0 p-0"),children:!i&&n})]}));GR.displayName="Badge";var $R=cva("inline-flex items-center gap-1 font-medium rounded-full",{variants:{color:{default:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white",success:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500",warning:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500",danger:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500",info:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},size:{sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-0.5 text-xs",lg:"px-3 py-1 text-sm"}},defaultVariants:{color:"default",size:"md"}}),UR=W.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:u($R({color:t,size:n}),e),...r}));UR.displayName="TextBadge";var ud=cva("animate-spin",{variants:{size:{sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},color:{default:"text-foreground",primary:"text-primary",muted:"text-muted-foreground",success:"text-success",warning:"text-warning",danger:"text-danger",white:"text-white"}},defaultVariants:{size:"md",color:"default"}}),YR={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=W.forwardRef(({className:e,size:t="md",color:n,label:r="Loading",text:o,textPosition:a="right",customColor:s,...i},l)=>{let c=jsxs("svg",{className:u(ud({size:t,color:s?void 0:n})),style:s?{color:s}:void 0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status","aria-label":r,children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});if(!o)return jsx("div",{ref:l,className:u("inline-flex",e),...i,children:c});let d=jsx("span",{className:u("text-muted-foreground",YR[t]),children:o}),m=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:u("inline-flex items-center",m?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(m?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});Ha.displayName="Spinner";var bn=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-200 ease-out cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.97] [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{solid:"",bordered:"border-2 border-current bg-transparent hover:opacity-70",light:"bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800",flat:"bg-zinc-100 dark:bg-zinc-800 hover:opacity-70",ghost:"border-2 bg-transparent"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-9 px-3 text-xs",md:"h-10 px-4",lg:"h-11 px-5 text-base",icon:"h-10 w-10"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300"},{variant:"bordered",color:"default",className:"text-zinc-900 dark:text-white"},{variant:"light",color:"default",className:"text-zinc-900 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800"},{variant:"flat",color:"default",className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white"},{variant:"ghost",color:"default",className:"text-zinc-900 border-zinc-900 hover:bg-zinc-900 hover:text-white dark:text-white dark:border-white dark:hover:bg-white dark:hover:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:text-white dark:hover:bg-green-600"},{variant:"bordered",color:"success",className:"text-green-600 dark:text-green-500"},{variant:"light",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"flat",color:"success",className:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500"},{variant:"ghost",color:"success",className:"text-green-600 border-green-600 hover:bg-green-600 hover:text-white dark:text-green-500 dark:border-green-500 dark:hover:bg-green-500 dark:hover:text-white"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:text-white dark:hover:bg-amber-600"},{variant:"bordered",color:"warning",className:"text-amber-600 dark:text-amber-500"},{variant:"light",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"flat",color:"warning",className:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500"},{variant:"ghost",color:"warning",className:"text-amber-600 border-amber-600 hover:bg-amber-600 hover:text-white dark:text-amber-500 dark:border-amber-500 dark:hover:bg-amber-500 dark:hover:text-white"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:text-white dark:hover:bg-red-600"},{variant:"bordered",color:"danger",className:"text-red-600 dark:text-red-500"},{variant:"light",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"flat",color:"danger",className:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500"},{variant:"ghost",color:"danger",className:"text-red-600 border-red-600 hover:bg-red-600 hover:text-white dark:text-red-500 dark:border-red-500 dark:hover:bg-red-500 dark:hover:text-white"},{variant:"solid",color:"info",className:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-700 dark:text-white dark:hover:bg-blue-600"},{variant:"bordered",color:"info",className:"text-blue-600 dark:text-blue-500"},{variant:"light",color:"info",className:"text-blue-600 hover:bg-blue-600/10 dark:text-blue-500 dark:hover:bg-blue-500/10"},{variant:"flat",color:"info",className:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},{variant:"ghost",color:"info",className:"text-blue-600 border-blue-600 hover:bg-blue-600 hover:text-white dark:text-blue-500 dark:border-blue-500 dark:hover:bg-blue-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),oe=W.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,href:a,loading:s=false,startContent:i,endContent:l,children:c,disabled:d,style:m,...f},p)=>{let g=d||s,b=t==="bordered"?{borderColor:"currentColor",...m}:m,R=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?g?jsx("span",{role:"link","aria-disabled":"true",className:u(bn({variant:t,color:n,size:r,radius:o,className:e}),"pointer-events-none opacity-50 cursor-not-allowed"),style:b,children:R}):jsx("a",{href:a,className:u(bn({variant:t,color:n,size:r,radius:o,className:e})),style:b,...f,children:R}):jsx("button",{type:"button",className:u(bn({variant:t,color:n,size:r,radius:o,className:e})),ref:p,disabled:g,style:b,...f,children:R})});oe.displayName="Button";var gd=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"lg"}}),bd=W.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:u(gd({radius:t,className:e})),...n}));bd.displayName="Card";var vd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex flex-col space-y-1.5 p-6",e),...t}));vd.displayName="CardHeader";var hd=W.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:u("text-2xl font-semibold leading-none tracking-tight",e),...t}));hd.displayName="CardTitle";var xd=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));xd.displayName="CardDescription";var yd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("p-6 pt-0",e),...t}));yd.displayName="CardContent";var Rd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center p-6 pt-0",e),...t}));Rd.displayName="CardFooter";var Ko=W.forwardRef(({className:e,checked:t,defaultChecked:n=false,onCheckedChange:r,disabled:o,required:a,name:s,value:i="on",text:l,description:c,onKeyDown:d,...m},f)=>{let[p,g]=W.useState(n),h=t!==void 0,b=h?t:p,[v,R]=W.useState(false),w=W.useId(),x=()=>{if(o)return;let k=b==="indeterminate"?true:!b;h||g(k),r?.(k);},C=k=>{k.key==="Enter"&&k.preventDefault(),d?.(k);},y=b===true,N=b==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?w:void 0,"aria-checked":N?"mixed":y,"aria-required":a,disabled:o,ref:f,className:u("peer h-4 w-4 shrink-0 rounded-sm border border-primary focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",y&&"bg-primary text-primary-foreground",N&&"bg-background text-foreground",!l&&e),style:{borderColor:v?"var(--color-foreground)":void 0},onClick:x,onKeyDown:C,onFocus:()=>R(true),onBlur:()=>R(false),...m,children:(y||N)&&jsx("span",{className:"flex items-center justify-center text-current",children:N?jsx(Minus,{className:"h-4 w-4"}):jsx(Check,{className:"h-4 w-4"})})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:y,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:u("flex items-start gap-2",e),children:[T,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:w,className:u("text-sm font-medium leading-none cursor-pointer",o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:"text-xs text-muted-foreground",children:c})]})]}):T});Ko.displayName="Checkbox";var Go=0,Ti=null;function dt(){Go===0&&(Ti=document.body.style.overflow,document.body.style.overflow="hidden"),Go++;}function ut(){Go--,Go<=0&&(Go=0,document.body.style.overflow=Ti??"",Ti=null);}var Cd=W.createContext(null),Zr=()=>{let e=W.useContext(Cd);if(!e)throw new Error("Dialog components must be used within a Dialog");return e},Va=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useId(),c=W.useId(),d=W.useId(),m=W.useCallback(f=>{s||a(f),r?.(f);},[s,r]);return jsx(Cd.Provider,{value:{open:i,onOpenChange:m,contentId:l,titleId:c,descriptionId:d},children:e})};Va.displayName="Dialog";var Td=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Zr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Td.displayName="DialogTrigger";var Md=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Zr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Md.displayName="DialogClose";var Ni=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Ni.displayName="DialogPortal";var ki=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Zr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});ki.displayName="DialogOverlay";var Aa=W.forwardRef(({className:e,children:t,onEscapeKeyDown:n,onInteractOutside:r,...o},a)=>{let{open:s,onOpenChange:i,contentId:l,titleId:c,descriptionId:d}=Zr(),[m,f]=W.useState(false);return W.useEffect(()=>{f(true);},[]),W.useEffect(()=>{if(s)return dt(),()=>ut()},[s]),W.useEffect(()=>{if(!s)return;let p=g=>{g.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s,i,n]),!m||!s?null:jsxs(Ni,{children:[jsx(ki,{}),jsxs("div",{ref:a,id:l,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-describedby":d,"data-state":s?"open":"closed",className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,jsxs("button",{type:"button",onClick:()=>i(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Aa.displayName="DialogContent";var Nd=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Nd.displayName="DialogHeader";var kd=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kd.displayName="DialogFooter";var Pd=W.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Zr();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});Pd.displayName="DialogTitle";var Ed=W.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Zr();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});Ed.displayName="DialogDescription";var t0=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),za=W.forwardRef(({className:e,type:t,radius:n,label:r,isRequired:o,description:a,errorMessage:s,isInvalid:i,onFocus:l,onBlur:c,style:d,...m},f)=>{let[p,g]=W.useState(false),h=W.useId(),b=m.id||h,v=i||!!s,R=jsx("input",{id:b,type:t,className:u(t0({radius:n}),v&&"border-danger focus:border-danger",!r&&e),ref:f,required:o,"aria-invalid":v,"aria-describedby":a||s?`${b}-description`:void 0,style:{...d,borderColor:v?void 0:p?"var(--color-foreground)":void 0},onFocus:w=>{g(true),l?.(w);},onBlur:w=>{g(false),c?.(w);},...m});return !r&&!a&&!s?R:jsxs("div",{className:u("flex flex-col gap-1.5",e),children:[r&&jsxs("label",{htmlFor:b,className:"text-sm font-medium leading-none",children:[r,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),R,(a||s)&&jsx("p",{id:`${b}-description`,className:u("text-xs",v?"text-danger":"text-muted-foreground"),children:s||a})]})});za.displayName="Input";var r0=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Rr=W.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:u(r0(),e),...t}));Rr.displayName="Label";var Gn=W.forwardRef(({className:e,orientation:t="horizontal",decorative:n=true,text:r,...o},a)=>{let s=n?{role:"none"}:{role:"separator","aria-orientation":t};return r&&t==="horizontal"?jsxs("div",{className:u("flex items-center gap-4",e),children:[jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"}),jsx("span",{className:"text-sm text-muted-foreground",children:r}),jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"})]}):jsx("div",{ref:a,...s,className:u("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});Gn.displayName="Separator";var s0="peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",Ba={default:"bg-zinc-800 dark:bg-zinc-200",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500",info:"bg-blue-600 dark:bg-blue-500"},Hd={sm:{track:"h-5 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{track:"h-6 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{track:"h-7 w-14",thumb:"h-6 w-6",translate:"translate-x-7"}},Id=W.forwardRef(({className:e,color:t,size:n="md",customColor:r,checked:o,defaultChecked:a=false,onCheckedChange:s,disabled:i,required:l,name:c,value:d="on",onKeyDown:m,style:f,...p},g)=>{let[h,b]=W.useState(a),v=o!==void 0,R=v?o:h,w=()=>{if(i)return;let N=!R;v||b(N),s?.(N);},x=N=>{N.key==="Enter"&&N.preventDefault(),m?.(N);},C=t&&Ba[t]?Ba[t]:Ba.default,y=Hd[n]||Hd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":R,"aria-required":l,"data-state":R?"checked":"unchecked",disabled:i,ref:g,className:u(s0,y.track,R?r?"":C:"bg-input",e),style:r&&R?{backgroundColor:r,...f}:f,onClick:w,onKeyDown:x,...p,children:jsx("span",{className:u("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",y.thumb,R?y.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:R,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Id.displayName="Switch";var d0=cva("flex min-h-[80px] w-full border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"md"}}),Vd=W.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=W.useState(false);return jsx("textarea",{className:u(d0({radius:t,className:e})),ref:s,style:{...o,borderColor:i?"var(--color-foreground)":void 0},onFocus:c=>{l(true),n?.(c);},onBlur:c=>{l(false),r?.(c);},...a})});Vd.displayName="Textarea";var zd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Ga=W.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:u(zd({variant:t,className:e})),...n}));Ga.displayName="Skeleton";var g0=cva("relative flex shrink-0 overflow-hidden cursor-pointer",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),Od=W.createContext(null),Bd=()=>{let e=W.useContext(Od);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},wr=W.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=W.useState("idle");return jsx(Od.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:u(g0({size:t,radius:n,className:e})),...r})})});wr.displayName="Avatar";var Jr=W.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Bd();return W.useEffect(()=>{if(!t){i("error");return}i("loading"),r?.("loading");let l=new Image;l.src=t,l.onload=()=>{i("loaded"),r?.("loaded");},l.onerror=()=>{i("error"),r?.("error");};},[t,i,r]),s!=="loaded"?null:jsx("img",{ref:a,src:t,alt:n,className:u("aspect-square h-full w-full object-cover",e),...o})});Jr.displayName="AvatarImage";var Cr=W.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Bd(),[s,i]=W.useState(t===0);return W.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:u("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});Cr.displayName="AvatarFallback";var Kd=W.createContext({delayDuration:700,skipDelayDuration:300}),$n=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Kd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});$n.displayName="TooltipProvider";var Gd=W.createContext(null),$d=()=>{let e=W.useContext(Gd);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Un=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=W.useContext(Kd),[s,i]=W.useState(n),l=t!==void 0,c=l?t:s,d=W.useRef(null),m=W.useId(),f=W.useRef(null),p=o??a.delayDuration,g=W.useCallback(h=>{f.current&&clearTimeout(f.current),h?f.current=setTimeout(()=>{l||i(true),r?.(true);},p):(l||i(false),r?.(false));},[l,r,p]);return W.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Gd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:m},children:e})};Un.displayName="Tooltip";var Wn=W.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=$d();return jsx("button",{ref:h=>{l.current=h,typeof s=="function"?s(h):s&&(s.current=h);},type:"button","aria-describedby":d?c:void 0,onMouseEnter:h=>{t?.(h),i(true);},onMouseLeave:h=>{n?.(h),i(false);},onFocus:h=>{r?.(h),i(true);},onBlur:h=>{o?.(h),i(false);},...a,children:e})});Wn.displayName="TooltipTrigger";var _n=W.forwardRef(({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...s},i)=>{let{open:l,triggerRef:c,contentId:d}=$d(),[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);if(W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),w=0,x=0;switch(t){case "top":w=v.top-R.height-n;break;case "bottom":w=v.bottom+n;break;case "left":x=v.left-R.width-n;break;case "right":x=v.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":x=v.left+o;break;case "center":x=v.left+v.width/2-R.width/2;break;case "end":x=v.right-R.width-o;break}else switch(r){case "start":w=v.top+o;break;case "center":w=v.top+v.height/2-R.height/2;break;case "end":w=v.bottom-R.height-o;break}f({top:w,left:x});},[l,t,n,r,o,c]),!p||!l)return null;let b={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Ya.createPortal(jsx("div",{ref:v=>{h.current=v,typeof i=="function"?i(v):i&&(i.current=v);},id:d,role:"tooltip","data-side":t,className:u("fixed z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",b,e),style:{top:m.top,left:m.left},...s,children:a}),document.body)});_n.displayName="TooltipContent";var ze=W.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",children:r,style:o,...a},s)=>{let[i,l]=W.useState(false),c=W.useId().replace(/:/g,""),d=n==="visible"||n==="hover"&&i,m=d?"rgba(0,0,0,0.3)":"transparent",f=d?"rgba(255,255,255,0.3)":"transparent",p=`
1
+ import*as W from'react';import {createContext,useContext,useCallback,useState,useEffect,useRef,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,Circle,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Calendar,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,RefreshCw,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Undo,Redo,Heading1,Heading2,Heading3,Bold,Italic,Underline,Strikethrough,List,ListOrdered,AlignLeft,AlignCenter,AlignRight,Quote,Code,Link,Unlink,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,ArrowRight,Hash,User,Settings,Bell,CheckCircle,Trash2,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,XCircle,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as Ya from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {format,getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {HexColorPicker,HexColorInput}from'react-colorful';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import BN from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import jN from'@tiptap/starter-kit';import XN from'@tiptap/extension-link';import qN from'@tiptap/extension-underline';import ZN from'@tiptap/extension-text-align';import QN from'@tiptap/extension-placeholder';import xk,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import kk from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';import Ho from'canvas-confetti';function u(...e){return twMerge(clsx(e))}var VR=cva("relative w-full p-4",{variants:{variant:{solid:"border",bordered:"border bg-transparent",flat:""},type:{default:"",success:"",warning:"",error:""},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",type:"default",className:"!border-primary bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"bordered",type:"default",className:"!border-primary text-primary [&>svg]:text-primary"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"!border-green-600 bg-green-600 text-white dark:!border-green-500 dark:bg-green-500 [&>svg]:text-white"},{variant:"bordered",type:"success",className:"!border-green-600 text-green-600 dark:!border-green-500 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"!border-amber-600 bg-amber-600 text-white dark:!border-amber-500 dark:bg-amber-500 [&>svg]:text-white"},{variant:"bordered",type:"warning",className:"!border-amber-600 text-amber-600 dark:!border-amber-500 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"!border-red-600 bg-red-600 text-white dark:!border-red-500 dark:bg-red-500 [&>svg]:text-white"},{variant:"bordered",type:"error",className:"!border-red-600 text-red-600 dark:!border-red-500 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",radius:"md"}}),AR={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},zR=W.forwardRef(({className:e,variant:t="solid",type:n="default",radius:r="md",icon:o,hideIcon:a=false,endContent:s,children:i,...l},c)=>{let d=AR[n],m=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:u(VR({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[m&&f&&jsx("span",{className:"mt-0.5 shrink-0",children:f}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});zR.displayName="Alert";var OR=W.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:u("mb-1 font-medium leading-none tracking-tight",e),...t}));OR.displayName="AlertTitle";var BR=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("text-sm [&_p]:leading-relaxed",e),...t}));BR.displayName="AlertDescription";var FR=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border-2"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"",md:"",lg:""},placement:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white dark:bg-green-500"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white dark:bg-amber-500"},{variant:"solid",color:"danger",className:"bg-red-600 text-white dark:bg-red-500"},{variant:"solid",color:"info",className:"bg-blue-600 text-white dark:bg-blue-500"},{variant:"bordered",color:"default",className:"bg-white border-zinc-800 text-zinc-800 dark:bg-zinc-900 dark:border-zinc-200 dark:text-zinc-200"},{variant:"bordered",color:"success",className:"bg-white border-green-600 text-green-600 dark:bg-zinc-900 dark:border-green-500 dark:text-green-500"},{variant:"bordered",color:"warning",className:"bg-white border-amber-600 text-amber-600 dark:bg-zinc-900 dark:border-amber-500 dark:text-amber-500"},{variant:"bordered",color:"danger",className:"bg-white border-red-600 text-red-600 dark:bg-zinc-900 dark:border-red-500 dark:text-red-500"},{variant:"bordered",color:"info",className:"bg-white border-blue-600 text-blue-600 dark:bg-zinc-900 dark:border-blue-500 dark:text-blue-500"},{size:"sm",className:"min-w-4 h-4 text-[10px] px-1"},{size:"md",className:"min-w-5 h-5 text-xs px-1"},{size:"lg",className:"min-w-6 h-6 text-sm px-1.5"}],defaultVariants:{variant:"solid",color:"default",size:"md",placement:"top-right"}}),KR={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},GR=W.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,...l},c)=>jsxs("div",{ref:c,className:u("relative inline-flex",e),...l,children:[t,jsx("span",{className:u(FR({variant:r,color:o,size:i?void 0:a,placement:s}),i&&KR[a||"md"],i&&"min-w-0 p-0"),children:!i&&n})]}));GR.displayName="Badge";var $R=cva("inline-flex items-center gap-1 font-medium rounded-full",{variants:{color:{default:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white",success:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500",warning:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500",danger:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500",info:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},size:{sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-0.5 text-xs",lg:"px-3 py-1 text-sm"}},defaultVariants:{color:"default",size:"md"}}),UR=W.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:u($R({color:t,size:n}),e),...r}));UR.displayName="TextBadge";var ud=cva("animate-spin",{variants:{size:{sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},color:{default:"text-foreground",primary:"text-primary",muted:"text-muted-foreground",success:"text-success",warning:"text-warning",danger:"text-danger",white:"text-white"}},defaultVariants:{size:"md",color:"default"}}),YR={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=W.forwardRef(({className:e,size:t="md",color:n,label:r="Loading",text:o,textPosition:a="right",customColor:s,...i},l)=>{let c=jsxs("svg",{className:u(ud({size:t,color:s?void 0:n})),style:s?{color:s}:void 0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status","aria-label":r,children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});if(!o)return jsx("div",{ref:l,className:u("inline-flex",e),...i,children:c});let d=jsx("span",{className:u("text-muted-foreground",YR[t]),children:o}),m=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:u("inline-flex items-center",m?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(m?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});Ha.displayName="Spinner";var bn=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-200 ease-out cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.97] [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{solid:"",bordered:"border-2 border-current bg-transparent hover:opacity-70",light:"bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800",flat:"bg-zinc-100 dark:bg-zinc-800 hover:opacity-70",ghost:"border-2 bg-transparent"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-9 px-3 text-xs",md:"h-10 px-4",lg:"h-11 px-5 text-base",icon:"h-10 w-10"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300"},{variant:"bordered",color:"default",className:"text-zinc-900 dark:text-white"},{variant:"light",color:"default",className:"text-zinc-900 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800"},{variant:"flat",color:"default",className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white"},{variant:"ghost",color:"default",className:"text-zinc-900 border-zinc-900 hover:bg-zinc-900 hover:text-white dark:text-white dark:border-white dark:hover:bg-white dark:hover:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:text-white dark:hover:bg-green-600"},{variant:"bordered",color:"success",className:"text-green-600 dark:text-green-500"},{variant:"light",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"flat",color:"success",className:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500"},{variant:"ghost",color:"success",className:"text-green-600 border-green-600 hover:bg-green-600 hover:text-white dark:text-green-500 dark:border-green-500 dark:hover:bg-green-500 dark:hover:text-white"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:text-white dark:hover:bg-amber-600"},{variant:"bordered",color:"warning",className:"text-amber-600 dark:text-amber-500"},{variant:"light",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"flat",color:"warning",className:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500"},{variant:"ghost",color:"warning",className:"text-amber-600 border-amber-600 hover:bg-amber-600 hover:text-white dark:text-amber-500 dark:border-amber-500 dark:hover:bg-amber-500 dark:hover:text-white"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:text-white dark:hover:bg-red-600"},{variant:"bordered",color:"danger",className:"text-red-600 dark:text-red-500"},{variant:"light",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"flat",color:"danger",className:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500"},{variant:"ghost",color:"danger",className:"text-red-600 border-red-600 hover:bg-red-600 hover:text-white dark:text-red-500 dark:border-red-500 dark:hover:bg-red-500 dark:hover:text-white"},{variant:"solid",color:"info",className:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-700 dark:text-white dark:hover:bg-blue-600"},{variant:"bordered",color:"info",className:"text-blue-600 dark:text-blue-500"},{variant:"light",color:"info",className:"text-blue-600 hover:bg-blue-600/10 dark:text-blue-500 dark:hover:bg-blue-500/10"},{variant:"flat",color:"info",className:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},{variant:"ghost",color:"info",className:"text-blue-600 border-blue-600 hover:bg-blue-600 hover:text-white dark:text-blue-500 dark:border-blue-500 dark:hover:bg-blue-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),oe=W.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,href:a,loading:s=false,startContent:i,endContent:l,children:c,disabled:d,style:m,...f},p)=>{let g=d||s,b=t==="bordered"?{borderColor:"currentColor",...m}:m,y=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?g?jsx("span",{role:"link","aria-disabled":"true",className:u(bn({variant:t,color:n,size:r,radius:o,className:e}),"pointer-events-none opacity-50 cursor-not-allowed"),style:b,children:y}):jsx("a",{href:a,className:u(bn({variant:t,color:n,size:r,radius:o,className:e})),style:b,...f,children:y}):jsx("button",{type:"button",className:u(bn({variant:t,color:n,size:r,radius:o,className:e})),ref:p,disabled:g,style:b,...f,children:y})});oe.displayName="Button";var gd=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"lg"}}),bd=W.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:u(gd({radius:t,className:e})),...n}));bd.displayName="Card";var vd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex flex-col space-y-1.5 p-6",e),...t}));vd.displayName="CardHeader";var hd=W.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:u("text-2xl font-semibold leading-none tracking-tight",e),...t}));hd.displayName="CardTitle";var xd=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));xd.displayName="CardDescription";var yd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("p-6 pt-0",e),...t}));yd.displayName="CardContent";var Rd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center p-6 pt-0",e),...t}));Rd.displayName="CardFooter";var Ko=W.forwardRef(({className:e,checked:t,defaultChecked:n=false,onCheckedChange:r,disabled:o,required:a,name:s,value:i="on",text:l,description:c,onKeyDown:d,...m},f)=>{let[p,g]=W.useState(n),h=t!==void 0,b=h?t:p,[v,y]=W.useState(false),R=W.useId(),w=()=>{if(o)return;let k=b==="indeterminate"?true:!b;h||g(k),r?.(k);},C=k=>{k.key==="Enter"&&k.preventDefault(),d?.(k);},x=b===true,N=b==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?R:void 0,"aria-checked":N?"mixed":x,"aria-required":a,disabled:o,ref:f,className:u("peer h-4 w-4 shrink-0 rounded-sm border border-primary focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",x&&"bg-primary text-primary-foreground",N&&"bg-background text-foreground",!l&&e),style:{borderColor:v?"var(--color-foreground)":void 0},onClick:w,onKeyDown:C,onFocus:()=>y(true),onBlur:()=>y(false),...m,children:(x||N)&&jsx("span",{className:"flex items-center justify-center text-current",children:N?jsx(Minus,{className:"h-4 w-4"}):jsx(Check,{className:"h-4 w-4"})})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:x,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:u("flex items-start gap-2",e),children:[T,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:R,className:u("text-sm font-medium leading-none cursor-pointer",o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:"text-xs text-muted-foreground",children:c})]})]}):T});Ko.displayName="Checkbox";var Go=0,Ti=null;function dt(){Go===0&&(Ti=document.body.style.overflow,document.body.style.overflow="hidden"),Go++;}function ut(){Go--,Go<=0&&(Go=0,document.body.style.overflow=Ti??"",Ti=null);}var Cd=W.createContext(null),Zr=()=>{let e=W.useContext(Cd);if(!e)throw new Error("Dialog components must be used within a Dialog");return e},Va=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useId(),c=W.useId(),d=W.useId(),m=W.useCallback(f=>{s||a(f),r?.(f);},[s,r]);return jsx(Cd.Provider,{value:{open:i,onOpenChange:m,contentId:l,titleId:c,descriptionId:d},children:e})};Va.displayName="Dialog";var Td=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Zr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Td.displayName="DialogTrigger";var Md=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Zr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Md.displayName="DialogClose";var Ni=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Ni.displayName="DialogPortal";var ki=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Zr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});ki.displayName="DialogOverlay";var Aa=W.forwardRef(({className:e,children:t,onEscapeKeyDown:n,onInteractOutside:r,...o},a)=>{let{open:s,onOpenChange:i,contentId:l,titleId:c,descriptionId:d}=Zr(),[m,f]=W.useState(false);return W.useEffect(()=>{f(true);},[]),W.useEffect(()=>{if(s)return dt(),()=>ut()},[s]),W.useEffect(()=>{if(!s)return;let p=g=>{g.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s,i,n]),!m||!s?null:jsxs(Ni,{children:[jsx(ki,{}),jsxs("div",{ref:a,id:l,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-describedby":d,"data-state":s?"open":"closed",className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,jsxs("button",{type:"button",onClick:()=>i(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Aa.displayName="DialogContent";var Nd=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Nd.displayName="DialogHeader";var kd=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kd.displayName="DialogFooter";var Pd=W.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Zr();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});Pd.displayName="DialogTitle";var Ed=W.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Zr();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});Ed.displayName="DialogDescription";var t0=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),za=W.forwardRef(({className:e,type:t,radius:n,label:r,isRequired:o,description:a,errorMessage:s,isInvalid:i,onFocus:l,onBlur:c,style:d,...m},f)=>{let[p,g]=W.useState(false),h=W.useId(),b=m.id||h,v=i||!!s,y=jsx("input",{id:b,type:t,className:u(t0({radius:n}),v&&"border-danger focus:border-danger",!r&&e),ref:f,required:o,"aria-invalid":v,"aria-describedby":a||s?`${b}-description`:void 0,style:{...d,borderColor:v?void 0:p?"var(--color-foreground)":void 0},onFocus:R=>{g(true),l?.(R);},onBlur:R=>{g(false),c?.(R);},...m});return !r&&!a&&!s?y:jsxs("div",{className:u("flex flex-col gap-1.5",e),children:[r&&jsxs("label",{htmlFor:b,className:"text-sm font-medium leading-none",children:[r,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),y,(a||s)&&jsx("p",{id:`${b}-description`,className:u("text-xs",v?"text-danger":"text-muted-foreground"),children:s||a})]})});za.displayName="Input";var r0=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Rr=W.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:u(r0(),e),...t}));Rr.displayName="Label";var Gn=W.forwardRef(({className:e,orientation:t="horizontal",decorative:n=true,text:r,...o},a)=>{let s=n?{role:"none"}:{role:"separator","aria-orientation":t};return r&&t==="horizontal"?jsxs("div",{className:u("flex items-center gap-4",e),children:[jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"}),jsx("span",{className:"text-sm text-muted-foreground",children:r}),jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"})]}):jsx("div",{ref:a,...s,className:u("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});Gn.displayName="Separator";var s0="peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",Ba={default:"bg-zinc-800 dark:bg-zinc-200",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500",info:"bg-blue-600 dark:bg-blue-500"},Hd={sm:{track:"h-5 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{track:"h-6 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{track:"h-7 w-14",thumb:"h-6 w-6",translate:"translate-x-7"}},Id=W.forwardRef(({className:e,color:t,size:n="md",customColor:r,checked:o,defaultChecked:a=false,onCheckedChange:s,disabled:i,required:l,name:c,value:d="on",onKeyDown:m,style:f,...p},g)=>{let[h,b]=W.useState(a),v=o!==void 0,y=v?o:h,R=()=>{if(i)return;let N=!y;v||b(N),s?.(N);},w=N=>{N.key==="Enter"&&N.preventDefault(),m?.(N);},C=t&&Ba[t]?Ba[t]:Ba.default,x=Hd[n]||Hd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-required":l,"data-state":y?"checked":"unchecked",disabled:i,ref:g,className:u(s0,x.track,y?r?"":C:"bg-input",e),style:r&&y?{backgroundColor:r,...f}:f,onClick:R,onKeyDown:w,...p,children:jsx("span",{className:u("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",x.thumb,y?x.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:y,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Id.displayName="Switch";var d0=cva("flex min-h-[80px] w-full border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"md"}}),Vd=W.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=W.useState(false);return jsx("textarea",{className:u(d0({radius:t,className:e})),ref:s,style:{...o,borderColor:i?"var(--color-foreground)":void 0},onFocus:c=>{l(true),n?.(c);},onBlur:c=>{l(false),r?.(c);},...a})});Vd.displayName="Textarea";var zd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Ga=W.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:u(zd({variant:t,className:e})),...n}));Ga.displayName="Skeleton";var g0=cva("relative flex shrink-0 overflow-hidden cursor-pointer",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),Od=W.createContext(null),Bd=()=>{let e=W.useContext(Od);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},wr=W.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=W.useState("idle");return jsx(Od.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:u(g0({size:t,radius:n,className:e})),...r})})});wr.displayName="Avatar";var Jr=W.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Bd();return W.useEffect(()=>{if(!t){i("error");return}i("loading"),r?.("loading");let l=new Image;l.src=t,l.onload=()=>{i("loaded"),r?.("loaded");},l.onerror=()=>{i("error"),r?.("error");};},[t,i,r]),s!=="loaded"?null:jsx("img",{ref:a,src:t,alt:n,className:u("aspect-square h-full w-full object-cover",e),...o})});Jr.displayName="AvatarImage";var Cr=W.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Bd(),[s,i]=W.useState(t===0);return W.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:u("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});Cr.displayName="AvatarFallback";var Kd=W.createContext({delayDuration:700,skipDelayDuration:300}),$n=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Kd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});$n.displayName="TooltipProvider";var Gd=W.createContext(null),$d=()=>{let e=W.useContext(Gd);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Un=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=W.useContext(Kd),[s,i]=W.useState(n),l=t!==void 0,c=l?t:s,d=W.useRef(null),m=W.useId(),f=W.useRef(null),p=o??a.delayDuration,g=W.useCallback(h=>{f.current&&clearTimeout(f.current),h?f.current=setTimeout(()=>{l||i(true),r?.(true);},p):(l||i(false),r?.(false));},[l,r,p]);return W.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Gd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:m},children:e})};Un.displayName="Tooltip";var Wn=W.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=$d();return jsx("button",{ref:h=>{l.current=h,typeof s=="function"?s(h):s&&(s.current=h);},type:"button","aria-describedby":d?c:void 0,onMouseEnter:h=>{t?.(h),i(true);},onMouseLeave:h=>{n?.(h),i(false);},onFocus:h=>{r?.(h),i(true);},onBlur:h=>{o?.(h),i(false);},...a,children:e})});Wn.displayName="TooltipTrigger";var _n=W.forwardRef(({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...s},i)=>{let{open:l,triggerRef:c,contentId:d}=$d(),[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);if(W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),R=0,w=0;switch(t){case "top":R=v.top-y.height-n;break;case "bottom":R=v.bottom+n;break;case "left":w=v.left-y.width-n;break;case "right":w=v.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":w=v.left+o;break;case "center":w=v.left+v.width/2-y.width/2;break;case "end":w=v.right-y.width-o;break}else switch(r){case "start":R=v.top+o;break;case "center":R=v.top+v.height/2-y.height/2;break;case "end":R=v.bottom-y.height-o;break}f({top:R,left:w});},[l,t,n,r,o,c]),!p||!l)return null;let b={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Ya.createPortal(jsx("div",{ref:v=>{h.current=v,typeof i=="function"?i(v):i&&(i.current=v);},id:d,role:"tooltip","data-side":t,className:u("fixed z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",b,e),style:{top:m.top,left:m.left},...s,children:a}),document.body)});_n.displayName="TooltipContent";var ze=W.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",children:r,style:o,...a},s)=>{let[i,l]=W.useState(false),c=W.useId().replace(/:/g,""),d=n==="visible"||n==="hover"&&i,m=d?"rgba(0,0,0,0.3)":"transparent",f=d?"rgba(255,255,255,0.3)":"transparent",p=`
2
2
  #${c} {
3
3
  scrollbar-width: thin;
4
4
  scrollbar-color: ${m} transparent;
@@ -40,7 +40,7 @@ import*as W from'react';import {createContext,useContext,useCallback,useState,us
40
40
  scrollbar-width: none;
41
41
  }
42
42
  `:""}
43
- `;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:p}}),jsx("div",{ref:s,id:c,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:o,className:u("h-full w-full",t==="vertical"&&"overflow-y-auto overflow-x-hidden",t==="horizontal"&&"overflow-x-auto overflow-y-hidden",t==="both"&&"overflow-auto",e),...a,children:r})]})});ze.displayName="ScrollArea";var jd=cva("flex min-h-10 w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 py-2 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),Xd=W.forwardRef(({options:e,multiple:t=false,value:n,defaultValue:r,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",disabled:c=false,clearable:d=false,maxDisplayItems:m=3,maxDropdownHeight:f=240,radius:p,className:g,...h},b)=>{let[v,R]=W.useState(false),[w,x]=W.useState(""),[C,y]=W.useState(r||""),[N,T]=W.useState(r||[]),[k,M]=W.useState({top:0,left:0,width:0}),P=W.useRef(null),E=W.useRef(null),D=W.useRef(null),H=W.useRef(null),L=n!==void 0?n:C,S=n!==void 0?n:N,V=n!==void 0,z=A=>{d&&L===A?(V||y(""),o?.("")):(V||y(A),o?.(A)),R(false),x("");},F=A=>{let Y=S.includes(A)?S.filter(se=>se!==A):[...S,A];V||T(Y),o?.(Y);},I=(A,Y)=>{Y.stopPropagation();let se=S.filter(Ce=>Ce!==A);V||T(se),o?.(se);},K=A=>{A.stopPropagation(),t?(V||T([]),o?.([])):(V||y(""),o?.(""));},B=e.find(A=>A.value===L),q=e.filter(A=>S.includes(A.value)),ne=q.slice(0,m),G=q.length-m,O=s?e.filter(A=>A.label.toLowerCase().includes(w.toLowerCase())):e;W.useEffect(()=>{if(v&&E.current){let A=E.current.getBoundingClientRect();M({top:A.bottom+4,left:A.left,width:A.width}),s&&setTimeout(()=>H.current?.focus(),0);}v||x("");},[v,s]),W.useEffect(()=>{let A=Y=>{let se=Y.target,Ce=P.current&&!P.current.contains(se),U=D.current&&!D.current.contains(se);Ce&&U&&(R(false),x(""));};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),W.useEffect(()=>{if(!v)return;let A=Y=>{D.current?.contains(Y.target)||(R(false),x(""));};return window.addEventListener("scroll",A,true),()=>window.removeEventListener("scroll",A,true)},[v]);let _=t?S.length>0:!!L;return jsxs("div",{ref:P,className:u("relative",g),...h,children:[jsxs("div",{ref:A=>{E.current=A,typeof b=="function"?b(A):b&&(b.current=A);},role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&R(!v),className:u(jd({radius:p}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!B&&"text-muted-foreground"),children:B?B.label:a}),t&&jsx(Fragment,{children:q.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[ne.map(A=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[A.label,jsx("span",{role:"button",tabIndex:0,onClick:Y=>I(A.value,Y),onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&I(A.value,Y);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},A.value)),G>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",G," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&_&&jsx("span",{role:"button",tabIndex:0,onClick:K,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&K(A);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",v&&"rotate-180")})]})]}),v&&!c&&typeof document<"u"&&Ya.createPortal(jsxs("div",{ref:D,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:H,type:"text",value:w,onChange:A=>x(A.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(ze,{style:{maxHeight:f},onWheel:A=>A.stopPropagation(),children:jsx("div",{className:"p-1",children:O.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):O.map(A=>{let Y=t?S.includes(A.value):L===A.value;return jsxs("div",{role:"option","aria-selected":Y,onClick:()=>{A.disabled||(t?F(A.value):z(A.value));},className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800",A.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:Y&&jsx(Check,{className:"h-4 w-4"})}),A.label]},A.value)})})})]}),document.body)]})});Xd.displayName="Select";var qd=W.createContext(null),$o=()=>{let e=W.useContext(qd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},Si=W.createContext({radius:"md"}),Di=W.createContext(null),to=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),[s,i]=W.useState(-1),l=t!==void 0,c=l?t:o,d=W.useRef(null),m=W.useRef(null),f=W.useId(),p=W.useRef(new Map),g=W.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=W.useCallback((v,R)=>{p.current.set(v,R);},[]),b=W.useCallback(v=>{p.current.delete(v);},[]);return jsx(qd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};to.displayName="Dropdown";var no=W.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=$o();return jsx("div",{ref:m=>{i.current=m,typeof o=="function"?o(m):o&&(o.current=m);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:m=>{t?.(m),s(!a);},onKeyDown:m=>{n?.(m),(m.key==="ArrowDown"||m.key==="ArrowUp")&&(m.preventDefault(),s(true)),(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});no.displayName="DropdownTrigger";var C0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},ro=W.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:b,contentId:v,activeIndex:R,setActiveIndex:w,items:x}=$o(),[C,y]=W.useState({top:0,left:0}),[N,T]=W.useState(t),[k,M]=W.useState(false),P=W.useRef(0);if(W.useEffect(()=>{M(true);},[]),W.useEffect(()=>{p&&(P.current=x.current.size);},[p,x]),W.useEffect(()=>{if(!p||!h.current||!b.current)return;let D=()=>{if(!h.current||!b.current)return;let H=h.current.getBoundingClientRect(),L=b.current.getBoundingClientRect(),S=window.innerWidth,V=window.innerHeight,z=0,F=0,I=t;switch(t){case "top":z=H.top-L.height-n,z<a&&(z=H.bottom+n,I="bottom");break;case "bottom":z=H.bottom+n,z+L.height>V-a&&(z=H.top-L.height-n,I="top");break;case "left":F=H.left-L.width-n,F<a&&(F=H.right+n,I="right");break;case "right":F=H.right+n,F+L.width>S-a&&(F=H.left-L.width-n,I="left");break}if(I==="top"||I==="bottom"){switch(r){case "start":F=H.left+o;break;case "center":F=H.left+H.width/2-L.width/2;break;case "end":F=H.right-L.width-o;break}F<a?F=a:F+L.width>S-a&&(F=S-L.width-a);}else {switch(r){case "start":z=H.top+o;break;case "center":z=H.top+H.height/2-L.height/2;break;case "end":z=H.bottom-L.height-o;break}z<a?z=a:z+L.height>V-a&&(z=V-L.height-a);}y({top:z,left:F}),T(I);};return D(),window.addEventListener("resize",D),window.addEventListener("scroll",D,true),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,true);}},[p,t,n,r,o,a,h]),W.useEffect(()=>{if(!p)return;let D=H=>{let L=H.target;b.current&&!b.current.contains(L)&&h.current&&!h.current.contains(L)&&(s?.(),g(false));};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[p,g,s,h,b]),W.useEffect(()=>{if(!p)return;let D=H=>{let L=Array.from(x.current.entries()).sort(([V],[z])=>V-z).map(([,V])=>V),S=L.length;if(S!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),R===-1||R>=S-1?w(l?0:Math.min(R+1,S-1)):w(R+1);break;case "ArrowUp":H.preventDefault(),R<=0?w(l?S-1:0):w(R-1);break;case "Home":H.preventDefault(),w(0);break;case "End":H.preventDefault(),w(S-1);break;case "Enter":case " ":H.preventDefault(),R>=0&&R<S&&L[R]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[p,g,i,R,w,x,l,h]),W.useEffect(()=>{p&&R>=0&&Array.from(x.current.entries()).sort(([H],[L])=>H-L).map(([,H])=>H)[R]?.focus();},[p,R,x]),!k||!p)return null;let E={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[N];return Ya.createPortal(jsx("div",{ref:D=>{b.current=D,typeof f=="function"?f(D):f&&(f.current=D);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":N,className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",C0[c],E,e),style:{top:C.top,left:C.left},...m,children:jsx(Si.Provider,{value:{radius:c},children:d})}),document.body)});ro.displayName="DropdownContent";var Zd=0,Qd={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Yn=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:m,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=$o(),{radius:b}=W.useContext(Si),[v]=W.useState(()=>Zd++),R=W.useRef(null);W.useEffect(()=>(!n&&R.current&&g(v,R.current),()=>{h(v);}),[n,v,g,h]);let w=y=>{if(n){y.preventDefault();return}o?.(y),r?.(),m(false);},x=y=>{a?.(y),n||p(v);};return jsxs("div",{ref:y=>{R.current=y,typeof d=="function"?d(y):d&&(d.current=y);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===v?"":void 0,className:u("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Qd[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:w,onMouseEnter:x,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Yn.displayName="DropdownItem";var Hi=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Hi.displayName="DropdownSection";var Jd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Jd.displayName="DropdownSeparator";var eu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});eu.displayName="DropdownShortcut";var tu=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));tu.displayName="DropdownGroup";var nu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),{contentRef:s}=$o(),i=t!==void 0,l=i?t:o,c=W.useRef(null),d=W.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Di.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};nu.displayName="DropdownSub";var ru=W.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=W.useContext(Di),{setActiveIndex:d,registerItem:m,unregisterItem:f}=$o(),{radius:p}=W.useContext(Si),[g]=W.useState(()=>Zd++),h=W.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:R}=c;W.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let w=y=>{o?.(y),n||(d(g),v(true));},x=y=>{a?.(y);},C=y=>{s?.(y),(y.key==="ArrowRight"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),v(true));};return jsxs("div",{ref:y=>{h.current=y,R.current=y,typeof l=="function"?l(y):l&&(l.current=y);},role:"menuitem","aria-haspopup":"menu","aria-expanded":b,tabIndex:n?-1:0,"aria-disabled":n,"data-state":b?"open":"closed","data-disabled":n?"":void 0,className:u("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Qd[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:w,onMouseLeave:x,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});ru.displayName="DropdownSubTrigger";var ou=W.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=W.useContext(Di);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=W.useState({top:0,left:0}),[h,b]=W.useState(false),v=W.useRef(null),R=W.useRef(null);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{if(!c||!m.current||!v.current)return;(()=>{if(!m.current||!v.current)return;let y=m.current.getBoundingClientRect(),N=v.current.getBoundingClientRect(),T=window.innerWidth,k=window.innerHeight,M=y.top+n,P=y.right+t;P+N.width>T-r&&(P=y.left-N.width-t),M+N.height>k-r&&(M=k-N.height-r),M<r&&(M=r),g({top:M,left:P});})();},[c,t,n,r,m]);let w=C=>{o?.(C),R.current&&(clearTimeout(R.current),R.current=null),d(true);},x=C=>{a?.(C);let y=C.relatedTarget;m.current?.contains(y)||f?.current?.contains(y)||(R.current=setTimeout(()=>{d(false);},100));};return W.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),!h||!c?null:Ya.createPortal(jsx("div",{ref:C=>{v.current=C,typeof i=="function"?i(C):i&&(i.current=C);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:p.top,left:p.left},onMouseEnter:w,onMouseLeave:x,...s}),document.body)});ou.displayName="DropdownSubContent";var T0=Hi;var iu=W.createContext(null),Ii=()=>{let e=W.useContext(iu);if(!e)throw new Error("Popover components must be used within a Popover");return e},nt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useId(),d=W.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx(iu.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};nt.displayName="Popover";var Lt=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{open:o,onOpenChange:a,triggerRef:s,contentId:i}=Ii();return jsx("button",{ref:c=>{s.current=c,typeof r=="function"?r(c):r&&(r.current=c);},type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-controls":o?i:void 0,onClick:c=>{t?.(c),a(!o);},...n,children:e})});Lt.displayName="PopoverTrigger";var oo=W.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Ii();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});oo.displayName="PopoverAnchor";var rt=W.forwardRef(({className:e,style:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:b}=Ii(),[v,R]=W.useState({top:0,left:0}),[w,x]=W.useState(false),[C,y]=W.useState(null);if(W.useEffect(()=>{x(true);},[]),W.useEffect(()=>{if(!p||!h.current||!C)return;let T=()=>{if(!h.current||!C)return;let k=h.current.getBoundingClientRect(),M=C.getBoundingClientRect(),P=0,E=0;switch(n){case "top":P=k.top-M.height-r;break;case "bottom":P=k.bottom+r;break;case "left":E=k.left-M.width-r;break;case "right":E=k.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":E=k.left+a;break;case "center":E=k.left+k.width/2-M.width/2;break;case "end":E=k.right-M.width-a;break}else switch(o){case "start":P=k.top+a;break;case "center":P=k.top+k.height/2-M.height/2;break;case "end":P=k.bottom-M.height-a;break}R({top:P,left:E});};return T(),window.addEventListener("resize",T),window.addEventListener("scroll",T,true),()=>{window.removeEventListener("resize",T),window.removeEventListener("scroll",T,true);}},[p,n,r,o,a,h,C]),W.useEffect(()=>{if(!p)return;let T=k=>{let M=k.target;C&&!C.contains(M)&&h.current&&!h.current.contains(M)&&(s?.(),g(false));};return document.addEventListener("mouseup",T),()=>document.removeEventListener("mouseup",T)},[p,g,s,h,C]),W.useEffect(()=>{if(!p)return;let T=k=>{k.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[p,g,i]),!w||!p)return null;let N={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[n];return Ya.createPortal(jsx("div",{ref:T=>{y(k=>k!==T?T:k),typeof f=="function"?f(T):f&&(f.current=T);},id:b,role:"dialog","data-state":p?"open":"closed","data-side":n,className:u("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",N,e),style:{...t,top:v.top,left:v.left},...m,children:d}),document.body)});rt.displayName="PopoverContent";var lu=W.createContext(null),Ai=()=>{let e=W.useContext(lu);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},cu=W.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,m]=W.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(lu.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:u(s==="vertical"&&"flex gap-4",e),...l,children:i})})});cu.displayName="Tabs";var Vi={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},du=W.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Ai(),l=W.useRef(null),[c,d]=W.useState({opacity:0});W.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let R=g.getBoundingClientRect(),w=v.getBoundingClientRect(),x=s==="vertical";o==="underline"?d(x?{width:2,height:w.height,transform:`translateY(${w.top-R.top}px)`,opacity:1}:{width:w.width,height:2,transform:`translateX(${w.left-R.left}px)`,opacity:1}):o==="solid"&&d(x?{width:w.width,height:w.height,transform:`translateY(${w.top-R.top}px)`,opacity:1}:{width:w.width,height:w.height,transform:`translateX(${w.left-R.left}px)`,opacity:1});}};h();let b=new ResizeObserver(h);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let m={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",outline:"bg-transparent p-0 gap-1 !rounded-none"},f=s==="vertical",p=()=>o==="solid"?f?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?f?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof r=="function"?r(g):r&&(r.current=g);},role:"tablist","aria-orientation":s,className:u("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",Vi[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",Vi[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});du.displayName="TabsList";var uu=W.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Ai(),d=s===t,m={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",outline:"border border-transparent data-[state=active]:border-border data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,"aria-selected":d,"data-state":d?"active":"inactive",disabled:n,className:u("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",Vi[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});uu.displayName="TabsTrigger";var mu=W.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Ai(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r,children:n}):null});mu.displayName="TabsContent";var pu=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function N0(e,t=pu){return e?t.filter(r=>r.test(e)).length/t.length:0}function k0(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function P0(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var gu=W.createContext(null),_a=()=>{let e=W.useContext(gu);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},bu=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=W.useState(t),s=e!==void 0,i=s?e:o,l=W.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(gu.Provider,{value:{open:i,onOpenChange:l},children:r})};bu.displayName="Sheet";var vu=W.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});vu.displayName="SheetTrigger";var hu=W.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});hu.displayName="SheetClose";var Oi=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Oi.displayName="SheetPortal";var xu=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=_a();return r?jsx("div",{ref:n,className:u("fixed inset-0 z-50 bg-black/80",r?"animate-in fade-in-0":"animate-out fade-out-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});xu.displayName="SheetOverlay";var yu=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition-transform duration-300 ease-in-out",{variants:{side:{top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}}),S0=(e,t)=>({top:t?"animate-in slide-in-from-top":"animate-out slide-out-to-top",bottom:t?"animate-in slide-in-from-bottom":"animate-out slide-out-to-bottom",left:t?"animate-in slide-in-from-left":"animate-out slide-out-to-left",right:t?"animate-in slide-in-from-right":"animate-out slide-out-to-right"})[e],Ru=W.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=_a(),[d,m]=W.useState(false),[,f]=W.useState(false);return W.useEffect(()=>{if(l)m(true),f(true),dt();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{ut();}},[l]),W.useEffect(()=>{let p=g=>{g.key==="Escape"&&l&&(o?.(),c(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,c,o]),!d&&!l?null:jsxs(Oi,{children:[jsx("div",{className:u("fixed inset-0 z-50 bg-black/80 transition-opacity duration-300",l?"opacity-100":"opacity-0"),onClick:()=>{a?.(),c(false);},"aria-hidden":"true"}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true",className:u(yu({side:e}),S0(e,l),t),...s,children:[!r&&jsxs("button",{type:"button",onClick:()=>c(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),n]})]})});Ru.displayName="SheetContent";var wu=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});wu.displayName="SheetHeader";var Cu=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cu.displayName="SheetFooter";var Tu=W.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));Tu.displayName="SheetTitle";var Mu=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Mu.displayName="SheetDescription";var I0=({theme:e="system",...t})=>jsx(Toaster,{theme:e,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});var Nu=W.createContext(null),Wo=()=>{let e=W.useContext(Nu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Bi=W.createContext(null),ku=W.createContext(null),Pu=({children:e,onOpenChange:t})=>{let[n,r]=W.useState(false),[o,a]=W.useState({x:0,y:0}),s=W.useId(),i=W.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(Nu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};Pu.displayName="ContextMenu";var Eu=W.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Wo(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:r,onContextMenu:i=>{t?.(i),s(i);},...n,children:e})});Eu.displayName="ContextMenuTrigger";var Lu=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Lu.displayName="ContextMenuGroup";var Su=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Su.displayName="ContextMenuPortal";var Du=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Bi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Du.displayName="ContextMenuSub";var Hu=W.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(ku.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Hu.displayName="ContextMenuRadioGroup";var Iu=W.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Wo(),[d,m]=W.useState(false),[f,p]=W.useState(l),g=W.useRef(null);return W.useEffect(()=>{m(true);},[]),W.useEffect(()=>{if(!s||!g.current){p(l);return}let b=g.current.getBoundingClientRect(),{x:v,y:R}=l;v+b.width>window.innerWidth&&(v=window.innerWidth-b.width-8),R+b.height>window.innerHeight&&(R=window.innerHeight-b.height-8),p({x:v,y:R});},[s,l]),W.useEffect(()=>{if(!s)return;let h=b=>{let v=b.target;g.current&&!g.current.contains(v)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),W.useEffect(()=>{if(!s)return;let h=b=>{b.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Ya.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:u("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:f.y,left:f.x},...o,children:r}),document.body)});Iu.displayName="ContextMenuContent";var Vu=W.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=W.useContext(Bi);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,m=p=>{r?.(p),c(true);},f=p=>{o?.(p),c(false);};return jsxs("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:u("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:m,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Vu.displayName="ContextMenuSubTrigger";var Au=W.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=W.useContext(Bi);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=W.useState({top:0,left:0}),[f,p]=W.useState(false),g=W.useRef(null);W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let R=c.current.getBoundingClientRect(),w=g.current.getBoundingClientRect(),x=R.top,C=R.right+t;C+w.width>window.innerWidth&&(C=R.left-w.width-t),m({top:x,left:C});})();},[i,t,c]);let h=v=>{n?.(v),l(true);},b=v=>{r?.(v),l(false);};return !f||!i?null:Ya.createPortal(jsx("div",{ref:v=>{g.current=v,typeof a=="function"?a(v):a&&(a.current=v);},role:"menu","data-state":i?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:h,onMouseLeave:b,...o}),document.body)});Au.displayName="ContextMenuSubContent";var zu=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Wo(),l=c=>{if(n){c.preventDefault();return}o?.(c),r?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});zu.displayName="ContextMenuItem";var Ou=W.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Wo(),c=d=>{if(o){d.preventDefault();return}a?.(d),r?.(!n),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Ou.displayName="ContextMenuCheckboxItem";var Bu=W.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Wo(),l=W.useContext(ku),c=l?.value===n,d=m=>{if(r){m.preventDefault();return}o?.(m),l?.onValueChange(n),i(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":c,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":c?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:d,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c&&jsx(Circle,{className:"h-4 w-4 fill-current"})}),t]})});Bu.displayName="ContextMenuRadioItem";var Fu=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));Fu.displayName="ContextMenuLabel";var Ku=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ku.displayName="ContextMenuSeparator";var Gu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Gu.displayName="ContextMenuShortcut";var $u=W.createContext(null),F0=()=>{let e=W.useContext($u);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},Uu=W.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",children:l,...c},d)=>{let[m,f]=W.useState(n),p=t!==void 0,g=p?t:m,h=W.useId(),b=v=>{p||f(v),r?.(v);};return jsx("div",{ref:d,role:"radiogroup","aria-required":s,"aria-orientation":i,className:u(i==="vertical"?"grid gap-2":"flex gap-4",e),...c,children:jsx($u.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});Uu.displayName="RadioGroup";var Wu=W.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=F0(),s=a.value===t,i=n||a.disabled;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"radio","aria-checked":s,disabled:i,ref:o,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",e),onClick:()=>a.onValueChange(t),...r,children:s&&jsx("span",{className:"flex items-center justify-center",children:jsx(Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}),jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:a.name,value:t,checked:s,required:a.required,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Wu.displayName="RadioGroupItem";var Xa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-transparent hover:bg-muted data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",outline:"border border-input bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",ghost:"bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",soft:"bg-transparent hover:bg-primary/10 data-[state=on]:bg-primary/15 data-[state=on]:text-primary",surface:"bg-muted/50 hover:bg-muted data-[state=on]:bg-muted data-[state=on]:text-foreground"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),_u=W.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=W.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let b=!p;f||m(b),a?.(b);},h=b=>{b.key==="Enter"&&b.preventDefault(),i?.(b);};return jsx("button",{type:"button","aria-pressed":p,"data-state":p?"on":"off",disabled:s,ref:c,className:u(Xa({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});_u.displayName="Toggle";var Yu=W.createContext(null),W0=()=>{let e=W.useContext(Yu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},ju=W.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=W.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:m,h=b=>{if(r==="single"){let v=g.includes(b)?[]:[b];p||f(v),s?.(v[0]||"");}else {let v=g.includes(b)?g.filter(R=>R!==b):[...g,b];p||f(v),s?.(v);}};return jsx("div",{ref:d,role:"group",className:u("flex items-center justify-center gap-1",e),...c,children:jsx(Yu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});ju.displayName="ToggleGroup";var Xu=W.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=W0(),c=l.value.includes(o),d=a||l.disabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:u(Xa({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Xu.displayName="ToggleGroupItem";var Za=W.forwardRef(({className:e,value:t,defaultValue:n=[0],onValueChange:r,onValueCommit:o,min:a=0,max:s=100,step:i=1,disabled:l=false,orientation:c="horizontal",name:d,...m},f)=>{let[p,g]=W.useState(n),h=t!==void 0,b=h?t:p,v=W.useRef(null),[R,w]=W.useState(false),[x,C]=W.useState(null),y=(H,L)=>{if(!v.current)return b[0];let S=v.current.getBoundingClientRect(),V;c==="horizontal"?V=(H-S.left)/S.width:V=1-(L-S.top)/S.height,V=Math.max(0,Math.min(1,V));let z=a+V*(s-a),F=Math.round(z/i)*i;return Math.max(a,Math.min(s,F))},N=(H,L)=>{let S=[...b];S[L]=H,L>0&&H<b[L-1]&&(S[L]=b[L-1]),L<b.length-1&&H>b[L+1]&&(S[L]=b[L+1]),h||g(S),r?.(S);},T=(H,L)=>{l||(H.preventDefault(),w(true),C(L),H.target.setPointerCapture(H.pointerId));},k=H=>{if(!R||x===null||l)return;let L=y(H.clientX,H.clientY);N(L,x);},M=()=>{R&&(w(false),C(null),o?.(b));},P=H=>{if(l)return;let L=y(H.clientX,H.clientY),S=0,V=Math.abs(b[0]-L);for(let z=1;z<b.length;z++){let F=Math.abs(b[z]-L);F<V&&(V=F,S=z);}N(L,S),o?.([...b.slice(0,S),L,...b.slice(S+1)]);},E=(H,L)=>{if(l)return;let S=b[L];switch(H.key){case "ArrowRight":case "ArrowUp":H.preventDefault(),S=Math.min(s,b[L]+i);break;case "ArrowLeft":case "ArrowDown":H.preventDefault(),S=Math.max(a,b[L]-i);break;case "Home":H.preventDefault(),S=a;break;case "End":H.preventDefault(),S=s;break;default:return}N(S,L),o?.([...b.slice(0,L),S,...b.slice(L+1)]);},D=H=>(H-a)/(s-a)*100;return jsxs("div",{ref:f,className:u("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...m,children:[jsx("div",{ref:v,className:u("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:P,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${D(b[0])}%`:0,right:`${100-D(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${D(b[0])}%`:0,top:`${100-D(b[b.length-1])}%`,left:0,right:0}})}),b.map((H,L)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":H,"aria-orientation":c,"aria-disabled":l,className:u("absolute block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",R&&x===L&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${D(H)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${D(H)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:S=>T(S,L),onPointerMove:k,onPointerUp:M,onPointerCancel:M,onKeyDown:S=>E(S,L)},L)),d&&b.map((H,L)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${L}]`:d,value:H},L))]})});Za.displayName="Slider";var qu=W.createContext(null),Zu=()=>{let e=W.useContext(qu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Gi=W.createContext(null),Qu=()=>{let e=W.useContext(Gi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Ju=W.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=W.useState(()=>t==="single"?r?[r]:[]:r||[]),f=W.useRef(new Map),p=W.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=x=>{if(t==="single"){let y=h.includes(x)&&a?[]:[x];g||m(y),o?.(y[0]||"");}else {let C=h.includes(x)?h.filter(y=>y!==x):[...h,x];g||m(C),o?.(C);}},v=W.useCallback((x,C)=>{f.current.set(x,C),p.current.includes(x)||p.current.push(x);},[]),R=W.useCallback(x=>{f.current.delete(x),p.current=p.current.filter(C=>C!==x);},[]),w=W.useCallback(x=>{let C=p.current;if(C.length===0)return;let y=document.activeElement,N;f.current.forEach((E,D)=>{E===y&&(N=D);});let T=N?C.indexOf(N):-1,k;switch(x){case "first":k=0;break;case "last":k=C.length-1;break;case "next":k=T===-1?0:(T+1)%C.length;break;case "prev":k=T===-1?C.length-1:(T-1+C.length)%C.length;break}let M=C[k];f.current.get(M)?.focus();},[]);return jsx(qu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:R,focusTrigger:w},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Ju.displayName="Accordion";var em=W.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Zu(),d=c.value.includes(t),m=n||c.disabled||false,f=W.useId(),p=W.useId();return r!==void 0?jsx(Gi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:[jsx(tm,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:r}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(nm,{children:s})]})}):jsx(Gi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:s})})});em.displayName="AccordionItem";var tm=W.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Zu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=Qu(),f=W.useRef(null);W.useEffect(()=>{let g=f.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let p=g=>{switch(r?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{f.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:m,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:u("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{n?.(g),s.onValueChange(i);},onKeyDown:p,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});tm.displayName="AccordionTrigger";var nm=W.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Qu();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:n,...r,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});nm.displayName="AccordionContent";var om=W.createContext(null),am=()=>{let e=W.useContext(om);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},sm=W.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=W.useState(n),m=t!==void 0,f=m?t:c,p=W.useId(),g=W.useId(),h=b=>{o||(m||d(b),r?.(b));};return jsx(om.Provider,{value:{open:f,onOpenChange:h,disabled:o,contentId:p,triggerId:g},children:jsxs("div",{ref:l,"data-state":f?"open":"closed","data-disabled":o?"":void 0,className:u("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx($i,{})]}),s]})})});sm.displayName="Collapsible";var $i=W.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=am();return jsx("button",{ref:o,type:"button",id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",e),onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:"h-4 w-4"})})});$i.displayName="CollapsibleTrigger";var im=W.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=am(),c=W.useRef(null),[d,m]=W.useState(void 0),[f,p]=W.useState(false),[g,h]=W.useState(a);W.useEffect(()=>{a?(h(true),p(true),requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);})):(p(true),m(0));},[a]);let b=()=>{p(false),a||h(false),m(void 0);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("overflow-hidden",e),style:{...n,height:f?d!==void 0?d:"auto":a?"auto":0,transition:f?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:b,...r,children:jsx("div",{ref:c,children:t})}):null});im.displayName="CollapsibleContent";var es=W.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=l=>`${Math.round(l)}%`,...s},i)=>{let l=Math.min(Math.max(t/n*100,0),100);return jsxs("div",{ref:i,className:"w-full",children:[(r||o)&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:u("text-muted-foreground",!r&&"ml-auto"),children:a(l)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:jsx("div",{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-l}%)`}})})]})});es.displayName="Progress";var um=W.createContext(null),mm=()=>{let e=W.useContext(um);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},pm=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=W.useState(n),c=t!==void 0,d=c?t:i,m=W.useRef(null),f=W.useId(),p=W.useRef(null),g=W.useRef(null),h=W.useCallback(b=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),b?p.current=setTimeout(()=>{c||l(true),r?.(true);},o):g.current=setTimeout(()=>{c||l(false),r?.(false);},a);},[c,r,o,a]);return W.useEffect(()=>{if(!s||!d)return;let b=()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",b,true),()=>window.removeEventListener("scroll",b,true)},[s,d,c,r]),W.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(um.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};pm.displayName="HoverCard";var fm=W.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=mm();return jsx("a",{ref:p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p);},onMouseEnter:p=>{t?.(p),i(true);},onMouseLeave:p=>{n?.(p),i(false);},onFocus:p=>{r?.(p),i(true);},onBlur:p=>{o?.(p),i(false);},...a,children:e})});fm.displayName="HoverCardTrigger";var gm=W.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:m,triggerRef:f,contentId:p}=mm(),[g,h]=W.useState({top:0,left:0}),[b,v]=W.useState(false),R=W.useRef(null);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!d||!f.current||!R.current)return;(()=>{if(!f.current||!R.current)return;let N=f.current.getBoundingClientRect(),T=R.current.getBoundingClientRect(),k=0,M=0;switch(t){case "top":k=N.top-T.height-n;break;case "bottom":k=N.bottom+n;break;case "left":M=N.left-T.width-n;break;case "right":M=N.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":M=N.left+o;break;case "center":M=N.left+N.width/2-T.width/2;break;case "end":M=N.right-T.width-o;break}else switch(r){case "start":k=N.top+o;break;case "center":k=N.top+N.height/2-T.height/2;break;case "end":k=N.bottom-T.height-o;break}h({top:k,left:M});})();},[d,t,n,r,o,f]);let w=y=>{a?.(y),m(true);},x=y=>{s?.(y),m(false);};if(!b||!d)return null;let C={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Ya.createPortal(jsx("div",{ref:y=>{R.current=y,typeof c=="function"?c(y):c&&(c.current=y);},id:p,"data-state":d?"open":"closed","data-side":t,className:u("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{top:g.top,left:g.left},onMouseEnter:w,onMouseLeave:x,...l,children:i}),document.body)});gm.displayName="HoverCardContent";var bm=W.createContext({size:"md",variant:"default",radius:"md"}),ns=()=>W.useContext(bm);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var Z0=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),Q0=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),J0=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),vm=W.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(bm.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));vm.displayName="Breadcrumb";var hm=W.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=ns();return jsx("ol",{ref:n,className:u(Z0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});hm.displayName="BreadcrumbList";var xm=W.forwardRef(({className:e,...t},n)=>{let{size:r}=ns();return jsx("li",{ref:n,className:u("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});xm.displayName="BreadcrumbItem";var ym=W.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));ym.displayName="BreadcrumbLink";var Rm=W.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:u("font-medium text-foreground",e),...t}));Rm.displayName="BreadcrumbPage";var wm=({children:e,className:t,...n})=>{let{size:r}=ns();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(Q0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};wm.displayName="BreadcrumbSeparator";var Cm=({className:e,...t})=>{let{size:n}=ns();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(J0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Cm.displayName="BreadcrumbEllipsis";var Nm=W.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:u("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));Nm.displayName="AspectRatio";var Em=W.createContext(null),Wi=()=>{let e=W.useContext(Em);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Lm=W.createContext(null),Sm=()=>{let e=W.useContext(Lm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Dm=W.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=W.useState(null);return jsx(Em.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:u("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(_i,{})]})})});Dm.displayName="NavigationMenu";var Hm=W.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Wi();return jsx("ul",{ref:n,className:u("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Hm.displayName="NavigationMenuList";var Im=W.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=Wi(),s=W.useId(),i=W.useRef(null),l=o===s,c=W.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Lm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});Im.displayName="NavigationMenuItem";var Vm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),Am=W.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Sm(),c=m=>{n?.(m),l(true);},d=m=>{r?.(m),l(!i);};return jsxs("button",{ref:m=>{s.current=m,typeof a=="function"?a(m):a&&(a.current=m);},type:"button","data-state":i?"open":"closed",className:u(Vm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});Am.displayName="NavigationMenuTrigger";var zm=W.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Sm(),l=W.useRef(null),[c,d]=W.useState({top:0,left:0});W.useEffect(()=>{if(!a||!i.current)return;let p=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,true),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,true);}},[a,i]);let m=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Ya.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:m,onMouseLeave:f,...r}),document.body):null});zm.displayName="NavigationMenuContent";var Om=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),Bm=W.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(Om(),t&&"bg-accent text-accent-foreground",e),...n}));Bm.displayName="NavigationMenuLink";var _i=W.forwardRef((e,t)=>null);_i.displayName="NavigationMenuViewport";var Fm=W.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=Wi();return r?jsx("div",{ref:n,className:u("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});Fm.displayName="NavigationMenuIndicator";var Um=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted",solid:"bg-muted hover:bg-muted/80",ghost:"hover:bg-accent hover:text-accent-foreground",light:"hover:bg-muted/50",outline:"border border-input hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{variant:"default",size:"md"}}),_o=W.forwardRef(({className:e,variant:t,size:n,iconSize:r,...o},a)=>{let i=r??{sm:14,md:16,lg:20}[n??"md"];return jsx("button",{ref:a,type:"button",className:u(Um({variant:t,size:n}),e),"aria-label":"Close",...o,children:jsx(X,{style:{width:i,height:i}})})});_o.displayName="CloseButton";var rs=W.createContext(null);function dw(){let e=W.useContext(rs);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Xn(){return W.useContext(rs)}var uw="16rem",mw="18rem",pw="3rem",fw="b",gw={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},bw={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Yi=W.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:n,placement:r="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:m,children:f,...p},g)=>{let h=c??"overlay",b=h==="overlay",[v,R]=W.useState(false),[w,x]=W.useState(false),[C,y]=W.useState(e),N=t??C,T=W.useCallback(E=>{let D=typeof E=="function"?E(N):E;n?n(D):y(D);},[n,N]);W.useEffect(()=>{let E=()=>{R(window.innerWidth<768);};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);let k=W.useCallback(()=>b?T(E=>!E):v?x(E=>!E):T(E=>!E),[v,T,x,b]);W.useEffect(()=>{if(b)return;let E=D=>{D.key===fw&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),k());};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[k,b]);let M=N?"expanded":"collapsed",P=W.useMemo(()=>({placement:r,state:M,open:N,setOpen:T,isMobile:v,openMobile:w,setOpenMobile:x,toggleDrawer:k,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,M,N,T,v,w,x,k,l,h,o,a,s,i]);return b?jsx(rs.Provider,{value:P,children:jsx(Drawer.Root,{open:N,onOpenChange:T,direction:r,dismissible:s,children:f})}):jsx(rs.Provider,{value:P,children:jsx($n,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":uw,"--drawer-width-icon":pw,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Yi.displayName="Drawer";var _m=W.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Xn();if(!s)return jsx("div",{ref:a,className:u("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:m,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:u("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",n),...o,children:r});if(c&&!t)return jsx(vw,{open:m,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:u("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:u("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",h?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":b&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:r})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:u("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:u("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:r})})]})});_m.displayName="DrawerSidebar";var vw=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=W.useState(false);return W.useEffect(()=>{a(true);},[]),W.useEffect(()=>{if(t)return dt(),()=>ut()},[t]),!o||!t?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("div",{className:u("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",r==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":mw},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Ym=W.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Xn();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:r,className:e,onClick:t,...n});let a=o?.toggleDrawer;return jsxs("button",{ref:r,type:"button","data-drawer":"trigger",className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});Ym.displayName="DrawerTrigger";var jm=W.forwardRef(({className:e,children:t,...n},r)=>{let o=Xn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque",c=o?.hideCloseButton||false;if(a){let d=s==="top"||s==="bottom",m=s==="left"||s==="right",f=m?gw[i]:bw[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},g={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:u("fixed inset-0 z-50",p[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",g[s],e),style:{...m?{width:f,height:"100%"}:{},...d?{maxHeight:f}:{},...n.style},...n,children:[m&&!c&&jsx(Drawer.Close,{asChild:true,children:jsx(_o,{variant:"light",className:"absolute right-4 top-4 z-10"})}),d&&jsx("div",{className:u("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:r,className:u("flex flex-col h-full",e),...n,children:t})});jm.displayName="DrawerContent";var Xm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"header",className:u("flex flex-col gap-2 p-4",e),...t}));Xm.displayName="DrawerHeader";var qm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:u("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));qm.displayName="DrawerBody";var Zm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:u("flex flex-col gap-2 p-4 mt-auto",e),...t}));Zm.displayName="DrawerFooter";var Qm=W.forwardRef(({className:e,...t},n)=>Xn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Qm.displayName="DrawerTitle";var Jm=W.forwardRef(({className:e,...t},n)=>Xn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:u("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Jm.displayName="DrawerDescription";var ep=W.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Xn();return o?.mode==="overlay"?jsx(Drawer.Close,{ref:r,className:e,onClick:t,...n}):jsx(_o,{ref:r,variant:"light",className:e,onClick:s=>{t?.(s),o?.setOpen(false);},...n})});ep.displayName="DrawerClose";var tp=W.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Xn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",m=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:u("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:p=>{t?.(p),s();},...r,children:[c?jsx(m,{className:"h-4 w-4 shrink-0"}):jsx(f,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});tp.displayName="DrawerToggle";var np=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));np.displayName="DrawerSeparator";var rp=W.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:u("flex w-full min-w-0 flex-col gap-1",e),...t}));rp.displayName="DrawerMenu";var op=W.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));op.displayName="DrawerMenuItem";var ap=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--border))] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),sp=W.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Xn(),c=l?.isMobile??false,d=l?.state??"expanded",m=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:u(ap({variant:t,size:n}),o),...s,children:a});return r?jsxs(Un,{children:[jsx(Wn,{children:m}),jsx(_n,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});sp.displayName="DrawerMenuButton";var ip=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:u("relative flex w-full min-w-0 flex-col p-2",e),...t}));ip.displayName="DrawerGroup";var lp=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:u("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));lp.displayName="DrawerGroupLabel";var cp=W.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:u("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));cp.displayName="DrawerInset";var hw=Yi;var up=W.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:u("w-full caption-bottom text-sm",e),...t})}));up.displayName="Table";var mp=W.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));mp.displayName="TableHeader";var pp=W.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));pp.displayName="TableBody";var fp=W.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));fp.displayName="TableFooter";var gp=W.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:u("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));gp.displayName="TableRow";var bp=W.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));bp.displayName="TableHead";var vp=W.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));vp.displayName="TableCell";var hp=W.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));hp.displayName="TableCaption";function Tw({className:e,data:t,columns:n,selectable:r=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(x,C)=>String(C),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:m=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:b=false,hoverable:v=true,...R},w){let[x,C]=W.useState(new Set),[y,N]=W.useState({columnId:null,direction:null}),[T,k]=W.useState({pageIndex:0,pageSize:m[0]||10}),M=o??x,P=l??y,E=f??T,D=G=>{a?a(G):C(G);},H=G=>{c?c(G):N(G);},L=G=>{p?p(G):k(G);},S=W.useMemo(()=>{if(!P.columnId||!P.direction)return t;let G=n.find(O=>O.id===P.columnId);return G?[...t].sort((O,_)=>{let A=G.accessor(O),Y=G.accessor(_);if(A===Y)return 0;if(A==null)return 1;if(Y==null)return -1;let se=String(A).localeCompare(String(Y),void 0,{numeric:true});return P.direction==="asc"?se:-se}):t},[t,P,n]),V=W.useMemo(()=>{if(!d)return S;let G=E.pageIndex*E.pageSize;return S.slice(G,G+E.pageSize)},[S,d,E]),z=Math.ceil(S.length/E.pageSize),F=G=>{if(G===true){let O=new Set(V.map((_,A)=>s(_,A)));D(O);}else D(new Set);},I=(G,O)=>{let _=new Set(M);O?_.add(G):_.delete(G),D(_);},K=V.length>0&&V.every((G,O)=>M.has(s(G,O))),B=V.some((G,O)=>M.has(s(G,O))),q=G=>{if(!n.find(A=>A.id===G)?.sortable&&!i)return;let _="asc";P.columnId===G&&(P.direction==="asc"?_="desc":P.direction==="desc"&&(_=null)),H({columnId:_?G:null,direction:_});},ne=G=>P.columnId!==G?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):P.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:w,className:u("w-full",e),...R,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(Ko,{checked:K?true:B?"indeterminate":false,onCheckedChange:F,"aria-label":"Select all"})}),n.map(G=>{let O=G.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",O&&"cursor-pointer select-none hover:text-foreground"),style:{width:G.width},onClick:()=>O&&q(G.id),children:jsxs("div",{className:"flex items-center gap-2",children:[G.header,O&&ne(G.id)]})},G.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:h?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):V.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):V.map((G,O)=>{let _=s(G,O),A=M.has(_);return jsxs("tr",{className:u("border-b transition-colors",v&&"hover:bg-muted/50",b&&O%2===1&&"bg-muted/30",A&&"bg-muted"),"data-state":A?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Ko,{checked:A,onCheckedChange:Y=>I(_,!!Y),"aria-label":`Select row ${O+1}`})}),n.map(Y=>jsx("td",{className:"p-4 align-middle",children:Y.cell?Y.cell(G,O):Y.accessor(G)},Y.id))]},_)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:E.pageSize,onChange:G=>L({pageIndex:0,pageSize:Number(G.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(G=>jsx("option",{value:G,children:G},G))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",E.pageIndex+1," of ",z||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(oe,{variant:"light",size:"icon",className:"h-8 w-8",onClick:()=>L({...E,pageIndex:E.pageIndex-1}),disabled:E.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"light",size:"icon",className:"h-8 w-8",onClick:()=>L({...E,pageIndex:E.pageIndex+1}),disabled:E.pageIndex>=z-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var Mw=W.forwardRef(Tw);var ji=["January","February","March","April","May","June","July","August","September","October","November","December"];function Dw({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let[o,a]=W.useState(false),[s,i]=W.useState(false),l=W.useRef(null),c=W.useRef(null),d=getMonth(e),m=getYear(e);W.useEffect(()=>{function h(b){l.current&&!l.current.contains(b.target)&&a(false),c.current&&!c.current.contains(b.target)&&i(false);}return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);let f=h=>{let b=setMonth(e,h);t(b),a(false);},p=h=>{let b=setYear(e,h);t(b),i(false);},g=W.useMemo(()=>{let h=[];for(let b=r;b>=n;b--)h.push(b);return h},[n,r]);return jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{ref:l,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>{a(!o),i(false);},className:u("inline-flex items-center justify-between gap-2 px-3 py-1.5 rounded-md","text-sm font-medium w-[120px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer",o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[jsx("span",{children:ji[d]}),jsx(ChevronDown,{className:u("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-180")})]}),o&&jsx("div",{className:"absolute top-full left-0 mt-1 z-50 min-w-[140px] rounded-md border border-border bg-background shadow-lg",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:ji.map((h,b)=>jsx("button",{type:"button",onClick:()=>f(b),className:u("w-full text-left px-3 py-2 text-sm rounded-md","hover:bg-muted transition-colors cursor-pointer",d===b&&"bg-primary/10 text-primary font-medium"),children:h},h))})})})]}),jsxs("div",{ref:c,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>{i(!s),a(false);},className:u("inline-flex items-center justify-between gap-2 px-3 py-1.5 rounded-md","text-sm font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer",s&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[jsx("span",{children:m}),jsx(ChevronDown,{className:u("h-4 w-4 text-muted-foreground transition-transform",s&&"rotate-180")})]}),s&&jsx("div",{className:"absolute top-full left-0 mt-1 z-50 min-w-[100px] rounded-md border border-border bg-background shadow-lg",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:g.map(h=>jsx("button",{type:"button",onClick:()=>p(h),className:u("w-full text-left px-3 py-2 text-sm rounded-md","hover:bg-muted transition-colors cursor-pointer",m===h&&"bg-primary/10 text-primary font-medium"),children:h},h))})})})]})]})}function Hw(e,t,n){return function({calendarMonth:o}){let{goToMonth:a,nextMonth:s,previousMonth:i}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsx(Dw,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]});let l=ji[o.date.getMonth()],c=o.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium w-[90px]",children:l}),jsx("span",{className:"text-sm font-medium w-[50px]",children:c})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}}function so({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=W.useMemo(()=>Hw(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:u("p-4",e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground w-10 font-normal text-xs text-center",week:"flex w-full mt-1",day:u("relative h-10 w-10 p-0 text-center text-sm","flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:u("size-10 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10 hover:text-primary","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:u("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:bg-transparent [&.outside-day]:text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0},outside:{backgroundColor:"transparent"}},components:{...s,MonthCaption:l},...i})}so.displayName="Calendar";var wp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});wp.displayName="Pagination";var Cp=W.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));Cp.displayName="PaginationContent";var Tp=W.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));Tp.displayName="PaginationItem";var os=({className:e,isActive:t,size:n="icon",...r})=>jsx("a",{"aria-current":t?"page":void 0,className:u(bn({variant:t?"solid":"light",size:n}),e),...r});os.displayName="PaginationLink";var Mp=({className:e,...t})=>jsxs(os,{"aria-label":"Go to previous page",size:"md",className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});Mp.displayName="PaginationPrevious";var Np=({className:e,...t})=>jsxs(os,{"aria-label":"Go to next page",size:"md",className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Np.displayName="PaginationNext";var kp=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:u("flex h-9 w-9 items-center justify-center",e),...t,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});kp.displayName="PaginationEllipsis";var Zi=W.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:u("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zi.displayName=Command.displayName;var Ow=({children:e,...t})=>jsx(Va,{...t,children:jsx(Aa,{className:"overflow-hidden p-0 shadow-lg",children:jsx(Zi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Pp=W.forwardRef(({className:e,...t},n)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:n,className:u("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Pp.displayName=Command.Input.displayName;var Ep=W.forwardRef(({className:e,...t},n)=>jsx(Command.List,{ref:n,className:u("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ep.displayName=Command.List.displayName;var Lp=W.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Lp.displayName=Command.Empty.displayName;var Sp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:u("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Sp.displayName=Command.Group.displayName;var Dp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Dp.displayName=Command.Separator.displayName;var Hp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Item,{ref:n,className:u("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Hp.displayName=Command.Item.displayName;var Ip=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ip.displayName="CommandShortcut";var Vp=W.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,...s},i)=>{let[l,c]=W.useState(false),[d,m]=W.useState(false);return jsxs("div",{className:"relative",children:[jsx("input",{type:l?"text":"password",className:u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",t&&"pr-10",e),ref:i,disabled:n,style:{...a,borderColor:d?"var(--color-foreground)":void 0},onFocus:f=>{m(true),r?.(f);},onBlur:f=>{m(false),o?.(f);},...s}),t&&jsx("button",{type:"button",className:"absolute right-0 top-0 h-10 w-10 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>c(!l),disabled:n,tabIndex:-1,"aria-label":l?"Hide password":"Show password",children:l?jsx(EyeOff,{className:"h-4 w-4"}):jsx(Eye,{className:"h-4 w-4"})})]})});Vp.displayName="PasswordInput";var Ap=W.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,...c},d)=>{let[m,f]=W.useState(s),[p,g]=W.useState(false),h=a!==void 0,b=h?a:m,v=T=>{T!==void 0&&(r!==void 0&&T<r&&(T=r),o!==void 0&&T>o&&(T=o)),h||f(T),i?.(T);},R=()=>{v((b??0)+n);},w=()=>{v((b??0)-n);},x=T=>{let k=T.target.value;if(k==="")v(void 0);else {let M=parseFloat(k);isNaN(M)||v(M);}},C=T=>{T.key==="ArrowUp"?(T.preventDefault(),R()):T.key==="ArrowDown"&&(T.preventDefault(),w());},y=r===void 0||(b??0)>r,N=o===void 0||(b??0)<o;return t?jsxs("div",{className:u("relative flex items-center rounded-md border transition-colors",p?"border-foreground":"border-input",l&&"opacity-50",e),children:[jsx("button",{type:"button",className:"h-10 w-10 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:w,disabled:l||!y,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:"h-4 w-4"})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"min-w-0 flex-1 h-10 bg-background text-sm text-center focus:outline-none disabled:cursor-not-allowed",ref:d,value:b??"",onChange:x,onKeyDown:C,disabled:l,onFocus:()=>g(true),onBlur:()=>g(false),...c}),jsx("button",{type:"button",className:"h-10 w-10 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:R,disabled:l||!N,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:"h-4 w-4"})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex h-10 w-full bg-background px-3 py-2 text-sm text-center border rounded-md placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",p?"border-foreground":"border-input",e),ref:d,value:b??"",onChange:x,onKeyDown:C,disabled:l,onFocus:()=>g(true),onBlur:()=>g(false),...c})});Ap.displayName="NumberInput";var Op=W.forwardRef(({value:e,defaultValue:t,onValueChange:n,placeholder:r="Pick a date",dateFormat:o="PPP",disabled:a=false,minDate:s,maxDate:i,className:l},c)=>{let[d,m]=W.useState(false),[f,p]=W.useState(t),g=e!==void 0,h=g?e:f,b=v=>{g||p(v),n?.(v),m(false);};return jsxs(nt,{open:d,onOpenChange:m,children:[jsxs(Lt,{ref:c,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!h&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",l),children:[jsx(Calendar,{className:"h-4 w-4"}),h?format(h,o):r]}),jsx(rt,{className:"w-auto p-0",align:"start",children:jsx(so,{mode:"single",selected:h,onSelect:b,disabled:v=>!!(s&&v<s||i&&v>i),initialFocus:true})})]})});Op.displayName="DatePicker";var Gp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Bp=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),$p=W.forwardRef(({className:e,items:t,max:n=5,size:r,showTooltips:o=false,...a},s)=>{let i=t.slice(0,n),l=t.length-n,c=(m,f)=>{let p=jsxs(wr,{className:u(Bp({size:r})),children:[m.src&&jsx(Jr,{src:m.src,alt:m.alt||""}),jsx(Cr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Un,{children:[jsx(Wn,{children:p}),jsx(_n,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:m.alt})]},f):p},d=jsxs("div",{ref:s,className:u(Gp({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(wr,{className:u(Bp({size:r})),children:jsxs(Cr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx($n,{delayDuration:300,children:d}):d});$p.displayName="AvatarGroup";var Up=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),Wp=W.forwardRef(({className:e,value:t,defaultValue:n=0,onValueChange:r,max:o=5,size:a,icon:s="star",allowHalf:i=false,readOnly:l=false,disabled:c=false,filledColor:d,emptyColor:m,...f},p)=>{let[g,h]=W.useState(n),[b,v]=W.useState(null),R=t!==void 0,w=R?t:g,x=b!==null?b:w,C=D=>{l||c||(R||h(D),r?.(D));},y=(D,H=false)=>{let L=i&&H?D+.5:D+1;C(L);},N=(D,H)=>{if(l||c)return;let L=D.currentTarget.getBoundingClientRect(),S=i&&D.clientX<L.left+L.width/2;v(S?H+.5:H+1);},T=()=>{v(null);},k=s==="heart"?Heart:Star,M=D=>x>=D+1?"full":x>=D+.5?"half":"empty",P=d?{color:d,fill:d}:{},E=m?{color:m}:{};return jsx("div",{ref:p,className:u(Up({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:T,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(D,H)=>{let L=M(H);return jsxs("button",{type:"button",className:u("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:S=>{let V=S.currentTarget.getBoundingClientRect(),z=i&&S.clientX<V.left+V.width/2;y(H,z);},onMouseMove:S=>N(S,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":w===H+1,children:[jsx(k,{className:u("text-muted-foreground/30",L!=="empty"&&"absolute inset-0"),style:L==="empty"?E:void 0}),L!=="empty"&&jsx(k,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",L==="half"&&"clip-path-half"),style:{...P,clipPath:L==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});Wp.displayName="Rating";var jp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"border-transparent text-primary-foreground",outline:"border bg-transparent",ghost:"border-transparent bg-transparent",soft:"border-transparent",surface:"border-transparent bg-muted text-muted-foreground"},color:{primary:"",secondary:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"solid",color:"success",className:"bg-success hover:bg-success/90"},{variant:"solid",color:"warning",className:"bg-warning text-warning-foreground hover:bg-warning/90"},{variant:"solid",color:"danger",className:"bg-danger hover:bg-danger/90"},{variant:"solid",color:"info",className:"bg-info hover:bg-info/90"},{variant:"outline",color:"primary",className:"border-primary text-primary hover:bg-primary/10"},{variant:"outline",color:"secondary",className:"border-secondary text-secondary-foreground hover:bg-secondary/10"},{variant:"outline",color:"success",className:"border-success text-success hover:bg-success/10"},{variant:"outline",color:"warning",className:"border-warning text-warning hover:bg-warning/10"},{variant:"outline",color:"danger",className:"border-danger text-danger hover:bg-danger/10"},{variant:"outline",color:"info",className:"border-info text-info hover:bg-info/10"},{variant:"ghost",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"ghost",color:"secondary",className:"text-secondary-foreground hover:bg-secondary"},{variant:"ghost",color:"success",className:"text-success hover:bg-success/10"},{variant:"ghost",color:"warning",className:"text-warning hover:bg-warning/10"},{variant:"ghost",color:"danger",className:"text-danger hover:bg-danger/10"},{variant:"ghost",color:"info",className:"text-info hover:bg-info/10"},{variant:"soft",color:"primary",className:"bg-primary/15 text-primary hover:bg-primary/20"},{variant:"soft",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"soft",color:"success",className:"bg-success/15 text-success hover:bg-success/20"},{variant:"soft",color:"warning",className:"bg-warning/15 text-warning hover:bg-warning/20"},{variant:"soft",color:"danger",className:"bg-danger/15 text-danger hover:bg-danger/20"},{variant:"soft",color:"info",className:"bg-info/15 text-info hover:bg-info/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),Jw=cva("ml-1 rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/10",{variants:{size:{sm:"[&_svg]:size-3",md:"[&_svg]:size-3.5",lg:"[&_svg]:size-4"}},defaultVariants:{size:"md"}}),Xp=W.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,avatar:m,children:f,onClick:p,...g},h)=>{let b=a||!!p,v=R=>{R.stopPropagation(),c?.();};return jsxs("div",{ref:h,role:b?"button":void 0,tabIndex:b&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:p,onKeyDown:b&&!d?R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),p?.(R));}:void 0,className:u(jp({variant:t,color:n,size:r,radius:o,clickable:b}),d&&"opacity-50 cursor-not-allowed",e),...g,children:[m&&jsx("span",{className:"-ml-1 [&>*]:size-5 [&>*]:rounded-full",children:m}),s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:f}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx("button",{type:"button","aria-label":"Remove",onClick:v,disabled:d,className:u(Jw({size:r})),children:jsx(X,{})})]})});Xp.displayName="Chip";var qp=createContext({direction:"horizontal"}),iC=({className:e,direction:t="horizontal",children:n,...r})=>jsx(qp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:u("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),lC=Panel,cC=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(qp),o=r==="vertical";return jsx(Separator,{className:u("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...n,children:e&&jsx("div",{className:u("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var ef=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),uC={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Zp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},tf=W.forwardRef(({className:e,size:t="md",color:n="default",value:r,max:o=100,showValue:a=false,formatValue:s=d=>`${Math.round(d)}%`,trackClassName:i,...l},c)=>{let d=Math.min(100,Math.max(0,r/o*100)),m=uC[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(ef({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:m.size,height:m.size,viewBox:`0 0 ${m.size} ${m.size}`,fill:"none",children:[jsx("circle",{className:u("stroke-muted",i),cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Zp[n]||Zp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:u("absolute font-medium text-foreground",m.fontSize),children:s(d)})]})});tf.displayName="CircularProgress";var nf=W.createContext(null),fC=()=>{let e=W.useContext(nf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},rf=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),of=W.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,children:d,...m},f)=>{let[p,g]=W.useState(o),[h,b]=W.useState(0),[v,R]=W.useState(false),w=W.useRef(null),x=r!==void 0?r:p;W.useImperativeHandle(f,()=>w.current),W.useEffect(()=>{b(Math.min(x.length,n-1));},[x,n]),W.useEffect(()=>{x.length===n&&s&&s(x);},[x,n,s]);let C=P=>{let E=P.target.value;if(i&&E){let D=new RegExp(i.replace("^","").replace("$","").replace("+",""));E=E.split("").filter(H=>D.test(H)).join("");}E=E.slice(0,n),r===void 0&&g(E),a?.(E);},y=P=>{P.key==="ArrowLeft"?b(E=>Math.max(0,E-1)):P.key==="ArrowRight"&&b(E=>Math.min(x.length,n-1,E+1));},N=()=>{w.current?.focus();},T=()=>{R(true),b(Math.min(x.length,n-1));},k=()=>{R(false);},M={value:x,activeIndex:v?h:-1,maxLength:n,disabled:l};return jsx(nf.Provider,{value:M,children:jsxs("div",{className:u(rf({size:c}),t),onClick:N,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:x,onChange:C,onKeyDown:y,onFocus:T,onBlur:k,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...m}),d]})})});of.displayName="InputOTP";var af=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));af.displayName="InputOTPGroup";var sf=W.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s}=fC(),i=o[e]||"",l=a===e,c=l&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":l,"data-filled":!!i,className:u("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[i,c&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});sf.displayName="InputOTPSlot";var lf=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));lf.displayName="InputOTPSeparator";var uf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900",bordered:"border-2 border-zinc-300 bg-transparent dark:border-zinc-600",light:"bg-transparent text-zinc-800 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800",flat:"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-white",ghost:"border-2 border-zinc-800 bg-transparent dark:border-white"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),mf=W.forwardRef(({className:e,variant:t,size:n,value:r=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,disabled:m,readOnly:f,renderTag:p,...g},h)=>{let[b,v]=W.useState(""),R=W.useRef(null);W.useImperativeHandle(h,()=>R.current);let w=M=>{let P=M.trim();if(P.length<i||P.length>l||s&&r.length>=s||!d&&r.some(D=>D.text.toLowerCase()===P.toLowerCase()))return;let E={id:crypto.randomUUID(),text:P};o?.([...r,E]),v("");},x=M=>{m||f||o?.(r.filter(P=>P.id!==M));},C=M=>{if(c.includes(M.key)){if(M.key==="Tab"&&!b)return;M.preventDefault(),w(b);}M.key==="Backspace"&&!b&&r.length>0&&x(r[r.length-1].id);},y=M=>{let P=M.target.value;if(P.includes(",")){P.split(",").forEach(D=>{D.trim()&&w(D);});return}v(P);},N=M=>{M.preventDefault(),M.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(D=>{w(D);});},T=()=>{R.current?.focus();},k=s?r.length>=s:false;return jsxs("div",{className:u("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",m&&"cursor-not-allowed opacity-50",e),onClick:T,children:[r.map(M=>p?p(M,()=>x(M.id)):jsxs("span",{className:u(uf({variant:t,size:n})),children:[M.text,!m&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),x(M.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${M.text}`,children:jsx(X,{className:"h-3 w-3"})})]},M.id)),!k&&!f&&jsx("input",{ref:R,type:"text",value:b,onChange:y,onKeyDown:C,onPaste:N,placeholder:r.length===0?a:"",disabled:m,className:u("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});mf.displayName="TagInput";var ff=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),gf=W.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(ff({size:t,className:e})),...i,children:[n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:n}),r&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:r}),o&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:o}),a&&jsx("div",{className:"mt-2",children:a}),s]}));gf.displayName="EmptyState";var vf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border-2 border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border-2 border-zinc-900 bg-transparent dark:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),hf=W.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let m=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,f=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:u(vf({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:u("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:u("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:u("flex items-center gap-0.5 text-sm",f),children:[jsx(m,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:u("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});hf.displayName="StatCard";var nl=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),MC=({checked:e,disabled:t,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:r=>{r.stopPropagation(),t||n(r);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function NC({className:e,variant:t,size:n,items:r,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:m,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:b=[],onCheck:v,children:R,...w},x){let[C,y]=W.useState(null),[N,T]=W.useState(null),[k,M]=W.useState(new Set(f)),P=m!==void 0,E=P?new Set(m):k,[D,H]=W.useState(new Set(b)),L=h!==void 0,S=L?new Set(h):D,V=(O,_)=>{y(_),O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",String(_));},z=(O,_)=>{O.preventDefault(),!(C===null||C===_)&&T(_);},F=()=>{T(null);},I=(O,_)=>{if(O.preventDefault(),!r||C===null||C===_){y(null),T(null);return}let A=[...r],[Y]=A.splice(C,1);A.splice(_,0,Y),s?.(A),y(null),T(null);},K=()=>{y(null),T(null);},B=W.useCallback((O,_)=>{if(!r)return;let A=new Set(E),Y=!A.has(O.id);d?Y?A.add(O.id):A.delete(O.id):(A.clear(),Y&&A.add(O.id)),P||M(A);let se=r.filter(Ce=>A.has(Ce.id));p?.(Array.from(A),{selected:Y,selectedItems:se,item:O,event:_});},[r,E,d,P,p]),q=W.useCallback((O,_)=>{if(!r)return;let A=new Set(S),Y=!A.has(O.id);Y?A.add(O.id):A.delete(O.id),L||H(A);let se=r.filter(Ce=>A.has(Ce.id));v?.(Array.from(A),{checked:Y,checkedItems:se,item:O,event:_});},[r,S,L,v]);return (a||c||g)&&r&&o?jsx("div",{ref:x,role:"list",className:u(nl({variant:t,size:n,className:e})),...w,children:r.map((O,_)=>{let A=E.has(O.id),Y=S.has(O.id);return jsxs("div",{role:"listitem","aria-selected":c?A:void 0,draggable:a,onDragStart:a?U=>V(U,_):void 0,onDragOver:a?U=>z(U,_):void 0,onDragLeave:a?F:void 0,onDrop:a?U=>I(U,_):void 0,onDragEnd:a?K:void 0,onClick:c&&!g?U=>B(O,U):void 0,className:u("flex items-center gap-3 transition-all",a&&"cursor-move",c&&!g&&"cursor-pointer hover:bg-muted/50",g&&"cursor-pointer hover:bg-muted/50",C===_&&"opacity-50 scale-[1.02] z-10",N===_&&"border-primary border-dashed border rounded-md",A&&c&&!g&&"bg-primary/10"),children:[a&&i&&l!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(MC,{checked:Y,onClick:U=>q(O,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,_)})]},O.id)})}):jsx("div",{ref:x,role:"list",className:u(nl({variant:t,size:n,className:e})),...w,children:R})}var kC=W.forwardRef(NC),yf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Rf=W.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(yf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"flex-shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"flex-shrink-0 whitespace-nowrap",children:r})]}));Rf.displayName="ListItem";var wf=W.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:u("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),n&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:n}),r]}));wf.displayName="ListItemText";var Mf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Nf=W.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(Mf({position:t,className:e})),...n}));Nf.displayName="Timeline";var kf=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Pf=W.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(kf({variant:t,className:e})),...s,children:[!n&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!r&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Pf.displayName="TimelineItem";var Ef=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));Ef.displayName="TimelineContent";var Lf=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Lf.displayName="TimelineOpposite";var Df=cva("inline-flex items-center rounded-lg bg-muted p-1 text-muted-foreground",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Hf=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 text-xs px-2.5",md:"h-8 text-sm px-3",lg:"h-10 text-base px-4"},selected:{true:"bg-background text-foreground shadow-sm",false:""}},defaultVariants:{size:"md",selected:false}}),If=W.createContext({}),Vf=W.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=W.useState(a),f=o!==void 0?o:d,p=W.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(If.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(Df({size:t,fullWidth:n,className:e})),...l,children:r})})});Vf.displayName="SegmentedControl";var Af=W.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=W.useContext(If),i=s.value===n,l=r||s.disabled;return jsx("button",{ref:a,type:"button",role:"radio","aria-checked":i,"data-state":i?"on":"off",disabled:l,onClick:()=>{l||s.onValueChange?.(n);},className:u(Hf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});Af.displayName="SegmentedControlItem";var zf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),Of=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},cs=e=>{if(e===0)return "0 Bytes";let t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},Bf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${cs(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},Ff=W.forwardRef(({className:e,variant:t,size:n,onFilesChange:r,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:m=true,disabled:f,...p},g)=>{let[h,b]=W.useState(false),[v,R]=W.useState(false),[w,x]=W.useState([]),C=W.useRef(null),y=W.useCallback(S=>{if(!S||S.length===0)return;let V=Array.from(S),z=[],F=[];(m?V:[V[0]]).forEach(K=>{let B=Bf(K,c,d);B.length>0?F.push({file:K,errors:B}):z.push(K);}),x(F),z.length>0&&r?.(z),F.length>0&&o?.(F);},[c,d,m,r,o]),N=W.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!f&&(b(true),S.dataTransfer.items)){let z=Array.from(S.dataTransfer.items).some(F=>{if(F.kind!=="file")return true;if(d&&d.length>0){let I=F.type;return !d.some(K=>K.endsWith("/*")?I.startsWith(K.slice(0,-2)):I===K)}return false});R(z);}},[f,d]),T=W.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!f&&(S.dataTransfer.dropEffect="copy");},[f]),k=W.useCallback(S=>{S.preventDefault(),S.stopPropagation();let V=S.currentTarget.getBoundingClientRect(),z=S.clientX,F=S.clientY;(z<V.left||z>V.right||F<V.top||F>V.bottom)&&(b(false),R(false));},[]),M=W.useCallback(S=>{S.preventDefault(),S.stopPropagation(),b(false),R(false),!f&&y(S.dataTransfer.files);},[f,y]),P=W.useCallback(()=>{f||C.current?.click();},[f]),E=W.useCallback(S=>{y(S.target.files),S.target.value="";},[y]),D=W.useCallback(S=>{f||(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),C.current?.click());},[f]),H=v?"error":h?"active":t,L=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:N,onDragOver:T,onDragLeave:k,onDrop:M,onClick:P,onKeyDown:D,className:u(zf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:L,multiple:m,disabled:f,onChange:E,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:"rounded-full bg-muted p-3",children:jsx(Upload,{className:"h-6 w-6 text-muted-foreground"})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:"text-sm font-medium",children:h?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[c&&`Max ${cs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),w.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:w.map(({file:S,errors:V})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:S.name}),":"," ",V.map(z=>z.message).join(", ")]},S.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(S=>{let V=Of(S.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",S.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(V,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:S.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[cs(S.file.size),S.error&&jsx("span",{className:"ml-2 text-danger",children:S.error})]}),S.progress!==void 0&&S.progress<100&&jsx(es,{value:S.progress,className:"mt-2 h-1"})]}),jsxs(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:z=>{z.stopPropagation(),a?.(S.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},S.id)})})]})});Ff.displayName="FileUpload";var zC=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Gf=cva("relative rounded-md border border-input shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),ta=W.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,...d},m)=>jsx("button",{ref:m,type:"button",disabled:c,onClick:g=>{l?.(g),r?.(e);},className:u(Gf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-ring ring-offset-2",i),style:{backgroundImage:n?zC:void 0,backgroundSize:n?"8px 8px":void 0},"aria-label":`Color ${e}`,"aria-pressed":t,...d,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));ta.displayName="ColorSwatch";var $f=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Uf=W.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,className:c,style:d,...m},f)=>{let[p,g]=W.useState(t),h=e??p,b=W.useCallback(R=>{l||(e===void 0&&g(R),n?.(R));},[e,n,l]),v=R=>R.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:u($f({layout:r}),c),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...d},...m,children:a.map(R=>{let w=h?v(h)===v(R):false;return jsx(ta,{role:"option",color:R,size:s,shape:i,isSelected:w,onSelect:b,disabled:l,"aria-selected":w},R)})})});Uf.displayName="ColorSwatchPicker";var FC=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Wf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},_f=W.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=FC,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=W.useState(e??t),f=W.useId();W.useEffect(()=>{e!==void 0&&m(e);},[e]);let p=b=>{m(b),n?.(b);},g=b=>{m(b),n?.(b);},h=b=>{let v=b.target.value.toUpperCase();m(v),n?.(v);};return l==="simple"?jsxs("label",{className:u("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",r&&"opacity-50 cursor-not-allowed",Wf[s],i),children:[jsx("input",{type:"color",value:d,onChange:h,disabled:r,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:f}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(nt,{children:[jsx(Lt,{ref:c,disabled:r,className:u("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Wf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(rt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:p,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Rr,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:p,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm uppercase ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Rr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(ta,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});_f.displayName="ColorPicker";var Yf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),al=e=>String(e).padStart(2,"0"),WC=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},_C=(e,t)=>`${al(e)}:${al(t)}`,jf=W.forwardRef(({className:e,size:t,value:n,onChange:r,use24Hour:o=true,minuteStep:a=1,showPicker:s=true,minTime:i,maxTime:l,disabled:c,...d},m)=>{let[f,p]=W.useState(n??""),[g,h]=W.useState(false);W.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=WC(f||"00:00"),R=k=>{let M=k.target.value;p(M),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(M)&&r?.(M);},w=(k,M)=>{let P=Math.max(0,Math.min(23,k)),E=Math.max(0,Math.min(59,M)),D=_C(P,E);p(D),r?.(D);},x=()=>w(b+1,v),C=()=>w(b-1,v),y=()=>w(b,v+a),N=()=>w(b,v-a),T=({value:k,onIncrement:M,onDecrement:P})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:M,disabled:c,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:al(k)}),jsx(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:P,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:m,type:"time",value:f,onChange:R,disabled:c,className:u(Yf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(nt,{open:g,onOpenChange:h,children:[jsxs(Lt,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(rt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(T,{value:b,onIncrement:x,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(T,{value:v,onIncrement:y,onDecrement:N,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:()=>{let k=new Date;w(k.getHours(),k.getMinutes());},children:"Now"}),jsx(oe,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});jf.displayName="TimeInput";var Xf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),jC=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},sl=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},qf=(e,t,n)=>{if(!e)return;let r=e.replace(new RegExp(`\\${t}`,"g"),"");r=r.replace(n,"."),r=r.replace(/[^0-9.-]/g,"");let o=parseFloat(r);return isNaN(o)?void 0:o},Zf=W.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:m="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",disabled:h,placeholder:b,...v},R)=>{let[w,x]=W.useState(r),[C,y]=W.useState(""),[N,T]=W.useState(false),k=n!==void 0?n:w,M=f??jC(a,s);W.useEffect(()=>{!N&&k!==void 0&&y(sl(k,i,p,g));},[k,i,p,g,N]);let P=S=>{let V=S.target.value;if(!V){y(""),n===void 0&&x(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(V))return;y(V);let F=qf(V,p,g);if(F!==void 0){let I=F;l!==void 0&&F<l&&(I=l),c!==void 0&&F>c&&(I=c),n===void 0&&x(I),o?.(I);}},E=()=>{T(true),k!==void 0&&y(k.toString().replace(".",g));},D=()=>{T(false),y(k!==void 0?sl(k,i,p,g):"");},H=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:M}),L=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:M});return jsxs("div",{className:"relative flex items-center",children:[H&&jsx("div",{className:"absolute left-3 pointer-events-none",children:H}),jsx("input",{ref:R,type:"text",inputMode:"decimal",value:C,onChange:P,onFocus:E,onBlur:D,disabled:h,placeholder:b??`0${g}${"0".repeat(i)}`,className:u(Xf({size:t}),H&&"pl-8",L&&"pr-8","text-right",e),style:{borderColor:N?"var(--color-foreground)":void 0},...v}),L&&jsx("div",{className:"absolute right-3 pointer-events-none",children:L})]})});Zf.displayName="CurrencyInput";var Qf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},ZC=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},er=e=>["#","A","*"].includes(e),us=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(er(s)){if(o<e.length){let i=e[o];ZC(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},ll=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];er(o)&&(n+=e[r]);}return n},Jf=(e,t)=>e.split("").map(n=>er(n)?t:n).join(""),QC=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)er(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,er(t[i])&&s++;for(;a<t.length&&!er(t[a]);)a++;return Math.min(a,e.length)},eg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,disabled:c,placeholder:d,...m},f)=>{let p=typeof a=="string"&&a in il?il[a].mask:a,[g,h]=W.useState(r),[b,v]=W.useState(""),[R,w]=W.useState(false),x=W.useRef(null),C=n!==void 0?n:g;W.useImperativeHandle(f,()=>x.current),W.useEffect(()=>{let k=us(C,p,true);v(k);},[C,p]);let y=k=>{let M=k.target.value,P=k.target.selectionStart??0,E=M.replace(/[^\w]/g,""),D=us(E,p,true),H=ll(D,p);v(D),n===void 0&&h(l?D:H),o?.(H,D),requestAnimationFrame(()=>{if(x.current){let L=QC(D,p,P);x.current.setSelectionRange(L,L);}});},N=k=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(k.key)||k.ctrlKey||k.metaKey)return;let M=x.current;if(!M)return;let P=M.selectionStart??0;if(k.key==="Backspace"&&P>0){let E=P-1;for(;E>0&&!er(p[E]);)E--;let D=ll(b,p),H=0;for(let V=0;V<E&&V<p.length;V++)er(p[V])&&H++;let L=D.slice(0,Math.max(0,H-1))+D.slice(H),S=us(L,p,true);v(S),n===void 0&&h(l?S:L),o?.(L,S),k.preventDefault(),requestAnimationFrame(()=>{x.current&&x.current.setSelectionRange(E,E);});}},T=i?Jf(p,s):d;return jsx("input",{ref:x,type:"text",value:b,onChange:y,onKeyDown:N,onFocus:()=>w(true),onBlur:()=>w(false),disabled:c,placeholder:T,className:u(Qf({size:t}),e),style:{borderColor:R?"var(--color-foreground)":void 0},...m})});eg.displayName="MaskedInput";var tg=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),fs={"DD/MM/YYYY":"/","MM/DD/YYYY":"/","YYYY-MM-DD":"-","DD.MM.YYYY":"."},dl={"DD/MM/YYYY":["day","month","year"],"MM/DD/YYYY":["month","day","year"],"YYYY-MM-DD":["year","month","day"],"DD.MM.YYYY":["day","month","year"]},cl=(e,t)=>String(e).padStart(t,"0"),ps=(e,t)=>{let n=cl(e.getDate(),2),r=cl(e.getMonth()+1,2),o=cl(e.getFullYear(),4),a=fs[t],s=dl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},ng=(e,t)=>{let n=fs[t],r=e.split(n);if(r.length!==3)return null;let o=dl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},nT=e=>e.toLowerCase(),rT=e=>{let t=fs[e];return dl[e].map(r=>r==="year"?"####":"##").join(t)},rg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,format:a="DD/MM/YYYY",minDate:s,maxDate:i,showIcon:l=true,disabled:c,placeholder:d,...m},f)=>{let[p,g]=W.useState(r??null),[h,b]=W.useState(""),[v,R]=W.useState(null),w=W.useRef(null),x=n!==void 0?n:p;W.useImperativeHandle(f,()=>w.current),W.useEffect(()=>{x?(b(ps(x,a)),R(null)):b("");},[x,a]);let C=fs[a],y=rT(a),N=M=>{let P=M.target.value;P=P.replace(new RegExp(`[^0-9\\${C}]`,"g"),"");let E=P.replace(new RegExp(`\\${C}`,"g"),""),D="",H=0;for(let L=0;L<y.length&&H<E.length;L++)y[L]==="#"?(D+=E[H],H++):D+=y[L];if(b(D),D.length===y.length){let L=ng(D,a);if(L){if(s&&L<s){R(`Date must be after ${ps(s,a)}`);return}if(i&&L>i){R(`Date must be before ${ps(i,a)}`);return}R(null),n===void 0&&g(L),o?.(L);}else R("Invalid date");}else n===void 0&&g(null),o?.(null),R(null);},T=()=>{h&&h.length!==y.length&&(b(""),R(null),n===void 0&&g(null),o?.(null));},k=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4";return jsxs("div",{className:"relative",children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",value:h,onChange:N,onBlur:T,disabled:c,placeholder:d??nT(a),className:u(tg({size:t}),l&&"pr-10",v&&"border-danger focus-visible:ring-danger",e),"aria-invalid":!!v,"aria-describedby":v?"date-error":void 0,...m}),l&&jsx("div",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2",children:jsx(Calendar,{className:u(k,"text-muted-foreground")})}),v&&jsx("p",{id:"date-error",className:"mt-1 text-xs text-danger",children:v})]})});rg.displayName="DateInput";var ag=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),sg=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],gs=(e,t)=>{let n=e.replace(/\D/g,""),r="",o=0;for(let a=0;a<t.length&&o<n.length;a++)t[a]==="#"?(r+=n[o],o++):r+=t[a];return r},lT=e=>e.replace(/#/g,"_"),ig=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=sg,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,...p},g)=>{let[h,b]=W.useState(r),[v,R]=W.useState(a??s),[w,x]=W.useState(false),[C,y]=W.useState(false),[N,T]=W.useState(false),[k,M]=W.useState({top:0,left:0,width:0}),P=W.useRef(null),E=W.useRef(null),D=n!==void 0?n:h,H=a??v,L=l.find(I=>I.code===H)??l[0],S=gs(D,L.format);W.useEffect(()=>{T(true);},[]),W.useEffect(()=>{if(C&&P.current){let I=P.current.getBoundingClientRect();M({top:I.bottom+4,left:I.left,width:Math.max(I.width,280)});}},[C]),W.useEffect(()=>{if(!C)return;let I=K=>{P.current&&!P.current.contains(K.target)&&E.current&&!E.current.contains(K.target)&&y(false);};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[C]),W.useEffect(()=>{if(!C)return;let I=K=>{K.key==="Escape"&&y(false);};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[C]);let V=I=>{let B=I.target.value.replace(/\D/g,"");n===void 0&&b(B);let q=gs(B,L.format),ne=`${L.dialCode} ${q}`;o?.(B,ne,L);},z=I=>{let K=l.find(ne=>ne.code===I);if(!K)return;a===void 0&&R(I),i?.(K);let B=gs(D,K.format),q=`${K.dialCode} ${B}`;o?.(D,q,K),y(false);};return jsxs("div",{className:"flex",children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:P,type:"button",disabled:m,onClick:()=>y(!C),className:u("flex items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","w-[100px] rounded-r-none border-r-0 shrink-0",t==="sm"?"h-8":t==="lg"?"h-12":"h-10"),children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:L.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:L.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",C&&"rotate-180")})]}),N&&C&&Ya.createPortal(jsx("div",{ref:E,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(ze,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(I=>jsxs("div",{role:"option","aria-selected":I.code===H,onClick:()=>z(I.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.code===H&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:I.flag}),jsx("span",{className:"flex-1",children:I.name}),jsx("span",{className:"text-xs text-muted-foreground",children:I.dialCode})]})]},I.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:L.dialCode}),jsx("input",{ref:g,type:"tel",inputMode:"tel",value:S,onChange:V,onFocus:()=>x(true),onBlur:()=>x(false),disabled:m,placeholder:f??lT(L.format),className:u(ag({size:t}),c&&"rounded-l-none",d&&!c&&"pl-12",e),style:{borderColor:w?"var(--color-foreground)":void 0},...p})]})]})});ig.displayName="PhoneInput";var cg=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"outline",size:"md",sticky:false}}),dg=W.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=W.useState(false),m={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],f={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:u(cg({variant:t,size:n,sticky:r,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:u("items-center gap-4 flex-1 justify-end",m),children:a}),jsx("button",{type:"button",className:u("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",f),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:u("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",f),children:a})]})});dg.displayName="Navbar";var ug=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));ug.displayName="NavbarBrand";var mg=W.forwardRef(({className:e,justify:t="start",...n},r)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:r,className:u("flex items-center gap-4",o,e),...n})});mg.displayName="NavbarContent";var pg=W.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));pg.displayName="NavbarItem";var fg=W.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:u("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));fg.displayName="NavbarLink";var bg=cva("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"text-primary-foreground bg-primary px-2 py-0.5 rounded hover:bg-primary/90",outline:"text-primary underline-offset-4 hover:underline",ghost:"text-foreground hover:text-primary",soft:"text-primary bg-primary/10 px-2 py-0.5 rounded hover:bg-primary/20",surface:"text-foreground bg-muted px-2 py-0.5 rounded hover:bg-muted/80"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},underline:{none:"",hover:"hover:underline underline-offset-4",always:"underline underline-offset-4"}},defaultVariants:{variant:"outline",size:"md",underline:"hover"}}),vg=W.forwardRef(({className:e,variant:t,size:n,underline:r,isExternal:o,showExternalIcon:a=true,isDisabled:s,children:i,...l},c)=>{let d=o?{target:"_blank",rel:"noopener noreferrer"}:{};return jsxs("a",{ref:c,className:u(bg({variant:t,size:n,underline:r,className:e}),s&&"pointer-events-none opacity-50"),"aria-disabled":s,...d,...l,children:[i,o&&a&&jsx(ExternalLink,{className:"h-3 w-3 ml-0.5","aria-hidden":"true"})]})});vg.displayName="Link";var hg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),xg=W.forwardRef(({className:e,position:t,threshold:n=400,icon:r,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:m,...f},p)=>{let[g,h]=W.useState(false);W.useEffect(()=>{let R=c?.current||window,w=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return R.addEventListener("scroll",w,{passive:true}),w(),()=>{R.removeEventListener("scroll",w);}},[n,c,g,d]);let b=R=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),m?.(R);},v=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:u(hg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(oe,{ref:p,type:"button",variant:a,color:s,size:"icon",radius:l,onClick:b,"aria-label":"Back to top",className:u("shadow-lg",i==="sm"&&"h-9 w-9",i==="md"&&"h-10 w-10",i==="lg"&&"h-12 w-12"),...f,children:r||jsx(ArrowUp,{className:v})})})});xg.displayName="BackTop";var wT=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),CT=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),yg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),hs=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),Rg=W.createContext(null),nr=()=>{let e=W.useContext(Rg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},wg=W.createContext(null),ra=()=>{let e=W.useContext(wg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},ml=W.createContext(null),Cg=W.createContext(null),Tg=W.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=W.useState(null);return jsx(Rg.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:u("flex h-10 items-center space-x-1 border bg-background p-1",wT({radius:n}),e),...r,children:t})})});Tg.displayName="Menubar";var Mg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=nr(),r=W.useId(),o=W.useRef(null),a=t===r,s=W.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(wg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Mg.displayName="MenubarMenu";var Ng=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Ng.displayName="MenubarGroup";var kg=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};kg.displayName="MenubarPortal";var Pg=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(ml.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Pg.displayName="MenubarSub";var Eg=W.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Cg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Eg.displayName="MenubarRadioGroup";var Lg=W.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=nr(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=ra(),f=g=>{t?.(g),m(!d);},p=g=>{n?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:u("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",CT({radius:i}),e),onClick:f,onMouseEnter:p,...r})});Lg.displayName="MenubarTrigger";var Sg=W.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=nr(),l=W.useContext(ml);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:m}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{m.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:u("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",hs({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Sg.displayName="MenubarSubTrigger";var Dg=W.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=nr(),i=W.useContext(ml);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let w=d.current.getBoundingClientRect(),x=h.current.getBoundingClientRect(),C=w.top,y=w.right+t;y+x.width>window.innerWidth&&(y=w.left-x.width-t),f({top:C,left:y});})();},[l,t,d]);let b=R=>{n?.(R),c(true);},v=R=>{r?.(R),c(false);};return !p||!l?null:Ya.createPortal(jsx("div",{ref:R=>{h.current=R,typeof a=="function"?a(R):a&&(a.current=R);},role:"menu","data-state":l?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",yg({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});Dg.displayName="MenubarSubContent";var Hg=W.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=nr(),{triggerRef:l,open:c,onOpenChange:d}=ra(),[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!c||!l.current||!h.current)return;let b=()=>{if(!l.current||!h.current)return;let v=l.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),w=v.bottom+r,x=v.left+n;t==="center"?x=v.left+v.width/2-R.width/2:t==="end"&&(x=v.right-R.width-n),f({top:w,left:x});};return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,true),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,true);}},[c,t,n,r,l]),W.useEffect(()=>{if(!c)return;let b=v=>{let R=v.target;h.current&&!h.current.contains(R)&&l.current&&!l.current.contains(R)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),W.useEffect(()=>{if(!c)return;let b=v=>{v.key==="Escape"&&d(false);};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[c,d]),!p||!c?null:Ya.createPortal(jsx("div",{ref:b=>{h.current=b,typeof s=="function"?s(b):s&&(s.current=b);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",yg({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});Hg.displayName="MenubarContent";var Ig=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=ra(),c=d=>{if(n){d.preventDefault();return}o?.(d),r?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});Ig.displayName="MenubarItem";var Vg=W.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=nr(),{onOpenChange:c}=ra(),d=m=>{if(o){m.preventDefault();return}a?.(m),r?.(!n),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Vg.displayName="MenubarCheckboxItem";var Ag=W.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=ra(),c=W.useContext(Cg),d=c?.value===n,m=f=>{if(r){f.preventDefault();return}o?.(f),c?.onValueChange(n),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":d?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:i}),!r&&"cursor-pointer",e),onClick:m,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ag.displayName="MenubarRadioItem";var zg=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));zg.displayName="MenubarLabel";var Og=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Og.displayName="MenubarSeparator";var Bg=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Bg.displayName="MenubarShortcut";var Fg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Kg=W.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=W.Children.toArray(o);return jsx("div",{ref:s,className:u(Fg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>W.isValidElement(l)?W.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<r?"completed":c===r?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:n}):l)})});Kg.displayName="Steps";var Gg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),MT=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),NT=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),$g=W.forwardRef(({className:e,orientation:t="horizontal",size:n="md",title:r,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:u(Gg({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:u("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:u(MT({status:s,size:n})),children:s==="completed"?jsx(Check,{className:n==="sm"?"h-3 w-3":n==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(r||o)&&jsxs("div",{className:"flex flex-col",children:[r&&jsx("span",{className:u("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:u("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:u(NT({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));$g.displayName="Step";var Wg=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),_g=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Yg=W.createContext(null),IT=()=>{let e=W.useContext(Yg);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},VT=({checked:e,indeterminate:t,disabled:n,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:n,onClick:o=>{o.stopPropagation(),n||r(o);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",n&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),jg=({node:e,level:t,isLast:n=false,parentIsLastPath:r=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:m,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:b,dragOverPosition:v,setDragOver:R,handleDrop:w,allowDrop:x,onDragStart:C,onDragOver:y,onDragEnter:N,onDragLeave:T,onDragEnd:k,showLine:M,showIcon:P,showHandle:E,dragIcon:D,icon:H,leafIcon:L,folderIcon:S,folderOpenIcon:V,blockNode:z,disabled:F,size:I,getAllKeys:K}=IT(),B=e.children&&e.children.length>0,q=e.isLeaf??!B,ne=o.has(e.key),G=s.has(e.key),O=c.has(e.key),_=d.has(e.key),A=g?.key===e.key,Y=b===e.key,se=!!(F||e.disabled),Ce=l&&e.selectable!==false,U=f&&e.checkable!==false,ct=W.useMemo(()=>se?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,se]),ee=W.useMemo(()=>D!==void 0?D:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[D,p]),tt=W.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:ne,isLeaf:q}):H:q?L:ne?V:S,[e.icon,H,ne,q,L,S,V]),On=j=>{if(!ct)return;j.stopPropagation(),j.dataTransfer.effectAllowed="move";let Se=j.currentTarget,le=Se.cloneNode(true),Ge=document.documentElement.classList.contains("dark"),$e=Ge?"#0a0a0a":"#ffffff",Fn=Ge?"#27272a":"#e4e4e7";le.style.cssText=`
43
+ `;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:p}}),jsx("div",{ref:s,id:c,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:o,className:u("h-full w-full",t==="vertical"&&"overflow-y-auto overflow-x-hidden",t==="horizontal"&&"overflow-x-auto overflow-y-hidden",t==="both"&&"overflow-auto",e),...a,children:r})]})});ze.displayName="ScrollArea";var jd=cva("flex min-h-10 w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 py-2 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),Xd=W.forwardRef(({options:e,multiple:t=false,value:n,defaultValue:r,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",disabled:c=false,clearable:d=false,maxDisplayItems:m=3,maxDropdownHeight:f=240,radius:p,className:g,...h},b)=>{let[v,y]=W.useState(false),[R,w]=W.useState(""),[C,x]=W.useState(r||""),[N,T]=W.useState(r||[]),[k,M]=W.useState({top:0,left:0,width:0}),P=W.useRef(null),E=W.useRef(null),D=W.useRef(null),H=W.useRef(null),L=n!==void 0?n:C,S=n!==void 0?n:N,V=n!==void 0,z=A=>{d&&L===A?(V||x(""),o?.("")):(V||x(A),o?.(A)),y(false),w("");},F=A=>{let Y=S.includes(A)?S.filter(se=>se!==A):[...S,A];V||T(Y),o?.(Y);},I=(A,Y)=>{Y.stopPropagation();let se=S.filter(Ce=>Ce!==A);V||T(se),o?.(se);},K=A=>{A.stopPropagation(),t?(V||T([]),o?.([])):(V||x(""),o?.(""));},B=e.find(A=>A.value===L),q=e.filter(A=>S.includes(A.value)),ne=q.slice(0,m),G=q.length-m,O=s?e.filter(A=>A.label.toLowerCase().includes(R.toLowerCase())):e;W.useEffect(()=>{if(v&&E.current){let A=E.current.getBoundingClientRect();M({top:A.bottom+4,left:A.left,width:A.width}),s&&setTimeout(()=>H.current?.focus(),0);}v||w("");},[v,s]),W.useEffect(()=>{let A=Y=>{let se=Y.target,Ce=P.current&&!P.current.contains(se),U=D.current&&!D.current.contains(se);Ce&&U&&(y(false),w(""));};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),W.useEffect(()=>{if(!v)return;let A=Y=>{D.current?.contains(Y.target)||(y(false),w(""));};return window.addEventListener("scroll",A,true),()=>window.removeEventListener("scroll",A,true)},[v]);let _=t?S.length>0:!!L;return jsxs("div",{ref:P,className:u("relative",g),...h,children:[jsxs("div",{ref:A=>{E.current=A,typeof b=="function"?b(A):b&&(b.current=A);},role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&y(!v),className:u(jd({radius:p}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!B&&"text-muted-foreground"),children:B?B.label:a}),t&&jsx(Fragment,{children:q.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[ne.map(A=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[A.label,jsx("span",{role:"button",tabIndex:0,onClick:Y=>I(A.value,Y),onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&I(A.value,Y);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},A.value)),G>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",G," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&_&&jsx("span",{role:"button",tabIndex:0,onClick:K,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&K(A);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",v&&"rotate-180")})]})]}),v&&!c&&typeof document<"u"&&Ya.createPortal(jsxs("div",{ref:D,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:H,type:"text",value:R,onChange:A=>w(A.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(ze,{style:{maxHeight:f},onWheel:A=>A.stopPropagation(),children:jsx("div",{className:"p-1",children:O.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):O.map(A=>{let Y=t?S.includes(A.value):L===A.value;return jsxs("div",{role:"option","aria-selected":Y,onClick:()=>{A.disabled||(t?F(A.value):z(A.value));},className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800",A.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:Y&&jsx(Check,{className:"h-4 w-4"})}),A.label]},A.value)})})})]}),document.body)]})});Xd.displayName="Select";var qd=W.createContext(null),$o=()=>{let e=W.useContext(qd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},Si=W.createContext({radius:"md"}),Di=W.createContext(null),to=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),[s,i]=W.useState(-1),l=t!==void 0,c=l?t:o,d=W.useRef(null),m=W.useRef(null),f=W.useId(),p=W.useRef(new Map),g=W.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=W.useCallback((v,y)=>{p.current.set(v,y);},[]),b=W.useCallback(v=>{p.current.delete(v);},[]);return jsx(qd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};to.displayName="Dropdown";var no=W.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=$o();return jsx("div",{ref:m=>{i.current=m,typeof o=="function"?o(m):o&&(o.current=m);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:m=>{t?.(m),s(!a);},onKeyDown:m=>{n?.(m),(m.key==="ArrowDown"||m.key==="ArrowUp")&&(m.preventDefault(),s(true)),(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});no.displayName="DropdownTrigger";var C0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},ro=W.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:b,contentId:v,activeIndex:y,setActiveIndex:R,items:w}=$o(),[C,x]=W.useState({top:0,left:0}),[N,T]=W.useState(t),[k,M]=W.useState(false),P=W.useRef(0);if(W.useEffect(()=>{M(true);},[]),W.useEffect(()=>{p&&(P.current=w.current.size);},[p,w]),W.useEffect(()=>{if(!p||!h.current||!b.current)return;let D=()=>{if(!h.current||!b.current)return;let H=h.current.getBoundingClientRect(),L=b.current.getBoundingClientRect(),S=window.innerWidth,V=window.innerHeight,z=0,F=0,I=t;switch(t){case "top":z=H.top-L.height-n,z<a&&(z=H.bottom+n,I="bottom");break;case "bottom":z=H.bottom+n,z+L.height>V-a&&(z=H.top-L.height-n,I="top");break;case "left":F=H.left-L.width-n,F<a&&(F=H.right+n,I="right");break;case "right":F=H.right+n,F+L.width>S-a&&(F=H.left-L.width-n,I="left");break}if(I==="top"||I==="bottom"){switch(r){case "start":F=H.left+o;break;case "center":F=H.left+H.width/2-L.width/2;break;case "end":F=H.right-L.width-o;break}F<a?F=a:F+L.width>S-a&&(F=S-L.width-a);}else {switch(r){case "start":z=H.top+o;break;case "center":z=H.top+H.height/2-L.height/2;break;case "end":z=H.bottom-L.height-o;break}z<a?z=a:z+L.height>V-a&&(z=V-L.height-a);}x({top:z,left:F}),T(I);};return D(),window.addEventListener("resize",D),window.addEventListener("scroll",D,true),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,true);}},[p,t,n,r,o,a,h]),W.useEffect(()=>{if(!p)return;let D=H=>{let L=H.target;b.current&&!b.current.contains(L)&&h.current&&!h.current.contains(L)&&(s?.(),g(false));};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[p,g,s,h,b]),W.useEffect(()=>{if(!p)return;let D=H=>{let L=Array.from(w.current.entries()).sort(([V],[z])=>V-z).map(([,V])=>V),S=L.length;if(S!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),y===-1||y>=S-1?R(l?0:Math.min(y+1,S-1)):R(y+1);break;case "ArrowUp":H.preventDefault(),y<=0?R(l?S-1:0):R(y-1);break;case "Home":H.preventDefault(),R(0);break;case "End":H.preventDefault(),R(S-1);break;case "Enter":case " ":H.preventDefault(),y>=0&&y<S&&L[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[p,g,i,y,R,w,l,h]),W.useEffect(()=>{p&&y>=0&&Array.from(w.current.entries()).sort(([H],[L])=>H-L).map(([,H])=>H)[y]?.focus();},[p,y,w]),!k||!p)return null;let E={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[N];return Ya.createPortal(jsx("div",{ref:D=>{b.current=D,typeof f=="function"?f(D):f&&(f.current=D);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":N,className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",C0[c],E,e),style:{top:C.top,left:C.left},...m,children:jsx(Si.Provider,{value:{radius:c},children:d})}),document.body)});ro.displayName="DropdownContent";var Zd=0,Qd={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Yn=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:m,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=$o(),{radius:b}=W.useContext(Si),[v]=W.useState(()=>Zd++),y=W.useRef(null);W.useEffect(()=>(!n&&y.current&&g(v,y.current),()=>{h(v);}),[n,v,g,h]);let R=x=>{if(n){x.preventDefault();return}o?.(x),r?.(),m(false);},w=x=>{a?.(x),n||p(v);};return jsxs("div",{ref:x=>{y.current=x,typeof d=="function"?d(x):d&&(d.current=x);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===v?"":void 0,className:u("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Qd[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:R,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Yn.displayName="DropdownItem";var Hi=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Hi.displayName="DropdownSection";var Jd=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Jd.displayName="DropdownSeparator";var eu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});eu.displayName="DropdownShortcut";var tu=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));tu.displayName="DropdownGroup";var nu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),{contentRef:s}=$o(),i=t!==void 0,l=i?t:o,c=W.useRef(null),d=W.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Di.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};nu.displayName="DropdownSub";var ru=W.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=W.useContext(Di),{setActiveIndex:d,registerItem:m,unregisterItem:f}=$o(),{radius:p}=W.useContext(Si),[g]=W.useState(()=>Zd++),h=W.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:y}=c;W.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let R=x=>{o?.(x),n||(d(g),v(true));},w=x=>{a?.(x);},C=x=>{s?.(x),(x.key==="ArrowRight"||x.key==="Enter"||x.key===" ")&&(x.preventDefault(),v(true));};return jsxs("div",{ref:x=>{h.current=x,y.current=x,typeof l=="function"?l(x):l&&(l.current=x);},role:"menuitem","aria-haspopup":"menu","aria-expanded":b,tabIndex:n?-1:0,"aria-disabled":n,"data-state":b?"open":"closed","data-disabled":n?"":void 0,className:u("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Qd[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:R,onMouseLeave:w,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});ru.displayName="DropdownSubTrigger";var ou=W.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=W.useContext(Di);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=W.useState({top:0,left:0}),[h,b]=W.useState(false),v=W.useRef(null),y=W.useRef(null);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{if(!c||!m.current||!v.current)return;(()=>{if(!m.current||!v.current)return;let x=m.current.getBoundingClientRect(),N=v.current.getBoundingClientRect(),T=window.innerWidth,k=window.innerHeight,M=x.top+n,P=x.right+t;P+N.width>T-r&&(P=x.left-N.width-t),M+N.height>k-r&&(M=k-N.height-r),M<r&&(M=r),g({top:M,left:P});})();},[c,t,n,r,m]);let R=C=>{o?.(C),y.current&&(clearTimeout(y.current),y.current=null),d(true);},w=C=>{a?.(C);let x=C.relatedTarget;m.current?.contains(x)||f?.current?.contains(x)||(y.current=setTimeout(()=>{d(false);},100));};return W.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Ya.createPortal(jsx("div",{ref:C=>{v.current=C,typeof i=="function"?i(C):i&&(i.current=C);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:p.top,left:p.left},onMouseEnter:R,onMouseLeave:w,...s}),document.body)});ou.displayName="DropdownSubContent";var T0=Hi;var iu=W.createContext(null),Ii=()=>{let e=W.useContext(iu);if(!e)throw new Error("Popover components must be used within a Popover");return e},nt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useId(),d=W.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx(iu.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};nt.displayName="Popover";var Lt=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{open:o,onOpenChange:a,triggerRef:s,contentId:i}=Ii();return jsx("button",{ref:c=>{s.current=c,typeof r=="function"?r(c):r&&(r.current=c);},type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-controls":o?i:void 0,onClick:c=>{t?.(c),a(!o);},...n,children:e})});Lt.displayName="PopoverTrigger";var oo=W.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Ii();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});oo.displayName="PopoverAnchor";var rt=W.forwardRef(({className:e,style:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...m},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:b}=Ii(),[v,y]=W.useState({top:0,left:0}),[R,w]=W.useState(false),[C,x]=W.useState(null);if(W.useEffect(()=>{w(true);},[]),W.useEffect(()=>{if(!p||!h.current||!C)return;let T=()=>{if(!h.current||!C)return;let k=h.current.getBoundingClientRect(),M=C.getBoundingClientRect(),P=0,E=0;switch(n){case "top":P=k.top-M.height-r;break;case "bottom":P=k.bottom+r;break;case "left":E=k.left-M.width-r;break;case "right":E=k.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":E=k.left+a;break;case "center":E=k.left+k.width/2-M.width/2;break;case "end":E=k.right-M.width-a;break}else switch(o){case "start":P=k.top+a;break;case "center":P=k.top+k.height/2-M.height/2;break;case "end":P=k.bottom-M.height-a;break}y({top:P,left:E});};return T(),window.addEventListener("resize",T),window.addEventListener("scroll",T,true),()=>{window.removeEventListener("resize",T),window.removeEventListener("scroll",T,true);}},[p,n,r,o,a,h,C]),W.useEffect(()=>{if(!p)return;let T=k=>{let M=k.target;C&&!C.contains(M)&&h.current&&!h.current.contains(M)&&(s?.(),g(false));};return document.addEventListener("mouseup",T),()=>document.removeEventListener("mouseup",T)},[p,g,s,h,C]),W.useEffect(()=>{if(!p)return;let T=k=>{k.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[p,g,i]),!R||!p)return null;let N={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[n];return Ya.createPortal(jsx("div",{ref:T=>{x(k=>k!==T?T:k),typeof f=="function"?f(T):f&&(f.current=T);},id:b,role:"dialog","data-state":p?"open":"closed","data-side":n,className:u("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",N,e),style:{...t,top:v.top,left:v.left},...m,children:d}),document.body)});rt.displayName="PopoverContent";var lu=W.createContext(null),Ai=()=>{let e=W.useContext(lu);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},cu=W.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,m]=W.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(lu.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:u(s==="vertical"&&"flex gap-4",e),...l,children:i})})});cu.displayName="Tabs";var Vi={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},du=W.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Ai(),l=W.useRef(null),[c,d]=W.useState({opacity:0});W.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let y=g.getBoundingClientRect(),R=v.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:R.height,transform:`translateY(${R.top-y.top}px)`,opacity:1}:{width:R.width,height:2,transform:`translateX(${R.left-y.left}px)`,opacity:1}):o==="solid"&&d(w?{width:R.width,height:R.height,transform:`translateY(${R.top-y.top}px)`,opacity:1}:{width:R.width,height:R.height,transform:`translateX(${R.left-y.left}px)`,opacity:1});}};h();let b=new ResizeObserver(h);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let m={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",outline:"bg-transparent p-0 gap-1 !rounded-none"},f=s==="vertical",p=()=>o==="solid"?f?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?f?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof r=="function"?r(g):r&&(r.current=g);},role:"tablist","aria-orientation":s,className:u("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",Vi[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",Vi[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});du.displayName="TabsList";var uu=W.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Ai(),d=s===t,m={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",outline:"border border-transparent data-[state=active]:border-border data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,"aria-selected":d,"data-state":d?"active":"inactive",disabled:n,className:u("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",Vi[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});uu.displayName="TabsTrigger";var mu=W.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Ai(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r,children:n}):null});mu.displayName="TabsContent";var pu=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function N0(e,t=pu){return e?t.filter(r=>r.test(e)).length/t.length:0}function k0(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function P0(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var gu=W.createContext(null),_a=()=>{let e=W.useContext(gu);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},bu=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=W.useState(t),s=e!==void 0,i=s?e:o,l=W.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(gu.Provider,{value:{open:i,onOpenChange:l},children:r})};bu.displayName="Sheet";var vu=W.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});vu.displayName="SheetTrigger";var hu=W.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=_a();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});hu.displayName="SheetClose";var Oi=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Oi.displayName="SheetPortal";var xu=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=_a();return r?jsx("div",{ref:n,className:u("fixed inset-0 z-50 bg-black/80",r?"animate-in fade-in-0":"animate-out fade-out-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});xu.displayName="SheetOverlay";var yu=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition-transform duration-300 ease-in-out",{variants:{side:{top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}}),S0=(e,t)=>({top:t?"animate-in slide-in-from-top":"animate-out slide-out-to-top",bottom:t?"animate-in slide-in-from-bottom":"animate-out slide-out-to-bottom",left:t?"animate-in slide-in-from-left":"animate-out slide-out-to-left",right:t?"animate-in slide-in-from-right":"animate-out slide-out-to-right"})[e],Ru=W.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=_a(),[d,m]=W.useState(false),[,f]=W.useState(false);return W.useEffect(()=>{if(l)m(true),f(true),dt();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{ut();}},[l]),W.useEffect(()=>{let p=g=>{g.key==="Escape"&&l&&(o?.(),c(false));};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,c,o]),!d&&!l?null:jsxs(Oi,{children:[jsx("div",{className:u("fixed inset-0 z-50 bg-black/80 transition-opacity duration-300",l?"opacity-100":"opacity-0"),onClick:()=>{a?.(),c(false);},"aria-hidden":"true"}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true",className:u(yu({side:e}),S0(e,l),t),...s,children:[!r&&jsxs("button",{type:"button",onClick:()=>c(false),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),n]})]})});Ru.displayName="SheetContent";var wu=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});wu.displayName="SheetHeader";var Cu=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cu.displayName="SheetFooter";var Tu=W.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));Tu.displayName="SheetTitle";var Mu=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Mu.displayName="SheetDescription";var I0=({theme:e="system",...t})=>jsx(Toaster,{theme:e,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});var Nu=W.createContext(null),Wo=()=>{let e=W.useContext(Nu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Bi=W.createContext(null),ku=W.createContext(null),Pu=({children:e,onOpenChange:t})=>{let[n,r]=W.useState(false),[o,a]=W.useState({x:0,y:0}),s=W.useId(),i=W.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(Nu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};Pu.displayName="ContextMenu";var Eu=W.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Wo(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:r,onContextMenu:i=>{t?.(i),s(i);},...n,children:e})});Eu.displayName="ContextMenuTrigger";var Lu=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Lu.displayName="ContextMenuGroup";var Su=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Su.displayName="ContextMenuPortal";var Du=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Bi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Du.displayName="ContextMenuSub";var Hu=W.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(ku.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Hu.displayName="ContextMenuRadioGroup";var Iu=W.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Wo(),[d,m]=W.useState(false),[f,p]=W.useState(l),g=W.useRef(null);return W.useEffect(()=>{m(true);},[]),W.useEffect(()=>{if(!s||!g.current){p(l);return}let b=g.current.getBoundingClientRect(),{x:v,y}=l;v+b.width>window.innerWidth&&(v=window.innerWidth-b.width-8),y+b.height>window.innerHeight&&(y=window.innerHeight-b.height-8),p({x:v,y});},[s,l]),W.useEffect(()=>{if(!s)return;let h=b=>{let v=b.target;g.current&&!g.current.contains(v)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),W.useEffect(()=>{if(!s)return;let h=b=>{b.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Ya.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:u("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:f.y,left:f.x},...o,children:r}),document.body)});Iu.displayName="ContextMenuContent";var Vu=W.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=W.useContext(Bi);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,m=p=>{r?.(p),c(true);},f=p=>{o?.(p),c(false);};return jsxs("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:u("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:m,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Vu.displayName="ContextMenuSubTrigger";var Au=W.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=W.useContext(Bi);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=W.useState({top:0,left:0}),[f,p]=W.useState(false),g=W.useRef(null);W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let y=c.current.getBoundingClientRect(),R=g.current.getBoundingClientRect(),w=y.top,C=y.right+t;C+R.width>window.innerWidth&&(C=y.left-R.width-t),m({top:w,left:C});})();},[i,t,c]);let h=v=>{n?.(v),l(true);},b=v=>{r?.(v),l(false);};return !f||!i?null:Ya.createPortal(jsx("div",{ref:v=>{g.current=v,typeof a=="function"?a(v):a&&(a.current=v);},role:"menu","data-state":i?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:h,onMouseLeave:b,...o}),document.body)});Au.displayName="ContextMenuSubContent";var zu=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Wo(),l=c=>{if(n){c.preventDefault();return}o?.(c),r?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});zu.displayName="ContextMenuItem";var Ou=W.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Wo(),c=d=>{if(o){d.preventDefault();return}a?.(d),r?.(!n),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Ou.displayName="ContextMenuCheckboxItem";var Bu=W.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Wo(),l=W.useContext(ku),c=l?.value===n,d=m=>{if(r){m.preventDefault();return}o?.(m),l?.onValueChange(n),i(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":c,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":c?"checked":"unchecked",className:u("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:d,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c&&jsx(Circle,{className:"h-4 w-4 fill-current"})}),t]})});Bu.displayName="ContextMenuRadioItem";var Fu=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));Fu.displayName="ContextMenuLabel";var Ku=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ku.displayName="ContextMenuSeparator";var Gu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Gu.displayName="ContextMenuShortcut";var $u=W.createContext(null),F0=()=>{let e=W.useContext($u);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},Uu=W.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",children:l,...c},d)=>{let[m,f]=W.useState(n),p=t!==void 0,g=p?t:m,h=W.useId(),b=v=>{p||f(v),r?.(v);};return jsx("div",{ref:d,role:"radiogroup","aria-required":s,"aria-orientation":i,className:u(i==="vertical"?"grid gap-2":"flex gap-4",e),...c,children:jsx($u.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});Uu.displayName="RadioGroup";var Wu=W.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=F0(),s=a.value===t,i=n||a.disabled;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"radio","aria-checked":s,disabled:i,ref:o,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",e),onClick:()=>a.onValueChange(t),...r,children:s&&jsx("span",{className:"flex items-center justify-center",children:jsx(Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}),jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:a.name,value:t,checked:s,required:a.required,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Wu.displayName="RadioGroupItem";var Xa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-transparent hover:bg-muted data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",outline:"border border-input bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",ghost:"bg-transparent hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",soft:"bg-transparent hover:bg-primary/10 data-[state=on]:bg-primary/15 data-[state=on]:text-primary",surface:"bg-muted/50 hover:bg-muted data-[state=on]:bg-muted data-[state=on]:text-foreground"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),_u=W.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=W.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let b=!p;f||m(b),a?.(b);},h=b=>{b.key==="Enter"&&b.preventDefault(),i?.(b);};return jsx("button",{type:"button","aria-pressed":p,"data-state":p?"on":"off",disabled:s,ref:c,className:u(Xa({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});_u.displayName="Toggle";var Yu=W.createContext(null),W0=()=>{let e=W.useContext(Yu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},ju=W.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=W.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:m,h=b=>{if(r==="single"){let v=g.includes(b)?[]:[b];p||f(v),s?.(v[0]||"");}else {let v=g.includes(b)?g.filter(y=>y!==b):[...g,b];p||f(v),s?.(v);}};return jsx("div",{ref:d,role:"group",className:u("flex items-center justify-center gap-1",e),...c,children:jsx(Yu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});ju.displayName="ToggleGroup";var Xu=W.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=W0(),c=l.value.includes(o),d=a||l.disabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:u(Xa({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Xu.displayName="ToggleGroupItem";var Za=W.forwardRef(({className:e,value:t,defaultValue:n=[0],onValueChange:r,onValueCommit:o,min:a=0,max:s=100,step:i=1,disabled:l=false,orientation:c="horizontal",name:d,...m},f)=>{let[p,g]=W.useState(n),h=t!==void 0,b=h?t:p,v=W.useRef(null),[y,R]=W.useState(false),[w,C]=W.useState(null),x=(H,L)=>{if(!v.current)return b[0];let S=v.current.getBoundingClientRect(),V;c==="horizontal"?V=(H-S.left)/S.width:V=1-(L-S.top)/S.height,V=Math.max(0,Math.min(1,V));let z=a+V*(s-a),F=Math.round(z/i)*i;return Math.max(a,Math.min(s,F))},N=(H,L)=>{let S=[...b];S[L]=H,L>0&&H<b[L-1]&&(S[L]=b[L-1]),L<b.length-1&&H>b[L+1]&&(S[L]=b[L+1]),h||g(S),r?.(S);},T=(H,L)=>{l||(H.preventDefault(),R(true),C(L),H.target.setPointerCapture(H.pointerId));},k=H=>{if(!y||w===null||l)return;let L=x(H.clientX,H.clientY);N(L,w);},M=()=>{y&&(R(false),C(null),o?.(b));},P=H=>{if(l)return;let L=x(H.clientX,H.clientY),S=0,V=Math.abs(b[0]-L);for(let z=1;z<b.length;z++){let F=Math.abs(b[z]-L);F<V&&(V=F,S=z);}N(L,S),o?.([...b.slice(0,S),L,...b.slice(S+1)]);},E=(H,L)=>{if(l)return;let S=b[L];switch(H.key){case "ArrowRight":case "ArrowUp":H.preventDefault(),S=Math.min(s,b[L]+i);break;case "ArrowLeft":case "ArrowDown":H.preventDefault(),S=Math.max(a,b[L]-i);break;case "Home":H.preventDefault(),S=a;break;case "End":H.preventDefault(),S=s;break;default:return}N(S,L),o?.([...b.slice(0,L),S,...b.slice(L+1)]);},D=H=>(H-a)/(s-a)*100;return jsxs("div",{ref:f,className:u("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...m,children:[jsx("div",{ref:v,className:u("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:P,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${D(b[0])}%`:0,right:`${100-D(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${D(b[0])}%`:0,top:`${100-D(b[b.length-1])}%`,left:0,right:0}})}),b.map((H,L)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":H,"aria-orientation":c,"aria-disabled":l,className:u("absolute block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",y&&w===L&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${D(H)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${D(H)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:S=>T(S,L),onPointerMove:k,onPointerUp:M,onPointerCancel:M,onKeyDown:S=>E(S,L)},L)),d&&b.map((H,L)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${L}]`:d,value:H},L))]})});Za.displayName="Slider";var qu=W.createContext(null),Zu=()=>{let e=W.useContext(qu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Gi=W.createContext(null),Qu=()=>{let e=W.useContext(Gi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Ju=W.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=W.useState(()=>t==="single"?r?[r]:[]:r||[]),f=W.useRef(new Map),p=W.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=w=>{if(t==="single"){let x=h.includes(w)&&a?[]:[w];g||m(x),o?.(x[0]||"");}else {let C=h.includes(w)?h.filter(x=>x!==w):[...h,w];g||m(C),o?.(C);}},v=W.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),y=W.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),R=W.useCallback(w=>{let C=p.current;if(C.length===0)return;let x=document.activeElement,N;f.current.forEach((E,D)=>{E===x&&(N=D);});let T=N?C.indexOf(N):-1,k;switch(w){case "first":k=0;break;case "last":k=C.length-1;break;case "next":k=T===-1?0:(T+1)%C.length;break;case "prev":k=T===-1?C.length-1:(T-1+C.length)%C.length;break}let M=C[k];f.current.get(M)?.focus();},[]);return jsx(qu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:y,focusTrigger:R},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Ju.displayName="Accordion";var em=W.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Zu(),d=c.value.includes(t),m=n||c.disabled||false,f=W.useId(),p=W.useId();return r!==void 0?jsx(Gi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:[jsx(tm,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:r}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(nm,{children:s})]})}):jsx(Gi.Provider,{value:{value:t,isOpen:d,isDisabled:m,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":m?"":void 0,className:u("border-b",m&&"opacity-50",e),...i,children:s})})});em.displayName="AccordionItem";var tm=W.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Zu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=Qu(),f=W.useRef(null);W.useEffect(()=>{let g=f.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let p=g=>{switch(r?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{f.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:m,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:u("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{n?.(g),s.onValueChange(i);},onKeyDown:p,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});tm.displayName="AccordionTrigger";var nm=W.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Qu();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:n,...r,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});nm.displayName="AccordionContent";var om=W.createContext(null),am=()=>{let e=W.useContext(om);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},sm=W.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=W.useState(n),m=t!==void 0,f=m?t:c,p=W.useId(),g=W.useId(),h=b=>{o||(m||d(b),r?.(b));};return jsx(om.Provider,{value:{open:f,onOpenChange:h,disabled:o,contentId:p,triggerId:g},children:jsxs("div",{ref:l,"data-state":f?"open":"closed","data-disabled":o?"":void 0,className:u("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx($i,{})]}),s]})})});sm.displayName="Collapsible";var $i=W.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=am();return jsx("button",{ref:o,type:"button",id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",e),onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:"h-4 w-4"})})});$i.displayName="CollapsibleTrigger";var im=W.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=am(),c=W.useRef(null),[d,m]=W.useState(void 0),[f,p]=W.useState(false),[g,h]=W.useState(a);W.useEffect(()=>{a?(h(true),p(true),requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);})):(p(true),m(0));},[a]);let b=()=>{p(false),a||h(false),m(void 0);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:u("overflow-hidden",e),style:{...n,height:f?d!==void 0?d:"auto":a?"auto":0,transition:f?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:b,...r,children:jsx("div",{ref:c,children:t})}):null});im.displayName="CollapsibleContent";var es=W.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=l=>`${Math.round(l)}%`,...s},i)=>{let l=Math.min(Math.max(t/n*100,0),100);return jsxs("div",{ref:i,className:"w-full",children:[(r||o)&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:u("text-muted-foreground",!r&&"ml-auto"),children:a(l)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...s,children:jsx("div",{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-l}%)`}})})]})});es.displayName="Progress";var um=W.createContext(null),mm=()=>{let e=W.useContext(um);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},pm=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=W.useState(n),c=t!==void 0,d=c?t:i,m=W.useRef(null),f=W.useId(),p=W.useRef(null),g=W.useRef(null),h=W.useCallback(b=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),b?p.current=setTimeout(()=>{c||l(true),r?.(true);},o):g.current=setTimeout(()=>{c||l(false),r?.(false);},a);},[c,r,o,a]);return W.useEffect(()=>{if(!s||!d)return;let b=()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",b,true),()=>window.removeEventListener("scroll",b,true)},[s,d,c,r]),W.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(um.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};pm.displayName="HoverCard";var fm=W.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=mm();return jsx("a",{ref:p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p);},onMouseEnter:p=>{t?.(p),i(true);},onMouseLeave:p=>{n?.(p),i(false);},onFocus:p=>{r?.(p),i(true);},onBlur:p=>{o?.(p),i(false);},...a,children:e})});fm.displayName="HoverCardTrigger";var gm=W.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:m,triggerRef:f,contentId:p}=mm(),[g,h]=W.useState({top:0,left:0}),[b,v]=W.useState(false),y=W.useRef(null);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!d||!f.current||!y.current)return;(()=>{if(!f.current||!y.current)return;let N=f.current.getBoundingClientRect(),T=y.current.getBoundingClientRect(),k=0,M=0;switch(t){case "top":k=N.top-T.height-n;break;case "bottom":k=N.bottom+n;break;case "left":M=N.left-T.width-n;break;case "right":M=N.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":M=N.left+o;break;case "center":M=N.left+N.width/2-T.width/2;break;case "end":M=N.right-T.width-o;break}else switch(r){case "start":k=N.top+o;break;case "center":k=N.top+N.height/2-T.height/2;break;case "end":k=N.bottom-T.height-o;break}h({top:k,left:M});})();},[d,t,n,r,o,f]);let R=x=>{a?.(x),m(true);},w=x=>{s?.(x),m(false);};if(!b||!d)return null;let C={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Ya.createPortal(jsx("div",{ref:x=>{y.current=x,typeof c=="function"?c(x):c&&(c.current=x);},id:p,"data-state":d?"open":"closed","data-side":t,className:u("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{top:g.top,left:g.left},onMouseEnter:R,onMouseLeave:w,...l,children:i}),document.body)});gm.displayName="HoverCardContent";var bm=W.createContext({size:"md",variant:"default",radius:"md"}),ns=()=>W.useContext(bm);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var Z0=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),Q0=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),J0=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),vm=W.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(bm.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));vm.displayName="Breadcrumb";var hm=W.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=ns();return jsx("ol",{ref:n,className:u(Z0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});hm.displayName="BreadcrumbList";var xm=W.forwardRef(({className:e,...t},n)=>{let{size:r}=ns();return jsx("li",{ref:n,className:u("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});xm.displayName="BreadcrumbItem";var ym=W.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));ym.displayName="BreadcrumbLink";var Rm=W.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:u("font-medium text-foreground",e),...t}));Rm.displayName="BreadcrumbPage";var wm=({children:e,className:t,...n})=>{let{size:r}=ns();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(Q0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};wm.displayName="BreadcrumbSeparator";var Cm=({className:e,...t})=>{let{size:n}=ns();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(J0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Cm.displayName="BreadcrumbEllipsis";var Nm=W.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:u("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));Nm.displayName="AspectRatio";var Em=W.createContext(null),Wi=()=>{let e=W.useContext(Em);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Lm=W.createContext(null),Sm=()=>{let e=W.useContext(Lm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Dm=W.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=W.useState(null);return jsx(Em.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:u("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(_i,{})]})})});Dm.displayName="NavigationMenu";var Hm=W.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Wi();return jsx("ul",{ref:n,className:u("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Hm.displayName="NavigationMenuList";var Im=W.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=Wi(),s=W.useId(),i=W.useRef(null),l=o===s,c=W.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Lm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});Im.displayName="NavigationMenuItem";var Vm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),Am=W.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Sm(),c=m=>{n?.(m),l(true);},d=m=>{r?.(m),l(!i);};return jsxs("button",{ref:m=>{s.current=m,typeof a=="function"?a(m):a&&(a.current=m);},type:"button","data-state":i?"open":"closed",className:u(Vm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});Am.displayName="NavigationMenuTrigger";var zm=W.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Sm(),l=W.useRef(null),[c,d]=W.useState({top:0,left:0});W.useEffect(()=>{if(!a||!i.current)return;let p=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,true),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,true);}},[a,i]);let m=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Ya.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:m,onMouseLeave:f,...r}),document.body):null});zm.displayName="NavigationMenuContent";var Om=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),Bm=W.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(Om(),t&&"bg-accent text-accent-foreground",e),...n}));Bm.displayName="NavigationMenuLink";var _i=W.forwardRef((e,t)=>null);_i.displayName="NavigationMenuViewport";var Fm=W.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=Wi();return r?jsx("div",{ref:n,className:u("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});Fm.displayName="NavigationMenuIndicator";var Um=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted",solid:"bg-muted hover:bg-muted/80",ghost:"hover:bg-accent hover:text-accent-foreground",light:"hover:bg-muted/50",outline:"border border-input hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{variant:"default",size:"md"}}),_o=W.forwardRef(({className:e,variant:t,size:n,iconSize:r,...o},a)=>{let i=r??{sm:14,md:16,lg:20}[n??"md"];return jsx("button",{ref:a,type:"button",className:u(Um({variant:t,size:n}),e),"aria-label":"Close",...o,children:jsx(X,{style:{width:i,height:i}})})});_o.displayName="CloseButton";var rs=W.createContext(null);function dw(){let e=W.useContext(rs);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Xn(){return W.useContext(rs)}var uw="16rem",mw="18rem",pw="3rem",fw="b",gw={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},bw={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Yi=W.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:n,placement:r="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:m,children:f,...p},g)=>{let h=c??"overlay",b=h==="overlay",[v,y]=W.useState(false),[R,w]=W.useState(false),[C,x]=W.useState(e),N=t??C,T=W.useCallback(E=>{let D=typeof E=="function"?E(N):E;n?n(D):x(D);},[n,N]);W.useEffect(()=>{let E=()=>{y(window.innerWidth<768);};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);let k=W.useCallback(()=>b?T(E=>!E):v?w(E=>!E):T(E=>!E),[v,T,w,b]);W.useEffect(()=>{if(b)return;let E=D=>{D.key===fw&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),k());};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[k,b]);let M=N?"expanded":"collapsed",P=W.useMemo(()=>({placement:r,state:M,open:N,setOpen:T,isMobile:v,openMobile:R,setOpenMobile:w,toggleDrawer:k,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,M,N,T,v,R,w,k,l,h,o,a,s,i]);return b?jsx(rs.Provider,{value:P,children:jsx(Drawer.Root,{open:N,onOpenChange:T,direction:r,dismissible:s,children:f})}):jsx(rs.Provider,{value:P,children:jsx($n,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":uw,"--drawer-width-icon":pw,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Yi.displayName="Drawer";var _m=W.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Xn();if(!s)return jsx("div",{ref:a,className:u("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:m,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:u("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",n),...o,children:r});if(c&&!t)return jsx(vw,{open:m,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:u("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:u("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",h?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":b&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:r})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:u("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:u("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",n),...o,children:jsx("div",{"data-drawer":"drawer",className:u("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:r})})]})});_m.displayName="DrawerSidebar";var vw=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=W.useState(false);return W.useEffect(()=>{a(true);},[]),W.useEffect(()=>{if(t)return dt(),()=>ut()},[t]),!o||!t?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("div",{className:u("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",r==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":mw},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Ym=W.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Xn();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:r,className:e,onClick:t,...n});let a=o?.toggleDrawer;return jsxs("button",{ref:r,type:"button","data-drawer":"trigger",className:u("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});Ym.displayName="DrawerTrigger";var jm=W.forwardRef(({className:e,children:t,...n},r)=>{let o=Xn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque",c=o?.hideCloseButton||false;if(a){let d=s==="top"||s==="bottom",m=s==="left"||s==="right",f=m?gw[i]:bw[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},g={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:u("fixed inset-0 z-50",p[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",g[s],e),style:{...m?{width:f,height:"100%"}:{},...d?{maxHeight:f}:{},...n.style},...n,children:[m&&!c&&jsx(Drawer.Close,{asChild:true,children:jsx(_o,{variant:"light",className:"absolute right-4 top-4 z-10"})}),d&&jsx("div",{className:u("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:r,className:u("flex flex-col h-full",e),...n,children:t})});jm.displayName="DrawerContent";var Xm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"header",className:u("flex flex-col gap-2 p-4",e),...t}));Xm.displayName="DrawerHeader";var qm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:u("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));qm.displayName="DrawerBody";var Zm=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:u("flex flex-col gap-2 p-4 mt-auto",e),...t}));Zm.displayName="DrawerFooter";var Qm=W.forwardRef(({className:e,...t},n)=>Xn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Qm.displayName="DrawerTitle";var Jm=W.forwardRef(({className:e,...t},n)=>Xn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:u("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Jm.displayName="DrawerDescription";var ep=W.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Xn();return o?.mode==="overlay"?jsx(Drawer.Close,{ref:r,className:e,onClick:t,...n}):jsx(_o,{ref:r,variant:"light",className:e,onClick:s=>{t?.(s),o?.setOpen(false);},...n})});ep.displayName="DrawerClose";var tp=W.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Xn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",m=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:u("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:p=>{t?.(p),s();},...r,children:[c?jsx(m,{className:"h-4 w-4 shrink-0"}):jsx(f,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});tp.displayName="DrawerToggle";var np=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));np.displayName="DrawerSeparator";var rp=W.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:u("flex w-full min-w-0 flex-col gap-1",e),...t}));rp.displayName="DrawerMenu";var op=W.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));op.displayName="DrawerMenuItem";var ap=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--border))] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),sp=W.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Xn(),c=l?.isMobile??false,d=l?.state??"expanded",m=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:u(ap({variant:t,size:n}),o),...s,children:a});return r?jsxs(Un,{children:[jsx(Wn,{children:m}),jsx(_n,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});sp.displayName="DrawerMenuButton";var ip=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:u("relative flex w-full min-w-0 flex-col p-2",e),...t}));ip.displayName="DrawerGroup";var lp=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:u("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));lp.displayName="DrawerGroupLabel";var cp=W.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:u("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));cp.displayName="DrawerInset";var hw=Yi;var up=W.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:u("w-full caption-bottom text-sm",e),...t})}));up.displayName="Table";var mp=W.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));mp.displayName="TableHeader";var pp=W.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));pp.displayName="TableBody";var fp=W.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));fp.displayName="TableFooter";var gp=W.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:u("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));gp.displayName="TableRow";var bp=W.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));bp.displayName="TableHead";var vp=W.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));vp.displayName="TableCell";var hp=W.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));hp.displayName="TableCaption";function Tw({className:e,data:t,columns:n,selectable:r=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(w,C)=>String(C),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:m=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:b=false,hoverable:v=true,...y},R){let[w,C]=W.useState(new Set),[x,N]=W.useState({columnId:null,direction:null}),[T,k]=W.useState({pageIndex:0,pageSize:m[0]||10}),M=o??w,P=l??x,E=f??T,D=G=>{a?a(G):C(G);},H=G=>{c?c(G):N(G);},L=G=>{p?p(G):k(G);},S=W.useMemo(()=>{if(!P.columnId||!P.direction)return t;let G=n.find(O=>O.id===P.columnId);return G?[...t].sort((O,_)=>{let A=G.accessor(O),Y=G.accessor(_);if(A===Y)return 0;if(A==null)return 1;if(Y==null)return -1;let se=String(A).localeCompare(String(Y),void 0,{numeric:true});return P.direction==="asc"?se:-se}):t},[t,P,n]),V=W.useMemo(()=>{if(!d)return S;let G=E.pageIndex*E.pageSize;return S.slice(G,G+E.pageSize)},[S,d,E]),z=Math.ceil(S.length/E.pageSize),F=G=>{if(G===true){let O=new Set(V.map((_,A)=>s(_,A)));D(O);}else D(new Set);},I=(G,O)=>{let _=new Set(M);O?_.add(G):_.delete(G),D(_);},K=V.length>0&&V.every((G,O)=>M.has(s(G,O))),B=V.some((G,O)=>M.has(s(G,O))),q=G=>{if(!n.find(A=>A.id===G)?.sortable&&!i)return;let _="asc";P.columnId===G&&(P.direction==="asc"?_="desc":P.direction==="desc"&&(_=null)),H({columnId:_?G:null,direction:_});},ne=G=>P.columnId!==G?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):P.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:R,className:u("w-full",e),...y,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(Ko,{checked:K?true:B?"indeterminate":false,onCheckedChange:F,"aria-label":"Select all"})}),n.map(G=>{let O=G.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",O&&"cursor-pointer select-none hover:text-foreground"),style:{width:G.width},onClick:()=>O&&q(G.id),children:jsxs("div",{className:"flex items-center gap-2",children:[G.header,O&&ne(G.id)]})},G.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:h?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):V.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):V.map((G,O)=>{let _=s(G,O),A=M.has(_);return jsxs("tr",{className:u("border-b transition-colors",v&&"hover:bg-muted/50",b&&O%2===1&&"bg-muted/30",A&&"bg-muted"),"data-state":A?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Ko,{checked:A,onCheckedChange:Y=>I(_,!!Y),"aria-label":`Select row ${O+1}`})}),n.map(Y=>jsx("td",{className:"p-4 align-middle",children:Y.cell?Y.cell(G,O):Y.accessor(G)},Y.id))]},_)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:E.pageSize,onChange:G=>L({pageIndex:0,pageSize:Number(G.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(G=>jsx("option",{value:G,children:G},G))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",E.pageIndex+1," of ",z||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(oe,{variant:"light",size:"icon",className:"h-8 w-8",onClick:()=>L({...E,pageIndex:E.pageIndex-1}),disabled:E.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"light",size:"icon",className:"h-8 w-8",onClick:()=>L({...E,pageIndex:E.pageIndex+1}),disabled:E.pageIndex>=z-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var Mw=W.forwardRef(Tw);var ji=["January","February","March","April","May","June","July","August","September","October","November","December"];function Dw({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let[o,a]=W.useState(false),[s,i]=W.useState(false),l=W.useRef(null),c=W.useRef(null),d=getMonth(e),m=getYear(e);W.useEffect(()=>{function h(b){l.current&&!l.current.contains(b.target)&&a(false),c.current&&!c.current.contains(b.target)&&i(false);}return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);let f=h=>{let b=setMonth(e,h);t(b),a(false);},p=h=>{let b=setYear(e,h);t(b),i(false);},g=W.useMemo(()=>{let h=[];for(let b=r;b>=n;b--)h.push(b);return h},[n,r]);return jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{ref:l,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>{a(!o),i(false);},className:u("inline-flex items-center justify-between gap-2 px-3 py-1.5 rounded-md","text-sm font-medium w-[120px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer",o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[jsx("span",{children:ji[d]}),jsx(ChevronDown,{className:u("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-180")})]}),o&&jsx("div",{className:"absolute top-full left-0 mt-1 z-50 min-w-[140px] rounded-md border border-border bg-background shadow-lg",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:ji.map((h,b)=>jsx("button",{type:"button",onClick:()=>f(b),className:u("w-full text-left px-3 py-2 text-sm rounded-md","hover:bg-muted transition-colors cursor-pointer",d===b&&"bg-primary/10 text-primary font-medium"),children:h},h))})})})]}),jsxs("div",{ref:c,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>{i(!s),a(false);},className:u("inline-flex items-center justify-between gap-2 px-3 py-1.5 rounded-md","text-sm font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer",s&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[jsx("span",{children:m}),jsx(ChevronDown,{className:u("h-4 w-4 text-muted-foreground transition-transform",s&&"rotate-180")})]}),s&&jsx("div",{className:"absolute top-full left-0 mt-1 z-50 min-w-[100px] rounded-md border border-border bg-background shadow-lg",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:g.map(h=>jsx("button",{type:"button",onClick:()=>p(h),className:u("w-full text-left px-3 py-2 text-sm rounded-md","hover:bg-muted transition-colors cursor-pointer",m===h&&"bg-primary/10 text-primary font-medium"),children:h},h))})})})]})]})}function Hw(e,t,n){return function({calendarMonth:o}){let{goToMonth:a,nextMonth:s,previousMonth:i}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsx(Dw,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]});let l=ji[o.date.getMonth()],c=o.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 h-10 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium w-[90px]",children:l}),jsx("span",{className:"text-sm font-medium w-[50px]",children:c})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-8 w-8 inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}}function so({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=W.useMemo(()=>Hw(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:u("p-4",e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground w-10 font-normal text-xs text-center",week:"flex w-full mt-1",day:u("relative h-10 w-10 p-0 text-center text-sm","flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:u("size-10 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10 hover:text-primary","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:u("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:bg-transparent [&.outside-day]:text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0},outside:{backgroundColor:"transparent"}},components:{...s,MonthCaption:l},...i})}so.displayName="Calendar";var wp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});wp.displayName="Pagination";var Cp=W.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));Cp.displayName="PaginationContent";var Tp=W.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));Tp.displayName="PaginationItem";var os=({className:e,isActive:t,size:n="icon",...r})=>jsx("a",{"aria-current":t?"page":void 0,className:u(bn({variant:t?"solid":"light",size:n}),e),...r});os.displayName="PaginationLink";var Mp=({className:e,...t})=>jsxs(os,{"aria-label":"Go to previous page",size:"md",className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});Mp.displayName="PaginationPrevious";var Np=({className:e,...t})=>jsxs(os,{"aria-label":"Go to next page",size:"md",className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Np.displayName="PaginationNext";var kp=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:u("flex h-9 w-9 items-center justify-center",e),...t,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});kp.displayName="PaginationEllipsis";var Zi=W.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:u("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zi.displayName=Command.displayName;var Ow=({children:e,...t})=>jsx(Va,{...t,children:jsx(Aa,{className:"overflow-hidden p-0 shadow-lg",children:jsx(Zi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Pp=W.forwardRef(({className:e,...t},n)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:n,className:u("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Pp.displayName=Command.Input.displayName;var Ep=W.forwardRef(({className:e,...t},n)=>jsx(Command.List,{ref:n,className:u("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ep.displayName=Command.List.displayName;var Lp=W.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Lp.displayName=Command.Empty.displayName;var Sp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:u("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Sp.displayName=Command.Group.displayName;var Dp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Dp.displayName=Command.Separator.displayName;var Hp=W.forwardRef(({className:e,...t},n)=>jsx(Command.Item,{ref:n,className:u("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Hp.displayName=Command.Item.displayName;var Ip=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ip.displayName="CommandShortcut";var Vp=W.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,...s},i)=>{let[l,c]=W.useState(false),[d,m]=W.useState(false);return jsxs("div",{className:"relative",children:[jsx("input",{type:l?"text":"password",className:u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",t&&"pr-10",e),ref:i,disabled:n,style:{...a,borderColor:d?"var(--color-foreground)":void 0},onFocus:f=>{m(true),r?.(f);},onBlur:f=>{m(false),o?.(f);},...s}),t&&jsx("button",{type:"button",className:"absolute right-0 top-0 h-10 w-10 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>c(!l),disabled:n,tabIndex:-1,"aria-label":l?"Hide password":"Show password",children:l?jsx(EyeOff,{className:"h-4 w-4"}):jsx(Eye,{className:"h-4 w-4"})})]})});Vp.displayName="PasswordInput";var Ap=W.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,...c},d)=>{let[m,f]=W.useState(s),[p,g]=W.useState(false),h=a!==void 0,b=h?a:m,v=T=>{T!==void 0&&(r!==void 0&&T<r&&(T=r),o!==void 0&&T>o&&(T=o)),h||f(T),i?.(T);},y=()=>{v((b??0)+n);},R=()=>{v((b??0)-n);},w=T=>{let k=T.target.value;if(k==="")v(void 0);else {let M=parseFloat(k);isNaN(M)||v(M);}},C=T=>{T.key==="ArrowUp"?(T.preventDefault(),y()):T.key==="ArrowDown"&&(T.preventDefault(),R());},x=r===void 0||(b??0)>r,N=o===void 0||(b??0)<o;return t?jsxs("div",{className:u("relative flex items-center rounded-md border transition-colors",p?"border-foreground":"border-input",l&&"opacity-50",e),children:[jsx("button",{type:"button",className:"h-10 w-10 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:R,disabled:l||!x,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:"h-4 w-4"})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:"min-w-0 flex-1 h-10 bg-background text-sm text-center focus:outline-none disabled:cursor-not-allowed",ref:d,value:b??"",onChange:w,onKeyDown:C,disabled:l,onFocus:()=>g(true),onBlur:()=>g(false),...c}),jsx("button",{type:"button",className:"h-10 w-10 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:y,disabled:l||!N,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:"h-4 w-4"})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex h-10 w-full bg-background px-3 py-2 text-sm text-center border rounded-md placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",p?"border-foreground":"border-input",e),ref:d,value:b??"",onChange:w,onKeyDown:C,disabled:l,onFocus:()=>g(true),onBlur:()=>g(false),...c})});Ap.displayName="NumberInput";var Op=W.forwardRef(({value:e,defaultValue:t,onValueChange:n,placeholder:r="Pick a date",dateFormat:o="PPP",disabled:a=false,minDate:s,maxDate:i,className:l},c)=>{let[d,m]=W.useState(false),[f,p]=W.useState(t),g=e!==void 0,h=g?e:f,b=v=>{g||p(v),n?.(v),m(false);};return jsxs(nt,{open:d,onOpenChange:m,children:[jsxs(Lt,{ref:c,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!h&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",l),children:[jsx(Calendar,{className:"h-4 w-4"}),h?format(h,o):r]}),jsx(rt,{className:"w-auto p-0",align:"start",children:jsx(so,{mode:"single",selected:h,onSelect:b,disabled:v=>!!(s&&v<s||i&&v>i),initialFocus:true})})]})});Op.displayName="DatePicker";var Gp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Bp=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),$p=W.forwardRef(({className:e,items:t,max:n=5,size:r,showTooltips:o=false,...a},s)=>{let i=t.slice(0,n),l=t.length-n,c=(m,f)=>{let p=jsxs(wr,{className:u(Bp({size:r})),children:[m.src&&jsx(Jr,{src:m.src,alt:m.alt||""}),jsx(Cr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Un,{children:[jsx(Wn,{children:p}),jsx(_n,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:m.alt})]},f):p},d=jsxs("div",{ref:s,className:u(Gp({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(wr,{className:u(Bp({size:r})),children:jsxs(Cr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx($n,{delayDuration:300,children:d}):d});$p.displayName="AvatarGroup";var Up=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),Wp=W.forwardRef(({className:e,value:t,defaultValue:n=0,onValueChange:r,max:o=5,size:a,icon:s="star",allowHalf:i=false,readOnly:l=false,disabled:c=false,filledColor:d,emptyColor:m,...f},p)=>{let[g,h]=W.useState(n),[b,v]=W.useState(null),y=t!==void 0,R=y?t:g,w=b!==null?b:R,C=D=>{l||c||(y||h(D),r?.(D));},x=(D,H=false)=>{let L=i&&H?D+.5:D+1;C(L);},N=(D,H)=>{if(l||c)return;let L=D.currentTarget.getBoundingClientRect(),S=i&&D.clientX<L.left+L.width/2;v(S?H+.5:H+1);},T=()=>{v(null);},k=s==="heart"?Heart:Star,M=D=>w>=D+1?"full":w>=D+.5?"half":"empty",P=d?{color:d,fill:d}:{},E=m?{color:m}:{};return jsx("div",{ref:p,className:u(Up({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:T,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(D,H)=>{let L=M(H);return jsxs("button",{type:"button",className:u("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:S=>{let V=S.currentTarget.getBoundingClientRect(),z=i&&S.clientX<V.left+V.width/2;x(H,z);},onMouseMove:S=>N(S,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":R===H+1,children:[jsx(k,{className:u("text-muted-foreground/30",L!=="empty"&&"absolute inset-0"),style:L==="empty"?E:void 0}),L!=="empty"&&jsx(k,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",L==="half"&&"clip-path-half"),style:{...P,clipPath:L==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});Wp.displayName="Rating";var jp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"border-transparent text-primary-foreground",outline:"border bg-transparent",ghost:"border-transparent bg-transparent",soft:"border-transparent",surface:"border-transparent bg-muted text-muted-foreground"},color:{primary:"",secondary:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"solid",color:"success",className:"bg-success hover:bg-success/90"},{variant:"solid",color:"warning",className:"bg-warning text-warning-foreground hover:bg-warning/90"},{variant:"solid",color:"danger",className:"bg-danger hover:bg-danger/90"},{variant:"solid",color:"info",className:"bg-info hover:bg-info/90"},{variant:"outline",color:"primary",className:"border-primary text-primary hover:bg-primary/10"},{variant:"outline",color:"secondary",className:"border-secondary text-secondary-foreground hover:bg-secondary/10"},{variant:"outline",color:"success",className:"border-success text-success hover:bg-success/10"},{variant:"outline",color:"warning",className:"border-warning text-warning hover:bg-warning/10"},{variant:"outline",color:"danger",className:"border-danger text-danger hover:bg-danger/10"},{variant:"outline",color:"info",className:"border-info text-info hover:bg-info/10"},{variant:"ghost",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"ghost",color:"secondary",className:"text-secondary-foreground hover:bg-secondary"},{variant:"ghost",color:"success",className:"text-success hover:bg-success/10"},{variant:"ghost",color:"warning",className:"text-warning hover:bg-warning/10"},{variant:"ghost",color:"danger",className:"text-danger hover:bg-danger/10"},{variant:"ghost",color:"info",className:"text-info hover:bg-info/10"},{variant:"soft",color:"primary",className:"bg-primary/15 text-primary hover:bg-primary/20"},{variant:"soft",color:"secondary",className:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},{variant:"soft",color:"success",className:"bg-success/15 text-success hover:bg-success/20"},{variant:"soft",color:"warning",className:"bg-warning/15 text-warning hover:bg-warning/20"},{variant:"soft",color:"danger",className:"bg-danger/15 text-danger hover:bg-danger/20"},{variant:"soft",color:"info",className:"bg-info/15 text-info hover:bg-info/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),Jw=cva("ml-1 rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/10",{variants:{size:{sm:"[&_svg]:size-3",md:"[&_svg]:size-3.5",lg:"[&_svg]:size-4"}},defaultVariants:{size:"md"}}),Xp=W.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,avatar:m,children:f,onClick:p,...g},h)=>{let b=a||!!p,v=y=>{y.stopPropagation(),c?.();};return jsxs("div",{ref:h,role:b?"button":void 0,tabIndex:b&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:p,onKeyDown:b&&!d?y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p?.(y));}:void 0,className:u(jp({variant:t,color:n,size:r,radius:o,clickable:b}),d&&"opacity-50 cursor-not-allowed",e),...g,children:[m&&jsx("span",{className:"-ml-1 [&>*]:size-5 [&>*]:rounded-full",children:m}),s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:f}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx("button",{type:"button","aria-label":"Remove",onClick:v,disabled:d,className:u(Jw({size:r})),children:jsx(X,{})})]})});Xp.displayName="Chip";var qp=createContext({direction:"horizontal"}),iC=({className:e,direction:t="horizontal",children:n,...r})=>jsx(qp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:u("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),lC=Panel,cC=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(qp),o=r==="vertical";return jsx(Separator,{className:u("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...n,children:e&&jsx("div",{className:u("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var ef=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),uC={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Zp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},tf=W.forwardRef(({className:e,size:t="md",color:n="default",value:r,max:o=100,showValue:a=false,formatValue:s=d=>`${Math.round(d)}%`,trackClassName:i,...l},c)=>{let d=Math.min(100,Math.max(0,r/o*100)),m=uC[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(ef({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:m.size,height:m.size,viewBox:`0 0 ${m.size} ${m.size}`,fill:"none",children:[jsx("circle",{className:u("stroke-muted",i),cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:f,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Zp[n]||Zp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:u("absolute font-medium text-foreground",m.fontSize),children:s(d)})]})});tf.displayName="CircularProgress";var nf=W.createContext(null),fC=()=>{let e=W.useContext(nf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},rf=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),of=W.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,children:d,...m},f)=>{let[p,g]=W.useState(o),[h,b]=W.useState(0),[v,y]=W.useState(false),R=W.useRef(null),w=r!==void 0?r:p;W.useImperativeHandle(f,()=>R.current),W.useEffect(()=>{b(Math.min(w.length,n-1));},[w,n]),W.useEffect(()=>{w.length===n&&s&&s(w);},[w,n,s]);let C=P=>{let E=P.target.value;if(i&&E){let D=new RegExp(i.replace("^","").replace("$","").replace("+",""));E=E.split("").filter(H=>D.test(H)).join("");}E=E.slice(0,n),r===void 0&&g(E),a?.(E);},x=P=>{P.key==="ArrowLeft"?b(E=>Math.max(0,E-1)):P.key==="ArrowRight"&&b(E=>Math.min(w.length,n-1,E+1));},N=()=>{R.current?.focus();},T=()=>{y(true),b(Math.min(w.length,n-1));},k=()=>{y(false);},M={value:w,activeIndex:v?h:-1,maxLength:n,disabled:l};return jsx(nf.Provider,{value:M,children:jsxs("div",{className:u(rf({size:c}),t),onClick:N,"data-otp-container":true,children:[jsx("input",{ref:R,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:w,onChange:C,onKeyDown:x,onFocus:T,onBlur:k,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...m}),d]})})});of.displayName="InputOTP";var af=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));af.displayName="InputOTPGroup";var sf=W.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s}=fC(),i=o[e]||"",l=a===e,c=l&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":l,"data-filled":!!i,className:u("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[i,c&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});sf.displayName="InputOTPSlot";var lf=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));lf.displayName="InputOTPSeparator";var uf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900",bordered:"border-2 border-zinc-300 bg-transparent dark:border-zinc-600",light:"bg-transparent text-zinc-800 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800",flat:"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-white",ghost:"border-2 border-zinc-800 bg-transparent dark:border-white"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),mf=W.forwardRef(({className:e,variant:t,size:n,value:r=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,disabled:m,readOnly:f,renderTag:p,...g},h)=>{let[b,v]=W.useState(""),y=W.useRef(null);W.useImperativeHandle(h,()=>y.current);let R=M=>{let P=M.trim();if(P.length<i||P.length>l||s&&r.length>=s||!d&&r.some(D=>D.text.toLowerCase()===P.toLowerCase()))return;let E={id:crypto.randomUUID(),text:P};o?.([...r,E]),v("");},w=M=>{m||f||o?.(r.filter(P=>P.id!==M));},C=M=>{if(c.includes(M.key)){if(M.key==="Tab"&&!b)return;M.preventDefault(),R(b);}M.key==="Backspace"&&!b&&r.length>0&&w(r[r.length-1].id);},x=M=>{let P=M.target.value;if(P.includes(",")){P.split(",").forEach(D=>{D.trim()&&R(D);});return}v(P);},N=M=>{M.preventDefault(),M.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(D=>{R(D);});},T=()=>{y.current?.focus();},k=s?r.length>=s:false;return jsxs("div",{className:u("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",m&&"cursor-not-allowed opacity-50",e),onClick:T,children:[r.map(M=>p?p(M,()=>w(M.id)):jsxs("span",{className:u(uf({variant:t,size:n})),children:[M.text,!m&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),w(M.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${M.text}`,children:jsx(X,{className:"h-3 w-3"})})]},M.id)),!k&&!f&&jsx("input",{ref:y,type:"text",value:b,onChange:x,onKeyDown:C,onPaste:N,placeholder:r.length===0?a:"",disabled:m,className:u("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});mf.displayName="TagInput";var ff=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),gf=W.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(ff({size:t,className:e})),...i,children:[n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:n}),r&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:r}),o&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:o}),a&&jsx("div",{className:"mt-2",children:a}),s]}));gf.displayName="EmptyState";var vf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border-2 border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border-2 border-zinc-900 bg-transparent dark:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),hf=W.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let m=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,f=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:u(vf({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:u("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:u("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:u("flex items-center gap-0.5 text-sm",f),children:[jsx(m,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:u("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});hf.displayName="StatCard";var nl=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),MC=({checked:e,disabled:t,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:r=>{r.stopPropagation(),t||n(r);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function NC({className:e,variant:t,size:n,items:r,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:m,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:b=[],onCheck:v,children:y,...R},w){let[C,x]=W.useState(null),[N,T]=W.useState(null),[k,M]=W.useState(new Set(f)),P=m!==void 0,E=P?new Set(m):k,[D,H]=W.useState(new Set(b)),L=h!==void 0,S=L?new Set(h):D,V=(O,_)=>{x(_),O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",String(_));},z=(O,_)=>{O.preventDefault(),!(C===null||C===_)&&T(_);},F=()=>{T(null);},I=(O,_)=>{if(O.preventDefault(),!r||C===null||C===_){x(null),T(null);return}let A=[...r],[Y]=A.splice(C,1);A.splice(_,0,Y),s?.(A),x(null),T(null);},K=()=>{x(null),T(null);},B=W.useCallback((O,_)=>{if(!r)return;let A=new Set(E),Y=!A.has(O.id);d?Y?A.add(O.id):A.delete(O.id):(A.clear(),Y&&A.add(O.id)),P||M(A);let se=r.filter(Ce=>A.has(Ce.id));p?.(Array.from(A),{selected:Y,selectedItems:se,item:O,event:_});},[r,E,d,P,p]),q=W.useCallback((O,_)=>{if(!r)return;let A=new Set(S),Y=!A.has(O.id);Y?A.add(O.id):A.delete(O.id),L||H(A);let se=r.filter(Ce=>A.has(Ce.id));v?.(Array.from(A),{checked:Y,checkedItems:se,item:O,event:_});},[r,S,L,v]);return (a||c||g)&&r&&o?jsx("div",{ref:w,role:"list",className:u(nl({variant:t,size:n,className:e})),...R,children:r.map((O,_)=>{let A=E.has(O.id),Y=S.has(O.id);return jsxs("div",{role:"listitem","aria-selected":c?A:void 0,draggable:a,onDragStart:a?U=>V(U,_):void 0,onDragOver:a?U=>z(U,_):void 0,onDragLeave:a?F:void 0,onDrop:a?U=>I(U,_):void 0,onDragEnd:a?K:void 0,onClick:c&&!g?U=>B(O,U):void 0,className:u("flex items-center gap-3 transition-all",a&&"cursor-move",c&&!g&&"cursor-pointer hover:bg-muted/50",g&&"cursor-pointer hover:bg-muted/50",C===_&&"opacity-50 scale-[1.02] z-10",N===_&&"border-primary border-dashed border rounded-md",A&&c&&!g&&"bg-primary/10"),children:[a&&i&&l!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(MC,{checked:Y,onClick:U=>q(O,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,_)})]},O.id)})}):jsx("div",{ref:w,role:"list",className:u(nl({variant:t,size:n,className:e})),...R,children:y})}var kC=W.forwardRef(NC),yf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Rf=W.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(yf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"flex-shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"flex-shrink-0 whitespace-nowrap",children:r})]}));Rf.displayName="ListItem";var wf=W.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:u("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),n&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:n}),r]}));wf.displayName="ListItemText";var Mf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Nf=W.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(Mf({position:t,className:e})),...n}));Nf.displayName="Timeline";var kf=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Pf=W.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(kf({variant:t,className:e})),...s,children:[!n&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!r&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Pf.displayName="TimelineItem";var Ef=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));Ef.displayName="TimelineContent";var Lf=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Lf.displayName="TimelineOpposite";var Df=cva("inline-flex items-center rounded-lg bg-muted p-1 text-muted-foreground",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Hf=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 text-xs px-2.5",md:"h-8 text-sm px-3",lg:"h-10 text-base px-4"},selected:{true:"bg-background text-foreground shadow-sm",false:""}},defaultVariants:{size:"md",selected:false}}),If=W.createContext({}),Vf=W.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=W.useState(a),f=o!==void 0?o:d,p=W.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(If.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(Df({size:t,fullWidth:n,className:e})),...l,children:r})})});Vf.displayName="SegmentedControl";var Af=W.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=W.useContext(If),i=s.value===n,l=r||s.disabled;return jsx("button",{ref:a,type:"button",role:"radio","aria-checked":i,"data-state":i?"on":"off",disabled:l,onClick:()=>{l||s.onValueChange?.(n);},className:u(Hf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});Af.displayName="SegmentedControlItem";var zf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),Of=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},cs=e=>{if(e===0)return "0 Bytes";let t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},Bf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${cs(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},Ff=W.forwardRef(({className:e,variant:t,size:n,onFilesChange:r,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:m=true,disabled:f,...p},g)=>{let[h,b]=W.useState(false),[v,y]=W.useState(false),[R,w]=W.useState([]),C=W.useRef(null),x=W.useCallback(S=>{if(!S||S.length===0)return;let V=Array.from(S),z=[],F=[];(m?V:[V[0]]).forEach(K=>{let B=Bf(K,c,d);B.length>0?F.push({file:K,errors:B}):z.push(K);}),w(F),z.length>0&&r?.(z),F.length>0&&o?.(F);},[c,d,m,r,o]),N=W.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!f&&(b(true),S.dataTransfer.items)){let z=Array.from(S.dataTransfer.items).some(F=>{if(F.kind!=="file")return true;if(d&&d.length>0){let I=F.type;return !d.some(K=>K.endsWith("/*")?I.startsWith(K.slice(0,-2)):I===K)}return false});y(z);}},[f,d]),T=W.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!f&&(S.dataTransfer.dropEffect="copy");},[f]),k=W.useCallback(S=>{S.preventDefault(),S.stopPropagation();let V=S.currentTarget.getBoundingClientRect(),z=S.clientX,F=S.clientY;(z<V.left||z>V.right||F<V.top||F>V.bottom)&&(b(false),y(false));},[]),M=W.useCallback(S=>{S.preventDefault(),S.stopPropagation(),b(false),y(false),!f&&x(S.dataTransfer.files);},[f,x]),P=W.useCallback(()=>{f||C.current?.click();},[f]),E=W.useCallback(S=>{x(S.target.files),S.target.value="";},[x]),D=W.useCallback(S=>{f||(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),C.current?.click());},[f]),H=v?"error":h?"active":t,L=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:N,onDragOver:T,onDragLeave:k,onDrop:M,onClick:P,onKeyDown:D,className:u(zf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:L,multiple:m,disabled:f,onChange:E,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:"rounded-full bg-muted p-3",children:jsx(Upload,{className:"h-6 w-6 text-muted-foreground"})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:"text-sm font-medium",children:h?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[c&&`Max ${cs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),R.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:R.map(({file:S,errors:V})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:S.name}),":"," ",V.map(z=>z.message).join(", ")]},S.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(S=>{let V=Of(S.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",S.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(V,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:S.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[cs(S.file.size),S.error&&jsx("span",{className:"ml-2 text-danger",children:S.error})]}),S.progress!==void 0&&S.progress<100&&jsx(es,{value:S.progress,className:"mt-2 h-1"})]}),jsxs(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:z=>{z.stopPropagation(),a?.(S.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},S.id)})})]})});Ff.displayName="FileUpload";var zC=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Gf=cva("relative rounded-md border border-input shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),ta=W.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,...d},m)=>jsx("button",{ref:m,type:"button",disabled:c,onClick:g=>{l?.(g),r?.(e);},className:u(Gf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-ring ring-offset-2",i),style:{backgroundImage:n?zC:void 0,backgroundSize:n?"8px 8px":void 0},"aria-label":`Color ${e}`,"aria-pressed":t,...d,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));ta.displayName="ColorSwatch";var $f=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Uf=W.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,className:c,style:d,...m},f)=>{let[p,g]=W.useState(t),h=e??p,b=W.useCallback(y=>{l||(e===void 0&&g(y),n?.(y));},[e,n,l]),v=y=>y.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:u($f({layout:r}),c),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...d},...m,children:a.map(y=>{let R=h?v(h)===v(y):false;return jsx(ta,{role:"option",color:y,size:s,shape:i,isSelected:R,onSelect:b,disabled:l,"aria-selected":R},y)})})});Uf.displayName="ColorSwatchPicker";var FC=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Wf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},_f=W.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=FC,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=W.useState(e??t),f=W.useId();W.useEffect(()=>{e!==void 0&&m(e);},[e]);let p=b=>{m(b),n?.(b);},g=b=>{m(b),n?.(b);},h=b=>{let v=b.target.value.toUpperCase();m(v),n?.(v);};return l==="simple"?jsxs("label",{className:u("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",r&&"opacity-50 cursor-not-allowed",Wf[s],i),children:[jsx("input",{type:"color",value:d,onChange:h,disabled:r,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:f}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(nt,{children:[jsx(Lt,{ref:c,disabled:r,className:u("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Wf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(rt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:p,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Rr,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:p,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm uppercase ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Rr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(ta,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});_f.displayName="ColorPicker";var Yf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),al=e=>String(e).padStart(2,"0"),WC=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},_C=(e,t)=>`${al(e)}:${al(t)}`,jf=W.forwardRef(({className:e,size:t,value:n,onChange:r,use24Hour:o=true,minuteStep:a=1,showPicker:s=true,minTime:i,maxTime:l,disabled:c,...d},m)=>{let[f,p]=W.useState(n??""),[g,h]=W.useState(false);W.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=WC(f||"00:00"),y=k=>{let M=k.target.value;p(M),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(M)&&r?.(M);},R=(k,M)=>{let P=Math.max(0,Math.min(23,k)),E=Math.max(0,Math.min(59,M)),D=_C(P,E);p(D),r?.(D);},w=()=>R(b+1,v),C=()=>R(b-1,v),x=()=>R(b,v+a),N=()=>R(b,v-a),T=({value:k,onIncrement:M,onDecrement:P})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:M,disabled:c,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:al(k)}),jsx(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:P,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:m,type:"time",value:f,onChange:y,disabled:c,className:u(Yf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(nt,{open:g,onOpenChange:h,children:[jsxs(Lt,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(rt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(T,{value:b,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(T,{value:v,onIncrement:x,onDecrement:N,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:()=>{let k=new Date;R(k.getHours(),k.getMinutes());},children:"Now"}),jsx(oe,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});jf.displayName="TimeInput";var Xf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),jC=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},sl=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},qf=(e,t,n)=>{if(!e)return;let r=e.replace(new RegExp(`\\${t}`,"g"),"");r=r.replace(n,"."),r=r.replace(/[^0-9.-]/g,"");let o=parseFloat(r);return isNaN(o)?void 0:o},Zf=W.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:m="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",disabled:h,placeholder:b,...v},y)=>{let[R,w]=W.useState(r),[C,x]=W.useState(""),[N,T]=W.useState(false),k=n!==void 0?n:R,M=f??jC(a,s);W.useEffect(()=>{!N&&k!==void 0&&x(sl(k,i,p,g));},[k,i,p,g,N]);let P=S=>{let V=S.target.value;if(!V){x(""),n===void 0&&w(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(V))return;x(V);let F=qf(V,p,g);if(F!==void 0){let I=F;l!==void 0&&F<l&&(I=l),c!==void 0&&F>c&&(I=c),n===void 0&&w(I),o?.(I);}},E=()=>{T(true),k!==void 0&&x(k.toString().replace(".",g));},D=()=>{T(false),x(k!==void 0?sl(k,i,p,g):"");},H=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:M}),L=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:M});return jsxs("div",{className:"relative flex items-center",children:[H&&jsx("div",{className:"absolute left-3 pointer-events-none",children:H}),jsx("input",{ref:y,type:"text",inputMode:"decimal",value:C,onChange:P,onFocus:E,onBlur:D,disabled:h,placeholder:b??`0${g}${"0".repeat(i)}`,className:u(Xf({size:t}),H&&"pl-8",L&&"pr-8","text-right",e),style:{borderColor:N?"var(--color-foreground)":void 0},...v}),L&&jsx("div",{className:"absolute right-3 pointer-events-none",children:L})]})});Zf.displayName="CurrencyInput";var Qf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},ZC=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},er=e=>["#","A","*"].includes(e),us=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(er(s)){if(o<e.length){let i=e[o];ZC(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},ll=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];er(o)&&(n+=e[r]);}return n},Jf=(e,t)=>e.split("").map(n=>er(n)?t:n).join(""),QC=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)er(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,er(t[i])&&s++;for(;a<t.length&&!er(t[a]);)a++;return Math.min(a,e.length)},eg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,disabled:c,placeholder:d,...m},f)=>{let p=typeof a=="string"&&a in il?il[a].mask:a,[g,h]=W.useState(r),[b,v]=W.useState(""),[y,R]=W.useState(false),w=W.useRef(null),C=n!==void 0?n:g;W.useImperativeHandle(f,()=>w.current),W.useEffect(()=>{let k=us(C,p,true);v(k);},[C,p]);let x=k=>{let M=k.target.value,P=k.target.selectionStart??0,E=M.replace(/[^\w]/g,""),D=us(E,p,true),H=ll(D,p);v(D),n===void 0&&h(l?D:H),o?.(H,D),requestAnimationFrame(()=>{if(w.current){let L=QC(D,p,P);w.current.setSelectionRange(L,L);}});},N=k=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(k.key)||k.ctrlKey||k.metaKey)return;let M=w.current;if(!M)return;let P=M.selectionStart??0;if(k.key==="Backspace"&&P>0){let E=P-1;for(;E>0&&!er(p[E]);)E--;let D=ll(b,p),H=0;for(let V=0;V<E&&V<p.length;V++)er(p[V])&&H++;let L=D.slice(0,Math.max(0,H-1))+D.slice(H),S=us(L,p,true);v(S),n===void 0&&h(l?S:L),o?.(L,S),k.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(E,E);});}},T=i?Jf(p,s):d;return jsx("input",{ref:w,type:"text",value:b,onChange:x,onKeyDown:N,onFocus:()=>R(true),onBlur:()=>R(false),disabled:c,placeholder:T,className:u(Qf({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...m})});eg.displayName="MaskedInput";var tg=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),fs={"DD/MM/YYYY":"/","MM/DD/YYYY":"/","YYYY-MM-DD":"-","DD.MM.YYYY":"."},dl={"DD/MM/YYYY":["day","month","year"],"MM/DD/YYYY":["month","day","year"],"YYYY-MM-DD":["year","month","day"],"DD.MM.YYYY":["day","month","year"]},cl=(e,t)=>String(e).padStart(t,"0"),ps=(e,t)=>{let n=cl(e.getDate(),2),r=cl(e.getMonth()+1,2),o=cl(e.getFullYear(),4),a=fs[t],s=dl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},ng=(e,t)=>{let n=fs[t],r=e.split(n);if(r.length!==3)return null;let o=dl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},nT=e=>e.toLowerCase(),rT=e=>{let t=fs[e];return dl[e].map(r=>r==="year"?"####":"##").join(t)},rg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,format:a="DD/MM/YYYY",minDate:s,maxDate:i,showIcon:l=true,disabled:c,placeholder:d,...m},f)=>{let[p,g]=W.useState(r??null),[h,b]=W.useState(""),[v,y]=W.useState(null),R=W.useRef(null),w=n!==void 0?n:p;W.useImperativeHandle(f,()=>R.current),W.useEffect(()=>{w?(b(ps(w,a)),y(null)):b("");},[w,a]);let C=fs[a],x=rT(a),N=M=>{let P=M.target.value;P=P.replace(new RegExp(`[^0-9\\${C}]`,"g"),"");let E=P.replace(new RegExp(`\\${C}`,"g"),""),D="",H=0;for(let L=0;L<x.length&&H<E.length;L++)x[L]==="#"?(D+=E[H],H++):D+=x[L];if(b(D),D.length===x.length){let L=ng(D,a);if(L){if(s&&L<s){y(`Date must be after ${ps(s,a)}`);return}if(i&&L>i){y(`Date must be before ${ps(i,a)}`);return}y(null),n===void 0&&g(L),o?.(L);}else y("Invalid date");}else n===void 0&&g(null),o?.(null),y(null);},T=()=>{h&&h.length!==x.length&&(b(""),y(null),n===void 0&&g(null),o?.(null));},k=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4";return jsxs("div",{className:"relative",children:[jsx("input",{ref:R,type:"text",inputMode:"numeric",value:h,onChange:N,onBlur:T,disabled:c,placeholder:d??nT(a),className:u(tg({size:t}),l&&"pr-10",v&&"border-danger focus-visible:ring-danger",e),"aria-invalid":!!v,"aria-describedby":v?"date-error":void 0,...m}),l&&jsx("div",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2",children:jsx(Calendar,{className:u(k,"text-muted-foreground")})}),v&&jsx("p",{id:"date-error",className:"mt-1 text-xs text-danger",children:v})]})});rg.displayName="DateInput";var ag=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),sg=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],gs=(e,t)=>{let n=e.replace(/\D/g,""),r="",o=0;for(let a=0;a<t.length&&o<n.length;a++)t[a]==="#"?(r+=n[o],o++):r+=t[a];return r},lT=e=>e.replace(/#/g,"_"),ig=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=sg,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,...p},g)=>{let[h,b]=W.useState(r),[v,y]=W.useState(a??s),[R,w]=W.useState(false),[C,x]=W.useState(false),[N,T]=W.useState(false),[k,M]=W.useState({top:0,left:0,width:0}),P=W.useRef(null),E=W.useRef(null),D=n!==void 0?n:h,H=a??v,L=l.find(I=>I.code===H)??l[0],S=gs(D,L.format);W.useEffect(()=>{T(true);},[]),W.useEffect(()=>{if(C&&P.current){let I=P.current.getBoundingClientRect();M({top:I.bottom+4,left:I.left,width:Math.max(I.width,280)});}},[C]),W.useEffect(()=>{if(!C)return;let I=K=>{P.current&&!P.current.contains(K.target)&&E.current&&!E.current.contains(K.target)&&x(false);};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[C]),W.useEffect(()=>{if(!C)return;let I=K=>{K.key==="Escape"&&x(false);};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[C]);let V=I=>{let B=I.target.value.replace(/\D/g,"");n===void 0&&b(B);let q=gs(B,L.format),ne=`${L.dialCode} ${q}`;o?.(B,ne,L);},z=I=>{let K=l.find(ne=>ne.code===I);if(!K)return;a===void 0&&y(I),i?.(K);let B=gs(D,K.format),q=`${K.dialCode} ${B}`;o?.(D,q,K),x(false);};return jsxs("div",{className:"flex",children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:P,type:"button",disabled:m,onClick:()=>x(!C),className:u("flex items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","w-[100px] rounded-r-none border-r-0 shrink-0",t==="sm"?"h-8":t==="lg"?"h-12":"h-10"),children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:L.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:L.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",C&&"rotate-180")})]}),N&&C&&Ya.createPortal(jsx("div",{ref:E,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(ze,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(I=>jsxs("div",{role:"option","aria-selected":I.code===H,onClick:()=>z(I.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.code===H&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:I.flag}),jsx("span",{className:"flex-1",children:I.name}),jsx("span",{className:"text-xs text-muted-foreground",children:I.dialCode})]})]},I.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:L.dialCode}),jsx("input",{ref:g,type:"tel",inputMode:"tel",value:S,onChange:V,onFocus:()=>w(true),onBlur:()=>w(false),disabled:m,placeholder:f??lT(L.format),className:u(ag({size:t}),c&&"rounded-l-none",d&&!c&&"pl-12",e),style:{borderColor:R?"var(--color-foreground)":void 0},...p})]})]})});ig.displayName="PhoneInput";var cg=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"outline",size:"md",sticky:false}}),dg=W.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=W.useState(false),m={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],f={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:u(cg({variant:t,size:n,sticky:r,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:u("items-center gap-4 flex-1 justify-end",m),children:a}),jsx("button",{type:"button",className:u("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",f),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:u("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",f),children:a})]})});dg.displayName="Navbar";var ug=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));ug.displayName="NavbarBrand";var mg=W.forwardRef(({className:e,justify:t="start",...n},r)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:r,className:u("flex items-center gap-4",o,e),...n})});mg.displayName="NavbarContent";var pg=W.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));pg.displayName="NavbarItem";var fg=W.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:u("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));fg.displayName="NavbarLink";var bg=cva("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"text-primary-foreground bg-primary px-2 py-0.5 rounded hover:bg-primary/90",outline:"text-primary underline-offset-4 hover:underline",ghost:"text-foreground hover:text-primary",soft:"text-primary bg-primary/10 px-2 py-0.5 rounded hover:bg-primary/20",surface:"text-foreground bg-muted px-2 py-0.5 rounded hover:bg-muted/80"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},underline:{none:"",hover:"hover:underline underline-offset-4",always:"underline underline-offset-4"}},defaultVariants:{variant:"outline",size:"md",underline:"hover"}}),vg=W.forwardRef(({className:e,variant:t,size:n,underline:r,isExternal:o,showExternalIcon:a=true,isDisabled:s,children:i,...l},c)=>{let d=o?{target:"_blank",rel:"noopener noreferrer"}:{};return jsxs("a",{ref:c,className:u(bg({variant:t,size:n,underline:r,className:e}),s&&"pointer-events-none opacity-50"),"aria-disabled":s,...d,...l,children:[i,o&&a&&jsx(ExternalLink,{className:"h-3 w-3 ml-0.5","aria-hidden":"true"})]})});vg.displayName="Link";var hg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),xg=W.forwardRef(({className:e,position:t,threshold:n=400,icon:r,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:m,...f},p)=>{let[g,h]=W.useState(false);W.useEffect(()=>{let y=c?.current||window,R=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return y.addEventListener("scroll",R,{passive:true}),R(),()=>{y.removeEventListener("scroll",R);}},[n,c,g,d]);let b=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),m?.(y);},v=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:u(hg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(oe,{ref:p,type:"button",variant:a,color:s,size:"icon",radius:l,onClick:b,"aria-label":"Back to top",className:u("shadow-lg",i==="sm"&&"h-9 w-9",i==="md"&&"h-10 w-10",i==="lg"&&"h-12 w-12"),...f,children:r||jsx(ArrowUp,{className:v})})})});xg.displayName="BackTop";var wT=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),CT=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),yg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),hs=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),Rg=W.createContext(null),nr=()=>{let e=W.useContext(Rg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},wg=W.createContext(null),ra=()=>{let e=W.useContext(wg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},ml=W.createContext(null),Cg=W.createContext(null),Tg=W.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=W.useState(null);return jsx(Rg.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:u("flex h-10 items-center space-x-1 border bg-background p-1",wT({radius:n}),e),...r,children:t})})});Tg.displayName="Menubar";var Mg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=nr(),r=W.useId(),o=W.useRef(null),a=t===r,s=W.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(wg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Mg.displayName="MenubarMenu";var Ng=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Ng.displayName="MenubarGroup";var kg=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};kg.displayName="MenubarPortal";var Pg=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=W.useState(n),s=t!==void 0,i=s?t:o,l=W.useRef(null),c=W.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(ml.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Pg.displayName="MenubarSub";var Eg=W.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Cg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Eg.displayName="MenubarRadioGroup";var Lg=W.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=nr(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=ra(),f=g=>{t?.(g),m(!d);},p=g=>{n?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:u("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",CT({radius:i}),e),onClick:f,onMouseEnter:p,...r})});Lg.displayName="MenubarTrigger";var Sg=W.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=nr(),l=W.useContext(ml);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:m}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{m.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:u("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",hs({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Sg.displayName="MenubarSubTrigger";var Dg=W.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=nr(),i=W.useContext(ml);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let R=d.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=R.top,x=R.right+t;x+w.width>window.innerWidth&&(x=R.left-w.width-t),f({top:C,left:x});})();},[l,t,d]);let b=y=>{n?.(y),c(true);},v=y=>{r?.(y),c(false);};return !p||!l?null:Ya.createPortal(jsx("div",{ref:y=>{h.current=y,typeof a=="function"?a(y):a&&(a.current=y);},role:"menu","data-state":l?"open":"closed",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",yg({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});Dg.displayName="MenubarSubContent";var Hg=W.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=nr(),{triggerRef:l,open:c,onOpenChange:d}=ra(),[m,f]=W.useState({top:0,left:0}),[p,g]=W.useState(false),h=W.useRef(null);return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!c||!l.current||!h.current)return;let b=()=>{if(!l.current||!h.current)return;let v=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),R=v.bottom+r,w=v.left+n;t==="center"?w=v.left+v.width/2-y.width/2:t==="end"&&(w=v.right-y.width-n),f({top:R,left:w});};return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,true),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,true);}},[c,t,n,r,l]),W.useEffect(()=>{if(!c)return;let b=v=>{let y=v.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),W.useEffect(()=>{if(!c)return;let b=v=>{v.key==="Escape"&&d(false);};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[c,d]),!p||!c?null:Ya.createPortal(jsx("div",{ref:b=>{h.current=b,typeof s=="function"?s(b):s&&(s.current=b);},role:"menu","data-state":c?"open":"closed",className:u("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",yg({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});Hg.displayName="MenubarContent";var Ig=W.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=ra(),c=d=>{if(n){d.preventDefault();return}o?.(d),r?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:u("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});Ig.displayName="MenubarItem";var Vg=W.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=nr(),{onOpenChange:c}=ra(),d=m=>{if(o){m.preventDefault();return}a?.(m),r?.(!n),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Vg.displayName="MenubarCheckboxItem";var Ag=W.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=ra(),c=W.useContext(Cg),d=c?.value===n,m=f=>{if(r){f.preventDefault();return}o?.(f),c?.onValueChange(n),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":d?"checked":"unchecked",className:u("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",hs({radius:i}),!r&&"cursor-pointer",e),onClick:m,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ag.displayName="MenubarRadioItem";var zg=W.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));zg.displayName="MenubarLabel";var Og=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Og.displayName="MenubarSeparator";var Bg=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Bg.displayName="MenubarShortcut";var Fg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Kg=W.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=W.Children.toArray(o);return jsx("div",{ref:s,className:u(Fg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>W.isValidElement(l)?W.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<r?"completed":c===r?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:n}):l)})});Kg.displayName="Steps";var Gg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),MT=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),NT=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),$g=W.forwardRef(({className:e,orientation:t="horizontal",size:n="md",title:r,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:u(Gg({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:u("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:u(MT({status:s,size:n})),children:s==="completed"?jsx(Check,{className:n==="sm"?"h-3 w-3":n==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(r||o)&&jsxs("div",{className:"flex flex-col",children:[r&&jsx("span",{className:u("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:u("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:u(NT({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));$g.displayName="Step";var Wg=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),_g=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Yg=W.createContext(null),IT=()=>{let e=W.useContext(Yg);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},VT=({checked:e,indeterminate:t,disabled:n,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:n,onClick:o=>{o.stopPropagation(),n||r(o);},className:u("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",n&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),jg=({node:e,level:t,isLast:n=false,parentIsLastPath:r=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:m,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:b,dragOverPosition:v,setDragOver:y,handleDrop:R,allowDrop:w,onDragStart:C,onDragOver:x,onDragEnter:N,onDragLeave:T,onDragEnd:k,showLine:M,showIcon:P,showHandle:E,dragIcon:D,icon:H,leafIcon:L,folderIcon:S,folderOpenIcon:V,blockNode:z,disabled:F,size:I,getAllKeys:K}=IT(),B=e.children&&e.children.length>0,q=e.isLeaf??!B,ne=o.has(e.key),G=s.has(e.key),O=c.has(e.key),_=d.has(e.key),A=g?.key===e.key,Y=b===e.key,se=!!(F||e.disabled),Ce=l&&e.selectable!==false,U=f&&e.checkable!==false,ct=W.useMemo(()=>se?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,se]),ee=W.useMemo(()=>D!==void 0?D:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[D,p]),tt=W.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:ne,isLeaf:q}):H:q?L:ne?V:S,[e.icon,H,ne,q,L,S,V]),On=j=>{if(!ct)return;j.stopPropagation(),j.dataTransfer.effectAllowed="move";let Se=j.currentTarget,le=Se.cloneNode(true),Ge=document.documentElement.classList.contains("dark"),$e=Ge?"#0a0a0a":"#ffffff",Fn=Ge?"#27272a":"#e4e4e7";le.style.cssText=`
44
44
  position: fixed;
45
45
  top: -9999px;
46
46
  left: -9999px;
@@ -52,7 +52,7 @@ import*as W from'react';import {createContext,useContext,useCallback,useState,us
52
52
  width: ${Se.offsetWidth}px;
53
53
  opacity: 1;
54
54
  z-index: 9999;
55
- `,document.body.appendChild(le),j.dataTransfer.setDragImage(le,20,15),setTimeout(()=>{document.body.removeChild(le);},0),h(e),C?.({event:j,node:e});},bt=j=>{if(j.preventDefault(),j.stopPropagation(),!g||g.key===e.key||se)return;let Se=j.currentTarget.getBoundingClientRect(),le=j.clientY-Se.top,Ge=Se.height,$e;le<Ge*.25?$e=-1:le>Ge*.75?$e=1:$e=0,!(x&&!x({dropNode:e,dropPosition:$e,dragNode:g}))&&(R(e.key,$e),y?.({event:j,node:e}));},br=j=>{j.preventDefault(),j.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:j,node:e,expandedKeys:K()});},Bn=j=>{j.stopPropagation(),T?.({event:j,node:e});},Bo=j=>{j.preventDefault(),j.stopPropagation(),!(!g||g.key===e.key||se)&&(v!==null&&w(e,v),h(null),R(null,null));},Ft=j=>{h(null),R(null,null),k?.({event:j,node:e});},Ea=j=>{se||Ce&&i(e.key,e,j);},vr=j=>{j.stopPropagation(),!se&&!q&&a(e.key,e);},$=W.useMemo(()=>{if(!Y||v===null)return "";switch(v){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[Y,v]),re=[...r,n];return jsxs("div",{className:"relative",children:[M&&t>0&&jsxs(Fragment,{children:[r.map((j,Se)=>!j&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Se} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Se)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":q?void 0:ne,"aria-selected":Ce?G:void 0,"aria-disabled":se,draggable:ct,onDragStart:On,onDragOver:bt,onDragEnter:br,onDragLeave:Bn,onDrop:Bo,onDragEnd:Ft,onClick:Ea,className:u("relative",_g({size:I,isSelected:G,isDragging:A,isDisabled:se,isHoverable:Ce&&!se}),$,z&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[ct&&E&&ee!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:ee}),jsx("button",{type:"button",onClick:vr,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",q&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",ne&&"rotate-90")})}),U&&jsx(VT,{checked:O,indeterminate:_,disabled:se,onClick:j=>m(e.key,e,j)}),P&&tt&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:tt}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",z&&"flex-none"),children:e.label})]}),B&&ne&&jsx("div",{role:"group",children:e.children.map((j,Se)=>jsx(jg,{node:j,level:t+1,isLast:Se===e.children.length-1,parentIsLastPath:re},j.key))})]})},AT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},zT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},Xg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Xg(n,t))return true;return false},qg=W.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:R=[],onCheck:w,showLine:x=false,showIcon:C=false,showHandle:y=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:M=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:E,onDragEnter:D,onDragOver:H,onDragLeave:L,onDragEnd:S,onDrop:V,blockNode:z=false,disabled:F=false,...I},K)=>{let B=W.useCallback(()=>l?new Set(AT(r)):new Set(i),[l,i,r]),[q,ne]=W.useState(B),G=s!==void 0,O=G?new Set(s):q,_=W.useCallback((pe,We)=>{let Kt=new Set(O),Ve=!Kt.has(pe);Ve?Kt.add(pe):Kt.delete(pe),G||ne(Kt),c?.(Array.from(Kt),{expanded:Ve,node:We});},[O,G,c]),[A,Y]=W.useState(new Set(p)),se=f!==void 0,Ce=se?new Set(f):A,U=W.useCallback((pe,We,Kt)=>{let Ve=new Set(Ce),gn=!Ve.has(pe);m?gn?Ve.add(pe):Ve.delete(pe):(Ve.clear(),gn&&Ve.add(pe)),se||Y(Ve);let Yr=[],Fo=La=>{for(let jr of La)Ve.has(jr.key)&&Yr.push(jr),jr.children&&Fo(jr.children);};Fo(r),g?.(Array.from(Ve),{selected:gn,selectedNodes:Yr,node:We,event:Kt});},[Ce,m,se,g,r]),[ct,ee]=W.useState(new Set(R)),[tt,On]=W.useState(new Set),bt=v!==void 0,br=bt?new Set(Array.isArray(v)?v:v.checked):ct,Bn=bt&&!Array.isArray(v)?new Set(v.halfChecked):tt,Bo=W.useCallback((pe,We,Kt)=>{let Ve=new Set(br),gn=new Set(Bn),Yr=!Ve.has(pe);if(Yr?(Ve.add(pe),gn.delete(pe)):Ve.delete(pe),!b&&We.children){let Ri=zT(We);for(let Kn of Ri)Yr?(Ve.add(Kn),gn.delete(Kn)):Ve.delete(Kn);}bt||(ee(Ve),On(gn));let Fo=[],La=Ri=>{for(let Kn of Ri)Ve.has(Kn.key)&&Fo.push(Kn),Kn.children&&La(Kn.children);};La(r);let jr=b?{checked:Array.from(Ve),halfChecked:Array.from(gn)}:Array.from(Ve);w?.(jr,{checked:Yr,checkedNodes:Fo,node:We,event:Kt,halfCheckedKeys:Array.from(gn)});},[br,Bn,b,bt,w,r]),[Ft,Ea]=W.useState(null),[vr,$]=W.useState(null),[re,j]=W.useState(null),Se=W.useCallback((pe,We)=>{$(pe),j(We);},[]),le=W.useCallback((pe,We)=>{!Ft||!V||We===0&&Xg(Ft,pe.key)||V({event:{},node:pe,dragNode:Ft,dropPosition:We,dropToGap:We!==0});},[Ft,V]),Ge=W.useCallback(()=>Array.from(O),[O]),$e={expandedKeys:O,toggleExpand:_,selectedKeys:Ce,handleSelect:U,selectable:d,multiple:m,checkedKeys:br,halfCheckedKeys:Bn,handleCheck:Bo,checkable:h,checkStrictly:b,draggable:o,draggedNode:Ft,setDraggedNode:Ea,dragOverKey:vr,dragOverPosition:re,setDragOver:Se,handleDrop:le,allowDrop:a,onDragStart:E,onDragEnter:D,onDragOver:H,onDragLeave:L,onDragEnd:S,showLine:x,showIcon:C,showHandle:y,dragIcon:N,icon:T,leafIcon:k,folderIcon:M,folderOpenIcon:P,blockNode:z,disabled:F,size:n,data:r,getAllKeys:Ge},Fn=pe=>{let We=pe.relatedTarget,Kt=pe.currentTarget;(!We||!Kt.contains(We))&&Se(null,null);};return jsx(Yg.Provider,{value:$e,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":m||h,className:u(Wg({variant:t,size:n,className:e})),onDragLeave:Fn,...I,children:r.map((pe,We)=>jsx(jg,{node:pe,level:0,isLast:We===r.length-1},pe.key))})})});qg.displayName="Tree";var Qg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),$T=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},UT=(e,t)=>{let[n,r]=W.useState(e);return W.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},Jg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:R,...w},x)=>{let[C,y]=W.useState(false),[N,T]=W.useState(r),[k,M]=W.useState([]),[P,E]=W.useState(false),[D,H]=W.useState(false),[L,S]=W.useState(0),V=W.useRef(null),z=W.useRef(null),F=n!==void 0?n:N,I=UT(F,l);W.useEffect(()=>{let U=z.current;if(!U)return;let ct=()=>{S(U.offsetWidth);};ct();let ee=new ResizeObserver(ct);return ee.observe(U),()=>{ee.disconnect();}},[]),W.useImperativeHandle(x,()=>V.current);let K=i?k:s,B=W.useMemo(()=>i?K:K.filter(U=>U.label.toLowerCase().includes(F.toLowerCase())),[K,F,i]);W.useEffect(()=>{if(!i)return;if(I.length<c){M([]);return}let U=false;return (async()=>{E(true);try{let ee=await i(I);U||M(ee);}catch{U||M([]);}finally{U||E(false);}})(),()=>{U=true;}},[I,i,c]);let q=U=>{n===void 0&&T(U),o?.(U);},ne=U=>{let ct=U.target.value;q(ct),ct.length>=c&&y(true);},G=U=>{q(U.label),a?.(U),y(false);},O=()=>{q(""),V.current?.focus();},_=()=>{H(true),y(true);},A=()=>{H(false);},Y=U=>{U.key==="Escape"&&y(false),U.key==="ArrowDown"&&!C&&B.length>0&&y(true);},se=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ce=p&&F?"pr-8":"pr-3";return jsxs(nt,{open:C,onOpenChange:y,children:[jsxs(oo,{ref:z,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:F,onChange:ne,onFocus:_,onBlur:A,onKeyDown:Y,disabled:R,placeholder:d,className:u(Qg({size:t,fullWidth:v}),Ce,e),style:{borderColor:D?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...w}),p&&F&&!R&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:se})})]}),jsx(rt,{className:"p-0",align:"start",style:{width:L>0?L:void 0},onOpenAutoFocus:U=>U.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(ze,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(se,"animate-spin")}),f]}):B.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):B.map(U=>jsxs(Command.Item,{value:U.value,disabled:U.disabled,onSelect:()=>G(U),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",F===U.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx($T,{text:U.label,query:F}):U.label})]},U.value))})})})})]})});Jg.displayName="Autocomplete";var vl=W.createContext(null),hl=W.createContext(null),xl=()=>{let e=W.useContext(vl);if(!e)throw new Error("useFormContext must be used within a Form");return e},Rs=()=>{let e=W.useContext(hl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},WT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},eb=W.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=W.useState(e),[m,f]=W.useState({}),[p,g]=W.useState({}),[h,b]=W.useState({}),[v,R]=W.useState(false),w=W.useRef(new Map),x=W.useCallback((L,S)=>{w.current.set(L,S);},[]),C=W.useCallback(L=>{w.current.delete(L);},[]),y=W.useCallback(L=>{let S=w.current.get(L)||[],V=c[L];for(let z of S)if(!z.validate(V))return f(F=>({...F,[L]:z.message})),false;return f(z=>({...z,[L]:null})),true},[c]),N=W.useCallback(()=>{let L=true,S={};return w.current.forEach((V,z)=>{let F=c[z];for(let I of V)if(!I.validate(F)){S[z]=I.message,L=false;break}S[z]||(S[z]=null);}),f(S),L},[c]),T=W.useCallback((L,S)=>{d(V=>({...V,[L]:S})),b(V=>({...V,[L]:true})),o&&setTimeout(()=>{y(L);},0);},[o,y]),k=W.useCallback((L,S)=>{f(V=>({...V,[L]:S}));},[]),M=W.useCallback((L,S)=>{g(V=>({...V,[L]:S})),S&&r&&y(L);},[r,y]),P=W.useCallback(L=>({value:c[L],error:m[L]??null,touched:p[L]??false,dirty:h[L]??false}),[c,m,p,h]),E=W.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),D=async L=>{L.preventDefault();let S={};if(w.current.forEach((z,F)=>{S[F]=true;}),g(S),!N()){n?.(m);return}if(t){R(true);try{await t(c);}finally{R(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:T,setError:k,setTouched:M,validateField:y,validateAll:N,registerField:x,unregisterField:C,getFieldState:P,reset:E};return jsx(vl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:D,className:u("space-y-4",s),...i,children:a})})});eb.displayName="Form";var tb=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=xl(),a=W.useId();W.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(hl.Provider,{value:i,children:r})};tb.displayName="FormField";var nb=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));nb.displayName="FormItem";var rb=W.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Rs();return jsxs(Rr,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});rb.displayName="FormLabel";var ob=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Rs(),a=xl(),s=a.getFieldState(t),i=c=>{let d=c.target,m=d.type==="checkbox"?d.checked:d.value;a.setValue(t,m);},l=()=>{a.setTouched(t,true);};return W.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};ob.displayName="FormControl";var ab=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));ab.displayName="FormDescription";var sb=W.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=Rs(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...n,children:i}):null});sb.displayName="FormMessage";var lb=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),cb=W.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(lb({size:t,className:e})),...i,children:[jsxs(wr,{"data-user-avatar":true,children:[o&&jsx(Jr,{src:o,alt:n}),jsx(Cr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});cb.displayName="User";var ub=cva("font-mono rounded",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-transparent",ghost:"bg-transparent",soft:"bg-muted text-foreground",surface:"bg-muted/50 text-foreground border border-border"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"}},defaultVariants:{variant:"soft",size:"md"}}),mb=W.forwardRef(({className:e,variant:t,size:n,...r},o)=>jsx("code",{ref:o,className:u(ub({variant:t,size:n,className:e})),...r}));mb.displayName="Code";var pb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-transparent border-input",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),fb=W.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=W.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(pb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":m?"Copied":a,children:m?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});fb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),gb=W.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=W.useState("loading");W.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},v={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:u(wl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(wl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Ga,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:b,className:u("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...m})]})});gb.displayName="Image";var hb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),xb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),yb=W.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),Rb=W.forwardRef(({className:e,size:t="md",value:n,defaultValue:r="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=W.useState(r),m=n??c,f=p=>{let g;if(a){let h=Array.isArray(m)?m:[m].filter(Boolean);h.includes(p)?g=h.filter(b=>b!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(yb.Provider,{value:{value:m,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:u(hb({size:t,className:e})),...i,children:s})})});Rb.displayName="Listbox";var wb=W.forwardRef(({className:e,value:t,disabled:n,icon:r,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:m}=W.useContext(yb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{n||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!n&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":n?"":void 0,tabIndex:n?-1:0,className:u(xb({size:m}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[r&&jsx("span",{className:"mr-2 flex-shrink-0",children:r}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});wb.displayName="ListboxItem";var Tb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Mb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function oM({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=W.useState(null),[f,p]=W.useState(null),g=(w,x)=>{i||(m(x),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",String(x)));},h=(w,x)=>{w.preventDefault(),!(i||d===null||d===x)&&p(x);},b=()=>{p(null);},v=(w,x)=>{if(w.preventDefault(),i||d===null||d===x){m(null),p(null);return}let C=[...r],[y]=C.splice(d,1);C.splice(x,0,y),o?.(C),m(null),p(null);},R=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(Tb({variant:t,size:n,className:e})),...l,children:r.map((w,x)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,x),onDragOver:C=>h(C,x),onDragLeave:b,onDrop:C=>v(C,x),onDragEnd:R,className:u(Mb({variant:t,size:n,isDragging:d===x,isDragOver:f===x}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(w,x)})]},w.id))})}var aM=W.forwardRef(oM);var Pb=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),cM={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Eb=W.forwardRef(({className:e,variant:t,loading:n=true,size:r="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u("relative",e),...i,children:[s,jsx("div",{className:u(Pb({variant:t,visible:n})),"aria-hidden":!n,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:u(cM[r],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Eb.displayName="LoadingOverlay";var Lb=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Sb=W.forwardRef(({className:e,color:t,isLoading:n=false,progress:r,showSpinner:o=false,...a},s)=>{let[i,l]=W.useState(0),[c,d]=W.useState(false),m=W.useRef(null);return W.useEffect(()=>{if(r!==void 0){l(r),d(r>0&&r<100);return}return n?(d(true),l(10),m.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{m.current&&clearInterval(m.current);}},[n,r]),!c&&r===void 0||r!==void 0&&(r<=0||r>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:u(Lb({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:u("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Sb.displayName="NProgress";var Vb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),Db={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},gM={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Ab=W.forwardRef(({className:e,variant:t="spinner",size:n="md",fullScreen:r,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:u(gM[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:u(Db[n||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:u(Db[n||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:u(Vb({variant:t,size:n,fullScreen:r,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:u("text-sm",l),children:o})]})})});Ab.displayName="Loading";var Ml=class extends W.Component{constructor(t){super(t),this.state={hasError:false,error:null};}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,n){this.props.onError?.(t,n);}componentDidUpdate(t){this.state.hasError&&this.props.resetKeys&&this.props.resetKeys.some((r,o)=>r!==t.resetKeys?.[o])&&this.reset();}reset=()=>{this.props.onReset?.(),this.setState({hasError:false,error:null});};render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsx(Nl,{error:this.state.error,onReset:this.reset}):this.props.children}},Nl=W.forwardRef(({error:e,onReset:t,className:n},r)=>jsxs("div",{ref:r,className:u("flex min-h-[200px] flex-col items-center justify-center gap-4 rounded-lg border border-danger/20 bg-danger/5 p-6 text-center",n),role:"alert",children:[jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger/10",children:jsx(AlertTriangle,{className:"h-6 w-6 text-danger"})}),jsxs("div",{className:"space-y-2",children:[jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Something went wrong"}),e&&jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:e.message||"An unexpected error occurred"})]}),t&&jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-md bg-danger px-4 py-2 text-sm font-medium text-danger-foreground hover:bg-danger/90 transition-colors",children:[jsx(RefreshCw,{className:"h-4 w-4"}),"Try again"]})]}));Nl.displayName="DefaultErrorFallback";var hM=Ml;var Ob=W.forwardRef(({value:e,defaultValue:t,onValueChange:n,placeholder:r="Pick a date range",dateFormat:o="LLL dd, y",disabled:a=false,minDate:s,maxDate:i,numberOfMonths:l=2,className:c,align:d="start"},m)=>{let[f,p]=W.useState(false),[g,h]=W.useState(t),b=e!==void 0,v=b?e:g,R=x=>{b||h(x),n?.(x);},w=x=>{if(!x)return r;let{from:C,to:y}=x;return C&&y?`${format(C,o)} - ${format(y,o)}`:C?format(C,o):r};return jsxs(nt,{open:f,onOpenChange:p,children:[jsxs(Lt,{ref:m,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!v?.from&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",c),children:[jsx(Calendar,{className:"h-4 w-4"}),w(v)]}),jsx(rt,{className:"w-auto p-0",align:d,children:jsx(so,{mode:"range",defaultMonth:v?.from,selected:v,onSelect:R,numberOfMonths:l,disabled:x=>!!(s&&x<s||i&&x>i),initialFocus:true})})]})});Ob.displayName="DateRangePicker";var bo=e=>String(e).padStart(2,"0"),Bb=W.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=W.useState(false),d=r?Array.from({length:24},(w,x)=>x):Array.from({length:12},(w,x)=>x+1),m=Array.from({length:Math.floor(60/o)},(w,x)=>x*o),f=w=>{if(!w)return n;if(r)return `${bo(w.hours)}:${bo(w.minutes)}`;let x=w.hours%12||12,C=w.hours>=12?"PM":"AM";return `${bo(x)}:${bo(w.minutes)} ${C}`},p=w=>{let x=e?.minutes??0,C=w;if(!r&&e){let y=e.hours>=12;y&&w!==12?C=w+12:!y&&w===12&&(C=0);}t?.({hours:C,minutes:x});},g=w=>{let x=e?.hours??0;t?.({hours:x,minutes:w});},h=w=>{if(!e)return;let x=e.hours;w==="AM"&&e.hours>=12?x=e.hours-12:w==="PM"&&e.hours<12&&(x=e.hours+12),t?.({hours:x,minutes:e.minutes});},b=()=>{let w=new Date;t?.({hours:w.getHours(),minutes:w.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,R=e?r?e.hours:e.hours%12||12:void 0;return jsxs(nt,{open:l,onOpenChange:c,children:[jsxs(Lt,{ref:i,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(rt,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(w=>jsx(oe,{variant:R===w?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(w),children:bo(w)},w))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(w=>jsx(oe,{variant:e?.minutes===w?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(w),children:bo(w)},w))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(oe,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(oe,{variant:v==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(oe,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(oe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Bb.displayName="TimePicker";var Fb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function wM({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=W.useRef(null),[p,g]=W.useState(0);W.useImperativeHandle(m,()=>f.current);let h=n.length*(r+l)-l,b=r+l,v=Math.max(0,Math.floor(p/b)-a),R=Math.ceil(o/b)+2*a,w=Math.min(n.length-1,v+R),x=y=>{let N=y.currentTarget.scrollTop;g(N),c?.(N);},C=W.useMemo(()=>{let y=[];for(let N=v;N<=w;N++)n[N]!==void 0&&y.push({item:n[N],index:N,style:{position:"absolute",top:N*b,left:0,right:0,height:r}});return y},[n,v,w,b,r]);return jsx("div",{ref:f,className:u(Fb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:x,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:y,index:N,style:T})=>jsx("div",{style:T,children:s(y,N)},i?i(y,N):N))})})}var CM=W.forwardRef(wM);var Gb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ll=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),$b=W.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,...f},p)=>{let g=W.useRef(null),h=W.useRef(null),b=W.useRef(false);W.useImperativeHandle(p,()=>g.current),W.useEffect(()=>{let R=h.current;if(!R)return;let w=new IntersectionObserver(x=>{let[C]=x;C.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return w.observe(R),()=>{w.disconnect();}},[a,s,o,l,c,d]);let v=jsx("div",{className:u(Ll({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:u(Gb({variant:t,className:e})),...f,children:[r,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||v),!a&&!s&&m&&jsx("div",{className:u(Ll({size:n}),"text-muted-foreground text-sm"),children:m})]})});$b.displayName="InfiniteScroll";var la=W.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));la.displayName="VisuallyHidden";var Wb={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},kM={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},_b=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Dl=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),Es=W.createContext(null),Hr=()=>{let e=W.useContext(Es);if(!e)throw new Error("Modal components must be used within a Modal");return e},jb=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=W.useState(false),b=e!==void 0,v=b?e:g,[R,w]=W.useState(false),x=W.useRef(null),C=W.useId(),y=W.useId();W.useEffect(()=>{w(true);},[]);let N=W.useCallback(P=>{b||h(P),t?.(P);},[b,t]);W.useEffect(()=>{if(v)return dt(),()=>ut()},[v]),W.useEffect(()=>{if(!v||i)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,N]);let T=P=>{s&&P.target===P.currentTarget&&N(false);},k=n?W.isValidElement(n)?W.cloneElement(n,{onClick:P=>{n.props.onClick?.(P),N(true);}}):jsx("button",{type:"button",onClick:()=>N(true),children:n}):null,M=()=>!R||!v?null:d==="outside"?Ya.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(_b(),Wb[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:T,children:jsxs("div",{ref:P=>{x.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":y,"data-state":v?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(la,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsxs("button",{type:"button",className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:()=>N(false),children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(_b(),Wb[l]),onClick:T,"aria-hidden":"true"}),jsxs("div",{ref:P=>{x.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":y,"data-state":v?"open":"closed",className:u(Dl({size:m}),kM[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(la,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsxs("button",{type:"button",className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:()=>N(false),children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),document.body);return jsxs(Es.Provider,{value:{open:v,onOpenChange:N,scrollBehavior:d,titleId:C,descriptionId:y},children:[k,M()]})});jb.displayName="Modal";var Xb=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=W.useState(n),i=t!==void 0,l=i?t:a,c=W.useId(),d=W.useId(),m=W.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(Es.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Xb.displayName="ModalRoot";var qb=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Hr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});qb.displayName="ModalTrigger";var Hl=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Hl.displayName="ModalPortal";var Il=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Hr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Il.displayName="ModalOverlay";var Vl=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Hr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Vl.displayName="ModalClose";var Zb=W.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Hr(),[f,p]=W.useState(false);return W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(l)return dt(),()=>ut()},[l]),W.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(Hl,{children:[jsx(Il,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Dl({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsxs(Vl,{className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Zb.displayName="ModalContent";var Qb=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qb.displayName="ModalHeader";var Jb=({className:e,children:t})=>(W.useContext(Es)?.scrollBehavior??"inside")==="inside"?jsx(ze,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});Jb.displayName="ModalBody";var ev=({className:e,children:t,...n})=>{let{onOpenChange:r}=Hr();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:W.Children.map(t,o=>W.isValidElement(o)?W.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};ev.displayName="ModalFooter";var tv=W.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Hr();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});tv.displayName="ModalTitle";var nv=W.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Hr();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});nv.displayName="ModalDescription";var av=cva("h-10 w-10 rounded-full p-2",{variants:{variant:{default:"bg-muted text-foreground",danger:"bg-danger/10 text-danger",warning:"bg-warning/10 text-warning",success:"bg-success/10 text-success",info:"bg-info/10 text-info"}},defaultVariants:{variant:"default"}}),IM=cva("",{variants:{variant:{default:"",danger:"bg-danger text-danger-foreground hover:bg-danger/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90",info:"bg-info text-info-foreground hover:bg-info/90"}},defaultVariants:{variant:"default"}}),VM=W.createContext(null),AM={default:HelpCircle,danger:XCircle,warning:AlertTriangle,success:CheckCircle,info:Info},Al=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,confirmText:a="Confirm",cancelText:s="Cancel",onConfirm:i,onCancel:l,showIcon:c=true,icon:d,variant:m="default",loading:f=false,disabled:p=false,className:g},h)=>{let[b,v]=W.useState(false),[R,w]=W.useState(false),[x,C]=W.useState(false),y=e!==void 0,N=y?e:b,T=AM[m||"default"],k=W.useId(),M=W.useId();W.useEffect(()=>{C(true);},[]);let P=W.useCallback(V=>{y||v(V),t?.(V);},[y,t]);W.useEffect(()=>{if(N)return dt(),()=>ut()},[N]);let E=async()=>{if(i){let V=i();if(V instanceof Promise){w(true);try{await V;}finally{w(false);}}}P(false);},D=()=>{l?.(),P(false);},H=f||R,L=n?W.isValidElement(n)?W.cloneElement(n,{onClick:V=>{n.props.onClick?.(V),P(true);}}):jsx("button",{type:"button",onClick:()=>P(true),children:n}):null,S=()=>!x||!N?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":N?"open":"closed",className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","aria-hidden":"true"}),jsxs("div",{ref:h,role:"alertdialog","aria-modal":"true","aria-labelledby":k,"aria-describedby":o?M:void 0,"data-state":N?"open":"closed",className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-md translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",g),children:[jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:items-start",children:[c&&jsx("div",{className:u(av({variant:m})),children:d||jsx(T,{className:"h-6 w-6"})}),jsxs("div",{className:"flex flex-col space-y-2 text-center sm:text-left",children:[jsx("h2",{id:k,className:"text-lg font-semibold",children:r}),o&&jsx("p",{id:M,className:"text-sm text-muted-foreground",children:o})]})]}),jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[jsx("button",{type:"button",className:u(bn({variant:"bordered"})),onClick:D,disabled:H,children:s}),jsx("button",{type:"button",className:u(bn(),IM({variant:m}),H&&"opacity-50 cursor-not-allowed"),onClick:E,disabled:p||H,children:H?jsxs("span",{className:"flex items-center gap-2",children:[jsxs("svg",{className:"h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):a})]})]})]}),document.body);return jsxs(VM.Provider,{value:{open:N,onOpenChange:P,titleId:k,descriptionId:M},children:[L,S()]})});Al.displayName="ConfirmDialog";function zM(){let[e,t]=W.useState({open:false,options:null,resolve:null}),n=W.useCallback(i=>new Promise(l=>{t({open:true,options:i,resolve:l});}),[]),r=W.useCallback(()=>{e.resolve?.(true),t({open:false,options:null,resolve:null});},[e.resolve]),o=W.useCallback(()=>{e.resolve?.(false),t({open:false,options:null,resolve:null});},[e.resolve]),a=W.useCallback(i=>{i||(e.resolve?.(false),t({open:false,options:null,resolve:null}));},[e.resolve]),s=W.useMemo(()=>e.options?jsx(Al,{open:e.open,onOpenChange:a,title:e.options.title,description:e.options.description,confirmText:e.options.confirmText,cancelText:e.options.cancelText,variant:e.options.variant,onConfirm:r,onCancel:o}):null,[e,r,o,a]);return {confirm:n,ConfirmDialog:s}}var jM=e=>e.map(t=>typeof t=="string"?{src:t}:t),zl=W.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=W.useMemo(()=>jM(e),[e]),[v,R]=W.useState(r),[w,x]=W.useState(1),[C,y]=W.useState(0),[N,T]=W.useState(false),[k,M]=W.useState(false),[P,E]=W.useState({x:0,y:0}),[D,H]=W.useState({x:0,y:0}),[L,S]=W.useState(false),V=W.useRef(null),z=b[v];W.useEffect(()=>{S(true);},[]),W.useEffect(()=>{R(r);},[r]),W.useEffect(()=>{o?.(v);},[v,o]),W.useEffect(()=>{x(1),y(0),E({x:0,y:0});},[v]),W.useEffect(()=>{if(t)return dt(),()=>ut()},[t]);let F=W.useCallback(()=>{R(ee=>ee>0?ee-1:b.length-1);},[b.length]),I=W.useCallback(()=>{R(ee=>ee<b.length-1?ee+1:0);},[b.length]),K=()=>{x(ee=>Math.min(ee+.5,4));},B=()=>{x(ee=>{let tt=Math.max(ee-.5,.5);return tt===1&&E({x:0,y:0}),tt});},q=()=>{y(ee=>(ee+90)%360);},ne=async()=>{if(z)try{let tt=await(await fetch(z.src)).blob(),On=URL.createObjectURL(tt),bt=document.createElement("a");bt.href=On,bt.download=z.alt||`image-${v+1}`,document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(On);}catch{window.open(z.src,"_blank");}},G=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=ee=>{w>1&&(M(true),H({x:ee.clientX-P.x,y:ee.clientY-P.y}));},_=ee=>{k&&w>1&&E({x:ee.clientX-D.x,y:ee.clientY-D.y});},A=()=>{M(false);},Y=()=>{n?.(false);},se=ee=>{p&&ee.target===ee.currentTarget&&Y();},Ce=W.useCallback(ee=>{switch(ee.key){case "ArrowLeft":F();break;case "ArrowRight":I();break;case "Escape":n?.(false);break;case "+":case "=":K();break;case "-":B();break}},[F,I,n]);if(W.useEffect(()=>{if(t)return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[t,Ce]),W.useEffect(()=>{let ee=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",ee),()=>document.removeEventListener("fullscreenchange",ee)},[]),b.length===0)return null;let U=a?W.isValidElement(a)?W.cloneElement(a,{onClick:ee=>{a.props.onClick?.(ee),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[U,!L||!t?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:se}),jsxs("div",{ref:h,className:u("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&b.length>1&&jsxs("span",{className:"text-sm",children:[v+1," / ",b.length]}),z?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:z.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(w*100),"%"]}),jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:ne,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:G,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:_,onMouseUp:A,onMouseLeave:A,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:F,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:z?.src,alt:z?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":w>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.y}px) scale(${w}) rotate(${C}deg)`},draggable:false})]}),z?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:z.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((ee,tt)=>jsx("button",{onClick:()=>R(tt),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===tt?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:ee.src,alt:ee.alt||`Thumbnail ${tt+1}`,className:"h-full w-full object-cover"})},tt))})]})]}),document.body)]})});zl.displayName="ImageViewer";var iv=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=W.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(zl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};iv.displayName="ImageViewerTrigger";var lv=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),cv=W.forwardRef(({className:e,color:t,size:n,position:r,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let m=a!=null;return jsxs("span",{ref:d,className:u(lv({color:t,size:m?void 0:n,position:r,ping:o}),m&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${r?.includes("right")?i:-i}px, ${r?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});cv.displayName="Indicator";var dv=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("relative inline-flex",e),...n,children:t}));dv.displayName="IndicatorWrapper";var mv=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),pv=W.forwardRef(({className:e,orientation:t,size:n,hideScrollbar:r=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=W.useRef(null),[c,d]=W.useState({top:false,bottom:false,left:false,right:false});W.useImperativeHandle(i,()=>l.current);let m=W.useCallback(()=>{let v=l.current;if(!v)return;let{scrollTop:R,scrollLeft:w,scrollHeight:x,scrollWidth:C,clientHeight:y,clientWidth:N}=v;d({top:R>0,bottom:R<x-y-1,left:w>0,right:w<C-N-1});},[]);W.useEffect(()=>{let v=l.current;if(v)return m(),v.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{v.removeEventListener("scroll",m),window.removeEventListener("resize",m);}},[m]);let p={sm:"20px",md:"40px",lg:"60px"}[n??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",b={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:u(mv({orientation:t,size:n}),r&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:b,...s,children:a})});pv.displayName="ScrollShadow";var fv=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",outline:"rounded border border-border text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),eN={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},tN={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},nN=e=>{let t=e.toLowerCase();return eN[t]||e.toUpperCase()},da=e=>{let t=e.toLowerCase();return tN[t]||t},Ls=e=>{let t=da(e);return ["meta","control","alt","shift"].includes(t)},gv=W.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{W.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Ls).map(da),p=m.filter(h=>!Ls(h)).map(da),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,R=f.includes("alt")===h.altKey,w=f.includes("shift")===h.shiftKey,x=p.length===0||p.includes(h.key.toLowerCase());b&&v&&R&&w&&x&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(W.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:nN(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(fv({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});gv.displayName="Kbd";function rN(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;W.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Ls).map(da),i=a.filter(c=>!Ls(c)).map(da),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var bv=cva("inline-flex items-center justify-center rounded-md transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted",solid:"bg-muted hover:bg-muted/80",ghost:"hover:bg-accent hover:text-accent-foreground",outline:"border border-input hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{variant:"default",size:"md"}}),vv=W.forwardRef(({className:e,variant:t,size:n,value:r,successDuration:o=2e3,onCopySuccess:a,onCopyError:s,copyIcon:i,successIcon:l,...c},d)=>{let[m,f]=W.useState(false),p={sm:14,md:16,lg:20}[n??"md"],g=async()=>{try{await navigator.clipboard.writeText(r),f(!0),a?.(),setTimeout(()=>{f(!1);},o);}catch(h){s?.(h);}};return jsx("button",{ref:d,type:"button",className:u(bv({variant:t,size:n}),e),onClick:g,"aria-label":m?"Copied":"Copy to clipboard",...c,children:m?l??jsx(Check,{className:"text-success",style:{width:p,height:p}}):i??jsx(Copy,{style:{width:p,height:p}})})});vv.displayName="CopyButton";var xv=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),uN=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mN=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function pN(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function fN(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Hs(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ds(e){return Hs(e,new Date)}function hv(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Hs(r,t)||Hs(o,t)||r<t&&o>t})}var yv=W.forwardRef(({className:e,variant:t,size:n,events:r=[],view:o="month",onViewChange:a,date:s,onDateChange:i,onEventClick:l,onSlotClick:c,weekStartsOn:d=0,locale:m="en-US",...f},p)=>{let[g,h]=W.useState(new Date),b=s??g,v=M=>{i?i(M):h(M);},R=d===1?mN:uN,w=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),v(M);},x=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),v(M);},C=()=>{v(new Date);},y=()=>o==="day"?b.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(m,{year:"numeric",month:"long"}),N=()=>{let M=pN(b.getFullYear(),b.getMonth(),d);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:R.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,E)=>{let D=hv(r,P),H=P.getMonth()===b.getMonth();return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!H&&"bg-muted/30"),onClick:()=>c?.(P),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Ds(P)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:S=>{S.stopPropagation(),l?.(L);},children:L.title},L.id)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},E)})})]})},T=()=>{let M=fN(b,d),P=Array.from({length:24},(E,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((E,D)=>jsxs("div",{className:u("p-2 text-center border-l",Ds(E)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:R[D]}),jsx("div",{className:u("text-lg font-semibold",Ds(E)&&"text-primary"),children:E.getDate()})]},D))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(E=>jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),M.map((D,H)=>{let L=new Date(D);L.setHours(E,0,0,0);let S=r.filter(V=>{let z=new Date(V.start);return Hs(z,D)&&z.getHours()===E});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(L),children:S.map(V=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:V.color||"hsl(var(--primary))",color:"white"},onClick:z=>{z.stopPropagation(),l?.(V);},children:V.title},V.id))},H)})]},E))})})]})},k=()=>{let M=Array.from({length:24},(E,D)=>D),P=hv(r,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Ds(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(E=>{let D=new Date(b);D.setHours(E,0,0,0);let H=P.filter(L=>new Date(L.start).getHours()===E);return jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(D),children:H.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:S=>{S.stopPropagation(),l?.(L);},children:L.title},L.id))})]},E)})})})]})};return jsxs("div",{ref:p,className:u(xv({variant:t,size:n,className:e})),...f,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:C,children:"Today"}),jsx(oe,{variant:"ghost",size:"icon",onClick:w,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"ghost",size:"icon",onClick:x,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx("h2",{className:"text-lg font-semibold ml-2",children:y()})]}),jsx("div",{className:"flex items-center gap-1 border rounded-lg p-1",children:["month","week","day"].map(M=>jsx(oe,{variant:o===M?"solid":"ghost",size:"sm",onClick:()=>a?.(M),children:M.charAt(0).toUpperCase()+M.slice(1)},M))})]}),o==="month"&&N(),o==="week"&&T(),o==="day"&&k()]})});yv.displayName="FullCalendar";var ma=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),pa=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],Rv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ma({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));Rv.displayName="LineChart";var wv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));wv.displayName="BarChart";var Cv=W.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=pa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"}}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Cv.displayName="PieChart";var Tv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));Tv.displayName="AreaChart";var kv=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),Pv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Wl=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function zN({card:e,columnId:t,variant:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u(Wl({variant:n,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function ON({column:e,variant:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:u(Pv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(ze,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(zN,{card:i,columnId:e.id,variant:t,renderCard:n,onCardClick:r},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var Ev=W.forwardRef(({className:e,variant:t,columns:n,onCardMove:r,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[m,f]=W.useState(null),[p,g]=W.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),b=x=>n.find(C=>C.cards.some(y=>y.id===x));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:x=>{let{active:C}=x,y=b(C.id);if(y){let N=y.cards.find(T=>T.id===C.id);N&&(f(N),g(y.id));}},onDragOver:x=>{let{active:C,over:y}=x;if(!y)return;let N=C.id,T=y.id,k=b(N),M=b(T)||n.find(D=>D.id===T);if(!k||!M||k.id===M.id)return;let P=M.cards.findIndex(D=>D.id===T),E=P===-1?M.cards.length:P;r?.(N,k.id,M.id,E);},onDragEnd:x=>{let{active:C,over:y}=x;if(y&&C.id!==y.id){let N=b(C.id),T=b(y.id)||n.find(k=>k.id===y.id);if(N&&T){let k=T.cards.findIndex(P=>P.id===y.id),M=k===-1?T.cards.length:k;r?.(C.id,N.id,T.id,M);}}f(null),g(null);},children:[jsx("div",{ref:d,className:u(kv({variant:t,className:e})),...c,children:n.map(x=>jsx(ON,{column:x,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},x.id))}),jsx(DragOverlay,{children:m&&p&&jsx("div",{className:u(Wl({variant:t,isDragging:true})),children:s?s(m,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:m.title}),m.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:m.description})]})]})})})]})});Ev.displayName="KanbanBoard";var Lv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Sv=W.createContext(null);function _l(){let e=W.useContext(Sv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Dv=W.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=BN({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=W.useState(false),[h,b]=W.useState(false),[v,R]=W.useState(0),[w,x]=W.useState([]),C=W.useCallback(M=>{M&&(R(M.selectedScrollSnap()),g(M.canScrollPrev()),b(M.canScrollNext()));},[]),y=W.useCallback(()=>{f?.scrollPrev();},[f]),N=W.useCallback(()=>{f?.scrollNext();},[f]),T=W.useCallback(M=>{f?.scrollTo(M);},[f]),k=W.useCallback(M=>{M.key==="ArrowLeft"?(M.preventDefault(),y()):M.key==="ArrowRight"&&(M.preventDefault(),N());},[y,N]);return W.useEffect(()=>{!f||!l||l(f);},[f,l]),W.useEffect(()=>{if(f)return x(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Sv.Provider,{value:{carouselRef:m,api:f,scrollPrev:y,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:w,scrollTo:T},children:jsxs("div",{ref:d,className:u(Lv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Yl,{}),jsx(jl,{})]}),i&&w.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:w.map((M,P)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});Dv.displayName="Carousel";var Hv=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));Hv.displayName="CarouselContent";var Iv=W.forwardRef(({className:e,basis:t="basis-full",...n},r)=>jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0 pl-4",t,e),...n}));Iv.displayName="CarouselItem";var Yl=W.forwardRef(({className:e,variant:t="bordered",size:n="icon",...r},o)=>{let{scrollPrev:a,canScrollPrev:s}=_l();return jsxs(oe,{ref:o,variant:t,size:n,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...r,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Yl.displayName="CarouselPrevious";var jl=W.forwardRef(({className:e,variant:t="bordered",size:n="icon",...r},o)=>{let{scrollNext:a,canScrollNext:s}=_l();return jsxs(oe,{ref:o,variant:t,size:n,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...r,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});jl.displayName="CarouselNext";var Vv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),Bs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},ql={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u{1F44D}","\u{1F44E}","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9BF}","\u{1F9B5}","\u{1F9B6}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F94C}","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},Av=W.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=W.useState(r.length>0?"recent":o),[m,f]=W.useState(""),g=m?Object.values(ql).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:ql[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:u(Vv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(za,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx("div",{className:"flex border-b px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:u("flex-1 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Bs[b].name,children:v},b))}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Bs[c].name}),jsx(ze,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,v)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(b),children:b},`${b}-${v}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});Av.displayName="EmojiPicker";var zv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),vk=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),hk=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),_e=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Un,{children:[jsx(Wn,{children:jsx(oe,{type:"button",variant:n?"solid":"ghost",size:"icon",className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(_n,{side:"top",className:"text-xs",children:t})]}),Ov=W.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[jN.configure({heading:{levels:[1,2,3]}}),XN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),qN,ZN.configure({types:["heading","paragraph"]}),QN.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});W.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),W.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,b=window.prompt("URL",h);if(b!==null){if(b===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:b}).run();}};return p?jsx($n,{children:jsxs("div",{ref:f,className:u(zv({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(vk({size:n})),children:[jsx(_e,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(_e,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(_e,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(_e,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(_e,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(_e,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(_e,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(_e,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(_e,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(_e,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(_e,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(_e,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:u(hk({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Ov.displayName="RichTextEditor";var Fv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function Nk(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function Bv(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var Kv=W.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=W.useRef(null),[h,b]=W.useState(),[v,R]=W.useState(),[w,x]=W.useState(1),[C,y]=W.useState(0),N=P=>{let{width:E,height:D}=P.currentTarget;if(r){let H=Nk(E,D,r);b(H);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},T=P=>{b(P),o?.(P);},k=async P=>{if(R(P),a&&g.current&&P.width&&P.height){let E=await Bv(g.current,P,C,w);a(E);}},M=()=>{y(P=>(P+90)%360);};return W.useEffect(()=>{v&&g.current&&a&&Bv(g.current,v,C,w).then(P=>{a(P);});},[w,C,v,a]),jsxs("div",{ref:p,className:u(Fv({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(xk,{crop:h,onChange:T,onComplete:k,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",onLoad:N,style:{transform:`scale(${w}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Za,{value:[w],onValueChange:([P])=>x(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(oe,{variant:"bordered",size:"icon",onClick:M,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Kv.displayName="ImageCropper";var ec=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Ek={sm:96,md:128,lg:192},$v=W.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??Ek[n??"md"];return r?jsx("div",{ref:h,className:u(ec({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(kk,{value:r,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:u(ec({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});$v.displayName="QRCode";var Uv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});Uv.displayName="ThemeProvider";var Ak=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Wv=W.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=W.useState(false);W.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?r==="cycle"?jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(to,{children:[jsx(no,{children:jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(ro,{align:"end",children:[jsxs(Yn,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Yn,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Yn,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Wv.displayName="ThemeToggle";var _v=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Yv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),jv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Xv=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let b=W.useId(),v=p||b,R=`${v}-description`,w=`${v}-error`,x=a&&r;return jsxs("div",{className:u(_v({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(jv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[m&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:m}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":x?w:n?R:void 0,"aria-required":o,className:u(Yv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!x&&jsx("p",{id:R,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),x&&jsx("p",{id:w,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Xv.displayName="TextField";var Qv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Bk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),qv=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Zv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Fk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Jv=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:m,max:f,step:p=1,value:g,defaultValue:h,onChange:b,showButtons:v=true,formatOptions:R,fullWidth:w=false,disabled:x,id:C,...y},N)=>{let T=W.useId(),k=C||T,M=`${k}-description`,P=`${k}-error`,[E,D]=W.useState(h),[H,L]=W.useState(false),S=g!==void 0?g:E,V=a&&r,z=W.useCallback(O=>{O!==void 0&&(m!==void 0&&O<m&&(O=m),f!==void 0&&O>f&&(O=f)),g===void 0&&D(O),b?.(O);},[g,m,f,b]),F=()=>{let O=(S??0)+p;z(O);},I=()=>{let O=(S??0)-p;z(O);},K=O=>{let _=O.target.value;if(_==="")z(void 0);else {let A=parseFloat(_);isNaN(A)||z(A);}},B=O=>{O.key==="ArrowUp"?(O.preventDefault(),F()):O.key==="ArrowDown"&&(O.preventDefault(),I());},q=W.useMemo(()=>S===void 0?"":R?new Intl.NumberFormat(void 0,R).format(S):S.toString(),[S,R]),ne=m!==void 0&&S!==void 0&&S<=m,G=f!==void 0&&S!==void 0&&S>=f;return jsxs("div",{className:u(Qv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(Fk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx("button",{type:"button",onClick:I,disabled:x||ne,className:u(qv({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:u(Zv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:q,onChange:K,onKeyDown:B,onFocus:()=>L(true),onBlur:()=>L(false),"aria-invalid":a,"aria-describedby":V?P:n?M:void 0,"aria-required":o,"aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":S,disabled:x,className:u(Bk({size:s,isInvalid:a,fullWidth:w}),!v&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...y}),v&&jsx("button",{type:"button",onClick:F,disabled:x||G,className:u(qv({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:u(Zv({size:s}))})})]}),n&&!V&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),V&&jsx("p",{id:P,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Jv.displayName="NumberField";var th=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),$k=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),eh=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Uk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Wk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),nh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:R,placeholder:w="Search...",id:x,...C},y)=>{let N=W.useId(),T=x||N,k=`${T}-description`,M=`${T}-error`,[P,E]=W.useState(f),D=m!==void 0?m:P,H=a&&r,L=D.length>0,S=F=>{let I=F.target.value;m===void 0&&E(I),p?.(I);},V=()=>{m===void 0&&E(""),p?.(""),g?.();},z=F=>{F.key==="Enter"?(F.preventDefault(),h?.(D)):F.key==="Escape"&&L&&(F.preventDefault(),V());};return jsxs("div",{className:u(th({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Uk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx(Search,{className:u(eh({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:y,id:T,type:"search",value:D,onChange:S,onKeyDown:z,placeholder:w,"aria-invalid":a,"aria-describedby":H?M:n?k:void 0,"aria-required":o,disabled:R,className:u($k({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&L&&!R&&jsx("button",{type:"button",onClick:V,className:u(Wk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(eh({size:s}))})})]}),n&&!H&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});nh.displayName="SearchField";var rh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Yk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-calendar-picker-indicator]:hidden",{variants:{size:{sm:"h-8 pl-3 pr-8 py-1.5 text-xs",md:"h-10 pl-3 pr-10 py-2 text-sm",lg:"h-12 pl-4 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),jk=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Xk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),sc=(e,t="yyyy-MM-dd")=>{if(!e)return "";let n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return t.replace("yyyy",String(n)).replace("MM",r).replace("dd",o)},qk=e=>{if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},oh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="yyyy-MM-dd",showIcon:v=true,fullWidth:R=false,disabled:w,id:x,...C},y)=>{let N=W.useId(),T=x||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=y||P,[D,H]=W.useState(f??null),[L,S]=W.useState(false),V=()=>{!w&&E.current&&E.current.showPicker?.();},z=m!==void 0?m:D,F=a&&r,I=ne=>{let G=qk(ne.target.value);m===void 0&&H(G),p?.(G);},K=z?sc(z,"yyyy-MM-dd"):"",B=g?sc(g,"yyyy-MM-dd"):void 0,q=h?sc(h,"yyyy-MM-dd"):void 0;return jsxs("div",{className:u(rh({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Xk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u("relative",R?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:T,type:"date",value:K,onChange:I,onFocus:()=>S(true),onBlur:()=>S(false),min:B,max:q,"aria-invalid":a,"aria-describedby":F?M:n?k:void 0,"aria-required":o,disabled:w,className:u(Yk({size:s,isInvalid:a,fullWidth:R}),!v&&"pr-3",l),style:{borderColor:L?"var(--color-foreground)":void 0},...C}),v&&jsx("button",{type:"button",onClick:V,disabled:w,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(jk({size:s}))})})]}),n&&!F&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),F&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});oh.displayName="DateField";var ah=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Zk=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),Qk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),sh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:R,fullWidth:w=false,id:x,...C},y)=>{let N=W.useId(),T=x||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=W.useRef(null),D=W.useRef(null),H=W.useRef(null),[L,S]=W.useState(f??null),V=m!==void 0?m:L,z=a&&r,F=$=>v===24?$:$===0?12:$>12?$-12:$,I=$=>$>=12?"PM":"AM",K=($,re)=>re==="AM"?$===12?0:$:$===12?12:$+12,[B,q]=W.useState(V?String(F(V.hour)).padStart(2,"0"):""),[ne,G]=W.useState(V?String(V.minute).padStart(2,"0"):""),[O,_]=W.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[A,Y]=W.useState(V?I(V.hour):"AM"),[se,Ce]=W.useState(false);W.useEffect(()=>{m!==void 0&&(m?(q(String(F(m.hour)).padStart(2,"0")),G(String(m.minute).padStart(2,"0")),m.second!==void 0&&_(String(m.second).padStart(2,"0")),Y(I(m.hour))):(q(""),G(""),_("")));},[m,v]);let U=($,re,j,Se)=>{let le=parseInt($,10),Ge=parseInt(re,10),$e=b?parseInt(j,10):void 0;if(isNaN(le)||isNaN(Ge)||b&&isNaN($e)){m===void 0&&S(null),p?.(null);return}let pe={hour:v===12?K(le,Se):le,minute:Ge,...b&&$e!==void 0&&{second:$e}};m===void 0&&S(pe),p?.(pe);},ct=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);q(re);let j=v===24?23:12,Se=v===24?0:1;if(re.length===2){let le=parseInt(re,10);le>=Se&&le<=j&&(E.current?.focus(),E.current?.select());}},ee=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);if(G(re),re.length===2){let j=parseInt(re,10);j>=0&&j<=59&&(b?(D.current?.focus(),D.current?.select()):v===12&&H.current?.focus());}},tt=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);_(re),re.length===2&&v===12&&H.current?.focus();},On=()=>{if(B){let $=parseInt(B,10),re=v===24?23:12,Se=Math.min(Math.max($,v===24?0:1),re),le=String(Se).padStart(2,"0");q(le),U(le,ne,O,A);}},bt=()=>{if(ne){let $=parseInt(ne,10),re=Math.min(Math.max($,0),59),j=String(re).padStart(2,"0");G(j),U(B,j,O,A);}},br=()=>{if(O){let $=parseInt(O,10),re=Math.min(Math.max($,0),59),j=String(re).padStart(2,"0");_(j),U(B,ne,j,A);}},Bn=()=>{let $=A==="AM"?"PM":"AM";Y($),U(B,ne,O,$);},Bo=$=>{let re=$.key.toLowerCase();re==="a"?($.preventDefault(),A!=="AM"&&(Y("AM"),U(B,ne,O,"AM"))):re==="p"?($.preventDefault(),A!=="PM"&&(Y("PM"),U(B,ne,O,"PM"))):re==="arrowup"||re==="arrowdown"?($.preventDefault(),Bn()):re==="arrowleft"&&($.preventDefault(),b?(D.current?.focus(),D.current?.select()):(E.current?.focus(),E.current?.select()));},Ft=($,re)=>{if($.key==="ArrowUp"||$.key==="ArrowDown"){$.preventDefault();let j=$.key==="ArrowUp"?1:-1;if(re==="hour"){let Se=parseInt(B,10)||0,le=v===24?23:12,Ge=v===24?0:1,$e=Se+j;$e>le&&($e=Ge),$e<Ge&&($e=le);let Fn=String($e).padStart(2,"0");q(Fn),U(Fn,ne,O,A);}else if(re==="minute"){let le=(parseInt(ne,10)||0)+j;le>59&&(le=0),le<0&&(le=59);let Ge=String(le).padStart(2,"0");G(Ge),U(B,Ge,O,A);}else if(re==="second"){let le=(parseInt(O,10)||0)+j;le>59&&(le=0),le<0&&(le=59);let Ge=String(le).padStart(2,"0");_(Ge),U(B,ne,Ge,A);}}$.key==="ArrowRight"&&($.preventDefault(),re==="hour"?(E.current?.focus(),E.current?.select()):re==="minute"&&b?(D.current?.focus(),D.current?.select()):(re==="minute"&&!b&&v===12||re==="second"&&v===12)&&H.current?.focus()),$.key==="ArrowLeft"&&($.preventDefault(),re==="minute"?(P.current?.focus(),P.current?.select()):re==="second"&&(E.current?.focus(),E.current?.select())),$.key==="Backspace"&&$.currentTarget.value===""&&(re==="minute"?P.current?.focus():re==="second"&&E.current?.focus());},vr=u((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",R&&"cursor-not-allowed");return jsxs("div",{ref:y,className:u(ah({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:u(Qk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(Zk({size:s,isInvalid:a,disabled:R,fullWidth:w}),l),style:{borderColor:se?"var(--color-foreground)":void 0},onFocus:()=>Ce(true),onBlur:$=>{$.currentTarget.contains($.relatedTarget)||Ce(false);},children:[jsx("input",{ref:P,id:T,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:B,onChange:ct,onBlur:On,onKeyDown:$=>Ft($,"hour"),onFocus:$=>$.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":z?M:n?k:void 0,"aria-required":o,disabled:R,className:vr}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:E,type:"text",inputMode:"numeric",placeholder:"mm",value:ne,onChange:ee,onBlur:bt,onKeyDown:$=>Ft($,"minute"),onFocus:$=>$.target.select(),"aria-label":"Minute",disabled:R,className:vr}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:D,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:tt,onBlur:br,onKeyDown:$=>Ft($,"second"),onFocus:$=>$.target.select(),"aria-label":"Second",disabled:R,className:vr})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:Bn,onKeyDown:Bo,disabled:R,className:u("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",R&&"cursor-not-allowed"),"aria-label":"AM/PM",children:A})]}),n&&!z&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),z&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});sh.displayName="TimeField";var lh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),eP=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono uppercase",{variants:{size:{sm:"h-8 pl-10 pr-3 py-1.5 text-xs",md:"h-10 pl-12 pr-3 py-2 text-sm",lg:"h-12 pl-14 pr-4 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),tP=cva("absolute left-2 top-1/2 -translate-y-1/2 rounded border border-input overflow-hidden",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),nP=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),ih=e=>/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e),rP=e=>(e.startsWith("#")||(e="#"+e),e.length===4&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),e.toUpperCase()),ch=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="#000000",onChange:p,showSwatch:g=true,showPicker:h=true,allowAlpha:b=false,fullWidth:v=false,disabled:R,id:w,...x},C)=>{let y=W.useId(),N=w||y,T=`${N}-picker`,k=`${N}-description`,M=`${N}-error`,[P,E]=W.useState(f),[D,H]=W.useState(false),L=m!==void 0?m:P,S=a&&r,V=K=>{let B=K.target.value;B&&!B.startsWith("#")&&(B="#"+B),m===void 0&&E(B),p?.(B);},z=K=>{let B=K.target.value.toUpperCase();m===void 0&&E(B),p?.(B);},F=()=>{if(L&&ih(L)){let K=rP(L);K!==L&&(m===void 0&&E(K),p?.(K));}},I=ih(L)?L:"#000000";return jsxs("div",{className:u(lh({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:u(nP({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[g&&jsx("div",{className:u(tP({size:s})),children:h?jsxs("label",{htmlFor:T,className:"block h-full w-full cursor-pointer",children:[jsx("input",{id:T,type:"color",value:I,onChange:z,disabled:R,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0",tabIndex:-1}),jsx("div",{className:"h-full w-full",style:{backgroundColor:I}})]}):jsx("div",{className:"h-full w-full",style:{backgroundColor:I}})}),jsx("input",{ref:C,id:N,type:"text",value:L,onChange:V,onFocus:()=>H(true),onBlur:()=>{H(false),F();},placeholder:"#000000",maxLength:b?9:7,"aria-invalid":a,"aria-describedby":S?M:n?k:void 0,"aria-required":o,disabled:R,className:u(eP({size:s,isInvalid:a,fullWidth:v}),!g&&"pl-3",l),style:{borderColor:D?"var(--color-foreground)":void 0},...x})]}),n&&!S&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),S&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});ch.displayName="ColorField";var uh=cva("inline-flex",{variants:{variant:{default:"",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),mh=W.createContext({});function aP(){return W.useContext(mh)}var ph=W.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(mh.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:u(uh({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));ph.displayName="ButtonGroup";var gh=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),bh=W.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],R=(x,C)=>{C&&C(),l&&l(x);},w=x=>jsxs("button",{type:"button",disabled:i||x.isDisabled,onClick:()=>R(x.key,x.onPress),className:u("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:b),"aria-label":x.label,children:[x.icon&&jsx("span",{className:v,children:x.icon}),c&&jsx("span",{children:x.label})]},x.key);return jsxs("div",{ref:f,role:"group",className:u(gh({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(x=>d?d(x):w(x)),g.length>0&&jsxs(to,{children:[jsx(no,{"aria-label":"More actions",className:u("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",b),children:jsx(MoreHorizontal,{className:v})}),jsx(ro,{align:"end",children:g.map(x=>jsxs(Yn,{disabled:x.isDisabled,onClick:()=>R(x.key,x.onPress),children:[x.icon&&jsx("span",{className:u(v,"mr-2"),children:x.icon}),x.label]},x.key))})]})]})});bh.displayName="ActionGroup";var yh=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),lP=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),Rh=W.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(yh({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(lP({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));Rh.displayName="StatusLight";var Ch=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),dP=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),uP=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),mP=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Th=W.forwardRef(({className:e,size:t,illustration:n,heading:r,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(Ch({size:t,className:e})),...s,children:[n&&jsx("div",{className:u(dP({size:t})),"aria-hidden":"true",children:n}),r&&jsx("h3",{className:u(uP({size:t})),children:r}),o&&jsx("p",{className:u(mP({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));Th.displayName="IllustratedMessage";var kh=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),xP={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Ph=W.forwardRef(({className:e,variant:t,title:n,icon:r,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[m,f]=W.useState(true);if(!m)return null;let p=xP[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:u(kh({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:r||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[n&&jsx("div",{className:"font-medium",children:n}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Ph.displayName="InlineAlert";var Eh=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),Lh=W.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let m=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Eh({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx("button",{type:"button",onClick:a,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors","aria-label":"Close action bar",children:jsx(X,{className:"h-4 w-4"})})]})]})});Lh.displayName="ActionBar";var Sh=W.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));Sh.displayName="ActionBarButton";var Ih=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Vh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Ah({className:e,variant:t,size:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),[h,b]=W.useState(null),[v,R]=W.useState(null),w=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),x=T=>{if(a==="none")return;let k;a==="single"?k=w.has(T)?new Set:new Set([T]):(k=new Set(w),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{b(k),T.dataTransfer.effectAllowed="move";},y=(T,k)=>{T.preventDefault(),h!==k&&R(k);},N=()=>{if(h&&v&&h!==v){let T=r.findIndex(E=>E.key===h),k=r.findIndex(E=>E.key===v),M=[...r],[P]=M.splice(T,1);M.splice(k,0,P),l?.(M);}b(null),R(null);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:u(Ih({variant:t,size:n,className:e})),...f,children:r.map(T=>{let k=w.has(T.key),M=h===T.key,P=v===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>x(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:E=>C(E,T.key),onDragOver:E=>y(E,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&x(T.key),className:u(Vh({variant:t,size:n,isSelected:k,isDisabled:T.isDisabled}),M&&"opacity-50",P&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:u("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}Ah.displayName="ListView";var zh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),MP=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),NP=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),Oh=W.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,R]=W.useState(o),w=r!==void 0,x=w?r:v,C=W.useRef(null),[y,N]=W.useState(false),[T,k]=W.useState(null),M=(I,K)=>{if(!C.current)return x[0];let B=C.current.getBoundingClientRect(),q;t==="horizontal"?q=(I-B.left)/B.width:q=1-(K-B.top)/B.height,q=Math.max(0,Math.min(1,q));let ne=i+q*(l-i),G=Math.round(ne/c)*c;return Math.max(i,Math.min(l,G))},P=(I,K)=>{let B=[...x];B[K]=I,K===0&&I>x[1]&&(B[0]=x[1]),K===1&&I<x[0]&&(B[1]=x[0]),w||R(B),a?.(B);},E=(I,K)=>{d||(I.preventDefault(),N(true),k(K),I.target.setPointerCapture(I.pointerId));},D=I=>{if(!y||T===null||d)return;let K=M(I.clientX,I.clientY);P(K,T);},H=()=>{y&&(N(false),k(null),s?.(x));},L=I=>{if(d)return;let K=M(I.clientX,I.clientY),B=Math.abs(x[0]-K),q=Math.abs(x[1]-K),ne=B<=q?0:1;P(K,ne);let G=[...x];G[ne]=K,s?.(G);},S=(I,K)=>{if(d)return;let B=x[K];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),B=Math.min(l,x[K]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),B=Math.max(i,x[K]-c);break;case "Home":I.preventDefault(),B=i;break;case "End":I.preventDefault(),B=l;break;default:return}P(B,K);let q=[...x];q[K]=B,s?.(q);},V=I=>(I-i)/(l-i)*100,z={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],F={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(x[0])}),jsx("span",{children:f(x[1])})]}),jsxs("div",{ref:b,className:u(zh({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(MP({orientation:t,size:n})),onClick:L,children:jsx("div",{className:u("absolute rounded-full",z,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(x[0])}%`,right:`${100-V(x[1])}%`,top:0,bottom:0}:{bottom:`${V(x[0])}%`,top:`${100-V(x[1])}%`,left:0,right:0}})}),x.map((I,K)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:u(NP({size:n}),y&&T===K&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${F/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${F/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:B=>E(B,K),onPointerMove:D,onPointerUp:H,onPointerCancel:H,onKeyDown:B=>S(B,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:x[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:x[1]})]})]})]})});Oh.displayName="RangeSlider";var pc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),SP=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),DP={help:HelpCircle,info:Info,warning:AlertCircle},Kh=W.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=W.useState(false),[b,v]=W.useState(false),[R,w]=W.useState({top:0,left:0}),x=W.useRef(null),C=W.useRef(null),y=i!==void 0?i:g,N=W.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!y||!x.current)return;let P=()=>{let E=x.current.getBoundingClientRect(),D=288,H=8,L=0,S=0;switch(a){case "top":L=E.top-H,S=E.left+E.width/2;break;case "bottom":L=E.bottom+H,S=E.left+E.width/2;break;case "left":L=E.top+E.height/2,S=E.left-H;break;case "right":L=E.top+E.height/2,S=E.right+H;break}if(a==="top"||a==="bottom")switch(s){case "start":S=E.left;break;case "center":S=E.left+E.width/2-D/2;break;case "end":S=E.right-D;break}S=Math.max(8,Math.min(S,window.innerWidth-D-8)),w({top:L,left:S});};return P(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[y,a,s]),W.useEffect(()=>{if(!y)return;let P=E=>{C.current&&!C.current.contains(E.target)&&x.current&&!x.current.contains(E.target)&&N(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[y,N]),W.useEffect(()=>{if(!y)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[y,N]);let T=DP[e??"help"],k=()=>{N(!y);},M=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?W.isValidElement(o)?W.cloneElement(o,{ref:x,onClick:P=>{o.props.onClick?.(P),k();}}):jsx("button",{ref:x,type:"button",onClick:k,className:u(pc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{x.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:k,className:u(pc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),b&&y&&Ya.createPortal(jsxs("div",{ref:C,className:u(SP({size:t}),f),style:{position:"fixed",top:R.top,left:R.left,transformOrigin:M()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Kh.displayName="ContextualHelp";var $h=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),fc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"outline",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Uh({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,b]=W.useState(new Set),v=W.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),R=y=>{if(s==="none")return;let N;s==="single"?N=v.has(y)?new Set:new Set([y]):(N=new Set(v),N.has(y)?N.delete(y):N.add(y)),a||b(N),i?.(N);},w=(y,N)=>{N.stopPropagation(),c?.(y);},x=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u($h({spacing:t}),e),...g,children:[x.map(y=>{let N=v.has(y.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!y.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!y.isDisabled&&R(y.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!y.isDisabled&&(k.preventDefault(),R(y.key));},style:y.color?{backgroundColor:y.color}:void 0,className:u(fc({variant:y.color?void 0:n,size:r,isSelected:N,isDisabled:y.isDisabled}),T&&!y.isDisabled&&"cursor-pointer hover:opacity-80",y.color&&"text-white"),children:[y.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:y.icon}),y.label,l&&!y.isDisabled&&jsx("button",{type:"button",onClick:k=>w(y.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${y.label}`,children:jsx(X,{className:"h-3 w-3"})})]},y.key)}),C>0&&jsxs("span",{className:u(fc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Uh.displayName="TagGroup";var Yh=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),jh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Xh({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),h=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let R;a==="single"?R=h.has(v)?new Set:new Set([v]):(R=new Set(h),R.has(v)?R.delete(v):R.add(v)),o||g(R),s?.(R);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u(Yh({columns:t,gap:n,className:e})),...f,children:r.map(v=>{let R=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":R,onClick:()=>b(v.key),children:d(v,R)},v.key):jsxs("div",{role:"gridcell","aria-selected":R,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:u(jh({variant:l,size:c,isSelected:R,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&R&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}Xh.displayName="GridList";var Zh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),AP=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),zP=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),ti=W.forwardRef(({className:e,size:t,value:n,min:r=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:m="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(n-r)/(o-r)*100)),b=()=>{if(m!=="auto")return "";let R=(n-r)/(o-r),w=s!==void 0?(s-r)/(o-r):.25,x=i!==void 0?(i-r)/(o-r):.75;return (a!==void 0?(a-r)/(o-r):1)>=.5?R<=w?"bg-red-500":R<=x?"bg-yellow-500":"bg-green-500":R>=x?"bg-red-500":R>=w?"bg-yellow-500":"bg-green-500"},v=d?d(n,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:u("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:v})]}),jsx("div",{role:"meter","aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":o,"aria-label":l,className:u(Zh({size:t})),children:jsx("div",{className:u(AP({variant:f})),children:jsx("div",{className:u(zP({color:m==="auto"?void 0:m,rounded:h>=100}),m==="auto"&&b()),style:{width:`${h}%`}})})})]})});ti.displayName="Meter";var Qh=W.forwardRef((e,t)=>jsx(ti,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Qh.displayName="DiskUsageMeter";var Jh=W.forwardRef((e,t)=>jsx(ti,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));Jh.displayName="BatteryMeter";var ex=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ri=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},tx=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},nx=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},rx=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),ox=W.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=W.useCallback(I=>{let K=nx(I);return K?tx(...K):[0,1,1]},[]),[v,R]=W.useState(()=>b(r||o)),w=e??v[0],x=t??v[1],C=n??v[2];W.useEffect(()=>{if(r){let I=b(r);R(I);}},[r,b]);let y=W.useCallback((I,K)=>{if(l||!p.current)return;let B=p.current.getBoundingClientRect(),q=Math.max(0,Math.min(1,(I-B.left)/B.width)),ne=Math.max(0,Math.min(1,(K-B.top)/B.height)),G=q,O=1-ne;t===void 0&&n===void 0&&R([w,G,O]),a?.({hue:w,saturation:G,brightness:O});let _=ri(w,G,O);s?.(rx(..._));},[l,w,t,n,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),y(I.clientX,I.clientY));},T=I=>{g&&y(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[M,P,E]=ri(w,1,1),D=`rgb(${M}, ${P}, ${E})`,H=x*100,L=(1-C)*100,[S,V,z]=ri(w,x,C),F=`rgb(${S}, ${V}, ${z})`;return jsx("div",{ref:f,className:u(ex({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:D},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${L}% - ${c/2}px)`,backgroundColor:F,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});ox.displayName="ColorArea";var sx=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),KP=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,ax="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",ix=W.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,R]=W.useState(t??b()),w=e??v,x=r==="hue"?w/360:w,C=W.useCallback((D,H)=>{if(i||!p.current)return;let L=p.current.getBoundingClientRect(),S=a!=="vertical",V;S?V=Math.max(0,Math.min(1,(D-L.left)/L.width)):V=Math.max(0,Math.min(1,1-(H-L.top)/L.height));let z=r==="hue"?V*360:V;e===void 0&&R(z),n?.(z);},[i,a,r,e,n]),y=D=>{i||(D.preventDefault(),h(true),D.target.setPointerCapture(D.pointerId),C(D.clientX,D.clientY));},N=D=>{g&&C(D.clientX,D.clientY);},T=D=>{h(false),D.target.releasePointerCapture(D.pointerId);},k=()=>{let D=a!=="vertical",H=D?"to right":"to top";switch(r){case "hue":return D?ax:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return ax}},M=()=>r==="hue"?`hsl(${w}, 100%, 50%)`:o,P=a!=="vertical",E=x*100;return jsx("div",{ref:f,className:u(sx({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?KP:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${E}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${E}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:M(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});ix.displayName="ColorSlider";var lx=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),UP=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},cx=W.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=W.useRef(null),[f,p]=W.useState(false),[g,h]=W.useState(t),b=e??g,v=W.useCallback((y,N)=>{if(o||!m.current)return;let T=m.current.getBoundingClientRect(),k=T.width/2,M=y-T.left,P=N-T.top,E=UP(M,P,k);e===void 0&&h(E),n?.(E);},[o,e,n]),R=y=>{o||(y.preventDefault(),p(true),y.target.setPointerCapture(y.pointerId),v(y.clientX,y.clientY));},w=y=>{f&&v(y.clientX,y.clientY);},x=y=>{p(false),y.target.releasePointerCapture(y.pointerId);},C=()=>{let y=[];for(let N=0;N<=360;N+=30)y.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:u(lx({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:R,onPointerMove:w,onPointerUp:x,onPointerLeave:x,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(WP,{hue:b,innerRadius:a,thumbSize:s})]})})});cx.displayName="ColorWheel";var WP=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var ux=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),YP=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),jP=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),mx=W.forwardRef(({className:e,orientation:t,size:n,align:r,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:m=false,copyable:f=false,onCopy:p,...g},h)=>{let b=async()=>{if(!(!f||a===null||a===void 0))try{let v=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(v),p?.();}catch{}};return jsxs("div",{ref:h,className:u(ux({orientation:t,size:n,align:r,className:e})),...g,children:[jsxs("span",{className:u(YP({size:n}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,m&&":"]}),jsx("span",{className:u(jP({size:n,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?b:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b());}:void 0,children:a})]})});mx.displayName="LabeledValue";var px=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),fx=W.forwardRef(({className:e,orientation:t,gap:n,...r},o)=>jsx("div",{ref:o,className:u(px({orientation:t,gap:n,className:e})),...r}));fx.displayName="LabeledValueGroup";var hx=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),ko=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),xx=W.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:R,...w},x)=>{let[C,y]=W.useState(false),[N,T]=W.useState(t),k=e!==void 0?e:N,M=W.useRef(null);W.useImperativeHandle(x,()=>M.current);let P=k.length>0,E=C&&(a.length>0||s.length>0||l.length>0||P),D=I=>{e===void 0&&T(I),n?.(I);},H=()=>{D(""),M.current?.focus();},L=I=>{I?.preventDefault(),k.trim()&&(r?.(k.trim()),y(false));},S=I=>{D(I.label),o?.(I),y(false);},V=I=>{D(I),r?.(I),y(false);},z=I=>{D(I),r?.(I),y(false);},F=W.useMemo(()=>{let I={};return a.forEach(K=>{let B=K.category||"Results";I[B]||(I[B]=[]),I[B].push(K);}),I},[a]);return jsxs(nt,{open:E,onOpenChange:y,children:[jsx(oo,{children:jsxs("form",{onSubmit:L,className:u(hx({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(ko({size:g}),"ml-3")}),jsx("input",{ref:M,type:"text",value:k,onChange:I=>D(I.target.value),onFocus:()=>y(true),placeholder:v,disabled:R,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...w}),d&&P&&!R&&jsx("button",{type:"button",onClick:H,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",ko({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(rt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,K)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(ko({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:u(ko({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,K)=>jsxs("button",{type:"button",onClick:()=>z(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(ko({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(F).map(([I,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),K.map(B=>jsxs("button",{type:"button",onClick:()=>S(B),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[B.icon||jsx(Search,{className:u(ko({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:B.label}),B.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:B.description})]})]},B.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});xx.displayName="SearchBar";var yx={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},Cx=W.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=W.useState(""),g=W.useRef(null),[h,b]=W.useState(false);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{e||p("");},[e]),W.useEffect(()=>{if(!e)return;let y=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),W.useEffect(()=>{if(e)return dt(),()=>ut()},[e]);let v=W.useMemo(()=>{let y={};return n.forEach(N=>{let T=N.category||"Results";y[T]||(y[T]=[]),y[T].push(N);}),y},[n]),R=y=>{y.onSelect?.(),c?.(y),t?.(false);},w=()=>{t?.(false);},x=f.length>0,C=!x&&r.length>0;return !h||!e?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:w}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(y=>jsxs(Command.Item,{value:y.label,onSelect:()=>R(y),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:y.icon||yx[y.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:y.label}),y.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:y.description})]}),y.shortcut&&jsx("div",{className:"flex items-center gap-1",children:y.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},y.id))]}),x&&Object.entries(v).map(([y,N])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>R(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||yx[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},y)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});Cx.displayName="SpotlightSearch";function iE(e="k"){let[t,n]=W.useState(false);return W.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var Nx=W.createContext(null),ai=()=>{let e=W.useContext(Nx);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},gE=({children:e,notifications:t,onNotificationsChange:n})=>{let[r,o]=W.useState([]),[a,s]=W.useState(false),i=W.useRef(null),l=t!==void 0,c=l?t:r,d=W.useCallback(b=>{l?n?.(b):o(b);},[l,n]),m=c.filter(b=>!b.read).length,f=W.useCallback(b=>{d(c.map(v=>v.id===b?{...v,read:true}:v));},[c,d]),p=W.useCallback(()=>{d(c.map(b=>({...b,read:true})));},[c,d]),g=W.useCallback(b=>{d(c.filter(v=>v.id!==b));},[c,d]),h=W.useCallback(()=>{d([]);},[d]);return jsx(Nx.Provider,{value:{notifications:c,unreadCount:m,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},kx=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("relative inline-block",e),...n,children:t}));kx.displayName="NotificationCenter";var Px=W.forwardRef(({className:e,showBadge:t=true,children:n,onClick:r,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=ai(),d=f=>{r?.(f),l(!i);},m=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:u("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[n||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:m})]})});Px.displayName="NotificationCenterTrigger";var Ex=W.forwardRef(({className:e,align:t="end",sideOffset:n=8,emptyMessage:r="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:m,triggerRef:f}=ai(),[p,g]=W.useState(false),h=W.useRef(null),[b,v]=W.useState({top:0,left:0});return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!i||!f.current||!h.current)return;let R=()=>{if(!f.current||!h.current)return;let w=f.current.getBoundingClientRect(),x=h.current.getBoundingClientRect(),C=w.bottom+n,y=w.left;t==="center"?y=w.left+w.width/2-x.width/2:t==="end"&&(y=w.right-x.width),y+x.width>window.innerWidth-16&&(y=window.innerWidth-x.width-16),y<16&&(y=16),v({top:C,left:y});};return R(),window.addEventListener("resize",R),window.addEventListener("scroll",R,true),()=>{window.removeEventListener("resize",R),window.removeEventListener("scroll",R,true);}},[i,f,t,n]),W.useEffect(()=>{if(!i)return;let R=x=>{h.current&&!h.current.contains(x.target)&&f.current&&!f.current.contains(x.target)&&l(false);},w=x=>{x.key==="Escape"&&l(false);};return document.addEventListener("mousedown",R),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",w);}},[i,l,f]),!p||!i?null:Ya.createPortal(jsxs("div",{ref:R=>{h.current=R,typeof s=="function"?s(R):s&&(s.current=R);},className:u("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:b.top,left:b.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:r})]}):c.map(R=>jsx(xc,{notification:R},R.id)))})]}),document.body)});Ex.displayName="NotificationCenterContent";var bE={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},vE={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},xc=({notification:e,onMarkAsRead:t,onRemove:n})=>{let{markAsRead:r,removeNotification:o}=ai(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:m,action:f}=e,p=vE[l],g=()=>{t?t():r(a);},h=()=>{n?n():o(a);},b=v=>{if(!v)return null;let R=typeof v=="string"?new Date(v):v,x=new Date().getTime()-R.getTime(),C=Math.floor(x/6e4),y=Math.floor(x/36e5),N=Math.floor(x/864e5);return C<1?"Just now":C<60?C+"m ago":y<24?y+"h ago":N<7?N+"d ago":R.toLocaleDateString()};return jsxs("div",{className:u("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",bE[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:m||jsx("div",{className:u("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:u("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:b(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};xc.displayName="NotificationItem";var Lx=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("divide-y",e),...n,children:t}));Lx.displayName="NotificationList";var Sx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),ME={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Dx=W.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,b]=W.useState(true),[v,R]=W.useState(false);W.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),W.useEffect(()=>{if(d&&h){let y=setTimeout(()=>{w();},d);return ()=>clearTimeout(y)}},[d,h]);let w=()=>{R(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let x=ME[t],C=r?o!==void 0?o:x?jsx(x,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Sx({variant:n,type:t,position:l}),c&&"animate-pulse",v&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:w,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});Dx.displayName="Banner";var ya=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-primary bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-primary bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),PE=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),Rc=W.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},b)=>{let[v,R]=W.useState(false),w=o&&o.length>0,x=k=>{w&&R(!v),p?.(k);},C=k=>{k.onClick?.(),R(false);},y={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&v?"rotate-45":"",T=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ya({position:m})),children:[w&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((k,M)=>jsxs("div",{className:u("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${M*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:u(ya({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:u(ya({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:b,type:"button",onClick:x,disabled:g,className:u(ya({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":w?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(PE({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),w&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>R(false)})]})});Rc.displayName="FloatingActionButton";var EE=Rc;var zx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),Ix=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Ox=W.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,hideLabels:i=false,showActiveLabel:l=false,renderItem:c,...d},m)=>{let[f,p]=W.useState(a||r[0]?.key),g=o!==void 0,h=g?o:f,b=x=>{x.disabled||(g||p(x.key),s?.(x.key));},v=x=>t==="filled"?x?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":x?"text-primary":"text-muted-foreground hover:text-foreground",R=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},w=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:m,className:u(zx({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...d,children:r.map(x=>{let C=h===x.key,y=!i&&(l?C:true),N=C&&x.activeIcon?x.activeIcon:x.icon;if(c)return jsx("div",{onClick:()=>b(x),className:u(Ix({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:c(x,C)},x.key);let T=jsxs("div",{onClick:()=>!x.href&&b(x),className:u(Ix({variant:t}),v(C),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":C?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),b(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(R(),"[&>svg]:h-full [&>svg]:w-full"),children:N}),x.badge!==void 0&&x.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:x.badge>99?"99+":x.badge}),x.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),y&&x.label&&jsx("span",{className:u(w(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>b(x),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",v(C)),children:T},x.key):T})})});Ox.displayName="BottomNavigation";var SE="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",Fx=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),Kx=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:SE,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(Fx({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});Kx.displayName="ActionSheet";var $x=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),Cc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Ux=W.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=W.useRef(null),[p,g]=W.useState(0),[h,b]=W.useState(false),v=W.useRef(0),R=W.useRef(0),w=n.length*(o==="sm"?64:o==="lg"?96:80),x=r.length*(o==="sm"?64:o==="lg"?96:80),C=M=>{i||(b(true),v.current=M.touches[0].clientX,R.current=p);},y=M=>{if(!h||i)return;let E=M.touches[0].clientX-v.current,D=R.current+E;(D>0&&n.length===0||D<0&&r.length===0)&&(D=0),D>w?D=w+(D-w)*.3:D<-x&&(D=-x+(D+x)*.3),g(D);},N=()=>{if(!h)return;b(false);let M=f.current?.offsetWidth||0,P=Math.abs(p)/M;if(l&&P>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>w*a&&n.length>0?(g(w),s?.("right")):p<-x*a&&r.length>0?(g(-x),s?.("left")):g(0);},T=(M,P)=>{M.onAction?.(),s?.(P,M.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:m,className:u($x({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:w},children:n.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"right"),className:u(Cc({variant:M.variant,size:o})),style:{opacity:Math.min(1,p/w)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:x},children:r.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"left"),className:u(Cc({variant:M.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/x)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:y,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});Ux.displayName="SwipeActions";var _x=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),IE=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),Yx=W.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=W.useRef(null),[b,v]=W.useState(0),[R,w]=W.useState("idle"),x=W.useRef(0),C=W.useRef(false),y=()=>l||R==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=E=>{y()&&(x.current=E.touches[0].clientY,C.current=true);},T=E=>{if(!C.current||!y())return;let H=E.touches[0].clientY-x.current;if(H<0){v(0),w("idle");return}let S=Math.min(H*.5,o);v(S),w(S>=r?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,R==="ready"){w("refreshing"),v(r*.6);try{await n();}finally{w("idle"),v(0);}}else w("idle"),v(0);},M={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(R==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(M,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let E=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(M,"text-muted-foreground transition-transform"),style:{transform:`rotate(${E}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:R==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(_x({variant:t,className:e})),...p,children:[jsx("div",{className:u(IE({size:i}),"z-10",R==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(r*.5),1)},children:P()}),jsx("div",{ref:h,className:u("transition-transform duration-200",R==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});Yx.displayName="PullToRefresh";var Ur=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),VE={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},jx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:VE,custom:i,transition:Ur(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});jx.displayName="Fade";var AE=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},Xx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=W.useMemo(()=>AE(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ur(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Xx.displayName="Slide";var zE={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},OE={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},qx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:OE,custom:i,transition:Ur(n,r,o),className:u(a),style:{transformOrigin:zE[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});qx.displayName="Scale";var Zx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Ur(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Zx.displayName="Collapse";var Qx=W.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Ur(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Qx.displayName="Expand";var Jx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ur(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Jx.displayName="Rotate";var ey=W.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:r?180:0},transition:Ur(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${m}(180deg)`},children:t})]})})});ey.displayName="Flip";var ty=W.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=W.useState([]),l=W.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(R=>[...R,v]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});ty.displayName="Ripple";var ny=W.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ny.displayName="Bounce";var KE={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},ry=W.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:KE[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ry.displayName="Shake";var GE={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},oy=W.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&GE[n],r),children:e}));oy.displayName="Pulse";var ay=W.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ay.displayName="Wiggle";var sy=W.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=W.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});sy.displayName="Pop";var jE=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},iy=W.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=W.useRef(null),g=useInView(p,{once:true}),[h,b]=W.useState(!l);W.useEffect(()=>{if(l&&g){let w=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(w)}},[l,g,c]);let v=useMotionValue(t),R=useTransform(v,w=>jE(w,r,s,i));return W.useEffect(()=>{if(h){let w=animate(v,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>w.stop()}},[h,e,n,v,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:R}),a]})})});iy.displayName="Counter";var ly=W.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=W.useState(""),[b,v]=W.useState(0),[R,w]=W.useState(false),[x,C]=W.useState(false),y=W.useRef(null),N=useInView(y,{once:true}),[T,k]=W.useState(!l);return W.useEffect(()=>{if(l&&N){let M=setTimeout(()=>k(true),n*1e3);return ()=>clearTimeout(M)}},[l,N,n]),W.useEffect(()=>{if(!T||x)return;let M=p[b],P;return R?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(w(false),v(E=>(E+1)%p.length)):g.length<M.length?P=setTimeout(()=>{h(M.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{w(true);},r):(C(true),m?.()),()=>clearTimeout(P)},[T,g,b,R,x,p,t,i,r,s,m]),jsxs("span",{ref:y,className:u(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:u("ml-0.5",d),children:a})]})});ly.displayName="Typewriter";var cy=W.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=W.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},b={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,R)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&R<p.length-1&&"\xA0"]},R))})})});cy.displayName="TextReveal";var dy=W.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=W.useState(0);W.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});dy.displayName="WordRotate";var fy=W.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=W.useRef(null),g=useInView(p,{once:a,amount:s}),b={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],v={hidden:{opacity:0,x:b.x,y:b.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});fy.displayName="ScrollReveal";var gy=W.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",b=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:b,backgroundColor:n}}),i&&jsx(qE,{progress:f,position:e})]})});gy.displayName="ScrollProgress";var qE=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=W.useState(0);return W.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},by=W.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=W.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});by.displayName="Parallax";var xy=W.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
55
+ `,document.body.appendChild(le),j.dataTransfer.setDragImage(le,20,15),setTimeout(()=>{document.body.removeChild(le);},0),h(e),C?.({event:j,node:e});},bt=j=>{if(j.preventDefault(),j.stopPropagation(),!g||g.key===e.key||se)return;let Se=j.currentTarget.getBoundingClientRect(),le=j.clientY-Se.top,Ge=Se.height,$e;le<Ge*.25?$e=-1:le>Ge*.75?$e=1:$e=0,!(w&&!w({dropNode:e,dropPosition:$e,dragNode:g}))&&(y(e.key,$e),x?.({event:j,node:e}));},br=j=>{j.preventDefault(),j.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:j,node:e,expandedKeys:K()});},Bn=j=>{j.stopPropagation(),T?.({event:j,node:e});},Bo=j=>{j.preventDefault(),j.stopPropagation(),!(!g||g.key===e.key||se)&&(v!==null&&R(e,v),h(null),y(null,null));},Ft=j=>{h(null),y(null,null),k?.({event:j,node:e});},Ea=j=>{se||Ce&&i(e.key,e,j);},vr=j=>{j.stopPropagation(),!se&&!q&&a(e.key,e);},$=W.useMemo(()=>{if(!Y||v===null)return "";switch(v){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[Y,v]),re=[...r,n];return jsxs("div",{className:"relative",children:[M&&t>0&&jsxs(Fragment,{children:[r.map((j,Se)=>!j&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Se} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Se)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":q?void 0:ne,"aria-selected":Ce?G:void 0,"aria-disabled":se,draggable:ct,onDragStart:On,onDragOver:bt,onDragEnter:br,onDragLeave:Bn,onDrop:Bo,onDragEnd:Ft,onClick:Ea,className:u("relative",_g({size:I,isSelected:G,isDragging:A,isDisabled:se,isHoverable:Ce&&!se}),$,z&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[ct&&E&&ee!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:ee}),jsx("button",{type:"button",onClick:vr,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",q&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",ne&&"rotate-90")})}),U&&jsx(VT,{checked:O,indeterminate:_,disabled:se,onClick:j=>m(e.key,e,j)}),P&&tt&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:tt}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",z&&"flex-none"),children:e.label})]}),B&&ne&&jsx("div",{role:"group",children:e.children.map((j,Se)=>jsx(jg,{node:j,level:t+1,isLast:Se===e.children.length-1,parentIsLastPath:re},j.key))})]})},AT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},zT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},Xg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Xg(n,t))return true;return false},qg=W.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:y=[],onCheck:R,showLine:w=false,showIcon:C=false,showHandle:x=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:M=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:E,onDragEnter:D,onDragOver:H,onDragLeave:L,onDragEnd:S,onDrop:V,blockNode:z=false,disabled:F=false,...I},K)=>{let B=W.useCallback(()=>l?new Set(AT(r)):new Set(i),[l,i,r]),[q,ne]=W.useState(B),G=s!==void 0,O=G?new Set(s):q,_=W.useCallback((pe,We)=>{let Kt=new Set(O),Ve=!Kt.has(pe);Ve?Kt.add(pe):Kt.delete(pe),G||ne(Kt),c?.(Array.from(Kt),{expanded:Ve,node:We});},[O,G,c]),[A,Y]=W.useState(new Set(p)),se=f!==void 0,Ce=se?new Set(f):A,U=W.useCallback((pe,We,Kt)=>{let Ve=new Set(Ce),gn=!Ve.has(pe);m?gn?Ve.add(pe):Ve.delete(pe):(Ve.clear(),gn&&Ve.add(pe)),se||Y(Ve);let Yr=[],Fo=La=>{for(let jr of La)Ve.has(jr.key)&&Yr.push(jr),jr.children&&Fo(jr.children);};Fo(r),g?.(Array.from(Ve),{selected:gn,selectedNodes:Yr,node:We,event:Kt});},[Ce,m,se,g,r]),[ct,ee]=W.useState(new Set(y)),[tt,On]=W.useState(new Set),bt=v!==void 0,br=bt?new Set(Array.isArray(v)?v:v.checked):ct,Bn=bt&&!Array.isArray(v)?new Set(v.halfChecked):tt,Bo=W.useCallback((pe,We,Kt)=>{let Ve=new Set(br),gn=new Set(Bn),Yr=!Ve.has(pe);if(Yr?(Ve.add(pe),gn.delete(pe)):Ve.delete(pe),!b&&We.children){let Ri=zT(We);for(let Kn of Ri)Yr?(Ve.add(Kn),gn.delete(Kn)):Ve.delete(Kn);}bt||(ee(Ve),On(gn));let Fo=[],La=Ri=>{for(let Kn of Ri)Ve.has(Kn.key)&&Fo.push(Kn),Kn.children&&La(Kn.children);};La(r);let jr=b?{checked:Array.from(Ve),halfChecked:Array.from(gn)}:Array.from(Ve);R?.(jr,{checked:Yr,checkedNodes:Fo,node:We,event:Kt,halfCheckedKeys:Array.from(gn)});},[br,Bn,b,bt,R,r]),[Ft,Ea]=W.useState(null),[vr,$]=W.useState(null),[re,j]=W.useState(null),Se=W.useCallback((pe,We)=>{$(pe),j(We);},[]),le=W.useCallback((pe,We)=>{!Ft||!V||We===0&&Xg(Ft,pe.key)||V({event:{},node:pe,dragNode:Ft,dropPosition:We,dropToGap:We!==0});},[Ft,V]),Ge=W.useCallback(()=>Array.from(O),[O]),$e={expandedKeys:O,toggleExpand:_,selectedKeys:Ce,handleSelect:U,selectable:d,multiple:m,checkedKeys:br,halfCheckedKeys:Bn,handleCheck:Bo,checkable:h,checkStrictly:b,draggable:o,draggedNode:Ft,setDraggedNode:Ea,dragOverKey:vr,dragOverPosition:re,setDragOver:Se,handleDrop:le,allowDrop:a,onDragStart:E,onDragEnter:D,onDragOver:H,onDragLeave:L,onDragEnd:S,showLine:w,showIcon:C,showHandle:x,dragIcon:N,icon:T,leafIcon:k,folderIcon:M,folderOpenIcon:P,blockNode:z,disabled:F,size:n,data:r,getAllKeys:Ge},Fn=pe=>{let We=pe.relatedTarget,Kt=pe.currentTarget;(!We||!Kt.contains(We))&&Se(null,null);};return jsx(Yg.Provider,{value:$e,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":m||h,className:u(Wg({variant:t,size:n,className:e})),onDragLeave:Fn,...I,children:r.map((pe,We)=>jsx(jg,{node:pe,level:0,isLast:We===r.length-1},pe.key))})})});qg.displayName="Tree";var Qg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),$T=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},UT=(e,t)=>{let[n,r]=W.useState(e);return W.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},Jg=W.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:y,...R},w)=>{let[C,x]=W.useState(false),[N,T]=W.useState(r),[k,M]=W.useState([]),[P,E]=W.useState(false),[D,H]=W.useState(false),[L,S]=W.useState(0),V=W.useRef(null),z=W.useRef(null),F=n!==void 0?n:N,I=UT(F,l);W.useEffect(()=>{let U=z.current;if(!U)return;let ct=()=>{S(U.offsetWidth);};ct();let ee=new ResizeObserver(ct);return ee.observe(U),()=>{ee.disconnect();}},[]),W.useImperativeHandle(w,()=>V.current);let K=i?k:s,B=W.useMemo(()=>i?K:K.filter(U=>U.label.toLowerCase().includes(F.toLowerCase())),[K,F,i]);W.useEffect(()=>{if(!i)return;if(I.length<c){M([]);return}let U=false;return (async()=>{E(true);try{let ee=await i(I);U||M(ee);}catch{U||M([]);}finally{U||E(false);}})(),()=>{U=true;}},[I,i,c]);let q=U=>{n===void 0&&T(U),o?.(U);},ne=U=>{let ct=U.target.value;q(ct),ct.length>=c&&x(true);},G=U=>{q(U.label),a?.(U),x(false);},O=()=>{q(""),V.current?.focus();},_=()=>{H(true),x(true);},A=()=>{H(false);},Y=U=>{U.key==="Escape"&&x(false),U.key==="ArrowDown"&&!C&&B.length>0&&x(true);},se=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ce=p&&F?"pr-8":"pr-3";return jsxs(nt,{open:C,onOpenChange:x,children:[jsxs(oo,{ref:z,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:F,onChange:ne,onFocus:_,onBlur:A,onKeyDown:Y,disabled:y,placeholder:d,className:u(Qg({size:t,fullWidth:v}),Ce,e),style:{borderColor:D?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...R}),p&&F&&!y&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:se})})]}),jsx(rt,{className:"p-0",align:"start",style:{width:L>0?L:void 0},onOpenAutoFocus:U=>U.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(ze,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(se,"animate-spin")}),f]}):B.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):B.map(U=>jsxs(Command.Item,{value:U.value,disabled:U.disabled,onSelect:()=>G(U),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",F===U.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx($T,{text:U.label,query:F}):U.label})]},U.value))})})})})]})});Jg.displayName="Autocomplete";var vl=W.createContext(null),hl=W.createContext(null),xl=()=>{let e=W.useContext(vl);if(!e)throw new Error("useFormContext must be used within a Form");return e},Rs=()=>{let e=W.useContext(hl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},WT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},eb=W.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=W.useState(e),[m,f]=W.useState({}),[p,g]=W.useState({}),[h,b]=W.useState({}),[v,y]=W.useState(false),R=W.useRef(new Map),w=W.useCallback((L,S)=>{R.current.set(L,S);},[]),C=W.useCallback(L=>{R.current.delete(L);},[]),x=W.useCallback(L=>{let S=R.current.get(L)||[],V=c[L];for(let z of S)if(!z.validate(V))return f(F=>({...F,[L]:z.message})),false;return f(z=>({...z,[L]:null})),true},[c]),N=W.useCallback(()=>{let L=true,S={};return R.current.forEach((V,z)=>{let F=c[z];for(let I of V)if(!I.validate(F)){S[z]=I.message,L=false;break}S[z]||(S[z]=null);}),f(S),L},[c]),T=W.useCallback((L,S)=>{d(V=>({...V,[L]:S})),b(V=>({...V,[L]:true})),o&&setTimeout(()=>{x(L);},0);},[o,x]),k=W.useCallback((L,S)=>{f(V=>({...V,[L]:S}));},[]),M=W.useCallback((L,S)=>{g(V=>({...V,[L]:S})),S&&r&&x(L);},[r,x]),P=W.useCallback(L=>({value:c[L],error:m[L]??null,touched:p[L]??false,dirty:h[L]??false}),[c,m,p,h]),E=W.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),D=async L=>{L.preventDefault();let S={};if(R.current.forEach((z,F)=>{S[F]=true;}),g(S),!N()){n?.(m);return}if(t){y(true);try{await t(c);}finally{y(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:T,setError:k,setTouched:M,validateField:x,validateAll:N,registerField:w,unregisterField:C,getFieldState:P,reset:E};return jsx(vl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:D,className:u("space-y-4",s),...i,children:a})})});eb.displayName="Form";var tb=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=xl(),a=W.useId();W.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(hl.Provider,{value:i,children:r})};tb.displayName="FormField";var nb=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));nb.displayName="FormItem";var rb=W.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Rs();return jsxs(Rr,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});rb.displayName="FormLabel";var ob=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Rs(),a=xl(),s=a.getFieldState(t),i=c=>{let d=c.target,m=d.type==="checkbox"?d.checked:d.value;a.setValue(t,m);},l=()=>{a.setTouched(t,true);};return W.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};ob.displayName="FormControl";var ab=W.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));ab.displayName="FormDescription";var sb=W.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=Rs(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...n,children:i}):null});sb.displayName="FormMessage";var lb=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),cb=W.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(lb({size:t,className:e})),...i,children:[jsxs(wr,{"data-user-avatar":true,children:[o&&jsx(Jr,{src:o,alt:n}),jsx(Cr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});cb.displayName="User";var ub=cva("font-mono rounded",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-transparent",ghost:"bg-transparent",soft:"bg-muted text-foreground",surface:"bg-muted/50 text-foreground border border-border"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"}},defaultVariants:{variant:"soft",size:"md"}}),mb=W.forwardRef(({className:e,variant:t,size:n,...r},o)=>jsx("code",{ref:o,className:u(ub({variant:t,size:n,className:e})),...r}));mb.displayName="Code";var pb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-transparent border-input",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),fb=W.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=W.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(pb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":m?"Copied":a,children:m?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});fb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),gb=W.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=W.useState("loading");W.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},v={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:u(wl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(wl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Ga,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:b,className:u("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...m})]})});gb.displayName="Image";var hb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),xb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),yb=W.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),Rb=W.forwardRef(({className:e,size:t="md",value:n,defaultValue:r="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=W.useState(r),m=n??c,f=p=>{let g;if(a){let h=Array.isArray(m)?m:[m].filter(Boolean);h.includes(p)?g=h.filter(b=>b!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(yb.Provider,{value:{value:m,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:u(hb({size:t,className:e})),...i,children:s})})});Rb.displayName="Listbox";var wb=W.forwardRef(({className:e,value:t,disabled:n,icon:r,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:m}=W.useContext(yb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{n||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!n&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":n?"":void 0,tabIndex:n?-1:0,className:u(xb({size:m}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[r&&jsx("span",{className:"mr-2 flex-shrink-0",children:r}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});wb.displayName="ListboxItem";var Tb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Mb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function oM({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=W.useState(null),[f,p]=W.useState(null),g=(R,w)=>{i||(m(w),R.dataTransfer.effectAllowed="move",R.dataTransfer.setData("text/plain",String(w)));},h=(R,w)=>{R.preventDefault(),!(i||d===null||d===w)&&p(w);},b=()=>{p(null);},v=(R,w)=>{if(R.preventDefault(),i||d===null||d===w){m(null),p(null);return}let C=[...r],[x]=C.splice(d,1);C.splice(w,0,x),o?.(C),m(null),p(null);},y=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(Tb({variant:t,size:n,className:e})),...l,children:r.map((R,w)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,w),onDragOver:C=>h(C,w),onDragLeave:b,onDrop:C=>v(C,w),onDragEnd:y,className:u(Mb({variant:t,size:n,isDragging:d===w,isDragOver:f===w}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(R,w)})]},R.id))})}var aM=W.forwardRef(oM);var Pb=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),cM={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Eb=W.forwardRef(({className:e,variant:t,loading:n=true,size:r="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u("relative",e),...i,children:[s,jsx("div",{className:u(Pb({variant:t,visible:n})),"aria-hidden":!n,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:u(cM[r],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Eb.displayName="LoadingOverlay";var Lb=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Sb=W.forwardRef(({className:e,color:t,isLoading:n=false,progress:r,showSpinner:o=false,...a},s)=>{let[i,l]=W.useState(0),[c,d]=W.useState(false),m=W.useRef(null);return W.useEffect(()=>{if(r!==void 0){l(r),d(r>0&&r<100);return}return n?(d(true),l(10),m.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{m.current&&clearInterval(m.current);}},[n,r]),!c&&r===void 0||r!==void 0&&(r<=0||r>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:u(Lb({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:u("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Sb.displayName="NProgress";var Vb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),Db={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},gM={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Ab=W.forwardRef(({className:e,variant:t="spinner",size:n="md",fullScreen:r,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:u(gM[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:u(Db[n||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:u(Db[n||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:u(Vb({variant:t,size:n,fullScreen:r,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:u("text-sm",l),children:o})]})})});Ab.displayName="Loading";var Ml=class extends W.Component{constructor(t){super(t),this.state={hasError:false,error:null};}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,n){this.props.onError?.(t,n);}componentDidUpdate(t){this.state.hasError&&this.props.resetKeys&&this.props.resetKeys.some((r,o)=>r!==t.resetKeys?.[o])&&this.reset();}reset=()=>{this.props.onReset?.(),this.setState({hasError:false,error:null});};render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsx(Nl,{error:this.state.error,onReset:this.reset}):this.props.children}},Nl=W.forwardRef(({error:e,onReset:t,className:n},r)=>jsxs("div",{ref:r,className:u("flex min-h-[200px] flex-col items-center justify-center gap-4 rounded-lg border border-danger/20 bg-danger/5 p-6 text-center",n),role:"alert",children:[jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger/10",children:jsx(AlertTriangle,{className:"h-6 w-6 text-danger"})}),jsxs("div",{className:"space-y-2",children:[jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Something went wrong"}),e&&jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:e.message||"An unexpected error occurred"})]}),t&&jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-md bg-danger px-4 py-2 text-sm font-medium text-danger-foreground hover:bg-danger/90 transition-colors",children:[jsx(RefreshCw,{className:"h-4 w-4"}),"Try again"]})]}));Nl.displayName="DefaultErrorFallback";var hM=Ml;var Ob=W.forwardRef(({value:e,defaultValue:t,onValueChange:n,placeholder:r="Pick a date range",dateFormat:o="LLL dd, y",disabled:a=false,minDate:s,maxDate:i,numberOfMonths:l=2,className:c,align:d="start"},m)=>{let[f,p]=W.useState(false),[g,h]=W.useState(t),b=e!==void 0,v=b?e:g,y=w=>{b||h(w),n?.(w);},R=w=>{if(!w)return r;let{from:C,to:x}=w;return C&&x?`${format(C,o)} - ${format(x,o)}`:C?format(C,o):r};return jsxs(nt,{open:f,onOpenChange:p,children:[jsxs(Lt,{ref:m,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!v?.from&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",c),children:[jsx(Calendar,{className:"h-4 w-4"}),R(v)]}),jsx(rt,{className:"w-auto p-0",align:d,children:jsx(so,{mode:"range",defaultMonth:v?.from,selected:v,onSelect:y,numberOfMonths:l,disabled:w=>!!(s&&w<s||i&&w>i),initialFocus:true})})]})});Ob.displayName="DateRangePicker";var bo=e=>String(e).padStart(2,"0"),Bb=W.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=W.useState(false),d=r?Array.from({length:24},(R,w)=>w):Array.from({length:12},(R,w)=>w+1),m=Array.from({length:Math.floor(60/o)},(R,w)=>w*o),f=R=>{if(!R)return n;if(r)return `${bo(R.hours)}:${bo(R.minutes)}`;let w=R.hours%12||12,C=R.hours>=12?"PM":"AM";return `${bo(w)}:${bo(R.minutes)} ${C}`},p=R=>{let w=e?.minutes??0,C=R;if(!r&&e){let x=e.hours>=12;x&&R!==12?C=R+12:!x&&R===12&&(C=0);}t?.({hours:C,minutes:w});},g=R=>{let w=e?.hours??0;t?.({hours:w,minutes:R});},h=R=>{if(!e)return;let w=e.hours;R==="AM"&&e.hours>=12?w=e.hours-12:R==="PM"&&e.hours<12&&(w=e.hours+12),t?.({hours:w,minutes:e.minutes});},b=()=>{let R=new Date;t?.({hours:R.getHours(),minutes:R.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(nt,{open:l,onOpenChange:c,children:[jsxs(Lt,{ref:i,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(rt,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(R=>jsx(oe,{variant:y===R?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(R),children:bo(R)},R))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(R=>jsx(oe,{variant:e?.minutes===R?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(R),children:bo(R)},R))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(oe,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(oe,{variant:v==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(oe,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(oe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Bb.displayName="TimePicker";var Fb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function wM({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=W.useRef(null),[p,g]=W.useState(0);W.useImperativeHandle(m,()=>f.current);let h=n.length*(r+l)-l,b=r+l,v=Math.max(0,Math.floor(p/b)-a),y=Math.ceil(o/b)+2*a,R=Math.min(n.length-1,v+y),w=x=>{let N=x.currentTarget.scrollTop;g(N),c?.(N);},C=W.useMemo(()=>{let x=[];for(let N=v;N<=R;N++)n[N]!==void 0&&x.push({item:n[N],index:N,style:{position:"absolute",top:N*b,left:0,right:0,height:r}});return x},[n,v,R,b,r]);return jsx("div",{ref:f,className:u(Fb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:x,index:N,style:T})=>jsx("div",{style:T,children:s(x,N)},i?i(x,N):N))})})}var CM=W.forwardRef(wM);var Gb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ll=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),$b=W.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,...f},p)=>{let g=W.useRef(null),h=W.useRef(null),b=W.useRef(false);W.useImperativeHandle(p,()=>g.current),W.useEffect(()=>{let y=h.current;if(!y)return;let R=new IntersectionObserver(w=>{let[C]=w;C.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return R.observe(y),()=>{R.disconnect();}},[a,s,o,l,c,d]);let v=jsx("div",{className:u(Ll({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:u(Gb({variant:t,className:e})),...f,children:[r,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||v),!a&&!s&&m&&jsx("div",{className:u(Ll({size:n}),"text-muted-foreground text-sm"),children:m})]})});$b.displayName="InfiniteScroll";var la=W.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));la.displayName="VisuallyHidden";var Wb={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},kM={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},_b=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Dl=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),Es=W.createContext(null),Hr=()=>{let e=W.useContext(Es);if(!e)throw new Error("Modal components must be used within a Modal");return e},jb=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=W.useState(false),b=e!==void 0,v=b?e:g,[y,R]=W.useState(false),w=W.useRef(null),C=W.useId(),x=W.useId();W.useEffect(()=>{R(true);},[]);let N=W.useCallback(P=>{b||h(P),t?.(P);},[b,t]);W.useEffect(()=>{if(v)return dt(),()=>ut()},[v]),W.useEffect(()=>{if(!v||i)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,N]);let T=P=>{s&&P.target===P.currentTarget&&N(false);},k=n?W.isValidElement(n)?W.cloneElement(n,{onClick:P=>{n.props.onClick?.(P),N(true);}}):jsx("button",{type:"button",onClick:()=>N(true),children:n}):null,M=()=>!y||!v?null:d==="outside"?Ya.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(_b(),Wb[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:T,children:jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(la,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsxs("button",{type:"button",className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:()=>N(false),children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(_b(),Wb[l]),onClick:T,"aria-hidden":"true"}),jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u(Dl({size:m}),kM[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(la,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsxs("button",{type:"button",className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:()=>N(false),children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),document.body);return jsxs(Es.Provider,{value:{open:v,onOpenChange:N,scrollBehavior:d,titleId:C,descriptionId:x},children:[k,M()]})});jb.displayName="Modal";var Xb=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=W.useState(n),i=t!==void 0,l=i?t:a,c=W.useId(),d=W.useId(),m=W.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(Es.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Xb.displayName="ModalRoot";var qb=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Hr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});qb.displayName="ModalTrigger";var Hl=({children:e,container:t})=>{let[n,r]=W.useState(false);return W.useEffect(()=>{r(true);},[]),n?Ya.createPortal(e,t||document.body):null};Hl.displayName="ModalPortal";var Il=W.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Hr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Il.displayName="ModalOverlay";var Vl=W.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Hr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Vl.displayName="ModalClose";var Zb=W.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Hr(),[f,p]=W.useState(false);return W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(l)return dt(),()=>ut()},[l]),W.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(Hl,{children:[jsx(Il,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Dl({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsxs(Vl,{className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Zb.displayName="ModalContent";var Qb=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qb.displayName="ModalHeader";var Jb=({className:e,children:t})=>(W.useContext(Es)?.scrollBehavior??"inside")==="inside"?jsx(ze,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});Jb.displayName="ModalBody";var ev=({className:e,children:t,...n})=>{let{onOpenChange:r}=Hr();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:W.Children.map(t,o=>W.isValidElement(o)?W.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};ev.displayName="ModalFooter";var tv=W.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Hr();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});tv.displayName="ModalTitle";var nv=W.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Hr();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});nv.displayName="ModalDescription";var av=cva("h-10 w-10 rounded-full p-2",{variants:{variant:{default:"bg-muted text-foreground",danger:"bg-danger/10 text-danger",warning:"bg-warning/10 text-warning",success:"bg-success/10 text-success",info:"bg-info/10 text-info"}},defaultVariants:{variant:"default"}}),IM=cva("",{variants:{variant:{default:"",danger:"bg-danger text-danger-foreground hover:bg-danger/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90",info:"bg-info text-info-foreground hover:bg-info/90"}},defaultVariants:{variant:"default"}}),VM=W.createContext(null),AM={default:HelpCircle,danger:XCircle,warning:AlertTriangle,success:CheckCircle,info:Info},Al=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,confirmText:a="Confirm",cancelText:s="Cancel",onConfirm:i,onCancel:l,showIcon:c=true,icon:d,variant:m="default",loading:f=false,disabled:p=false,className:g},h)=>{let[b,v]=W.useState(false),[y,R]=W.useState(false),[w,C]=W.useState(false),x=e!==void 0,N=x?e:b,T=AM[m||"default"],k=W.useId(),M=W.useId();W.useEffect(()=>{C(true);},[]);let P=W.useCallback(V=>{x||v(V),t?.(V);},[x,t]);W.useEffect(()=>{if(N)return dt(),()=>ut()},[N]);let E=async()=>{if(i){let V=i();if(V instanceof Promise){R(true);try{await V;}finally{R(false);}}}P(false);},D=()=>{l?.(),P(false);},H=f||y,L=n?W.isValidElement(n)?W.cloneElement(n,{onClick:V=>{n.props.onClick?.(V),P(true);}}):jsx("button",{type:"button",onClick:()=>P(true),children:n}):null,S=()=>!w||!N?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":N?"open":"closed",className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","aria-hidden":"true"}),jsxs("div",{ref:h,role:"alertdialog","aria-modal":"true","aria-labelledby":k,"aria-describedby":o?M:void 0,"data-state":N?"open":"closed",className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-md translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",g),children:[jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:items-start",children:[c&&jsx("div",{className:u(av({variant:m})),children:d||jsx(T,{className:"h-6 w-6"})}),jsxs("div",{className:"flex flex-col space-y-2 text-center sm:text-left",children:[jsx("h2",{id:k,className:"text-lg font-semibold",children:r}),o&&jsx("p",{id:M,className:"text-sm text-muted-foreground",children:o})]})]}),jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[jsx("button",{type:"button",className:u(bn({variant:"bordered"})),onClick:D,disabled:H,children:s}),jsx("button",{type:"button",className:u(bn(),IM({variant:m}),H&&"opacity-50 cursor-not-allowed"),onClick:E,disabled:p||H,children:H?jsxs("span",{className:"flex items-center gap-2",children:[jsxs("svg",{className:"h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):a})]})]})]}),document.body);return jsxs(VM.Provider,{value:{open:N,onOpenChange:P,titleId:k,descriptionId:M},children:[L,S()]})});Al.displayName="ConfirmDialog";function zM(){let[e,t]=W.useState({open:false,options:null,resolve:null}),n=W.useCallback(i=>new Promise(l=>{t({open:true,options:i,resolve:l});}),[]),r=W.useCallback(()=>{e.resolve?.(true),t({open:false,options:null,resolve:null});},[e.resolve]),o=W.useCallback(()=>{e.resolve?.(false),t({open:false,options:null,resolve:null});},[e.resolve]),a=W.useCallback(i=>{i||(e.resolve?.(false),t({open:false,options:null,resolve:null}));},[e.resolve]),s=W.useMemo(()=>e.options?jsx(Al,{open:e.open,onOpenChange:a,title:e.options.title,description:e.options.description,confirmText:e.options.confirmText,cancelText:e.options.cancelText,variant:e.options.variant,onConfirm:r,onCancel:o}):null,[e,r,o,a]);return {confirm:n,ConfirmDialog:s}}var jM=e=>e.map(t=>typeof t=="string"?{src:t}:t),zl=W.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=W.useMemo(()=>jM(e),[e]),[v,y]=W.useState(r),[R,w]=W.useState(1),[C,x]=W.useState(0),[N,T]=W.useState(false),[k,M]=W.useState(false),[P,E]=W.useState({x:0,y:0}),[D,H]=W.useState({x:0,y:0}),[L,S]=W.useState(false),V=W.useRef(null),z=b[v];W.useEffect(()=>{S(true);},[]),W.useEffect(()=>{y(r);},[r]),W.useEffect(()=>{o?.(v);},[v,o]),W.useEffect(()=>{w(1),x(0),E({x:0,y:0});},[v]),W.useEffect(()=>{if(t)return dt(),()=>ut()},[t]);let F=W.useCallback(()=>{y(ee=>ee>0?ee-1:b.length-1);},[b.length]),I=W.useCallback(()=>{y(ee=>ee<b.length-1?ee+1:0);},[b.length]),K=()=>{w(ee=>Math.min(ee+.5,4));},B=()=>{w(ee=>{let tt=Math.max(ee-.5,.5);return tt===1&&E({x:0,y:0}),tt});},q=()=>{x(ee=>(ee+90)%360);},ne=async()=>{if(z)try{let tt=await(await fetch(z.src)).blob(),On=URL.createObjectURL(tt),bt=document.createElement("a");bt.href=On,bt.download=z.alt||`image-${v+1}`,document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(On);}catch{window.open(z.src,"_blank");}},G=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=ee=>{R>1&&(M(true),H({x:ee.clientX-P.x,y:ee.clientY-P.y}));},_=ee=>{k&&R>1&&E({x:ee.clientX-D.x,y:ee.clientY-D.y});},A=()=>{M(false);},Y=()=>{n?.(false);},se=ee=>{p&&ee.target===ee.currentTarget&&Y();},Ce=W.useCallback(ee=>{switch(ee.key){case "ArrowLeft":F();break;case "ArrowRight":I();break;case "Escape":n?.(false);break;case "+":case "=":K();break;case "-":B();break}},[F,I,n]);if(W.useEffect(()=>{if(t)return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[t,Ce]),W.useEffect(()=>{let ee=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",ee),()=>document.removeEventListener("fullscreenchange",ee)},[]),b.length===0)return null;let U=a?W.isValidElement(a)?W.cloneElement(a,{onClick:ee=>{a.props.onClick?.(ee),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[U,!L||!t?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:se}),jsxs("div",{ref:h,className:u("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&b.length>1&&jsxs("span",{className:"text-sm",children:[v+1," / ",b.length]}),z?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:z.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(R*100),"%"]}),jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:ne,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:G,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:_,onMouseUp:A,onMouseLeave:A,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:F,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:z?.src,alt:z?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":R>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.y}px) scale(${R}) rotate(${C}deg)`},draggable:false})]}),z?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:z.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((ee,tt)=>jsx("button",{onClick:()=>y(tt),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===tt?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:ee.src,alt:ee.alt||`Thumbnail ${tt+1}`,className:"h-full w-full object-cover"})},tt))})]})]}),document.body)]})});zl.displayName="ImageViewer";var iv=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=W.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(zl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};iv.displayName="ImageViewerTrigger";var lv=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),cv=W.forwardRef(({className:e,color:t,size:n,position:r,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let m=a!=null;return jsxs("span",{ref:d,className:u(lv({color:t,size:m?void 0:n,position:r,ping:o}),m&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${r?.includes("right")?i:-i}px, ${r?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});cv.displayName="Indicator";var dv=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("relative inline-flex",e),...n,children:t}));dv.displayName="IndicatorWrapper";var mv=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),pv=W.forwardRef(({className:e,orientation:t,size:n,hideScrollbar:r=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=W.useRef(null),[c,d]=W.useState({top:false,bottom:false,left:false,right:false});W.useImperativeHandle(i,()=>l.current);let m=W.useCallback(()=>{let v=l.current;if(!v)return;let{scrollTop:y,scrollLeft:R,scrollHeight:w,scrollWidth:C,clientHeight:x,clientWidth:N}=v;d({top:y>0,bottom:y<w-x-1,left:R>0,right:R<C-N-1});},[]);W.useEffect(()=>{let v=l.current;if(v)return m(),v.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{v.removeEventListener("scroll",m),window.removeEventListener("resize",m);}},[m]);let p={sm:"20px",md:"40px",lg:"60px"}[n??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",b={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:u(mv({orientation:t,size:n}),r&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:b,...s,children:a})});pv.displayName="ScrollShadow";var fv=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",outline:"rounded border border-border text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),eN={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},tN={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},nN=e=>{let t=e.toLowerCase();return eN[t]||e.toUpperCase()},da=e=>{let t=e.toLowerCase();return tN[t]||t},Ls=e=>{let t=da(e);return ["meta","control","alt","shift"].includes(t)},gv=W.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{W.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Ls).map(da),p=m.filter(h=>!Ls(h)).map(da),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,y=f.includes("alt")===h.altKey,R=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());b&&v&&y&&R&&w&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(W.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:nN(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(fv({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});gv.displayName="Kbd";function rN(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;W.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Ls).map(da),i=a.filter(c=>!Ls(c)).map(da),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var bv=cva("inline-flex items-center justify-center rounded-md transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted",solid:"bg-muted hover:bg-muted/80",ghost:"hover:bg-accent hover:text-accent-foreground",outline:"border border-input hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{variant:"default",size:"md"}}),vv=W.forwardRef(({className:e,variant:t,size:n,value:r,successDuration:o=2e3,onCopySuccess:a,onCopyError:s,copyIcon:i,successIcon:l,...c},d)=>{let[m,f]=W.useState(false),p={sm:14,md:16,lg:20}[n??"md"],g=async()=>{try{await navigator.clipboard.writeText(r),f(!0),a?.(),setTimeout(()=>{f(!1);},o);}catch(h){s?.(h);}};return jsx("button",{ref:d,type:"button",className:u(bv({variant:t,size:n}),e),onClick:g,"aria-label":m?"Copied":"Copy to clipboard",...c,children:m?l??jsx(Check,{className:"text-success",style:{width:p,height:p}}):i??jsx(Copy,{style:{width:p,height:p}})})});vv.displayName="CopyButton";var xv=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),uN=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mN=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function pN(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function fN(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Hs(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ds(e){return Hs(e,new Date)}function hv(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Hs(r,t)||Hs(o,t)||r<t&&o>t})}var yv=W.forwardRef(({className:e,variant:t,size:n,events:r=[],view:o="month",onViewChange:a,date:s,onDateChange:i,onEventClick:l,onSlotClick:c,weekStartsOn:d=0,locale:m="en-US",...f},p)=>{let[g,h]=W.useState(new Date),b=s??g,v=M=>{i?i(M):h(M);},y=d===1?mN:uN,R=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),v(M);},w=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),v(M);},C=()=>{v(new Date);},x=()=>o==="day"?b.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(m,{year:"numeric",month:"long"}),N=()=>{let M=pN(b.getFullYear(),b.getMonth(),d);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:y.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,E)=>{let D=hv(r,P),H=P.getMonth()===b.getMonth();return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!H&&"bg-muted/30"),onClick:()=>c?.(P),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Ds(P)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:S=>{S.stopPropagation(),l?.(L);},children:L.title},L.id)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},E)})})]})},T=()=>{let M=fN(b,d),P=Array.from({length:24},(E,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((E,D)=>jsxs("div",{className:u("p-2 text-center border-l",Ds(E)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:y[D]}),jsx("div",{className:u("text-lg font-semibold",Ds(E)&&"text-primary"),children:E.getDate()})]},D))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(E=>jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),M.map((D,H)=>{let L=new Date(D);L.setHours(E,0,0,0);let S=r.filter(V=>{let z=new Date(V.start);return Hs(z,D)&&z.getHours()===E});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(L),children:S.map(V=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:V.color||"hsl(var(--primary))",color:"white"},onClick:z=>{z.stopPropagation(),l?.(V);},children:V.title},V.id))},H)})]},E))})})]})},k=()=>{let M=Array.from({length:24},(E,D)=>D),P=hv(r,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Ds(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(E=>{let D=new Date(b);D.setHours(E,0,0,0);let H=P.filter(L=>new Date(L.start).getHours()===E);return jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(D),children:H.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:S=>{S.stopPropagation(),l?.(L);},children:L.title},L.id))})]},E)})})})]})};return jsxs("div",{ref:p,className:u(xv({variant:t,size:n,className:e})),...f,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:C,children:"Today"}),jsx(oe,{variant:"ghost",size:"icon",onClick:R,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"ghost",size:"icon",onClick:w,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx("h2",{className:"text-lg font-semibold ml-2",children:x()})]}),jsx("div",{className:"flex items-center gap-1 border rounded-lg p-1",children:["month","week","day"].map(M=>jsx(oe,{variant:o===M?"solid":"ghost",size:"sm",onClick:()=>a?.(M),children:M.charAt(0).toUpperCase()+M.slice(1)},M))})]}),o==="month"&&N(),o==="week"&&T(),o==="day"&&k()]})});yv.displayName="FullCalendar";var ma=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),pa=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],Rv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ma({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));Rv.displayName="LineChart";var wv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));wv.displayName="BarChart";var Cv=W.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=pa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"}}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Cv.displayName="PieChart";var Tv=W.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=pa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...m},f)=>jsx("div",{ref:f,className:u(ma({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},labelStyle:{color:"hsl(var(--popover-foreground))"}}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));Tv.displayName="AreaChart";var kv=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),Pv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Wl=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function zN({card:e,columnId:t,variant:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u(Wl({variant:n,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function ON({column:e,variant:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:u(Pv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(ze,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(zN,{card:i,columnId:e.id,variant:t,renderCard:n,onCardClick:r},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var Ev=W.forwardRef(({className:e,variant:t,columns:n,onCardMove:r,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[m,f]=W.useState(null),[p,g]=W.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),b=w=>n.find(C=>C.cards.some(x=>x.id===w));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:w=>{let{active:C}=w,x=b(C.id);if(x){let N=x.cards.find(T=>T.id===C.id);N&&(f(N),g(x.id));}},onDragOver:w=>{let{active:C,over:x}=w;if(!x)return;let N=C.id,T=x.id,k=b(N),M=b(T)||n.find(D=>D.id===T);if(!k||!M||k.id===M.id)return;let P=M.cards.findIndex(D=>D.id===T),E=P===-1?M.cards.length:P;r?.(N,k.id,M.id,E);},onDragEnd:w=>{let{active:C,over:x}=w;if(x&&C.id!==x.id){let N=b(C.id),T=b(x.id)||n.find(k=>k.id===x.id);if(N&&T){let k=T.cards.findIndex(P=>P.id===x.id),M=k===-1?T.cards.length:k;r?.(C.id,N.id,T.id,M);}}f(null),g(null);},children:[jsx("div",{ref:d,className:u(kv({variant:t,className:e})),...c,children:n.map(w=>jsx(ON,{column:w,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},w.id))}),jsx(DragOverlay,{children:m&&p&&jsx("div",{className:u(Wl({variant:t,isDragging:true})),children:s?s(m,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:m.title}),m.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:m.description})]})]})})})]})});Ev.displayName="KanbanBoard";var Lv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Sv=W.createContext(null);function _l(){let e=W.useContext(Sv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Dv=W.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=BN({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=W.useState(false),[h,b]=W.useState(false),[v,y]=W.useState(0),[R,w]=W.useState([]),C=W.useCallback(M=>{M&&(y(M.selectedScrollSnap()),g(M.canScrollPrev()),b(M.canScrollNext()));},[]),x=W.useCallback(()=>{f?.scrollPrev();},[f]),N=W.useCallback(()=>{f?.scrollNext();},[f]),T=W.useCallback(M=>{f?.scrollTo(M);},[f]),k=W.useCallback(M=>{M.key==="ArrowLeft"?(M.preventDefault(),x()):M.key==="ArrowRight"&&(M.preventDefault(),N());},[x,N]);return W.useEffect(()=>{!f||!l||l(f);},[f,l]),W.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Sv.Provider,{value:{carouselRef:m,api:f,scrollPrev:x,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:R,scrollTo:T},children:jsxs("div",{ref:d,className:u(Lv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Yl,{}),jsx(jl,{})]}),i&&R.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:R.map((M,P)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});Dv.displayName="Carousel";var Hv=W.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));Hv.displayName="CarouselContent";var Iv=W.forwardRef(({className:e,basis:t="basis-full",...n},r)=>jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0 pl-4",t,e),...n}));Iv.displayName="CarouselItem";var Yl=W.forwardRef(({className:e,variant:t="bordered",size:n="icon",...r},o)=>{let{scrollPrev:a,canScrollPrev:s}=_l();return jsxs(oe,{ref:o,variant:t,size:n,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...r,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Yl.displayName="CarouselPrevious";var jl=W.forwardRef(({className:e,variant:t="bordered",size:n="icon",...r},o)=>{let{scrollNext:a,canScrollNext:s}=_l();return jsxs(oe,{ref:o,variant:t,size:n,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...r,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});jl.displayName="CarouselNext";var Vv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),Bs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},ql={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u{1F44D}","\u{1F44E}","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9BF}","\u{1F9B5}","\u{1F9B6}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F94C}","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},Av=W.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=W.useState(r.length>0?"recent":o),[m,f]=W.useState(""),g=m?Object.values(ql).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:ql[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:u(Vv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(za,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx("div",{className:"flex border-b px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:u("flex-1 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Bs[b].name,children:v},b))}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Bs[c].name}),jsx(ze,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,v)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(b),children:b},`${b}-${v}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});Av.displayName="EmojiPicker";var zv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),vk=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),hk=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),_e=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Un,{children:[jsx(Wn,{children:jsx(oe,{type:"button",variant:n?"solid":"ghost",size:"icon",className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(_n,{side:"top",className:"text-xs",children:t})]}),Ov=W.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[jN.configure({heading:{levels:[1,2,3]}}),XN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),qN,ZN.configure({types:["heading","paragraph"]}),QN.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});W.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),W.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,b=window.prompt("URL",h);if(b!==null){if(b===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:b}).run();}};return p?jsx($n,{children:jsxs("div",{ref:f,className:u(zv({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(vk({size:n})),children:[jsx(_e,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(_e,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(_e,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(_e,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(_e,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(_e,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(_e,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(_e,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(_e,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(_e,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(_e,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(Gn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(_e,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(_e,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:u(hk({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Ov.displayName="RichTextEditor";var Fv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function Nk(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function Bv(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var Kv=W.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=W.useRef(null),[h,b]=W.useState(),[v,y]=W.useState(),[R,w]=W.useState(1),[C,x]=W.useState(0),N=P=>{let{width:E,height:D}=P.currentTarget;if(r){let H=Nk(E,D,r);b(H);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},T=P=>{b(P),o?.(P);},k=async P=>{if(y(P),a&&g.current&&P.width&&P.height){let E=await Bv(g.current,P,C,R);a(E);}},M=()=>{x(P=>(P+90)%360);};return W.useEffect(()=>{v&&g.current&&a&&Bv(g.current,v,C,R).then(P=>{a(P);});},[R,C,v,a]),jsxs("div",{ref:p,className:u(Fv({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(xk,{crop:h,onChange:T,onComplete:k,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",onLoad:N,style:{transform:`scale(${R}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Za,{value:[R],onValueChange:([P])=>w(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(oe,{variant:"bordered",size:"icon",onClick:M,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Kv.displayName="ImageCropper";var ec=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Ek={sm:96,md:128,lg:192},$v=W.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??Ek[n??"md"];return r?jsx("div",{ref:h,className:u(ec({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(kk,{value:r,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:u(ec({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});$v.displayName="QRCode";var Uv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});Uv.displayName="ThemeProvider";var Ak=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Wv=W.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=W.useState(false);W.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?r==="cycle"?jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(to,{children:[jsx(no,{children:jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(ro,{align:"end",children:[jsxs(Yn,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Yn,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Yn,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Wv.displayName="ThemeToggle";var _v=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Yv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),jv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Xv=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let b=W.useId(),v=p||b,y=`${v}-description`,R=`${v}-error`,w=a&&r;return jsxs("div",{className:u(_v({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(jv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[m&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:m}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":w?R:n?y:void 0,"aria-required":o,className:u(Yv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!w&&jsx("p",{id:y,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:R,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Xv.displayName="TextField";var Qv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Bk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),qv=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Zv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Fk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Jv=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:m,max:f,step:p=1,value:g,defaultValue:h,onChange:b,showButtons:v=true,formatOptions:y,fullWidth:R=false,disabled:w,id:C,...x},N)=>{let T=W.useId(),k=C||T,M=`${k}-description`,P=`${k}-error`,[E,D]=W.useState(h),[H,L]=W.useState(false),S=g!==void 0?g:E,V=a&&r,z=W.useCallback(O=>{O!==void 0&&(m!==void 0&&O<m&&(O=m),f!==void 0&&O>f&&(O=f)),g===void 0&&D(O),b?.(O);},[g,m,f,b]),F=()=>{let O=(S??0)+p;z(O);},I=()=>{let O=(S??0)-p;z(O);},K=O=>{let _=O.target.value;if(_==="")z(void 0);else {let A=parseFloat(_);isNaN(A)||z(A);}},B=O=>{O.key==="ArrowUp"?(O.preventDefault(),F()):O.key==="ArrowDown"&&(O.preventDefault(),I());},q=W.useMemo(()=>S===void 0?"":y?new Intl.NumberFormat(void 0,y).format(S):S.toString(),[S,y]),ne=m!==void 0&&S!==void 0&&S<=m,G=f!==void 0&&S!==void 0&&S>=f;return jsxs("div",{className:u(Qv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(Fk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx("button",{type:"button",onClick:I,disabled:w||ne,className:u(qv({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:u(Zv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:q,onChange:K,onKeyDown:B,onFocus:()=>L(true),onBlur:()=>L(false),"aria-invalid":a,"aria-describedby":V?P:n?M:void 0,"aria-required":o,"aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":S,disabled:w,className:u(Bk({size:s,isInvalid:a,fullWidth:R}),!v&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...x}),v&&jsx("button",{type:"button",onClick:F,disabled:w||G,className:u(qv({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:u(Zv({size:s}))})})]}),n&&!V&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),V&&jsx("p",{id:P,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Jv.displayName="NumberField";var th=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),$k=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),eh=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Uk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Wk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),nh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:y,placeholder:R="Search...",id:w,...C},x)=>{let N=W.useId(),T=w||N,k=`${T}-description`,M=`${T}-error`,[P,E]=W.useState(f),D=m!==void 0?m:P,H=a&&r,L=D.length>0,S=F=>{let I=F.target.value;m===void 0&&E(I),p?.(I);},V=()=>{m===void 0&&E(""),p?.(""),g?.();},z=F=>{F.key==="Enter"?(F.preventDefault(),h?.(D)):F.key==="Escape"&&L&&(F.preventDefault(),V());};return jsxs("div",{className:u(th({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Uk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx(Search,{className:u(eh({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:x,id:T,type:"search",value:D,onChange:S,onKeyDown:z,placeholder:R,"aria-invalid":a,"aria-describedby":H?M:n?k:void 0,"aria-required":o,disabled:y,className:u($k({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&L&&!y&&jsx("button",{type:"button",onClick:V,className:u(Wk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(eh({size:s}))})})]}),n&&!H&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});nh.displayName="SearchField";var rh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Yk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-calendar-picker-indicator]:hidden",{variants:{size:{sm:"h-8 pl-3 pr-8 py-1.5 text-xs",md:"h-10 pl-3 pr-10 py-2 text-sm",lg:"h-12 pl-4 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),jk=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Xk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),sc=(e,t="yyyy-MM-dd")=>{if(!e)return "";let n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return t.replace("yyyy",String(n)).replace("MM",r).replace("dd",o)},qk=e=>{if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},oh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="yyyy-MM-dd",showIcon:v=true,fullWidth:y=false,disabled:R,id:w,...C},x)=>{let N=W.useId(),T=w||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=x||P,[D,H]=W.useState(f??null),[L,S]=W.useState(false),V=()=>{!R&&E.current&&E.current.showPicker?.();},z=m!==void 0?m:D,F=a&&r,I=ne=>{let G=qk(ne.target.value);m===void 0&&H(G),p?.(G);},K=z?sc(z,"yyyy-MM-dd"):"",B=g?sc(g,"yyyy-MM-dd"):void 0,q=h?sc(h,"yyyy-MM-dd"):void 0;return jsxs("div",{className:u(rh({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Xk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u("relative",y?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:T,type:"date",value:K,onChange:I,onFocus:()=>S(true),onBlur:()=>S(false),min:B,max:q,"aria-invalid":a,"aria-describedby":F?M:n?k:void 0,"aria-required":o,disabled:R,className:u(Yk({size:s,isInvalid:a,fullWidth:y}),!v&&"pr-3",l),style:{borderColor:L?"var(--color-foreground)":void 0},...C}),v&&jsx("button",{type:"button",onClick:V,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(jk({size:s}))})})]}),n&&!F&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),F&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});oh.displayName="DateField";var ah=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Zk=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),Qk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),sh=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:y,fullWidth:R=false,id:w,...C},x)=>{let N=W.useId(),T=w||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=W.useRef(null),D=W.useRef(null),H=W.useRef(null),[L,S]=W.useState(f??null),V=m!==void 0?m:L,z=a&&r,F=$=>v===24?$:$===0?12:$>12?$-12:$,I=$=>$>=12?"PM":"AM",K=($,re)=>re==="AM"?$===12?0:$:$===12?12:$+12,[B,q]=W.useState(V?String(F(V.hour)).padStart(2,"0"):""),[ne,G]=W.useState(V?String(V.minute).padStart(2,"0"):""),[O,_]=W.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[A,Y]=W.useState(V?I(V.hour):"AM"),[se,Ce]=W.useState(false);W.useEffect(()=>{m!==void 0&&(m?(q(String(F(m.hour)).padStart(2,"0")),G(String(m.minute).padStart(2,"0")),m.second!==void 0&&_(String(m.second).padStart(2,"0")),Y(I(m.hour))):(q(""),G(""),_("")));},[m,v]);let U=($,re,j,Se)=>{let le=parseInt($,10),Ge=parseInt(re,10),$e=b?parseInt(j,10):void 0;if(isNaN(le)||isNaN(Ge)||b&&isNaN($e)){m===void 0&&S(null),p?.(null);return}let pe={hour:v===12?K(le,Se):le,minute:Ge,...b&&$e!==void 0&&{second:$e}};m===void 0&&S(pe),p?.(pe);},ct=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);q(re);let j=v===24?23:12,Se=v===24?0:1;if(re.length===2){let le=parseInt(re,10);le>=Se&&le<=j&&(E.current?.focus(),E.current?.select());}},ee=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);if(G(re),re.length===2){let j=parseInt(re,10);j>=0&&j<=59&&(b?(D.current?.focus(),D.current?.select()):v===12&&H.current?.focus());}},tt=$=>{let re=$.target.value.replace(/\D/g,"").slice(0,2);_(re),re.length===2&&v===12&&H.current?.focus();},On=()=>{if(B){let $=parseInt(B,10),re=v===24?23:12,Se=Math.min(Math.max($,v===24?0:1),re),le=String(Se).padStart(2,"0");q(le),U(le,ne,O,A);}},bt=()=>{if(ne){let $=parseInt(ne,10),re=Math.min(Math.max($,0),59),j=String(re).padStart(2,"0");G(j),U(B,j,O,A);}},br=()=>{if(O){let $=parseInt(O,10),re=Math.min(Math.max($,0),59),j=String(re).padStart(2,"0");_(j),U(B,ne,j,A);}},Bn=()=>{let $=A==="AM"?"PM":"AM";Y($),U(B,ne,O,$);},Bo=$=>{let re=$.key.toLowerCase();re==="a"?($.preventDefault(),A!=="AM"&&(Y("AM"),U(B,ne,O,"AM"))):re==="p"?($.preventDefault(),A!=="PM"&&(Y("PM"),U(B,ne,O,"PM"))):re==="arrowup"||re==="arrowdown"?($.preventDefault(),Bn()):re==="arrowleft"&&($.preventDefault(),b?(D.current?.focus(),D.current?.select()):(E.current?.focus(),E.current?.select()));},Ft=($,re)=>{if($.key==="ArrowUp"||$.key==="ArrowDown"){$.preventDefault();let j=$.key==="ArrowUp"?1:-1;if(re==="hour"){let Se=parseInt(B,10)||0,le=v===24?23:12,Ge=v===24?0:1,$e=Se+j;$e>le&&($e=Ge),$e<Ge&&($e=le);let Fn=String($e).padStart(2,"0");q(Fn),U(Fn,ne,O,A);}else if(re==="minute"){let le=(parseInt(ne,10)||0)+j;le>59&&(le=0),le<0&&(le=59);let Ge=String(le).padStart(2,"0");G(Ge),U(B,Ge,O,A);}else if(re==="second"){let le=(parseInt(O,10)||0)+j;le>59&&(le=0),le<0&&(le=59);let Ge=String(le).padStart(2,"0");_(Ge),U(B,ne,Ge,A);}}$.key==="ArrowRight"&&($.preventDefault(),re==="hour"?(E.current?.focus(),E.current?.select()):re==="minute"&&b?(D.current?.focus(),D.current?.select()):(re==="minute"&&!b&&v===12||re==="second"&&v===12)&&H.current?.focus()),$.key==="ArrowLeft"&&($.preventDefault(),re==="minute"?(P.current?.focus(),P.current?.select()):re==="second"&&(E.current?.focus(),E.current?.select())),$.key==="Backspace"&&$.currentTarget.value===""&&(re==="minute"?P.current?.focus():re==="second"&&E.current?.focus());},vr=u((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",y&&"cursor-not-allowed");return jsxs("div",{ref:x,className:u(ah({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:u(Qk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(Zk({size:s,isInvalid:a,disabled:y,fullWidth:R}),l),style:{borderColor:se?"var(--color-foreground)":void 0},onFocus:()=>Ce(true),onBlur:$=>{$.currentTarget.contains($.relatedTarget)||Ce(false);},children:[jsx("input",{ref:P,id:T,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:B,onChange:ct,onBlur:On,onKeyDown:$=>Ft($,"hour"),onFocus:$=>$.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":z?M:n?k:void 0,"aria-required":o,disabled:y,className:vr}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:E,type:"text",inputMode:"numeric",placeholder:"mm",value:ne,onChange:ee,onBlur:bt,onKeyDown:$=>Ft($,"minute"),onFocus:$=>$.target.select(),"aria-label":"Minute",disabled:y,className:vr}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:D,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:tt,onBlur:br,onKeyDown:$=>Ft($,"second"),onFocus:$=>$.target.select(),"aria-label":"Second",disabled:y,className:vr})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:Bn,onKeyDown:Bo,disabled:y,className:u("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",y&&"cursor-not-allowed"),"aria-label":"AM/PM",children:A})]}),n&&!z&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),z&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});sh.displayName="TimeField";var lh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),eP=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono uppercase",{variants:{size:{sm:"h-8 pl-10 pr-3 py-1.5 text-xs",md:"h-10 pl-12 pr-3 py-2 text-sm",lg:"h-12 pl-14 pr-4 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),tP=cva("absolute left-2 top-1/2 -translate-y-1/2 rounded border border-input overflow-hidden",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),nP=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),ih=e=>/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e),rP=e=>(e.startsWith("#")||(e="#"+e),e.length===4&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),e.toUpperCase()),ch=W.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="#000000",onChange:p,showSwatch:g=true,showPicker:h=true,allowAlpha:b=false,fullWidth:v=false,disabled:y,id:R,...w},C)=>{let x=W.useId(),N=R||x,T=`${N}-picker`,k=`${N}-description`,M=`${N}-error`,[P,E]=W.useState(f),[D,H]=W.useState(false),L=m!==void 0?m:P,S=a&&r,V=K=>{let B=K.target.value;B&&!B.startsWith("#")&&(B="#"+B),m===void 0&&E(B),p?.(B);},z=K=>{let B=K.target.value.toUpperCase();m===void 0&&E(B),p?.(B);},F=()=>{if(L&&ih(L)){let K=rP(L);K!==L&&(m===void 0&&E(K),p?.(K));}},I=ih(L)?L:"#000000";return jsxs("div",{className:u(lh({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:u(nP({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[g&&jsx("div",{className:u(tP({size:s})),children:h?jsxs("label",{htmlFor:T,className:"block h-full w-full cursor-pointer",children:[jsx("input",{id:T,type:"color",value:I,onChange:z,disabled:y,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0",tabIndex:-1}),jsx("div",{className:"h-full w-full",style:{backgroundColor:I}})]}):jsx("div",{className:"h-full w-full",style:{backgroundColor:I}})}),jsx("input",{ref:C,id:N,type:"text",value:L,onChange:V,onFocus:()=>H(true),onBlur:()=>{H(false),F();},placeholder:"#000000",maxLength:b?9:7,"aria-invalid":a,"aria-describedby":S?M:n?k:void 0,"aria-required":o,disabled:y,className:u(eP({size:s,isInvalid:a,fullWidth:v}),!g&&"pl-3",l),style:{borderColor:D?"var(--color-foreground)":void 0},...w})]}),n&&!S&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),S&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});ch.displayName="ColorField";var uh=cva("inline-flex",{variants:{variant:{default:"",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),mh=W.createContext({});function aP(){return W.useContext(mh)}var ph=W.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(mh.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:u(uh({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));ph.displayName="ButtonGroup";var gh=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),bh=W.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],y=(w,C)=>{C&&C(),l&&l(w);},R=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>y(w.key,w.onPress),className:u("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:b),"aria-label":w.label,children:[w.icon&&jsx("span",{className:v,children:w.icon}),c&&jsx("span",{children:w.label})]},w.key);return jsxs("div",{ref:f,role:"group",className:u(gh({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(w=>d?d(w):R(w)),g.length>0&&jsxs(to,{children:[jsx(no,{"aria-label":"More actions",className:u("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",b),children:jsx(MoreHorizontal,{className:v})}),jsx(ro,{align:"end",children:g.map(w=>jsxs(Yn,{disabled:w.isDisabled,onClick:()=>y(w.key,w.onPress),children:[w.icon&&jsx("span",{className:u(v,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});bh.displayName="ActionGroup";var yh=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),lP=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),Rh=W.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(yh({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(lP({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));Rh.displayName="StatusLight";var Ch=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),dP=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),uP=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),mP=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Th=W.forwardRef(({className:e,size:t,illustration:n,heading:r,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(Ch({size:t,className:e})),...s,children:[n&&jsx("div",{className:u(dP({size:t})),"aria-hidden":"true",children:n}),r&&jsx("h3",{className:u(uP({size:t})),children:r}),o&&jsx("p",{className:u(mP({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));Th.displayName="IllustratedMessage";var kh=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),xP={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Ph=W.forwardRef(({className:e,variant:t,title:n,icon:r,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[m,f]=W.useState(true);if(!m)return null;let p=xP[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:u(kh({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:r||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[n&&jsx("div",{className:"font-medium",children:n}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Ph.displayName="InlineAlert";var Eh=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),Lh=W.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let m=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Eh({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx("button",{type:"button",onClick:a,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors","aria-label":"Close action bar",children:jsx(X,{className:"h-4 w-4"})})]})]})});Lh.displayName="ActionBar";var Sh=W.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));Sh.displayName="ActionBarButton";var Ih=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Vh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Ah({className:e,variant:t,size:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),[h,b]=W.useState(null),[v,y]=W.useState(null),R=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),w=T=>{if(a==="none")return;let k;a==="single"?k=R.has(T)?new Set:new Set([T]):(k=new Set(R),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{b(k),T.dataTransfer.effectAllowed="move";},x=(T,k)=>{T.preventDefault(),h!==k&&y(k);},N=()=>{if(h&&v&&h!==v){let T=r.findIndex(E=>E.key===h),k=r.findIndex(E=>E.key===v),M=[...r],[P]=M.splice(T,1);M.splice(k,0,P),l?.(M);}b(null),y(null);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:u(Ih({variant:t,size:n,className:e})),...f,children:r.map(T=>{let k=R.has(T.key),M=h===T.key,P=v===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>w(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:E=>C(E,T.key),onDragOver:E=>x(E,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&w(T.key),className:u(Vh({variant:t,size:n,isSelected:k,isDisabled:T.isDisabled}),M&&"opacity-50",P&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:u("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}Ah.displayName="ListView";var zh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),MP=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),NP=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),Oh=W.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,y]=W.useState(o),R=r!==void 0,w=R?r:v,C=W.useRef(null),[x,N]=W.useState(false),[T,k]=W.useState(null),M=(I,K)=>{if(!C.current)return w[0];let B=C.current.getBoundingClientRect(),q;t==="horizontal"?q=(I-B.left)/B.width:q=1-(K-B.top)/B.height,q=Math.max(0,Math.min(1,q));let ne=i+q*(l-i),G=Math.round(ne/c)*c;return Math.max(i,Math.min(l,G))},P=(I,K)=>{let B=[...w];B[K]=I,K===0&&I>w[1]&&(B[0]=w[1]),K===1&&I<w[0]&&(B[1]=w[0]),R||y(B),a?.(B);},E=(I,K)=>{d||(I.preventDefault(),N(true),k(K),I.target.setPointerCapture(I.pointerId));},D=I=>{if(!x||T===null||d)return;let K=M(I.clientX,I.clientY);P(K,T);},H=()=>{x&&(N(false),k(null),s?.(w));},L=I=>{if(d)return;let K=M(I.clientX,I.clientY),B=Math.abs(w[0]-K),q=Math.abs(w[1]-K),ne=B<=q?0:1;P(K,ne);let G=[...w];G[ne]=K,s?.(G);},S=(I,K)=>{if(d)return;let B=w[K];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),B=Math.min(l,w[K]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),B=Math.max(i,w[K]-c);break;case "Home":I.preventDefault(),B=i;break;case "End":I.preventDefault(),B=l;break;default:return}P(B,K);let q=[...w];q[K]=B,s?.(q);},V=I=>(I-i)/(l-i)*100,z={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],F={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(w[0])}),jsx("span",{children:f(w[1])})]}),jsxs("div",{ref:b,className:u(zh({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(MP({orientation:t,size:n})),onClick:L,children:jsx("div",{className:u("absolute rounded-full",z,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(w[0])}%`,right:`${100-V(w[1])}%`,top:0,bottom:0}:{bottom:`${V(w[0])}%`,top:`${100-V(w[1])}%`,left:0,right:0}})}),w.map((I,K)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:u(NP({size:n}),x&&T===K&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${F/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${F/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:B=>E(B,K),onPointerMove:D,onPointerUp:H,onPointerCancel:H,onKeyDown:B=>S(B,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});Oh.displayName="RangeSlider";var pc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),SP=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),DP={help:HelpCircle,info:Info,warning:AlertCircle},Kh=W.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=W.useState(false),[b,v]=W.useState(false),[y,R]=W.useState({top:0,left:0}),w=W.useRef(null),C=W.useRef(null),x=i!==void 0?i:g,N=W.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!x||!w.current)return;let P=()=>{let E=w.current.getBoundingClientRect(),D=288,H=8,L=0,S=0;switch(a){case "top":L=E.top-H,S=E.left+E.width/2;break;case "bottom":L=E.bottom+H,S=E.left+E.width/2;break;case "left":L=E.top+E.height/2,S=E.left-H;break;case "right":L=E.top+E.height/2,S=E.right+H;break}if(a==="top"||a==="bottom")switch(s){case "start":S=E.left;break;case "center":S=E.left+E.width/2-D/2;break;case "end":S=E.right-D;break}S=Math.max(8,Math.min(S,window.innerWidth-D-8)),R({top:L,left:S});};return P(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[x,a,s]),W.useEffect(()=>{if(!x)return;let P=E=>{C.current&&!C.current.contains(E.target)&&w.current&&!w.current.contains(E.target)&&N(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[x,N]),W.useEffect(()=>{if(!x)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[x,N]);let T=DP[e??"help"],k=()=>{N(!x);},M=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?W.isValidElement(o)?W.cloneElement(o,{ref:w,onClick:P=>{o.props.onClick?.(P),k();}}):jsx("button",{ref:w,type:"button",onClick:k,className:u(pc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:k,className:u(pc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),b&&x&&Ya.createPortal(jsxs("div",{ref:C,className:u(SP({size:t}),f),style:{position:"fixed",top:y.top,left:y.left,transformOrigin:M()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Kh.displayName="ContextualHelp";var $h=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),fc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"outline",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Uh({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,b]=W.useState(new Set),v=W.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),y=x=>{if(s==="none")return;let N;s==="single"?N=v.has(x)?new Set:new Set([x]):(N=new Set(v),N.has(x)?N.delete(x):N.add(x)),a||b(N),i?.(N);},R=(x,N)=>{N.stopPropagation(),c?.(x);},w=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u($h({spacing:t}),e),...g,children:[w.map(x=>{let N=v.has(x.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!x.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!x.isDisabled&&y(x.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!x.isDisabled&&(k.preventDefault(),y(x.key));},style:x.color?{backgroundColor:x.color}:void 0,className:u(fc({variant:x.color?void 0:n,size:r,isSelected:N,isDisabled:x.isDisabled}),T&&!x.isDisabled&&"cursor-pointer hover:opacity-80",x.color&&"text-white"),children:[x.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:x.icon}),x.label,l&&!x.isDisabled&&jsx("button",{type:"button",onClick:k=>R(x.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${x.label}`,children:jsx(X,{className:"h-3 w-3"})})]},x.key)}),C>0&&jsxs("span",{className:u(fc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Uh.displayName="TagGroup";var Yh=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),jh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Xh({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),h=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let y;a==="single"?y=h.has(v)?new Set:new Set([v]):(y=new Set(h),y.has(v)?y.delete(v):y.add(v)),o||g(y),s?.(y);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u(Yh({columns:t,gap:n,className:e})),...f,children:r.map(v=>{let y=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":y,onClick:()=>b(v.key),children:d(v,y)},v.key):jsxs("div",{role:"gridcell","aria-selected":y,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:u(jh({variant:l,size:c,isSelected:y,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&y&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}Xh.displayName="GridList";var Zh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),AP=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),zP=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),ti=W.forwardRef(({className:e,size:t,value:n,min:r=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:m="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(n-r)/(o-r)*100)),b=()=>{if(m!=="auto")return "";let y=(n-r)/(o-r),R=s!==void 0?(s-r)/(o-r):.25,w=i!==void 0?(i-r)/(o-r):.75;return (a!==void 0?(a-r)/(o-r):1)>=.5?y<=R?"bg-red-500":y<=w?"bg-yellow-500":"bg-green-500":y>=w?"bg-red-500":y>=R?"bg-yellow-500":"bg-green-500"},v=d?d(n,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:u("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:v})]}),jsx("div",{role:"meter","aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":o,"aria-label":l,className:u(Zh({size:t})),children:jsx("div",{className:u(AP({variant:f})),children:jsx("div",{className:u(zP({color:m==="auto"?void 0:m,rounded:h>=100}),m==="auto"&&b()),style:{width:`${h}%`}})})})]})});ti.displayName="Meter";var Qh=W.forwardRef((e,t)=>jsx(ti,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Qh.displayName="DiskUsageMeter";var Jh=W.forwardRef((e,t)=>jsx(ti,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));Jh.displayName="BatteryMeter";var ex=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ri=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},tx=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},nx=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},rx=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),ox=W.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=W.useCallback(I=>{let K=nx(I);return K?tx(...K):[0,1,1]},[]),[v,y]=W.useState(()=>b(r||o)),R=e??v[0],w=t??v[1],C=n??v[2];W.useEffect(()=>{if(r){let I=b(r);y(I);}},[r,b]);let x=W.useCallback((I,K)=>{if(l||!p.current)return;let B=p.current.getBoundingClientRect(),q=Math.max(0,Math.min(1,(I-B.left)/B.width)),ne=Math.max(0,Math.min(1,(K-B.top)/B.height)),G=q,O=1-ne;t===void 0&&n===void 0&&y([R,G,O]),a?.({hue:R,saturation:G,brightness:O});let _=ri(R,G,O);s?.(rx(..._));},[l,R,t,n,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),x(I.clientX,I.clientY));},T=I=>{g&&x(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[M,P,E]=ri(R,1,1),D=`rgb(${M}, ${P}, ${E})`,H=w*100,L=(1-C)*100,[S,V,z]=ri(R,w,C),F=`rgb(${S}, ${V}, ${z})`;return jsx("div",{ref:f,className:u(ex({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:D},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${L}% - ${c/2}px)`,backgroundColor:F,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});ox.displayName="ColorArea";var sx=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),KP=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,ax="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",ix=W.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,y]=W.useState(t??b()),R=e??v,w=r==="hue"?R/360:R,C=W.useCallback((D,H)=>{if(i||!p.current)return;let L=p.current.getBoundingClientRect(),S=a!=="vertical",V;S?V=Math.max(0,Math.min(1,(D-L.left)/L.width)):V=Math.max(0,Math.min(1,1-(H-L.top)/L.height));let z=r==="hue"?V*360:V;e===void 0&&y(z),n?.(z);},[i,a,r,e,n]),x=D=>{i||(D.preventDefault(),h(true),D.target.setPointerCapture(D.pointerId),C(D.clientX,D.clientY));},N=D=>{g&&C(D.clientX,D.clientY);},T=D=>{h(false),D.target.releasePointerCapture(D.pointerId);},k=()=>{let D=a!=="vertical",H=D?"to right":"to top";switch(r){case "hue":return D?ax:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return ax}},M=()=>r==="hue"?`hsl(${R}, 100%, 50%)`:o,P=a!=="vertical",E=w*100;return jsx("div",{ref:f,className:u(sx({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?KP:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:x,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${E}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${E}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:M(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});ix.displayName="ColorSlider";var lx=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),UP=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},cx=W.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=W.useRef(null),[f,p]=W.useState(false),[g,h]=W.useState(t),b=e??g,v=W.useCallback((x,N)=>{if(o||!m.current)return;let T=m.current.getBoundingClientRect(),k=T.width/2,M=x-T.left,P=N-T.top,E=UP(M,P,k);e===void 0&&h(E),n?.(E);},[o,e,n]),y=x=>{o||(x.preventDefault(),p(true),x.target.setPointerCapture(x.pointerId),v(x.clientX,x.clientY));},R=x=>{f&&v(x.clientX,x.clientY);},w=x=>{p(false),x.target.releasePointerCapture(x.pointerId);},C=()=>{let x=[];for(let N=0;N<=360;N+=30)x.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${x.join(", ")})`};return jsx("div",{ref:d,className:u(lx({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:y,onPointerMove:R,onPointerUp:w,onPointerLeave:w,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(WP,{hue:b,innerRadius:a,thumbSize:s})]})})});cx.displayName="ColorWheel";var WP=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var ux=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),YP=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),jP=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),mx=W.forwardRef(({className:e,orientation:t,size:n,align:r,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:m=false,copyable:f=false,onCopy:p,...g},h)=>{let b=async()=>{if(!(!f||a===null||a===void 0))try{let v=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(v),p?.();}catch{}};return jsxs("div",{ref:h,className:u(ux({orientation:t,size:n,align:r,className:e})),...g,children:[jsxs("span",{className:u(YP({size:n}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,m&&":"]}),jsx("span",{className:u(jP({size:n,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?b:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b());}:void 0,children:a})]})});mx.displayName="LabeledValue";var px=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),fx=W.forwardRef(({className:e,orientation:t,gap:n,...r},o)=>jsx("div",{ref:o,className:u(px({orientation:t,gap:n,className:e})),...r}));fx.displayName="LabeledValueGroup";var hx=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),ko=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),xx=W.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:y,...R},w)=>{let[C,x]=W.useState(false),[N,T]=W.useState(t),k=e!==void 0?e:N,M=W.useRef(null);W.useImperativeHandle(w,()=>M.current);let P=k.length>0,E=C&&(a.length>0||s.length>0||l.length>0||P),D=I=>{e===void 0&&T(I),n?.(I);},H=()=>{D(""),M.current?.focus();},L=I=>{I?.preventDefault(),k.trim()&&(r?.(k.trim()),x(false));},S=I=>{D(I.label),o?.(I),x(false);},V=I=>{D(I),r?.(I),x(false);},z=I=>{D(I),r?.(I),x(false);},F=W.useMemo(()=>{let I={};return a.forEach(K=>{let B=K.category||"Results";I[B]||(I[B]=[]),I[B].push(K);}),I},[a]);return jsxs(nt,{open:E,onOpenChange:x,children:[jsx(oo,{children:jsxs("form",{onSubmit:L,className:u(hx({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(ko({size:g}),"ml-3")}),jsx("input",{ref:M,type:"text",value:k,onChange:I=>D(I.target.value),onFocus:()=>x(true),placeholder:v,disabled:y,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...R}),d&&P&&!y&&jsx("button",{type:"button",onClick:H,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",ko({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(rt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,K)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(ko({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:u(ko({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,K)=>jsxs("button",{type:"button",onClick:()=>z(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(ko({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(F).map(([I,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),K.map(B=>jsxs("button",{type:"button",onClick:()=>S(B),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[B.icon||jsx(Search,{className:u(ko({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:B.label}),B.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:B.description})]})]},B.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});xx.displayName="SearchBar";var yx={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},Cx=W.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=W.useState(""),g=W.useRef(null),[h,b]=W.useState(false);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{e||p("");},[e]),W.useEffect(()=>{if(!e)return;let x=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t]),W.useEffect(()=>{if(e)return dt(),()=>ut()},[e]);let v=W.useMemo(()=>{let x={};return n.forEach(N=>{let T=N.category||"Results";x[T]||(x[T]=[]),x[T].push(N);}),x},[n]),y=x=>{x.onSelect?.(),c?.(x),t?.(false);},R=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:Ya.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:R}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(x=>jsxs(Command.Item,{value:x.label,onSelect:()=>y(x),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:x.icon||yx[x.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:x.label}),x.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:x.description})]}),x.shortcut&&jsx("div",{className:"flex items-center gap-1",children:x.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},x.id))]}),w&&Object.entries(v).map(([x,N])=>jsxs(Command.Group,{heading:x,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:x}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>y(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||yx[x]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},x)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});Cx.displayName="SpotlightSearch";function iE(e="k"){let[t,n]=W.useState(false);return W.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var Nx=W.createContext(null),ai=()=>{let e=W.useContext(Nx);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},gE=({children:e,notifications:t,onNotificationsChange:n})=>{let[r,o]=W.useState([]),[a,s]=W.useState(false),i=W.useRef(null),l=t!==void 0,c=l?t:r,d=W.useCallback(b=>{l?n?.(b):o(b);},[l,n]),m=c.filter(b=>!b.read).length,f=W.useCallback(b=>{d(c.map(v=>v.id===b?{...v,read:true}:v));},[c,d]),p=W.useCallback(()=>{d(c.map(b=>({...b,read:true})));},[c,d]),g=W.useCallback(b=>{d(c.filter(v=>v.id!==b));},[c,d]),h=W.useCallback(()=>{d([]);},[d]);return jsx(Nx.Provider,{value:{notifications:c,unreadCount:m,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},kx=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("relative inline-block",e),...n,children:t}));kx.displayName="NotificationCenter";var Px=W.forwardRef(({className:e,showBadge:t=true,children:n,onClick:r,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=ai(),d=f=>{r?.(f),l(!i);},m=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:u("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[n||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:m})]})});Px.displayName="NotificationCenterTrigger";var Ex=W.forwardRef(({className:e,align:t="end",sideOffset:n=8,emptyMessage:r="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:m,triggerRef:f}=ai(),[p,g]=W.useState(false),h=W.useRef(null),[b,v]=W.useState({top:0,left:0});return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!i||!f.current||!h.current)return;let y=()=>{if(!f.current||!h.current)return;let R=f.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=R.bottom+n,x=R.left;t==="center"?x=R.left+R.width/2-w.width/2:t==="end"&&(x=R.right-w.width),x+w.width>window.innerWidth-16&&(x=window.innerWidth-w.width-16),x<16&&(x=16),v({top:C,left:x});};return y(),window.addEventListener("resize",y),window.addEventListener("scroll",y,true),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,true);}},[i,f,t,n]),W.useEffect(()=>{if(!i)return;let y=w=>{h.current&&!h.current.contains(w.target)&&f.current&&!f.current.contains(w.target)&&l(false);},R=w=>{w.key==="Escape"&&l(false);};return document.addEventListener("mousedown",y),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",R);}},[i,l,f]),!p||!i?null:Ya.createPortal(jsxs("div",{ref:y=>{h.current=y,typeof s=="function"?s(y):s&&(s.current=y);},className:u("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:b.top,left:b.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:r})]}):c.map(y=>jsx(xc,{notification:y},y.id)))})]}),document.body)});Ex.displayName="NotificationCenterContent";var bE={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},vE={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},xc=({notification:e,onMarkAsRead:t,onRemove:n})=>{let{markAsRead:r,removeNotification:o}=ai(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:m,action:f}=e,p=vE[l],g=()=>{t?t():r(a);},h=()=>{n?n():o(a);},b=v=>{if(!v)return null;let y=typeof v=="string"?new Date(v):v,w=new Date().getTime()-y.getTime(),C=Math.floor(w/6e4),x=Math.floor(w/36e5),N=Math.floor(w/864e5);return C<1?"Just now":C<60?C+"m ago":x<24?x+"h ago":N<7?N+"d ago":y.toLocaleDateString()};return jsxs("div",{className:u("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",bE[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:m||jsx("div",{className:u("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:u("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:b(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};xc.displayName="NotificationItem";var Lx=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("divide-y",e),...n,children:t}));Lx.displayName="NotificationList";var Sx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),ME={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Dx=W.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,b]=W.useState(true),[v,y]=W.useState(false);W.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),W.useEffect(()=>{if(d&&h){let x=setTimeout(()=>{R();},d);return ()=>clearTimeout(x)}},[d,h]);let R=()=>{y(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let w=ME[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Sx({variant:n,type:t,position:l}),c&&"animate-pulse",v&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:R,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});Dx.displayName="Banner";var ya=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-primary bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-primary bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),PE=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),Rc=W.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},b)=>{let[v,y]=W.useState(false),R=o&&o.length>0,w=k=>{R&&y(!v),p?.(k);},C=k=>{k.onClick?.(),y(false);},x={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&v?"rotate-45":"",T=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ya({position:m})),children:[R&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",x[a].container),children:o.map((k,M)=>jsxs("div",{className:u("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${M*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:u(ya({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:u(ya({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:b,type:"button",onClick:w,disabled:g,className:u(ya({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":R?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(PE({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),R&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>y(false)})]})});Rc.displayName="FloatingActionButton";var EE=Rc;var zx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),Ix=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Ox=W.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[m,f]=W.useState(a||r[0]?.key),p=o!==void 0,g=p?o:m,h=R=>{R.disabled||(p||f(R.key),s?.(R.key));},b=R=>t==="filled"?R?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":R?"text-primary":"text-muted-foreground hover:text-foreground",v=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},y=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(zx({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(R=>{let w=g===R.key,C=i==="all"||i==="active"&&w,x=w&&R.activeIcon?R.activeIcon:R.icon;if(l)return jsx("div",{onClick:()=>h(R),className:u(Ix({variant:t}),R.disabled&&"opacity-50 cursor-not-allowed"),children:l(R,w)},R.key);let N=jsxs("div",{onClick:()=>!R.href&&h(R),className:u(Ix({variant:t}),b(w),R.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":w?"page":void 0,"aria-disabled":R.disabled,tabIndex:R.disabled?-1:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),h(R));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(v(),"[&>svg]:h-full [&>svg]:w-full"),children:x}),R.badge!==void 0&&R.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:R.badge>99?"99+":R.badge}),R.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&R.label&&jsx("span",{className:u(y(),"font-medium truncate max-w-full px-1"),children:R.label})]},R.key);return R.href&&!R.disabled?jsx("a",{href:R.href,onClick:()=>h(R),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(w)),children:N},R.key):N})})});Ox.displayName="BottomNavigation";var SE="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",Fx=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),Kx=W.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:SE,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(Fx({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});Kx.displayName="ActionSheet";var $x=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),Cc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Ux=W.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=W.useRef(null),[p,g]=W.useState(0),[h,b]=W.useState(false),v=W.useRef(0),y=W.useRef(0),R=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=M=>{i||(b(true),v.current=M.touches[0].clientX,y.current=p);},x=M=>{if(!h||i)return;let E=M.touches[0].clientX-v.current,D=y.current+E;(D>0&&n.length===0||D<0&&r.length===0)&&(D=0),D>R?D=R+(D-R)*.3:D<-w&&(D=-w+(D+w)*.3),g(D);},N=()=>{if(!h)return;b(false);let M=f.current?.offsetWidth||0,P=Math.abs(p)/M;if(l&&P>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>R*a&&n.length>0?(g(R),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},T=(M,P)=>{M.onAction?.(),s?.(P,M.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:m,className:u($x({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:R},children:n.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"right"),className:u(Cc({variant:M.variant,size:o})),style:{opacity:Math.min(1,p/R)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"left"),className:u(Cc({variant:M.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:x,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});Ux.displayName="SwipeActions";var _x=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),IE=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),Yx=W.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=W.useRef(null),[b,v]=W.useState(0),[y,R]=W.useState("idle"),w=W.useRef(0),C=W.useRef(false),x=()=>l||y==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=E=>{x()&&(w.current=E.touches[0].clientY,C.current=true);},T=E=>{if(!C.current||!x())return;let H=E.touches[0].clientY-w.current;if(H<0){v(0),R("idle");return}let S=Math.min(H*.5,o);v(S),R(S>=r?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,y==="ready"){R("refreshing"),v(r*.6);try{await n();}finally{R("idle"),v(0);}}else R("idle"),v(0);},M={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(y==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(M,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let E=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(M,"text-muted-foreground transition-transform"),style:{transform:`rotate(${E}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:y==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(_x({variant:t,className:e})),...p,children:[jsx("div",{className:u(IE({size:i}),"z-10",y==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(r*.5),1)},children:P()}),jsx("div",{ref:h,className:u("transition-transform duration-200",y==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});Yx.displayName="PullToRefresh";var Ur=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),VE={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},jx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:VE,custom:i,transition:Ur(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});jx.displayName="Fade";var AE=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},Xx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=W.useMemo(()=>AE(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ur(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Xx.displayName="Slide";var zE={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},OE={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},qx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:OE,custom:i,transition:Ur(n,r,o),className:u(a),style:{transformOrigin:zE[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});qx.displayName="Scale";var Zx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Ur(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Zx.displayName="Collapse";var Qx=W.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Ur(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Qx.displayName="Expand";var Jx=W.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ur(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Jx.displayName="Rotate";var ey=W.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:r?180:0},transition:Ur(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${m}(180deg)`},children:t})]})})});ey.displayName="Flip";var ty=W.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=W.useState([]),l=W.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(y=>[...y,v]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});ty.displayName="Ripple";var ny=W.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ny.displayName="Bounce";var KE={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},ry=W.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:KE[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ry.displayName="Shake";var GE={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},oy=W.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&GE[n],r),children:e}));oy.displayName="Pulse";var ay=W.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ay.displayName="Wiggle";var sy=W.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=W.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});sy.displayName="Pop";var jE=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},iy=W.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=W.useRef(null),g=useInView(p,{once:true}),[h,b]=W.useState(!l);W.useEffect(()=>{if(l&&g){let R=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(R)}},[l,g,c]);let v=useMotionValue(t),y=useTransform(v,R=>jE(R,r,s,i));return W.useEffect(()=>{if(h){let R=animate(v,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>R.stop()}},[h,e,n,v,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:y}),a]})})});iy.displayName="Counter";var ly=W.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=W.useState(""),[b,v]=W.useState(0),[y,R]=W.useState(false),[w,C]=W.useState(false),x=W.useRef(null),N=useInView(x,{once:true}),[T,k]=W.useState(!l);return W.useEffect(()=>{if(l&&N){let M=setTimeout(()=>k(true),n*1e3);return ()=>clearTimeout(M)}},[l,N,n]),W.useEffect(()=>{if(!T||w)return;let M=p[b],P;return y?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(R(false),v(E=>(E+1)%p.length)):g.length<M.length?P=setTimeout(()=>{h(M.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{R(true);},r):(C(true),m?.()),()=>clearTimeout(P)},[T,g,b,y,w,p,t,i,r,s,m]),jsxs("span",{ref:x,className:u(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:u("ml-0.5",d),children:a})]})});ly.displayName="Typewriter";var cy=W.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=W.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},b={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,y)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&y<p.length-1&&"\xA0"]},y))})})});cy.displayName="TextReveal";var dy=W.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=W.useState(0);W.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});dy.displayName="WordRotate";var fy=W.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=W.useRef(null),g=useInView(p,{once:a,amount:s}),b={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],v={hidden:{opacity:0,x:b.x,y:b.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});fy.displayName="ScrollReveal";var gy=W.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",b=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:b,backgroundColor:n}}),i&&jsx(qE,{progress:f,position:e})]})});gy.displayName="ScrollProgress";var qE=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=W.useState(0);return W.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},by=W.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=W.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});by.displayName="Parallax";var xy=W.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
56
56
  @keyframes shimmer-right {
57
57
  0% { transform: translateX(-100%); }
58
58
  100% { transform: translateX(100%); }
@@ -69,5 +69,5 @@ import*as W from'react';import {createContext,useContext,useCallback,useState,us
69
69
  0% { transform: translateY(-100%); }
70
70
  100% { transform: translateY(100%); }
71
71
  }
72
- `})]})});xy.displayName="Shimmer";var ZE={sm:24,md:40,lg:56,xl:80},QE={default:{circle:"stroke-muted-foreground",check:"stroke-foreground"},success:{circle:"stroke-green-500",check:"stroke-green-500"},primary:{circle:"stroke-primary",check:"stroke-primary"},outline:{circle:"stroke-border",check:"stroke-foreground"}},yy=W.forwardRef(({show:e=true,size:t="md",variant:n="success",strokeWidth:r=2,duration:o=.6,delay:a=0,className:s,onComplete:i},l)=>{let c=ZE[t],d=QE[n],m={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a,ease:"easeOut"}}},f={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a+o*.4,ease:"easeOut"}}};return jsxs("svg",{ref:l,width:c,height:c,viewBox:"0 0 50 50",className:u(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:r,className:d.circle,variants:m,initial:"hidden",animate:e?"visible":"hidden"}),jsx(motion.path,{d:"M14 27 L22 35 L36 18",fill:"none",strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",className:d.check,variants:f,initial:"hidden",animate:e?"visible":"hidden",onAnimationComplete:()=>e&&i?.()})]})});yy.displayName="Checkmark";var Io={particleCount:100,spread:70,startVelocity:30,decay:.95,gravity:1,colors:["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"],origin:{x:.5,y:.5},shapes:["square","circle"],scalar:1,drift:0,ticks:200},Ry=W.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=W.useCallback(()=>{let i={...Io,...n};Ho(i),o?.();},[n,o]);return W.useEffect(()=>{if(e){let i=setTimeout(s,t);return ()=>clearTimeout(i)}},[e,t,s]),r?jsx("div",{ref:a,onClick:s,className:"inline-block cursor-pointer",children:r}):null});Ry.displayName="Confetti";var JE=()=>{let e=W.useCallback(r=>{let o={...Io,...r};Ho(o);},[]),t=W.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Ho({...Io,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Ho({...Io,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=W.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&Ho({...Io,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&Ho({...Io,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},wy=W.forwardRef(({children:e,color:t="hsl(var(--primary))",intensity:n=20,spread:r=0,animate:o=false,duration:a=2,className:s},i)=>{let l={boxShadow:`0 0 ${n}px ${r}px ${t}`};return o?jsx(motion.div,{ref:i,className:u("rounded-[inherit]",s),animate:{boxShadow:[`0 0 ${n}px ${r}px ${t}`,`0 0 ${n*1.5}px ${r+5}px ${t}`,`0 0 ${n}px ${r}px ${t}`]},transition:{duration:a,repeat:1/0,ease:"easeInOut"},children:e}):jsx("div",{ref:i,className:u("rounded-[inherit]",s),style:l,children:e})});wy.displayName="Glow";var hy=(e,t)=>({id:Math.random().toString(36).substr(2,9),x:`${Math.random()*100}%`,y:`${Math.random()*100}%`,size:Math.random()*(t-e)+e,delay:Math.random()*2}),Cy=W.forwardRef(({children:e,count:t=10,color:n="hsl(var(--primary))",minSize:r=4,maxSize:o=8,duration:a=1.5,className:s},i)=>{let[l,c]=W.useState([]);return W.useEffect(()=>{let d=Array.from({length:t},()=>hy(r,o));c(d);let m=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=hy(r,o),p});},a*500);return ()=>clearInterval(m)},[t,r,o,a]),jsxs("div",{ref:i,className:u("relative inline-block",s),children:[e,l.map(d=>jsx(motion.svg,{className:"pointer-events-none absolute",style:{left:d.x,top:d.y,width:d.size,height:d.size},viewBox:"0 0 24 24",initial:{scale:0,opacity:0,rotate:0},animate:{scale:[0,1,0],opacity:[0,1,0],rotate:[0,180]},transition:{duration:a,delay:d.delay,repeat:1/0,ease:"easeInOut"},children:jsx("path",{d:"M12 0L14.59 9.41L24 12L14.59 14.59L12 24L9.41 14.59L0 12L9.41 9.41L12 0Z",fill:n})},d.id))]})});Cy.displayName="Sparkles";var Ty=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h1",{ref:r,className:u("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...n,children:t}));Ty.displayName="H1";var My=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h2",{ref:r,className:u("scroll-m-20 text-3xl font-semibold tracking-tight",e),...n,children:t}));My.displayName="H2";var Ny=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h3",{ref:r,className:u("scroll-m-20 text-2xl font-semibold tracking-tight",e),...n,children:t}));Ny.displayName="H3";var ky=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h4",{ref:r,className:u("scroll-m-20 text-xl font-semibold tracking-tight",e),...n,children:t}));ky.displayName="H4";var Py=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));Py.displayName="Paragraph";var Ey=W.forwardRef(({className:e,children:t,...n},r)=>jsx("blockquote",{ref:r,className:u("mt-6 border-l-2 pl-6 italic",e),...n,children:t}));Ey.displayName="Blockquote";var Ly=W.forwardRef(({className:e,children:t,...n},r)=>jsx("code",{ref:r,className:u("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...n,children:t}));Ly.displayName="InlineCode";var Sy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-xl text-muted-foreground",e),...n,children:t}));Sy.displayName="Lead";var Dy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("text-lg font-semibold",e),...n,children:t}));Dy.displayName="Large";var Hy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:u("text-sm font-medium leading-none",e),...n,children:t}));Hy.displayName="Small";var Iy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-sm text-muted-foreground",e),...n,children:t}));Iy.displayName="Muted";var Vy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("ul",{ref:r,className:u("my-6 ml-6 list-disc [&>li]:mt-2",e),...n,children:t}));Vy.displayName="UL";function Vo(e){let t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:false,[]),[n,r]=useState(()=>t(e));return useEffect(()=>{let o=window.matchMedia(e),a=()=>{r(o.matches);};return r(o.matches),o.addEventListener("change",a),()=>{o.removeEventListener("change",a);}},[e]),n}function rL(){return Vo("(max-width: 767px)")}function oL(){return Vo("(min-width: 768px) and (max-width: 1023px)")}function aL(){return Vo("(min-width: 1024px)")}function sL(){return Vo("(prefers-color-scheme: dark)")?"dark":"light"}function iL(){return Vo("(prefers-reduced-motion: reduce)")}function Ta(e={}){let{initialWidth:t=0,initialHeight:n=0,debounce:r=0,includeScrollbar:o=true}=e,[a,s]=useState(()=>typeof window>"u"?{width:t,height:n}:{width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight}),i=useRef(null),l=useCallback(()=>{let c=()=>{s({width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight});};r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(c,r)):c();},[r,o]);return useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),i.current&&clearTimeout(i.current);}),[l]),a}function mL(){let{width:e}=Ta();return e}function pL(){let{height:e}=Ta();return e}function fL(e){let{width:t}=Ta();return t>=e}function gL(){let{width:e}=Ta();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function hL(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading localStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting localStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.localStorage.setItem(e,JSON.stringify(l)),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:JSON.stringify(l)}));}catch(l){console.warn(`Error setting localStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(e),o(t),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:null}));}catch(i){console.warn(`Error removing localStorage key "${e}":`,i);}},[e,t]);return useEffect(()=>{let i=l=>{if(l.key===e&&l.newValue!==null)try{o(JSON.parse(l.newValue));}catch{o(l.newValue);}else l.key===e&&l.newValue===null&&o(t);};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i);}},[e,t]),[r,a,s]}function yL(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.sessionStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading sessionStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting sessionStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.sessionStorage.setItem(e,JSON.stringify(l));}catch(l){console.warn(`Error setting sessionStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.sessionStorage.removeItem(e),o(t);}catch(i){console.warn(`Error removing sessionStorage key "${e}":`,i);}},[e,t]);return [r,a,s]}function CL(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function TL(e,t=500){let n=useRef(null),r=useRef(e);return useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]),useCallback((...a)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...a);},t);},[t])}function ML(e,t=500){let n=useRef(null),r=useRef(e),o=useRef(null);useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]);let a=useCallback((...c)=>{o.current=c,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...c),n.current=null,o.current=null;},t);},[t]),s=useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null,o.current=null);},[]),i=useCallback(()=>{n.current&&o.current&&(clearTimeout(n.current),r.current(...o.current),n.current=null,o.current=null);},[]),l=useCallback(()=>n.current!==null,[]);return {debouncedCallback:a,cancel:s,flush:i,isPending:l}}function PL(e,t=500){let[n,r]=useState(e),o=useRef(Date.now());return useEffect(()=>{let a=Date.now();if(a>=o.current+t)o.current=a,r(e);else {let s=setTimeout(()=>{o.current=Date.now(),r(e);},t-(a-o.current));return ()=>clearTimeout(s)}},[e,t]),n}function EL(e,t=500){let n=useRef(0),r=useRef(null),o=useRef(e);return useEffect(()=>{o.current=e;},[e]),useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),useCallback((...s)=>{let i=Date.now();i-n.current>=t?(o.current(...s),n.current=i):(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{o.current(...s),n.current=Date.now();},t-(i-n.current)));},[t])}function SL(e,t=true){let n=useRef(null);return useEffect(()=>{if(!t)return;let r=o=>{let a=n.current;!a||a.contains(o.target)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t]),n}function DL(e,t,n=true){useEffect(()=>{if(!n)return;let r=o=>{e.some(s=>{let i=s.current;return i&&i.contains(o.target)})||t(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t,n]);}function HL(e=2e3){let[t,n]=useState(null),[r,o]=useState(false),[a,s]=useState(false),i=useCallback(()=>{n(null),o(false);},[]),l=useCallback(async c=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;s(true);try{return await navigator.clipboard.writeText(c),n(c),o(!0),e>0&&setTimeout(()=>{o(!1);},e),!0}catch(d){return console.warn("Copy to clipboard failed:",d),n(null),o(false),false}finally{s(false);}},[e]);return {copiedValue:t,success:r,isLoading:a,copy:l,reset:i}}function IL(){return useCallback(async e=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy to clipboard failed:",t),false}},[])}function zy(e){let t=e.toLowerCase().split("+");return {key:t[t.length-1],ctrl:t.includes("ctrl")||t.includes("control"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),meta:t.includes("meta")||t.includes("cmd")||t.includes("command")}}function Oy(e,t){let n=e.key.toLowerCase(),r=n===" "?"space":n==="escape"?"esc":n,o=t.key==="space"?" ":t.key;return (r===o||e.code.toLowerCase()===`key${o}`)&&e.ctrlKey===t.ctrl&&e.altKey===t.alt&&e.shiftKey===t.shift&&e.metaKey===t.meta}function VL(e,t,n={}){let{enabled:r=true,preventDefault:o=true,stopPropagation:a=false,target:s=null}=n,i=useRef(t);i.current=t;let l=zy(e);useEffect(()=>{if(!r)return;let c=m=>{Oy(m,l)&&(o&&m.preventDefault(),a&&m.stopPropagation(),i.current(m));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[r,o,a,s,l]);}function AL(e,t={}){let{enabled:n=true,preventDefault:r=true,stopPropagation:o=false,target:a=null}=t,s=useRef(e);s.current=e;let i=Object.entries(e).map(([l,c])=>({parsed:zy(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:m,handler:f}of i)if(Oy(d,m)){r&&d.preventDefault(),o&&d.stopPropagation(),f(d);break}},c=a||document;return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l);}},[n,r,o,a,i]);}function zL(e){let t=useRef(false);return useEffect(()=>{let n=o=>{o.key===e&&(t.current=true);},r=o=>{o.key===e&&(t.current=false);};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",r);}},[e]),t.current}function OL(e,t,n,r){let o=useRef(t);o.current=t,useEffect(()=>{let a;if(n==null?a=window:"current"in n?a=n.current:a=n,!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,r),()=>{a?.removeEventListener(e,s,r);}},[e,n,r]);}function BL(e,t,n){let r=useRef(null),o=useRef(t);return o.current=t,useEffect(()=>{let a=r.current;if(!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,n),()=>{a.removeEventListener(e,s,n);}},[e,n]),r}function FL(e,t,n={}){let{target:r,event:o="keydown",enabled:a=true}=n,s=useRef(t);s.current=t,useEffect(()=>{if(!a)return;let i=r?.current||window,l=c=>{c.key===e&&s.current(c);};return i.addEventListener(o,l),()=>{i.removeEventListener(o,l);}},[e,r,o,a]);}function KL(e,t={}){let{threshold:n=500,onStart:r,onCancel:o,enabled:a=true}=t,s=useRef(null),i=useRef(false),l=useRef(null),c=useCallback(m=>{a&&(l.current=m,i.current=false,r?.(m),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},n));},[e,n,r,a]),d=useCallback(m=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(m),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function GL(e){let t=useRef(null),[n,r]=useState(false),o=useCallback(()=>{r(true),e?.onHoverStart?.();},[e]),a=useCallback(()=>{r(false),e?.onHoverEnd?.();},[e]);return useEffect(()=>{let s=t.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[o,a]),{ref:t,isHovered:n}}function $L(e,t){let[n,r]=useState(false),o=useCallback(()=>{r(true),t?.onHoverStart?.();},[t]),a=useCallback(()=>{r(false),t?.onHoverEnd?.();},[t]);return useEffect(()=>{let s=e.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[e,o,a]),n}function UL(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function WL(e=0){let t=useRef(null),[n,r]=useState(false),o=useRef(null);return useEffect(()=>{let a=t.current;if(!a)return;let s=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},i=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(false);},e);};return a.addEventListener("mouseenter",s),a.addEventListener("mouseleave",i),()=>{a.removeEventListener("mouseenter",s),a.removeEventListener("mouseleave",i),o.current&&clearTimeout(o.current);}},[e]),{ref:t,isHovered:n}}function YL(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=r=>{t({x:r.clientX,y:r.clientY});};return window.addEventListener("mousemove",n),()=>{window.removeEventListener("mousemove",n);}},[]),e}function jL(e={}){let{enabled:t=true,resetOnLeave:n=false}=e,r=useRef(null),[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=r.current;if(!s||!t)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{n&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),n&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),n&&s.removeEventListener("mouseleave",l);}},[t,n]),{ref:r,...o}}function XL(e,t={}){let{enabled:n=true,resetOnLeave:r=false}=t,[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=e.current;if(!s||!n)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{r&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),r&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),r&&s.removeEventListener("mouseleave",l);}},[e,n,r]),o}var Ky=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(",");function qL(e={}){let{enabled:t=true,initialFocus:n,returnFocus:r=true,autoFocus:o=true}=e,a=useRef(null),s=useRef(null),i=useCallback(()=>{let c=a.current;return c?Array.from(c.querySelectorAll(Ky)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let m=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===m&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),m.focus());},[i]);return useEffect(()=>{if(!t)return;let c=a.current;if(c){if(s.current=document.activeElement,o)if(n?.current)n.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),r&&s.current&&s.current.focus();}}},[t,n,r,o,l,i]),a}function ZL(e,t={}){let{enabled:n=true,initialFocus:r,returnFocus:o=true,autoFocus:a=true}=t,s=useRef(null),i=useCallback(()=>{let c=e.current;return c?Array.from(c.querySelectorAll(Ky)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[e]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let m=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===m&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),m.focus());},[i]);useEffect(()=>{if(!n)return;let c=e.current;if(c){if(s.current=document.activeElement,a)if(r?.current)r.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),o&&s.current&&s.current.focus();}}},[e,n,r,o,a,l,i]);}function QL(e={}){let{threshold:t=0,throttle:n=0,element:r}=e,[o,a]=useState({x:0,y:0,isScrolled:false,directionY:0,directionX:0,isAtBottom:false,isAtTop:true,progress:0}),s=useRef(0),i=useRef(0),l=useRef(false),c=useRef(0),d=useCallback(()=>{let f=r?.current,p=f?f.scrollTop:window.scrollY,g=f?f.scrollLeft:window.scrollX,h=f?f.scrollHeight-f.clientHeight:document.documentElement.scrollHeight-window.innerHeight,b=p>s.current?1:p<s.current?-1:0,v=g>i.current?1:g<i.current?-1:0;s.current=p,i.current=g,a({x:g,y:p,isScrolled:p>t,directionY:b,directionX:v,isAtBottom:p>=h-1,isAtTop:p<=0,progress:h>0?p/h:0}),l.current=false;},[r,t]),m=useCallback(()=>{let f=Date.now();if(n>0&&f-c.current<n){l.current||(l.current=true,requestAnimationFrame(d));return}c.current=f,l.current||(l.current=true,requestAnimationFrame(d));},[n,d]);return useEffect(()=>{let f=r?.current||window;return f.addEventListener("scroll",m,{passive:true}),d(),()=>{f.removeEventListener("scroll",m);}},[r,m,d]),o}function JL(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=()=>{t({x:window.scrollX,y:window.scrollY});};return window.addEventListener("scroll",n,{passive:true}),n(),()=>{window.removeEventListener("scroll",n);}},[]),e}function Yy(e={}){let{autoLock:t=false,lockX:n=true}=e,r=useRef(false),o=useRef({x:0,y:0}),a=useRef(null),s=useCallback(()=>{if(typeof document>"u"||r.current)return;let{body:l}=document,c=window.scrollY,d=window.scrollX;o.current={x:d,y:c},a.current={overflow:l.style.overflow,overflowX:l.style.overflowX,overflowY:l.style.overflowY,position:l.style.position,top:l.style.top,left:l.style.left,width:l.style.width},l.style.overflow="hidden",n&&(l.style.overflowX="hidden"),l.style.overflowY="hidden",l.style.position="fixed",l.style.top=`-${c}px`,l.style.left=n?`-${d}px`:"0",l.style.width="100%",r.current=true;},[n]),i=useCallback(()=>{if(typeof document>"u"||!r.current)return;let{body:l}=document,c=a.current;c&&(l.style.overflow=c.overflow,l.style.overflowX=c.overflowX,l.style.overflowY=c.overflowY,l.style.position=c.position,l.style.top=c.top,l.style.left=c.left,l.style.width=c.width),window.scrollTo(o.current.x,o.current.y),r.current=false;},[]);return useEffect(()=>(t&&s(),()=>{i();}),[t,s,i]),{lock:s,unlock:i,isLocked:r.current}}function eS(e=true){let{lock:t,unlock:n}=Yy();useEffect(()=>{e?t():n();},[e,t,n]);}function qy(e={}){let{root:t=null,rootMargin:n="0px",threshold:r=0,once:o=false,enabled:a=true}=e,s=useRef(null),[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=s.current;if(!c||!a)return;let d=new IntersectionObserver(([m])=>{l({isIntersecting:m.isIntersecting,entry:m}),o&&m.isIntersecting&&d.disconnect();},{root:t,rootMargin:n,threshold:r});return d.observe(c),()=>{d.disconnect();}},[t,n,r,o,a]),{ref:s,...i}}function nS(e,t={}){let{root:n=null,rootMargin:r="0px",threshold:o=0,once:a=false,enabled:s=true}=t,[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=e.current;if(!c||!s)return;let d=new IntersectionObserver(([m])=>{l({isIntersecting:m.isIntersecting,entry:m}),a&&m.isIntersecting&&d.disconnect();},{root:n,rootMargin:r,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,n,r,o,a,s]),i}function rS(e="200px"){let{ref:t,isIntersecting:n}=qy({rootMargin:e,once:true});return {ref:t,isVisible:n}}function oS(e,t={}){let{enabled:n=true,childList:r=true,attributes:o=true,characterData:a=false,subtree:s=false,attributeOldValue:i=false,characterDataOldValue:l=false,attributeFilter:c}=t,d=useRef(null),m=useRef(e);return m.current=e,useEffect(()=>{let f=d.current;if(!f||!n)return;let p=new MutationObserver((g,h)=>{m.current(g,h);});return p.observe(f,{childList:r,attributes:o,characterData:a,subtree:s,attributeOldValue:i,characterDataOldValue:l,attributeFilter:c}),()=>{p.disconnect();}},[n,r,o,a,s,i,l,c]),d}function aS(e,t,n={}){let{enabled:r=true,childList:o=true,attributes:a=true,characterData:s=false,subtree:i=false,attributeOldValue:l=false,characterDataOldValue:c=false,attributeFilter:d}=n,m=useRef(t);m.current=t,useEffect(()=>{let f=e.current;if(!f||!r)return;let p=new MutationObserver((g,h)=>{m.current(g,h);});return p.observe(f,{childList:o,attributes:a,characterData:s,subtree:i,attributeOldValue:l,characterDataOldValue:c,attributeFilter:d}),()=>{p.disconnect();}},[e,r,o,a,s,i,l,c,d]);}function sS(e={}){let{enabled:t=true,box:n="content-box",debounce:r=0}=e,o=useRef(null),[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let m,f;n==="border-box"&&d.borderBoxSize?.[0]?(m=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(m=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(m=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:m,height:f});r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(p,r)):p();},[n,r]);return useEffect(()=>{let c=o.current;if(!c||!t)return;let d=new ResizeObserver(l);d.observe(c,{box:n});let m=c.getBoundingClientRect();return s({width:m.width,height:m.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,n,l]),{ref:o,...a}}function iS(e,t={}){let{enabled:n=true,box:r="content-box",debounce:o=0}=t,[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let m,f;r==="border-box"&&d.borderBoxSize?.[0]?(m=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(m=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(m=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:m,height:f});o>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(p,o)):p();},[r,o]);return useEffect(()=>{let c=e.current;if(!c||!n)return;let d=new ResizeObserver(l);d.observe(c,{box:r});let m=c.getBoundingClientRect();return s({width:m.width,height:m.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,n,r,l]),a}function lS(){let e=useRef(null),t=useCallback(()=>{let n=e.current;if(!n)return {width:0,height:0};let r=n.getBoundingClientRect();return {width:r.width,height:r.height}},[]);return {ref:e,measure:t}}function eR(e={}){let{defaultOpen:t=false,isOpen:n,onOpen:r,onClose:o,onChange:a,id:s}=e,[i,l]=useState(t),c=n!==void 0,d=c?n:i,m=useCallback(()=>{c||l(true),r?.(),a?.(true);},[c,r,a]),f=useCallback(()=>{c||l(false),o?.(),a?.(false);},[c,o,a]),p=useCallback(()=>{d?f():m();},[d,m,f]),g=useCallback(v=>{v?m():f();},[m,f]),h=useCallback(()=>({onClick:p,"aria-expanded":d,...s&&{"aria-controls":s}}),[p,d,s]),b=useCallback(()=>({hidden:!d,...s&&{id:s}}),[d,s]);return useMemo(()=>({isOpen:d,open:m,close:f,toggle:p,setIsOpen:g,getButtonProps:h,getDisclosureProps:b}),[d,m,f,p,g,h,b])}function uS(e){return eR({...e,defaultOpen:true})}function mS(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function pS(e,t=0){let[n,r]=useState(t),o=useCallback(()=>{r(i=>(i+1)%e.length);},[e.length]),a=useCallback(()=>{r(i=>(i-1+e.length)%e.length);},[e.length]),s=useCallback(i=>{let l=e.indexOf(i);l!==-1&&r(l);},[e]);return useMemo(()=>({value:e[n],index:n,next:o,prev:a,setIndex:r,setValue:s}),[e,n,o,a,s])}function fS(e=false){let[t,n]=useState(e),r=useCallback(()=>n(s=>!s),[]),o=useCallback(()=>n(true),[]),a=useCallback(()=>n(false),[]);return useMemo(()=>({value:t,toggle:r,on:o,off:a,set:n}),[t,r,o,a])}function bS(e=0,t={}){let{min:n=-1/0,max:r=1/0,step:o=1}=t,a=useCallback(g=>Math.min(Math.max(g,n),r),[n,r]),[s,i]=useState(()=>a(e)),l=useCallback(()=>{i(g=>a(g+o));},[a,o]),c=useCallback(()=>{i(g=>a(g-o));},[a,o]),d=useCallback(g=>{i(a(g));},[a]),m=useCallback(()=>{i(a(e));},[a,e]),f=s<=n,p=s>=r;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:m,isMin:f,isMax:p}),[s,l,c,d,m,f,p])}function vS(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function hS(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function xS(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function yS(e){let t=useRef(void 0),n=useRef(e),r=n.current!==e;return useEffect(()=>{t.current=n.current,n.current=e;},[e]),{current:e,previous:t.current,hasChanged:r}}function CS(e=[]){let[t,n]=useState(e),r=useCallback(C=>{n(C);},[]),o=useCallback(C=>{n(y=>[...y,C]);},[]),a=useCallback(C=>{n(y=>[...y,...C]);},[]),s=useCallback((C,y)=>{n(N=>{let T=[...N];return T.splice(C,0,y),T});},[]),i=useCallback((C,y)=>{n(N=>{let T=[...N];return T[C]=y,T});},[]),l=useCallback(C=>{n(y=>y.filter((N,T)=>T!==C));},[]),c=useCallback(C=>{n(y=>{let N=y.indexOf(C);return N===-1?y:y.filter((T,k)=>k!==N)});},[]),d=useCallback(C=>{n(y=>y.filter(N=>!C(N)));},[]),m=useCallback(()=>{let C;return n(y=>y.length===0?y:(C=y[0],y.slice(1))),C},[]),f=useCallback(C=>{n(y=>[C,...y]);},[]),p=useCallback(()=>{let C;return n(y=>y.length===0?y:(C=y[y.length-1],y.slice(0,-1))),C},[]),g=useCallback(()=>{n([]);},[]),h=useCallback(()=>{n(e);},[e]),b=useCallback((C,y)=>{n(N=>{let T=[...N],[k]=T.splice(C,1);return T.splice(y,0,k),T});},[]),v=useCallback((C,y)=>{n(N=>{let T=[...N];return [T[C],T[y]]=[T[y],T[C]],T});},[]),R=useCallback(C=>t.filter(C),[t]),w=useCallback(C=>t.find(C),[t]),x=useCallback(C=>t.includes(C),[t]);return useMemo(()=>({list:t,set:r,push:o,pushMany:a,insertAt:s,updateAt:i,removeAt:l,remove:c,removeWhere:d,shift:m,unshift:f,pop:p,clear:g,reset:h,move:b,swap:v,filter:R,find:w,includes:x,length:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i,l,c,d,m,f,p,g,h,b,v,R,w,x])}function TS(e=[]){let[t,n]=useState(()=>new Map(e)),r=useCallback(p=>t.get(p),[t]),o=useCallback((p,g)=>{n(h=>{let b=new Map(h);return b.set(p,g),b});},[]),a=useCallback(p=>{n(g=>{let h=new Map(g);return p.forEach(([b,v])=>h.set(b,v)),h});},[]),s=useCallback(p=>t.has(p),[t]),i=useCallback(p=>{n(g=>{let h=new Map(g);return h.delete(p),h});},[]),l=useCallback(()=>{n(new Map);},[]),c=useCallback(()=>{n(new Map(e));},[e]),d=useCallback(()=>Array.from(t.keys()),[t]),m=useCallback(()=>Array.from(t.values()),[t]),f=useCallback(()=>Array.from(t.entries()),[t]);return useMemo(()=>({map:t,get:r,set:o,setMany:a,has:s,delete:i,clear:l,reset:c,keys:d,values:m,entries:f,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d,m,f])}function MS(e={}){let[t,n]=useState(e),r=useCallback(d=>t[d],[t]),o=useCallback((d,m)=>{n(f=>({...f,[d]:m}));},[]),a=useCallback(d=>{n(m=>({...m,...d}));},[]),s=useCallback(d=>{n(m=>{let{[d]:f,...p}=m;return p});},[]),i=useCallback(()=>{n({});},[]),l=useCallback(()=>{n(e);},[e]),c=useCallback(d=>d in t,[t]);return useMemo(()=>({value:t,get:r,set:o,setAll:a,remove:s,clear:i,reset:l,has:c,keys:Object.keys(t),values:Object.values(t)}),[t,r,o,a,s,i,l,c])}function sR(e=[]){let[t,n]=useState(()=>new Set(e)),r=useCallback(m=>{n(f=>{let p=new Set(f);return p.add(m),p});},[]),o=useCallback(m=>{n(f=>{let p=new Set(f);return m.forEach(g=>p.add(g)),p});},[]),a=useCallback(m=>{n(f=>{let p=new Set(f);return p.delete(m),p});},[]),s=useCallback(m=>t.has(m),[t]),i=useCallback(m=>{n(f=>{let p=new Set(f);return p.has(m)?p.delete(m):p.add(m),p});},[]),l=useCallback(()=>{n(new Set);},[]),c=useCallback(()=>{n(new Set(e));},[e]),d=useCallback(()=>Array.from(t),[t]);return useMemo(()=>({set:t,add:r,addMany:o,remove:a,has:s,toggle:i,clear:l,reset:c,values:d,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d])}function kS(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=sR(e);return useMemo(()=>({selected:i(),isSelected:r,select:t,deselect:n,toggle:o,selectAll:s,deselectAll:a,count:l,isEmpty:l===0}),[i,r,t,n,o,s,a,l])}function PS(e=[]){let[t,n]=useState(e),r=useCallback(c=>{n(d=>[...d,c]);},[]),o=useCallback(c=>{n(d=>[...d,...c]);},[]),a=useCallback(()=>{let c;return n(d=>d.length===0?d:(c=d[0],d.slice(1))),c},[]),s=useCallback(()=>t[0],[t]),i=useCallback(()=>t[t.length-1],[t]),l=useCallback(()=>{n([]);},[]);return useMemo(()=>({queue:t,enqueue:r,enqueueMany:o,dequeue:a,peek:s,peekLast:i,clear:l,size:t.length,isEmpty:t.length===0,hasItems:t.length>0}),[t,r,o,a,s,i,l])}function ES(e=[]){let[t,n]=useState(e),r=useCallback(l=>{n(c=>[...c,l]);},[]),o=useCallback(l=>{n(c=>[...c,...l]);},[]),a=useCallback(()=>{let l;return n(c=>c.length===0?c:(l=c[c.length-1],c.slice(0,-1))),l},[]),s=useCallback(()=>t[t.length-1],[t]),i=useCallback(()=>{n([]);},[]);return useMemo(()=>({stack:t,push:r,pushMany:o,pop:a,peek:s,clear:i,size:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i])}function dR(e,t=false){let[n,r]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true}),o=useRef(true),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{r(c=>({...c,isLoading:true,isIdle:false,isError:false,error:null}));try{let c=await a.current(...l);return o.current&&r({data:c,error:null,isLoading:!1,isSuccess:!0,isError:!1,isIdle:!1}),c}catch(c){let d=c instanceof Error?c:new Error(String(c));return o.current&&r({data:null,error:d,isLoading:false,isSuccess:false,isError:true,isIdle:false}),null}},[]),i=useCallback(()=>{r({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true});},[]);return useEffect(()=>(o.current=true,t&&s(),()=>{o.current=false;}),[t,s]),{...n,execute:s,reset:i}}function SS(e,t=3,n=1e3){let[r,o]=useState(0),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{let c=null;for(let d=0;d<=t;d++)try{return o(d),await a.current(...l)}catch(m){c=m instanceof Error?m:new Error(String(m)),d<t&&await new Promise(f=>setTimeout(f,n));}throw c},[t,n]);return {...dR(s,false),retryCount:r}}var pR=new Map,DS=300*1e3;function HS(e,t={}){let{immediate:n=true,init:r,transform:o,deps:a=[],enabled:s=true,refetchInterval:i,cacheKey:l}=t,[c,d]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),m=useRef(null),f=useRef(true),p=useCallback(async()=>{if(!e||!s)return;let h=l||e,b=pR.get(h);if(b&&Date.now()-b.timestamp<DS){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}m.current&&m.current.abort(),m.current=new AbortController,d(v=>({...v,isLoading:true,error:null}));try{let v=await fetch(e,{...r,signal:m.current.signal});if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);let R=await v.json(),w=o?o(R):R;pR.set(h,{data:w,timestamp:Date.now()}),f.current&&d({data:w,error:null,isLoading:!1,isSuccess:!0,isError:!1});}catch(v){if(v instanceof Error&&v.name==="AbortError")return;let R=v instanceof Error?v:new Error(String(v));f.current&&d({data:null,error:R,isLoading:false,isSuccess:false,isError:true});}},[e,s,r,o,l]),g=useCallback(()=>{m.current&&m.current.abort();},[]);return useEffect(()=>(f.current=true,n&&s&&p(),()=>{f.current=false,g();}),[e,n,s,...a]),useEffect(()=>{if(!i||!s)return;let h=setInterval(p,i);return ()=>{clearInterval(h);}},[i,s,p]),{...c,refetch:p,abort:g}}function IS(e,t={}){let{transform:n,...r}=t,[o,a]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),s=useCallback(async l=>{a(c=>({...c,isLoading:true,error:null}));try{let c=await fetch(e,{...r,method:r.method||"POST",headers:{"Content-Type":"application/json",...r.headers},body:l?JSON.stringify(l):void 0});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json(),m=n?n(d):d;return a({data:m,error:null,isLoading:!1,isSuccess:!0,isError:!1}),m}catch(c){let d=c instanceof Error?c:new Error(String(c));return a({data:null,error:d,isLoading:false,isSuccess:false,isError:true}),null}},[e,r,n]),i=useCallback(()=>{a({data:null,error:null,isLoading:false,isSuccess:false,isError:false});},[]);return {...o,mutate:s,reset:i}}function xi(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setInterval(()=>{n.current();},t);return ()=>{clearInterval(r);}},[t]);}function AS(e,t){let[n,r]=useState(false);xi(e,n?t:null);let o=useCallback(()=>r(true),[]),a=useCallback(()=>r(false),[]),s=useCallback(()=>r(i=>!i),[]);return {start:o,stop:a,toggle:s,isRunning:n}}function zS(e,t={}){let{interval:n=1e3,onComplete:r,autoStart:o=false}=t,[a,s]=useState(e),[i,l]=useState(o),c=useRef(r);c.current=r;let d=a<=0;xi(()=>{s(g=>{let h=g-1;return h<=0?(l(false),c.current?.(),0):h});},i&&!d?n:null);let m=useCallback(()=>{d||l(true);},[d]),f=useCallback(()=>{l(false);},[]),p=useCallback(g=>{s(g??e),l(false);},[e]);return {seconds:a,isRunning:i,isComplete:d,start:m,pause:f,reset:p}}function OS(e={}){let{interval:t=1e3,maxSeconds:n,autoStart:r=false}=e,[o,a]=useState(0),[s,i]=useState(r),l=s&&(n===void 0||o<n);xi(()=>{a(p=>p+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),m=useCallback(()=>i(p=>!p),[]),f=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:f,toggle:m}}function bR(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setTimeout(()=>{n.current();},t);return ()=>{clearTimeout(r);}},[t]);}function BS(e,t){let[n,r]=useState(false),o=useRef(null),a=useRef(e);a.current=e;let s=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),r(false);},[]),i=useCallback(()=>{s(),r(true),o.current=setTimeout(()=>{a.current(),r(false);},t);},[t,s]),l=useCallback(()=>{i();},[i]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{start:i,cancel:s,reset:l,isScheduled:n}}function FS(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function KS(e,t=true){let[n,r]=useState(false);return bR(()=>{r(true);},t?e:null),n}function GS(e,t=true){let[n,r]=useState(t),[o,a]=useState(0),[s,i]=useState(0),l=useRef(e);l.current=e;let c=useRef(null),d=useRef(0),m=useRef(0),f=useRef(0),p=useRef(0),g=useCallback(v=>{let R=d.current?v-d.current:0;d.current=v,p.current++,v-f.current>=1e3&&(a(p.current),p.current=0,f.current=v),m.current++,i(m.current),l.current(R,v),c.current=requestAnimationFrame(g);},[]),h=useCallback(()=>{c.current===null&&(d.current=0,f.current=performance.now(),p.current=0,c.current=requestAnimationFrame(g),r(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,r(false));},[]);return useEffect(()=>(t&&h(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,h]),{start:h,stop:b,isRunning:n,frameCount:s,fps:o}}function $S(e,t={}){let{duration:n=300,easing:r="easeOutCubic"}=t,[o,a]=useState(e),s=useRef(e),i=useRef(null),l=useRef(null),c={linear:d=>d,easeInCubic:d=>d*d*d,easeOutCubic:d=>1-Math.pow(1-d,3),easeInOutCubic:d=>d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2};return useEffect(()=>{if(o===e)return;s.current=o,i.current=null;let d=m=>{i.current===null&&(i.current=m);let f=m-i.current,p=Math.min(f/n,1),g=c[r](p),h=s.current+(e-s.current)*g;a(h),p<1&&(l.current=requestAnimationFrame(d));};return l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r]),o}function US(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1}=t,[a,s]=useState(e),i=useRef(0),l=useRef(null),c=useRef(null);return useEffect(()=>{if(Math.abs(a-e)<.01&&Math.abs(i.current)<.01){s(e);return}let d=m=>{c.current===null&&(c.current=m);let f=Math.min((m-c.current)/1e3,.064);c.current=m;let p=(e-a)*n,g=i.current*r,h=(p-g)/o;i.current+=h*f;let b=a+i.current*f;s(b),Math.abs(b-e)>.01||Math.abs(i.current)>.01?l.current=requestAnimationFrame(d):(s(e),i.current=0);};return c.current=null,l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r,o,a]),a}var yR=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function WS(e,t={}){let{events:n=yR,initialState:r=false,enabled:o=true}=t,[a,s]=useState(r),i=useRef(null),l=useCallback(()=>{s(false),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{s(true);},e);},[e]);return useEffect(()=>{if(o)return l(),n.forEach(c=>{window.addEventListener(c,l);}),()=>{i.current&&clearTimeout(i.current),n.forEach(c=>{window.removeEventListener(c,l);});}},[o,n,l]),a}function _S(e,t,n,r={}){let{events:o=yR,initialState:a=false,enabled:s=true}=r,[i,l]=useState(a),c=useRef(null),d=useRef(a),m=useCallback(()=>{d.current&&(d.current=false,n?.()),l(false),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d.current=true,l(true),t?.();},e);},[e,t,n]);return useEffect(()=>{if(s)return m(),o.forEach(f=>{window.addEventListener(f,m);}),()=>{c.current&&clearTimeout(c.current),o.forEach(f=>{window.removeEventListener(f,m);});}},[s,o,m]),i}function wR(){let[e,t]=useState(()=>typeof document>"u"?"visible":document.visibilityState);return useEffect(()=>{let n=()=>{t(document.visibilityState);};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}},[]),e}function XS(){return wR()==="visible"}function qS(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function ZS(){let[e,t]=useState(()=>typeof navigator>"u"?true:navigator.onLine);return useEffect(()=>{let n=()=>t(true),r=()=>t(false);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r);}},[]),e}function QS(e,t){let[n,r]=useState(()=>typeof navigator>"u"?true:navigator.onLine),o=useCallback(()=>{r(true),e?.();},[e]),a=useCallback(()=>{r(false),t?.();},[t]);return useEffect(()=>(window.addEventListener("online",o),window.addEventListener("offline",a),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a);}),[o,a]),n}function NR(e){let[t,n]=useState(false),r=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),o=useCallback(async()=>{let i=e?.current||document.documentElement;try{i.requestFullscreen?await i.requestFullscreen():i.webkitRequestFullscreen?await i.webkitRequestFullscreen():i.mozRequestFullScreen?await i.mozRequestFullScreen():i.msRequestFullscreen&&await i.msRequestFullscreen();}catch(l){console.error("Failed to enter fullscreen:",l);}},[e]),a=useCallback(async()=>{try{document.exitFullscreen?await document.exitFullscreen():document.webkitExitFullscreen?await document.webkitExitFullscreen():document.mozCancelFullScreen?await document.mozCancelFullScreen():document.msExitFullscreen&&await document.msExitFullscreen();}catch(i){console.error("Failed to exit fullscreen:",i);}},[]),s=useCallback(async()=>{t?await a():await o();},[t,o,a]);return useEffect(()=>{let i=()=>{n(!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement));};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i);}},[]),{isFullscreen:t,enter:o,exit:a,toggle:s,isSupported:r}}function nD(){let e=useRef(null),t=NR(e);return {ref:e,...t}}function aD(e={}){let{watch:t=false,immediate:n=true,enableHighAccuracy:r=true,maximumAge:o=0,timeout:a=1e4}=e,[s,i]=useState({isLoading:false,position:null,error:null,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null}),l=typeof navigator<"u"&&"geolocation"in navigator,c=useCallback(f=>{i({isLoading:false,position:f,error:null,latitude:f.coords.latitude,longitude:f.coords.longitude,accuracy:f.coords.accuracy,altitude:f.coords.altitude,altitudeAccuracy:f.coords.altitudeAccuracy,heading:f.coords.heading,speed:f.coords.speed,timestamp:f.timestamp});},[]),d=useCallback(f=>{i(p=>({...p,isLoading:false,error:f}));},[]),m=useCallback(()=>{l&&(i(f=>({...f,isLoading:true,error:null})),navigator.geolocation.getCurrentPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a}));},[l,c,d,r,o,a]);return useEffect(()=>{if(l&&(n&&m(),t)){let f=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(f);}}},[t,n,l,m,c,d,r,o,a]),{...s,getCurrentPosition:m,isSupported:l}}function sD(e,t,n,r){if(e===null||t===null||n===null||r===null)return null;let o=6371e3,a=e*Math.PI/180,s=n*Math.PI/180,i=(n-e)*Math.PI/180,l=(r-t)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return o*d}function iD(e){let[t,n]=useState(null),[r,o]=useState(true),a=typeof navigator<"u"&&"permissions"in navigator,s=useCallback(async()=>{if(!a)return o(false),null;try{o(!0);let i=await navigator.permissions.query({name:e});return n(i.state),o(!1),i.state}catch(i){return console.error(`Permission query failed for ${e}:`,i),o(false),null}},[e,a]);return useEffect(()=>{if(!a){o(false);return}let i=null,l=()=>{i&&n(i.state);};return navigator.permissions.query({name:e}).then(c=>{i=c,n(c.state),o(false),c.addEventListener("change",l);}).catch(()=>{o(false);}),()=>{i&&i.removeEventListener("change",l);}},[e,a]),{state:t,isGranted:t==="granted",isDenied:t==="denied",isPrompt:t==="prompt",isLoading:r,isSupported:a,query:s}}function lD(){let[e,t]=useState(typeof Notification<"u"?Notification.permission:"default"),n=typeof Notification<"u",r=useCallback(async()=>{if(!n)return "default";let o=await Notification.requestPermission();return t(o),o},[n]);return useEffect(()=>{n&&t(Notification.permission);},[n]),{permission:e,request:r,isSupported:n}}function cD(e){let[t,n]=useState(null),[r,o]=useState(null),[a,s]=useState(false),i=typeof navigator<"u"&&"mediaDevices"in navigator,l=useCallback(async()=>{if(!i)return null;s(true),o(null);try{let d=await navigator.mediaDevices.getUserMedia(e);return n(d),s(!1),d}catch(d){let m=d instanceof Error?d:new Error(String(d));return o(m),s(false),null}},[e,i]),c=useCallback(()=>{t&&(t.getTracks().forEach(d=>d.stop()),n(null));},[t]);return useEffect(()=>()=>{t&&t.getTracks().forEach(d=>d.stop());},[t]),{stream:t,error:r,isLoading:a,request:l,stop:c,isSupported:i}}function uD(e={}){let{voice:t=null,rate:n=1,pitch:r=1,volume:o=1,lang:a="en-US"}=e,[s,i]=useState(false),[l,c]=useState(false),[d,m]=useState([]),f=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!f)return;let v=()=>{m(window.speechSynthesis.getVoices());};return v(),window.speechSynthesis.addEventListener("voiceschanged",v),()=>{window.speechSynthesis.removeEventListener("voiceschanged",v);}},[f]);let p=useCallback(v=>{if(!f)return;window.speechSynthesis.cancel();let R=new SpeechSynthesisUtterance(v);R.voice=t,R.rate=n,R.pitch=r,R.volume=o,R.lang=a,R.onstart=()=>i(true),R.onend=()=>{i(false),c(false);},R.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(R);},[f,t,n,r,o,a]),g=useCallback(()=>{f&&(window.speechSynthesis.cancel(),i(false),c(false));},[f]),h=useCallback(()=>{f&&(window.speechSynthesis.pause(),c(true));},[f]),b=useCallback(()=>{f&&(window.speechSynthesis.resume(),c(false));},[f]);return {speak:p,stop:g,pause:h,resume:b,isSpeaking:s,isPaused:l,isSupported:f,voices:d}}function mD(e={}){let{lang:t="en-US",continuous:n=false,interimResults:r=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,m]=useState(null),f=useRef(null),p=typeof window<"u"?window.SpeechRecognition||window.webkitSpeechRecognition:null,g=p!==null;useEffect(()=>{if(!g||!p)return;let w=new p;return w.lang=t,w.continuous=n,w.interimResults=r,w.onstart=()=>{a(true),m(null);},w.onend=()=>{a(false);},w.onerror=x=>{m(new Error(x.error)),a(false);},w.onresult=x=>{let C="",y="";for(let N=x.resultIndex;N<x.results.length;N++){let T=x.results[N];T.isFinal?y+=T[0].transcript:C+=T[0].transcript;}y&&i(N=>N+y),c(C);},f.current=w,()=>{w.abort();}},[g,p,t,n,r]);let h=useCallback(()=>{if(f.current&&!o)try{f.current.start();}catch{}},[o]),b=useCallback(()=>{f.current&&f.current.stop();},[]),v=useCallback(()=>{f.current&&f.current.abort();},[]),R=useCallback(()=>{i(""),c(""),m(null);},[]);return {start:h,stop:b,abort:v,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:R}}export{Ju as Accordion,em as AccordionItem,Lh as ActionBar,Sh as ActionBarButton,bh as ActionGroup,Kx as ActionSheet,zR as Alert,BR as AlertDescription,OR as AlertTitle,Tv as AreaChart,Nm as AspectRatio,Jg as Autocomplete,wr as Avatar,Cr as AvatarFallback,$p as AvatarGroup,Jr as AvatarImage,xg as BackTop,GR as Badge,Dx as Banner,wv as BarChart,Jh as BatteryMeter,Ey as Blockquote,Ox as BottomNavigation,ny as Bounce,vm as Breadcrumb,Cm as BreadcrumbEllipsis,xm as BreadcrumbItem,ym as BreadcrumbLink,hm as BreadcrumbList,Rm as BreadcrumbPage,wm as BreadcrumbSeparator,oe as Button,ph as ButtonGroup,sg as COUNTRIES,so as Calendar,bd as Card,yd as CardContent,xd as CardDescription,Rd as CardFooter,vd as CardHeader,hd as CardTitle,Dv as Carousel,Hv as CarouselContent,Iv as CarouselItem,jl as CarouselNext,Yl as CarouselPrevious,Ko as Checkbox,yy as Checkmark,Xp as Chip,tf as CircularProgress,_o as CloseButton,mb as Code,Zx as Collapse,sm as Collapsible,im as CollapsibleContent,$i as CollapsibleTrigger,ox as ColorArea,ch as ColorField,_f as ColorPicker,ix as ColorSlider,ta as ColorSwatch,Uf as ColorSwatchPicker,cx as ColorWheel,Zi as Command,Ow as CommandDialog,Lp as CommandEmpty,Sp as CommandGroup,Pp as CommandInput,Hp as CommandItem,Ep as CommandList,Dp as CommandSeparator,Ip as CommandShortcut,Ry as Confetti,Al as ConfirmDialog,Pu as ContextMenu,Ou as ContextMenuCheckboxItem,Iu as ContextMenuContent,Lu as ContextMenuGroup,zu as ContextMenuItem,Fu as ContextMenuLabel,Su as ContextMenuPortal,Hu as ContextMenuRadioGroup,Bu as ContextMenuRadioItem,Ku as ContextMenuSeparator,Gu as ContextMenuShortcut,Du as ContextMenuSub,Au as ContextMenuSubContent,Vu as ContextMenuSubTrigger,Eu as ContextMenuTrigger,Kh as ContextualHelp,vv as CopyButton,iy as Counter,Zf as CurrencyInput,pa as DEFAULT_COLORS,Mw as DataTable,oh as DateField,rg as DateInput,Op as DatePicker,Ob as DateRangePicker,Nl as DefaultErrorFallback,Va as Dialog,Md as DialogClose,Aa as DialogContent,Ed as DialogDescription,kd as DialogFooter,Nd as DialogHeader,ki as DialogOverlay,Ni as DialogPortal,Pd as DialogTitle,Td as DialogTrigger,Qh as DiskUsageMeter,Yi as Drawer,qm as DrawerBody,ep as DrawerClose,jm as DrawerContent,Jm as DrawerDescription,Zm as DrawerFooter,ip as DrawerGroup,lp as DrawerGroupLabel,Xm as DrawerHeader,cp as DrawerInset,rp as DrawerMenu,sp as DrawerMenuButton,op as DrawerMenuItem,hw as DrawerProvider,np as DrawerSeparator,_m as DrawerSidebar,Qm as DrawerTitle,tp as DrawerToggle,Ym as DrawerTrigger,to as Dropdown,ro as DropdownContent,tu as DropdownGroup,Yn as DropdownItem,T0 as DropdownLabel,Hi as DropdownSection,Jd as DropdownSeparator,eu as DropdownShortcut,nu as DropdownSub,ou as DropdownSubContent,ru as DropdownSubTrigger,no as DropdownTrigger,ql as EMOJIS,Bs as EMOJI_CATEGORIES,Av as EmojiPicker,gf as EmptyState,hM as ErrorBoundary,Qx as Expand,EE as FAB,jx as Fade,hl as FieldContext,Ff as FileUpload,ey as Flip,Rc as FloatingActionButton,eb as Form,vl as FormContext,ob as FormControl,ab as FormDescription,tb as FormField,nb as FormItem,rb as FormLabel,sb as FormMessage,yv as FullCalendar,wy as Glow,Xh as GridList,Ty as H1,My as H2,Ny as H3,ky as H4,pm as HoverCard,gm as HoverCardContent,fm as HoverCardTrigger,Th as IllustratedMessage,gb as Image,Kv as ImageCropper,zl as ImageViewer,iv as ImageViewerTrigger,cv as Indicator,dv as IndicatorWrapper,$b as InfiniteScroll,Ph as InlineAlert,Ly as InlineCode,za as Input,of as InputOTP,af as InputOTPGroup,lf as InputOTPSeparator,sf as InputOTPSlot,Ev as KanbanBoard,gv as Kbd,Rr as Label,mx as LabeledValue,fx as LabeledValueGroup,Dy as Large,Sy as Lead,Rv as LineChart,vg as Link,kC as List,Rf as ListItem,wf as ListItemText,Ah as ListView,Rb as Listbox,wb as ListboxItem,Ab as Loading,Eb as LoadingOverlay,il as MASK_PRESETS,eg as MaskedInput,Tg as Menubar,Vg as MenubarCheckboxItem,Hg as MenubarContent,Ng as MenubarGroup,Ig as MenubarItem,zg as MenubarLabel,Mg as MenubarMenu,kg as MenubarPortal,Eg as MenubarRadioGroup,Ag as MenubarRadioItem,Og as MenubarSeparator,Bg as MenubarShortcut,Pg as MenubarSub,Dg as MenubarSubContent,Sg as MenubarSubTrigger,Lg as MenubarTrigger,ti as Meter,jb as Modal,Jb as ModalBody,Vl as ModalClose,Zb as ModalContent,nv as ModalDescription,ev as ModalFooter,Qb as ModalHeader,Il as ModalOverlay,Hl as ModalPortal,Xb as ModalRoot,tv as ModalTitle,qb as ModalTrigger,Iy as Muted,Sb as NProgress,dg as Navbar,ug as NavbarBrand,mg as NavbarContent,pg as NavbarItem,fg as NavbarLink,Dm as NavigationMenu,zm as NavigationMenuContent,Fm as NavigationMenuIndicator,Im as NavigationMenuItem,Bm as NavigationMenuLink,Hm as NavigationMenuList,Am as NavigationMenuTrigger,_i as NavigationMenuViewport,kx as NotificationCenter,Ex as NotificationCenterContent,gE as NotificationCenterProvider,Px as NotificationCenterTrigger,xc as NotificationItem,Lx as NotificationList,Jv as NumberField,Ap as NumberInput,wp as Pagination,Cp as PaginationContent,kp as PaginationEllipsis,Tp as PaginationItem,os as PaginationLink,Np as PaginationNext,Mp as PaginationPrevious,Py as Paragraph,by as Parallax,Vp as PasswordInput,ig as PhoneInput,Cv as PieChart,sy as Pop,nt as Popover,oo as PopoverAnchor,rt as PopoverContent,Lt as PopoverTrigger,es as Progress,Yx as PullToRefresh,oy as Pulse,$v as QRCode,Uu as RadioGroup,Wu as RadioGroupItem,Oh as RangeSlider,Wp as Rating,cC as ResizableHandle,lC as ResizablePanel,iC as ResizablePanelGroup,Ov as RichTextEditor,ty as Ripple,Jx as Rotate,qx as Scale,ze as ScrollArea,gy as ScrollProgress,fy as ScrollReveal,pv as ScrollShadow,xx as SearchBar,nh as SearchField,Vf as SegmentedControl,Af as SegmentedControlItem,Xd as Select,Gn as Separator,ry as Shake,bu as Sheet,hu as SheetClose,Ru as SheetContent,Mu as SheetDescription,Cu as SheetFooter,wu as SheetHeader,xu as SheetOverlay,Oi as SheetPortal,Tu as SheetTitle,vu as SheetTrigger,xy as Shimmer,Ga as Skeleton,Xx as Slide,Za as Slider,Hy as Small,fb as Snippet,aM as SortableList,Cy as Sparkles,Ha as Spinner,Cx as SpotlightSearch,hf as StatCard,Rh as StatusLight,$g as Step,Kg as Steps,Ux as SwipeActions,Id as Switch,up as Table,pp as TableBody,hp as TableCaption,vp as TableCell,fp as TableFooter,bp as TableHead,mp as TableHeader,gp as TableRow,cu as Tabs,mu as TabsContent,du as TabsList,uu as TabsTrigger,Uh as TagGroup,mf as TagInput,UR as TextBadge,Xv as TextField,cy as TextReveal,Vd as Textarea,Uv as ThemeProvider,Wv as ThemeToggle,sh as TimeField,jf as TimeInput,Bb as TimePicker,Nf as Timeline,Ef as TimelineContent,Pf as TimelineItem,Lf as TimelineOpposite,I0 as Toaster,_u as Toggle,ju as ToggleGroup,Xu as ToggleGroupItem,Un as Tooltip,_n as TooltipContent,$n as TooltipProvider,Wn as TooltipTrigger,qg as Tree,ly as Typewriter,Vy as UL,cb as User,CM as VirtualList,ay as Wiggle,dy as WordRotate,Eh as actionBarVariants,gh as actionGroupVariants,Fx as actionSheetItemVariants,VR as alertVariants,us as applyMask,Qg as autocompleteInputVariants,Gp as avatarGroupVariants,hg as backTopVariants,FR as badgeIndicatorVariants,Sx as bannerVariants,zx as bottomNavigationVariants,uh as buttonGroupVariants,bn as buttonVariants,N0 as calculatePasswordStrength,gd as cardVariants,Lv as carouselVariants,ma as chartContainerVariants,jp as chipVariants,ef as circularProgressVariants,Um as closeButtonVariants,u as cn,ub as codeVariants,ex as colorAreaVariants,lh as colorFieldVariants,sx as colorSliderVariants,$f as colorSwatchPickerVariants,Gf as colorSwatchVariants,lx as colorWheelVariants,av as confirmDialogIconVariants,pc as contextualHelpTriggerVariants,bv as copyButtonVariants,Xf as currencyInputVariants,rh as dateFieldVariants,tg as dateInputVariants,pu as defaultPasswordRequirements,ap as drawerMenuButtonVariants,Vv as emojiPickerVariants,ff as emptyStateVariants,ya as fabVariants,zf as fileUploadVariants,sl as formatCurrency,ps as formatDate,cs as formatFileSize,gs as formatPhoneNumber,xv as fullCalendarVariants,Of as getFileIcon,Jf as getMaskPlaceholder,k0 as getPasswordStrengthColor,P0 as getPasswordStrengthLabel,jh as gridListItemVariants,Yh as gridListVariants,nx as hexToRgb,ri as hsvToRgb,Ch as illustratedMessageVariants,Fv as imageCropperVariants,wl as imageVariants,lv as indicatorVariants,Ll as infiniteScrollLoaderVariants,Gb as infiniteScrollVariants,kh as inlineAlertVariants,rf as inputOTPVariants,Yv as inputSizeVariants,kv as kanbanBoardVariants,Wl as kanbanCardVariants,Pv as kanbanColumnVariants,fv as kbdVariants,jv as labelSizeVariants,px as labeledValueGroupVariants,ux as labeledValueVariants,bg as linkVariants,yf as listItemVariants,nl as listVariants,Vh as listViewItemVariants,Ih as listViewVariants,xb as listboxItemVariants,hb as listboxVariants,Pb as loadingOverlayVariants,Vb as loadingVariants,Qf as maskedInputVariants,Zh as meterVariants,Dl as modalContentVariants,cg as navbarVariants,Om as navigationMenuLinkStyle,Vm as navigationMenuTriggerStyle,Lb as nprogressVariants,Qv as numberFieldVariants,ng as parseDate,qf as parseFormattedValue,ag as phoneInputVariants,_x as pullToRefreshVariants,ec as qrCodeVariants,zh as rangeSliderVariants,Up as ratingVariants,rx as rgbToHex,tx as rgbToHsv,zv as richTextEditorVariants,mv as scrollShadowVariants,hx as searchBarVariants,th as searchFieldVariants,Hf as segmentedControlItemVariants,Df as segmentedControlVariants,jd as selectVariants,yu as sheetVariants,zd as skeletonVariants,pb as snippetVariants,Mb as sortableItemVariants,Tb as sortableListVariants,ud as spinnerVariants,vf as statCardVariants,yh as statusLightVariants,Gg as stepVariants,Fg as stepsVariants,Cc as swipeActionVariants,$x as swipeActionsVariants,Ba as switchColors,fc as tagGroupItemVariants,$h as tagGroupVariants,uf as tagVariants,$R as textBadgeVariants,_v as textFieldVariants,Ak as themeToggleVariants,ah as timeFieldVariants,Yf as timeInputVariants,kf as timelineItemVariants,Mf as timelineVariants,Xa as toggleVariants,_g as treeItemVariants,Wg as treeVariants,ll as unmask,$S as useAnimatedValue,dR as useAsync,SS as useAsyncRetry,eS as useBodyScrollLock,fS as useBooleanToggle,fL as useBreakpoint,gL as useBreakpoints,aP as useButtonGroup,_l as useCarousel,SL as useClickOutside,DL as useClickOutsideMultiple,JE as useConfetti,zM as useConfirmDialog,IL as useCopy,HL as useCopyToClipboard,zS as useCountdown,bS as useCounter,pS as useCycle,CL as useDebounce,TL as useDebouncedCallback,ML as useDebouncedCallbackWithControls,FS as useDelayedValue,eR as useDisclosure,uS as useDisclosureOpen,sD as useDistance,XS as useDocumentIsVisible,wR as useDocumentVisibility,qS as useDocumentVisibilityCallback,dw as useDrawer,lS as useElementSize,OL as useEventListener,BL as useEventListenerRef,HS as useFetch,Rs as useFieldContext,qL as useFocusTrap,ZL as useFocusTrapRef,xl as useFormContext,NR as useFullscreen,nD as useFullscreenRef,aD as useGeolocation,VL as useHotkeys,AL as useHotkeysMap,GL as useHover,WL as useHoverDelay,UL as useHoverProps,$L as useHoverRef,WS as useIdle,_S as useIdleCallback,vS as useIncrementCounter,qy as useIntersectionObserver,nS as useIntersectionObserverRef,xi as useInterval,AS as useIntervalControls,aL as useIsDesktop,rL as useIsMobile,oL as useIsTablet,FL as useKeyPress,zL as useKeyPressed,rN as useKeyboardShortcut,rS as useLazyLoad,CS as useList,hL as useLocalStorage,KL as useLongPress,TS as useMap,cD as useMediaPermission,Vo as useMediaQuery,YL as useMouse,jL as useMouseElement,XL as useMouseElementRef,IS as useMutation,oS as useMutationObserver,aS as useMutationObserverRef,ai as useNotificationCenter,lD as useNotificationPermission,ZS as useOnlineStatus,QS as useOnlineStatusCallback,iD as usePermission,sL as usePrefersColorScheme,iL as usePrefersReducedMotion,hS as usePrevious,yS as usePreviousDistinct,xS as usePreviousWithInitial,PS as useQueue,GS as useRafLoop,MS as useRecord,sS as useResizeObserver,iS as useResizeObserverRef,Yy as useScrollLock,QL as useScrollPosition,kS as useSelection,yL as useSessionStorage,sR as useSet,mD as useSpeechRecognition,uD as useSpeechSynthesis,iE as useSpotlight,US as useSpringValue,ES as useStack,PL as useThrottle,EL as useThrottledCallback,bR as useTimeout,BS as useTimeoutControls,KS as useTimeoutFlag,OS as useTimer,mS as useToggle,pL as useWindowHeight,JL as useWindowScroll,Ta as useWindowSize,mL as useWindowWidth,lb as userVariants,Bf as validateFile,WT as validators,Fb as virtualListVariants};//# sourceMappingURL=index.js.map
72
+ `})]})});xy.displayName="Shimmer";var ZE={sm:24,md:40,lg:56,xl:80},QE={default:{circle:"stroke-muted-foreground",check:"stroke-foreground"},success:{circle:"stroke-green-500",check:"stroke-green-500"},primary:{circle:"stroke-primary",check:"stroke-primary"},outline:{circle:"stroke-border",check:"stroke-foreground"}},yy=W.forwardRef(({show:e=true,size:t="md",variant:n="success",strokeWidth:r=2,duration:o=.6,delay:a=0,className:s,onComplete:i},l)=>{let c=ZE[t],d=QE[n],m={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a,ease:"easeOut"}}},f={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a+o*.4,ease:"easeOut"}}};return jsxs("svg",{ref:l,width:c,height:c,viewBox:"0 0 50 50",className:u(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:r,className:d.circle,variants:m,initial:"hidden",animate:e?"visible":"hidden"}),jsx(motion.path,{d:"M14 27 L22 35 L36 18",fill:"none",strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",className:d.check,variants:f,initial:"hidden",animate:e?"visible":"hidden",onAnimationComplete:()=>e&&i?.()})]})});yy.displayName="Checkmark";var Io={particleCount:100,spread:70,startVelocity:30,decay:.95,gravity:1,colors:["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"],origin:{x:.5,y:.5},shapes:["square","circle"],scalar:1,drift:0,ticks:200},Ry=W.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=W.useCallback(()=>{let i={...Io,...n};Ho(i),o?.();},[n,o]);return W.useEffect(()=>{if(e){let i=setTimeout(s,t);return ()=>clearTimeout(i)}},[e,t,s]),r?jsx("div",{ref:a,onClick:s,className:"inline-block cursor-pointer",children:r}):null});Ry.displayName="Confetti";var JE=()=>{let e=W.useCallback(r=>{let o={...Io,...r};Ho(o);},[]),t=W.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Ho({...Io,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Ho({...Io,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=W.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&Ho({...Io,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&Ho({...Io,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},wy=W.forwardRef(({children:e,color:t="hsl(var(--primary))",intensity:n=20,spread:r=0,animate:o=false,duration:a=2,className:s},i)=>{let l={boxShadow:`0 0 ${n}px ${r}px ${t}`};return o?jsx(motion.div,{ref:i,className:u("rounded-[inherit]",s),animate:{boxShadow:[`0 0 ${n}px ${r}px ${t}`,`0 0 ${n*1.5}px ${r+5}px ${t}`,`0 0 ${n}px ${r}px ${t}`]},transition:{duration:a,repeat:1/0,ease:"easeInOut"},children:e}):jsx("div",{ref:i,className:u("rounded-[inherit]",s),style:l,children:e})});wy.displayName="Glow";var hy=(e,t)=>({id:Math.random().toString(36).substr(2,9),x:`${Math.random()*100}%`,y:`${Math.random()*100}%`,size:Math.random()*(t-e)+e,delay:Math.random()*2}),Cy=W.forwardRef(({children:e,count:t=10,color:n="hsl(var(--primary))",minSize:r=4,maxSize:o=8,duration:a=1.5,className:s},i)=>{let[l,c]=W.useState([]);return W.useEffect(()=>{let d=Array.from({length:t},()=>hy(r,o));c(d);let m=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=hy(r,o),p});},a*500);return ()=>clearInterval(m)},[t,r,o,a]),jsxs("div",{ref:i,className:u("relative inline-block",s),children:[e,l.map(d=>jsx(motion.svg,{className:"pointer-events-none absolute",style:{left:d.x,top:d.y,width:d.size,height:d.size},viewBox:"0 0 24 24",initial:{scale:0,opacity:0,rotate:0},animate:{scale:[0,1,0],opacity:[0,1,0],rotate:[0,180]},transition:{duration:a,delay:d.delay,repeat:1/0,ease:"easeInOut"},children:jsx("path",{d:"M12 0L14.59 9.41L24 12L14.59 14.59L12 24L9.41 14.59L0 12L9.41 9.41L12 0Z",fill:n})},d.id))]})});Cy.displayName="Sparkles";var Ty=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h1",{ref:r,className:u("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...n,children:t}));Ty.displayName="H1";var My=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h2",{ref:r,className:u("scroll-m-20 text-3xl font-semibold tracking-tight",e),...n,children:t}));My.displayName="H2";var Ny=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h3",{ref:r,className:u("scroll-m-20 text-2xl font-semibold tracking-tight",e),...n,children:t}));Ny.displayName="H3";var ky=W.forwardRef(({className:e,children:t,...n},r)=>jsx("h4",{ref:r,className:u("scroll-m-20 text-xl font-semibold tracking-tight",e),...n,children:t}));ky.displayName="H4";var Py=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));Py.displayName="Paragraph";var Ey=W.forwardRef(({className:e,children:t,...n},r)=>jsx("blockquote",{ref:r,className:u("mt-6 border-l-2 pl-6 italic",e),...n,children:t}));Ey.displayName="Blockquote";var Ly=W.forwardRef(({className:e,children:t,...n},r)=>jsx("code",{ref:r,className:u("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...n,children:t}));Ly.displayName="InlineCode";var Sy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-xl text-muted-foreground",e),...n,children:t}));Sy.displayName="Lead";var Dy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("text-lg font-semibold",e),...n,children:t}));Dy.displayName="Large";var Hy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:u("text-sm font-medium leading-none",e),...n,children:t}));Hy.displayName="Small";var Iy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-sm text-muted-foreground",e),...n,children:t}));Iy.displayName="Muted";var Vy=W.forwardRef(({className:e,children:t,...n},r)=>jsx("ul",{ref:r,className:u("my-6 ml-6 list-disc [&>li]:mt-2",e),...n,children:t}));Vy.displayName="UL";function Vo(e){let t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:false,[]),[n,r]=useState(()=>t(e));return useEffect(()=>{let o=window.matchMedia(e),a=()=>{r(o.matches);};return r(o.matches),o.addEventListener("change",a),()=>{o.removeEventListener("change",a);}},[e]),n}function rL(){return Vo("(max-width: 767px)")}function oL(){return Vo("(min-width: 768px) and (max-width: 1023px)")}function aL(){return Vo("(min-width: 1024px)")}function sL(){return Vo("(prefers-color-scheme: dark)")?"dark":"light"}function iL(){return Vo("(prefers-reduced-motion: reduce)")}function Ta(e={}){let{initialWidth:t=0,initialHeight:n=0,debounce:r=0,includeScrollbar:o=true}=e,[a,s]=useState(()=>typeof window>"u"?{width:t,height:n}:{width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight}),i=useRef(null),l=useCallback(()=>{let c=()=>{s({width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight});};r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(c,r)):c();},[r,o]);return useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),i.current&&clearTimeout(i.current);}),[l]),a}function mL(){let{width:e}=Ta();return e}function pL(){let{height:e}=Ta();return e}function fL(e){let{width:t}=Ta();return t>=e}function gL(){let{width:e}=Ta();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function hL(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading localStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting localStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.localStorage.setItem(e,JSON.stringify(l)),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:JSON.stringify(l)}));}catch(l){console.warn(`Error setting localStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(e),o(t),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:null}));}catch(i){console.warn(`Error removing localStorage key "${e}":`,i);}},[e,t]);return useEffect(()=>{let i=l=>{if(l.key===e&&l.newValue!==null)try{o(JSON.parse(l.newValue));}catch{o(l.newValue);}else l.key===e&&l.newValue===null&&o(t);};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i);}},[e,t]),[r,a,s]}function yL(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.sessionStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading sessionStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting sessionStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.sessionStorage.setItem(e,JSON.stringify(l));}catch(l){console.warn(`Error setting sessionStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.sessionStorage.removeItem(e),o(t);}catch(i){console.warn(`Error removing sessionStorage key "${e}":`,i);}},[e,t]);return [r,a,s]}function CL(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function TL(e,t=500){let n=useRef(null),r=useRef(e);return useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]),useCallback((...a)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...a);},t);},[t])}function ML(e,t=500){let n=useRef(null),r=useRef(e),o=useRef(null);useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]);let a=useCallback((...c)=>{o.current=c,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...c),n.current=null,o.current=null;},t);},[t]),s=useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null,o.current=null);},[]),i=useCallback(()=>{n.current&&o.current&&(clearTimeout(n.current),r.current(...o.current),n.current=null,o.current=null);},[]),l=useCallback(()=>n.current!==null,[]);return {debouncedCallback:a,cancel:s,flush:i,isPending:l}}function PL(e,t=500){let[n,r]=useState(e),o=useRef(Date.now());return useEffect(()=>{let a=Date.now();if(a>=o.current+t)o.current=a,r(e);else {let s=setTimeout(()=>{o.current=Date.now(),r(e);},t-(a-o.current));return ()=>clearTimeout(s)}},[e,t]),n}function EL(e,t=500){let n=useRef(0),r=useRef(null),o=useRef(e);return useEffect(()=>{o.current=e;},[e]),useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),useCallback((...s)=>{let i=Date.now();i-n.current>=t?(o.current(...s),n.current=i):(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{o.current(...s),n.current=Date.now();},t-(i-n.current)));},[t])}function SL(e,t=true){let n=useRef(null);return useEffect(()=>{if(!t)return;let r=o=>{let a=n.current;!a||a.contains(o.target)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t]),n}function DL(e,t,n=true){useEffect(()=>{if(!n)return;let r=o=>{e.some(s=>{let i=s.current;return i&&i.contains(o.target)})||t(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t,n]);}function HL(e=2e3){let[t,n]=useState(null),[r,o]=useState(false),[a,s]=useState(false),i=useCallback(()=>{n(null),o(false);},[]),l=useCallback(async c=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;s(true);try{return await navigator.clipboard.writeText(c),n(c),o(!0),e>0&&setTimeout(()=>{o(!1);},e),!0}catch(d){return console.warn("Copy to clipboard failed:",d),n(null),o(false),false}finally{s(false);}},[e]);return {copiedValue:t,success:r,isLoading:a,copy:l,reset:i}}function IL(){return useCallback(async e=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy to clipboard failed:",t),false}},[])}function zy(e){let t=e.toLowerCase().split("+");return {key:t[t.length-1],ctrl:t.includes("ctrl")||t.includes("control"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),meta:t.includes("meta")||t.includes("cmd")||t.includes("command")}}function Oy(e,t){let n=e.key.toLowerCase(),r=n===" "?"space":n==="escape"?"esc":n,o=t.key==="space"?" ":t.key;return (r===o||e.code.toLowerCase()===`key${o}`)&&e.ctrlKey===t.ctrl&&e.altKey===t.alt&&e.shiftKey===t.shift&&e.metaKey===t.meta}function VL(e,t,n={}){let{enabled:r=true,preventDefault:o=true,stopPropagation:a=false,target:s=null}=n,i=useRef(t);i.current=t;let l=zy(e);useEffect(()=>{if(!r)return;let c=m=>{Oy(m,l)&&(o&&m.preventDefault(),a&&m.stopPropagation(),i.current(m));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[r,o,a,s,l]);}function AL(e,t={}){let{enabled:n=true,preventDefault:r=true,stopPropagation:o=false,target:a=null}=t,s=useRef(e);s.current=e;let i=Object.entries(e).map(([l,c])=>({parsed:zy(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:m,handler:f}of i)if(Oy(d,m)){r&&d.preventDefault(),o&&d.stopPropagation(),f(d);break}},c=a||document;return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l);}},[n,r,o,a,i]);}function zL(e){let t=useRef(false);return useEffect(()=>{let n=o=>{o.key===e&&(t.current=true);},r=o=>{o.key===e&&(t.current=false);};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",r);}},[e]),t.current}function OL(e,t,n,r){let o=useRef(t);o.current=t,useEffect(()=>{let a;if(n==null?a=window:"current"in n?a=n.current:a=n,!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,r),()=>{a?.removeEventListener(e,s,r);}},[e,n,r]);}function BL(e,t,n){let r=useRef(null),o=useRef(t);return o.current=t,useEffect(()=>{let a=r.current;if(!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,n),()=>{a.removeEventListener(e,s,n);}},[e,n]),r}function FL(e,t,n={}){let{target:r,event:o="keydown",enabled:a=true}=n,s=useRef(t);s.current=t,useEffect(()=>{if(!a)return;let i=r?.current||window,l=c=>{c.key===e&&s.current(c);};return i.addEventListener(o,l),()=>{i.removeEventListener(o,l);}},[e,r,o,a]);}function KL(e,t={}){let{threshold:n=500,onStart:r,onCancel:o,enabled:a=true}=t,s=useRef(null),i=useRef(false),l=useRef(null),c=useCallback(m=>{a&&(l.current=m,i.current=false,r?.(m),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},n));},[e,n,r,a]),d=useCallback(m=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(m),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function GL(e){let t=useRef(null),[n,r]=useState(false),o=useCallback(()=>{r(true),e?.onHoverStart?.();},[e]),a=useCallback(()=>{r(false),e?.onHoverEnd?.();},[e]);return useEffect(()=>{let s=t.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[o,a]),{ref:t,isHovered:n}}function $L(e,t){let[n,r]=useState(false),o=useCallback(()=>{r(true),t?.onHoverStart?.();},[t]),a=useCallback(()=>{r(false),t?.onHoverEnd?.();},[t]);return useEffect(()=>{let s=e.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[e,o,a]),n}function UL(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function WL(e=0){let t=useRef(null),[n,r]=useState(false),o=useRef(null);return useEffect(()=>{let a=t.current;if(!a)return;let s=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},i=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(false);},e);};return a.addEventListener("mouseenter",s),a.addEventListener("mouseleave",i),()=>{a.removeEventListener("mouseenter",s),a.removeEventListener("mouseleave",i),o.current&&clearTimeout(o.current);}},[e]),{ref:t,isHovered:n}}function YL(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=r=>{t({x:r.clientX,y:r.clientY});};return window.addEventListener("mousemove",n),()=>{window.removeEventListener("mousemove",n);}},[]),e}function jL(e={}){let{enabled:t=true,resetOnLeave:n=false}=e,r=useRef(null),[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=r.current;if(!s||!t)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{n&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),n&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),n&&s.removeEventListener("mouseleave",l);}},[t,n]),{ref:r,...o}}function XL(e,t={}){let{enabled:n=true,resetOnLeave:r=false}=t,[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=e.current;if(!s||!n)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{r&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),r&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),r&&s.removeEventListener("mouseleave",l);}},[e,n,r]),o}var Ky=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(",");function qL(e={}){let{enabled:t=true,initialFocus:n,returnFocus:r=true,autoFocus:o=true}=e,a=useRef(null),s=useRef(null),i=useCallback(()=>{let c=a.current;return c?Array.from(c.querySelectorAll(Ky)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let m=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===m&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),m.focus());},[i]);return useEffect(()=>{if(!t)return;let c=a.current;if(c){if(s.current=document.activeElement,o)if(n?.current)n.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),r&&s.current&&s.current.focus();}}},[t,n,r,o,l,i]),a}function ZL(e,t={}){let{enabled:n=true,initialFocus:r,returnFocus:o=true,autoFocus:a=true}=t,s=useRef(null),i=useCallback(()=>{let c=e.current;return c?Array.from(c.querySelectorAll(Ky)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[e]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let m=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===m&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),m.focus());},[i]);useEffect(()=>{if(!n)return;let c=e.current;if(c){if(s.current=document.activeElement,a)if(r?.current)r.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),o&&s.current&&s.current.focus();}}},[e,n,r,o,a,l,i]);}function QL(e={}){let{threshold:t=0,throttle:n=0,element:r}=e,[o,a]=useState({x:0,y:0,isScrolled:false,directionY:0,directionX:0,isAtBottom:false,isAtTop:true,progress:0}),s=useRef(0),i=useRef(0),l=useRef(false),c=useRef(0),d=useCallback(()=>{let f=r?.current,p=f?f.scrollTop:window.scrollY,g=f?f.scrollLeft:window.scrollX,h=f?f.scrollHeight-f.clientHeight:document.documentElement.scrollHeight-window.innerHeight,b=p>s.current?1:p<s.current?-1:0,v=g>i.current?1:g<i.current?-1:0;s.current=p,i.current=g,a({x:g,y:p,isScrolled:p>t,directionY:b,directionX:v,isAtBottom:p>=h-1,isAtTop:p<=0,progress:h>0?p/h:0}),l.current=false;},[r,t]),m=useCallback(()=>{let f=Date.now();if(n>0&&f-c.current<n){l.current||(l.current=true,requestAnimationFrame(d));return}c.current=f,l.current||(l.current=true,requestAnimationFrame(d));},[n,d]);return useEffect(()=>{let f=r?.current||window;return f.addEventListener("scroll",m,{passive:true}),d(),()=>{f.removeEventListener("scroll",m);}},[r,m,d]),o}function JL(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=()=>{t({x:window.scrollX,y:window.scrollY});};return window.addEventListener("scroll",n,{passive:true}),n(),()=>{window.removeEventListener("scroll",n);}},[]),e}function Yy(e={}){let{autoLock:t=false,lockX:n=true}=e,r=useRef(false),o=useRef({x:0,y:0}),a=useRef(null),s=useCallback(()=>{if(typeof document>"u"||r.current)return;let{body:l}=document,c=window.scrollY,d=window.scrollX;o.current={x:d,y:c},a.current={overflow:l.style.overflow,overflowX:l.style.overflowX,overflowY:l.style.overflowY,position:l.style.position,top:l.style.top,left:l.style.left,width:l.style.width},l.style.overflow="hidden",n&&(l.style.overflowX="hidden"),l.style.overflowY="hidden",l.style.position="fixed",l.style.top=`-${c}px`,l.style.left=n?`-${d}px`:"0",l.style.width="100%",r.current=true;},[n]),i=useCallback(()=>{if(typeof document>"u"||!r.current)return;let{body:l}=document,c=a.current;c&&(l.style.overflow=c.overflow,l.style.overflowX=c.overflowX,l.style.overflowY=c.overflowY,l.style.position=c.position,l.style.top=c.top,l.style.left=c.left,l.style.width=c.width),window.scrollTo(o.current.x,o.current.y),r.current=false;},[]);return useEffect(()=>(t&&s(),()=>{i();}),[t,s,i]),{lock:s,unlock:i,isLocked:r.current}}function eS(e=true){let{lock:t,unlock:n}=Yy();useEffect(()=>{e?t():n();},[e,t,n]);}function qy(e={}){let{root:t=null,rootMargin:n="0px",threshold:r=0,once:o=false,enabled:a=true}=e,s=useRef(null),[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=s.current;if(!c||!a)return;let d=new IntersectionObserver(([m])=>{l({isIntersecting:m.isIntersecting,entry:m}),o&&m.isIntersecting&&d.disconnect();},{root:t,rootMargin:n,threshold:r});return d.observe(c),()=>{d.disconnect();}},[t,n,r,o,a]),{ref:s,...i}}function nS(e,t={}){let{root:n=null,rootMargin:r="0px",threshold:o=0,once:a=false,enabled:s=true}=t,[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=e.current;if(!c||!s)return;let d=new IntersectionObserver(([m])=>{l({isIntersecting:m.isIntersecting,entry:m}),a&&m.isIntersecting&&d.disconnect();},{root:n,rootMargin:r,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,n,r,o,a,s]),i}function rS(e="200px"){let{ref:t,isIntersecting:n}=qy({rootMargin:e,once:true});return {ref:t,isVisible:n}}function oS(e,t={}){let{enabled:n=true,childList:r=true,attributes:o=true,characterData:a=false,subtree:s=false,attributeOldValue:i=false,characterDataOldValue:l=false,attributeFilter:c}=t,d=useRef(null),m=useRef(e);return m.current=e,useEffect(()=>{let f=d.current;if(!f||!n)return;let p=new MutationObserver((g,h)=>{m.current(g,h);});return p.observe(f,{childList:r,attributes:o,characterData:a,subtree:s,attributeOldValue:i,characterDataOldValue:l,attributeFilter:c}),()=>{p.disconnect();}},[n,r,o,a,s,i,l,c]),d}function aS(e,t,n={}){let{enabled:r=true,childList:o=true,attributes:a=true,characterData:s=false,subtree:i=false,attributeOldValue:l=false,characterDataOldValue:c=false,attributeFilter:d}=n,m=useRef(t);m.current=t,useEffect(()=>{let f=e.current;if(!f||!r)return;let p=new MutationObserver((g,h)=>{m.current(g,h);});return p.observe(f,{childList:o,attributes:a,characterData:s,subtree:i,attributeOldValue:l,characterDataOldValue:c,attributeFilter:d}),()=>{p.disconnect();}},[e,r,o,a,s,i,l,c,d]);}function sS(e={}){let{enabled:t=true,box:n="content-box",debounce:r=0}=e,o=useRef(null),[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let m,f;n==="border-box"&&d.borderBoxSize?.[0]?(m=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(m=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(m=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:m,height:f});r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(p,r)):p();},[n,r]);return useEffect(()=>{let c=o.current;if(!c||!t)return;let d=new ResizeObserver(l);d.observe(c,{box:n});let m=c.getBoundingClientRect();return s({width:m.width,height:m.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,n,l]),{ref:o,...a}}function iS(e,t={}){let{enabled:n=true,box:r="content-box",debounce:o=0}=t,[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let m,f;r==="border-box"&&d.borderBoxSize?.[0]?(m=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(m=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(m=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:m,height:f});o>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(p,o)):p();},[r,o]);return useEffect(()=>{let c=e.current;if(!c||!n)return;let d=new ResizeObserver(l);d.observe(c,{box:r});let m=c.getBoundingClientRect();return s({width:m.width,height:m.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,n,r,l]),a}function lS(){let e=useRef(null),t=useCallback(()=>{let n=e.current;if(!n)return {width:0,height:0};let r=n.getBoundingClientRect();return {width:r.width,height:r.height}},[]);return {ref:e,measure:t}}function eR(e={}){let{defaultOpen:t=false,isOpen:n,onOpen:r,onClose:o,onChange:a,id:s}=e,[i,l]=useState(t),c=n!==void 0,d=c?n:i,m=useCallback(()=>{c||l(true),r?.(),a?.(true);},[c,r,a]),f=useCallback(()=>{c||l(false),o?.(),a?.(false);},[c,o,a]),p=useCallback(()=>{d?f():m();},[d,m,f]),g=useCallback(v=>{v?m():f();},[m,f]),h=useCallback(()=>({onClick:p,"aria-expanded":d,...s&&{"aria-controls":s}}),[p,d,s]),b=useCallback(()=>({hidden:!d,...s&&{id:s}}),[d,s]);return useMemo(()=>({isOpen:d,open:m,close:f,toggle:p,setIsOpen:g,getButtonProps:h,getDisclosureProps:b}),[d,m,f,p,g,h,b])}function uS(e){return eR({...e,defaultOpen:true})}function mS(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function pS(e,t=0){let[n,r]=useState(t),o=useCallback(()=>{r(i=>(i+1)%e.length);},[e.length]),a=useCallback(()=>{r(i=>(i-1+e.length)%e.length);},[e.length]),s=useCallback(i=>{let l=e.indexOf(i);l!==-1&&r(l);},[e]);return useMemo(()=>({value:e[n],index:n,next:o,prev:a,setIndex:r,setValue:s}),[e,n,o,a,s])}function fS(e=false){let[t,n]=useState(e),r=useCallback(()=>n(s=>!s),[]),o=useCallback(()=>n(true),[]),a=useCallback(()=>n(false),[]);return useMemo(()=>({value:t,toggle:r,on:o,off:a,set:n}),[t,r,o,a])}function bS(e=0,t={}){let{min:n=-1/0,max:r=1/0,step:o=1}=t,a=useCallback(g=>Math.min(Math.max(g,n),r),[n,r]),[s,i]=useState(()=>a(e)),l=useCallback(()=>{i(g=>a(g+o));},[a,o]),c=useCallback(()=>{i(g=>a(g-o));},[a,o]),d=useCallback(g=>{i(a(g));},[a]),m=useCallback(()=>{i(a(e));},[a,e]),f=s<=n,p=s>=r;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:m,isMin:f,isMax:p}),[s,l,c,d,m,f,p])}function vS(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function hS(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function xS(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function yS(e){let t=useRef(void 0),n=useRef(e),r=n.current!==e;return useEffect(()=>{t.current=n.current,n.current=e;},[e]),{current:e,previous:t.current,hasChanged:r}}function CS(e=[]){let[t,n]=useState(e),r=useCallback(C=>{n(C);},[]),o=useCallback(C=>{n(x=>[...x,C]);},[]),a=useCallback(C=>{n(x=>[...x,...C]);},[]),s=useCallback((C,x)=>{n(N=>{let T=[...N];return T.splice(C,0,x),T});},[]),i=useCallback((C,x)=>{n(N=>{let T=[...N];return T[C]=x,T});},[]),l=useCallback(C=>{n(x=>x.filter((N,T)=>T!==C));},[]),c=useCallback(C=>{n(x=>{let N=x.indexOf(C);return N===-1?x:x.filter((T,k)=>k!==N)});},[]),d=useCallback(C=>{n(x=>x.filter(N=>!C(N)));},[]),m=useCallback(()=>{let C;return n(x=>x.length===0?x:(C=x[0],x.slice(1))),C},[]),f=useCallback(C=>{n(x=>[C,...x]);},[]),p=useCallback(()=>{let C;return n(x=>x.length===0?x:(C=x[x.length-1],x.slice(0,-1))),C},[]),g=useCallback(()=>{n([]);},[]),h=useCallback(()=>{n(e);},[e]),b=useCallback((C,x)=>{n(N=>{let T=[...N],[k]=T.splice(C,1);return T.splice(x,0,k),T});},[]),v=useCallback((C,x)=>{n(N=>{let T=[...N];return [T[C],T[x]]=[T[x],T[C]],T});},[]),y=useCallback(C=>t.filter(C),[t]),R=useCallback(C=>t.find(C),[t]),w=useCallback(C=>t.includes(C),[t]);return useMemo(()=>({list:t,set:r,push:o,pushMany:a,insertAt:s,updateAt:i,removeAt:l,remove:c,removeWhere:d,shift:m,unshift:f,pop:p,clear:g,reset:h,move:b,swap:v,filter:y,find:R,includes:w,length:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i,l,c,d,m,f,p,g,h,b,v,y,R,w])}function TS(e=[]){let[t,n]=useState(()=>new Map(e)),r=useCallback(p=>t.get(p),[t]),o=useCallback((p,g)=>{n(h=>{let b=new Map(h);return b.set(p,g),b});},[]),a=useCallback(p=>{n(g=>{let h=new Map(g);return p.forEach(([b,v])=>h.set(b,v)),h});},[]),s=useCallback(p=>t.has(p),[t]),i=useCallback(p=>{n(g=>{let h=new Map(g);return h.delete(p),h});},[]),l=useCallback(()=>{n(new Map);},[]),c=useCallback(()=>{n(new Map(e));},[e]),d=useCallback(()=>Array.from(t.keys()),[t]),m=useCallback(()=>Array.from(t.values()),[t]),f=useCallback(()=>Array.from(t.entries()),[t]);return useMemo(()=>({map:t,get:r,set:o,setMany:a,has:s,delete:i,clear:l,reset:c,keys:d,values:m,entries:f,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d,m,f])}function MS(e={}){let[t,n]=useState(e),r=useCallback(d=>t[d],[t]),o=useCallback((d,m)=>{n(f=>({...f,[d]:m}));},[]),a=useCallback(d=>{n(m=>({...m,...d}));},[]),s=useCallback(d=>{n(m=>{let{[d]:f,...p}=m;return p});},[]),i=useCallback(()=>{n({});},[]),l=useCallback(()=>{n(e);},[e]),c=useCallback(d=>d in t,[t]);return useMemo(()=>({value:t,get:r,set:o,setAll:a,remove:s,clear:i,reset:l,has:c,keys:Object.keys(t),values:Object.values(t)}),[t,r,o,a,s,i,l,c])}function sR(e=[]){let[t,n]=useState(()=>new Set(e)),r=useCallback(m=>{n(f=>{let p=new Set(f);return p.add(m),p});},[]),o=useCallback(m=>{n(f=>{let p=new Set(f);return m.forEach(g=>p.add(g)),p});},[]),a=useCallback(m=>{n(f=>{let p=new Set(f);return p.delete(m),p});},[]),s=useCallback(m=>t.has(m),[t]),i=useCallback(m=>{n(f=>{let p=new Set(f);return p.has(m)?p.delete(m):p.add(m),p});},[]),l=useCallback(()=>{n(new Set);},[]),c=useCallback(()=>{n(new Set(e));},[e]),d=useCallback(()=>Array.from(t),[t]);return useMemo(()=>({set:t,add:r,addMany:o,remove:a,has:s,toggle:i,clear:l,reset:c,values:d,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d])}function kS(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=sR(e);return useMemo(()=>({selected:i(),isSelected:r,select:t,deselect:n,toggle:o,selectAll:s,deselectAll:a,count:l,isEmpty:l===0}),[i,r,t,n,o,s,a,l])}function PS(e=[]){let[t,n]=useState(e),r=useCallback(c=>{n(d=>[...d,c]);},[]),o=useCallback(c=>{n(d=>[...d,...c]);},[]),a=useCallback(()=>{let c;return n(d=>d.length===0?d:(c=d[0],d.slice(1))),c},[]),s=useCallback(()=>t[0],[t]),i=useCallback(()=>t[t.length-1],[t]),l=useCallback(()=>{n([]);},[]);return useMemo(()=>({queue:t,enqueue:r,enqueueMany:o,dequeue:a,peek:s,peekLast:i,clear:l,size:t.length,isEmpty:t.length===0,hasItems:t.length>0}),[t,r,o,a,s,i,l])}function ES(e=[]){let[t,n]=useState(e),r=useCallback(l=>{n(c=>[...c,l]);},[]),o=useCallback(l=>{n(c=>[...c,...l]);},[]),a=useCallback(()=>{let l;return n(c=>c.length===0?c:(l=c[c.length-1],c.slice(0,-1))),l},[]),s=useCallback(()=>t[t.length-1],[t]),i=useCallback(()=>{n([]);},[]);return useMemo(()=>({stack:t,push:r,pushMany:o,pop:a,peek:s,clear:i,size:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i])}function dR(e,t=false){let[n,r]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true}),o=useRef(true),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{r(c=>({...c,isLoading:true,isIdle:false,isError:false,error:null}));try{let c=await a.current(...l);return o.current&&r({data:c,error:null,isLoading:!1,isSuccess:!0,isError:!1,isIdle:!1}),c}catch(c){let d=c instanceof Error?c:new Error(String(c));return o.current&&r({data:null,error:d,isLoading:false,isSuccess:false,isError:true,isIdle:false}),null}},[]),i=useCallback(()=>{r({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true});},[]);return useEffect(()=>(o.current=true,t&&s(),()=>{o.current=false;}),[t,s]),{...n,execute:s,reset:i}}function SS(e,t=3,n=1e3){let[r,o]=useState(0),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{let c=null;for(let d=0;d<=t;d++)try{return o(d),await a.current(...l)}catch(m){c=m instanceof Error?m:new Error(String(m)),d<t&&await new Promise(f=>setTimeout(f,n));}throw c},[t,n]);return {...dR(s,false),retryCount:r}}var pR=new Map,DS=300*1e3;function HS(e,t={}){let{immediate:n=true,init:r,transform:o,deps:a=[],enabled:s=true,refetchInterval:i,cacheKey:l}=t,[c,d]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),m=useRef(null),f=useRef(true),p=useCallback(async()=>{if(!e||!s)return;let h=l||e,b=pR.get(h);if(b&&Date.now()-b.timestamp<DS){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}m.current&&m.current.abort(),m.current=new AbortController,d(v=>({...v,isLoading:true,error:null}));try{let v=await fetch(e,{...r,signal:m.current.signal});if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);let y=await v.json(),R=o?o(y):y;pR.set(h,{data:R,timestamp:Date.now()}),f.current&&d({data:R,error:null,isLoading:!1,isSuccess:!0,isError:!1});}catch(v){if(v instanceof Error&&v.name==="AbortError")return;let y=v instanceof Error?v:new Error(String(v));f.current&&d({data:null,error:y,isLoading:false,isSuccess:false,isError:true});}},[e,s,r,o,l]),g=useCallback(()=>{m.current&&m.current.abort();},[]);return useEffect(()=>(f.current=true,n&&s&&p(),()=>{f.current=false,g();}),[e,n,s,...a]),useEffect(()=>{if(!i||!s)return;let h=setInterval(p,i);return ()=>{clearInterval(h);}},[i,s,p]),{...c,refetch:p,abort:g}}function IS(e,t={}){let{transform:n,...r}=t,[o,a]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),s=useCallback(async l=>{a(c=>({...c,isLoading:true,error:null}));try{let c=await fetch(e,{...r,method:r.method||"POST",headers:{"Content-Type":"application/json",...r.headers},body:l?JSON.stringify(l):void 0});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json(),m=n?n(d):d;return a({data:m,error:null,isLoading:!1,isSuccess:!0,isError:!1}),m}catch(c){let d=c instanceof Error?c:new Error(String(c));return a({data:null,error:d,isLoading:false,isSuccess:false,isError:true}),null}},[e,r,n]),i=useCallback(()=>{a({data:null,error:null,isLoading:false,isSuccess:false,isError:false});},[]);return {...o,mutate:s,reset:i}}function xi(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setInterval(()=>{n.current();},t);return ()=>{clearInterval(r);}},[t]);}function AS(e,t){let[n,r]=useState(false);xi(e,n?t:null);let o=useCallback(()=>r(true),[]),a=useCallback(()=>r(false),[]),s=useCallback(()=>r(i=>!i),[]);return {start:o,stop:a,toggle:s,isRunning:n}}function zS(e,t={}){let{interval:n=1e3,onComplete:r,autoStart:o=false}=t,[a,s]=useState(e),[i,l]=useState(o),c=useRef(r);c.current=r;let d=a<=0;xi(()=>{s(g=>{let h=g-1;return h<=0?(l(false),c.current?.(),0):h});},i&&!d?n:null);let m=useCallback(()=>{d||l(true);},[d]),f=useCallback(()=>{l(false);},[]),p=useCallback(g=>{s(g??e),l(false);},[e]);return {seconds:a,isRunning:i,isComplete:d,start:m,pause:f,reset:p}}function OS(e={}){let{interval:t=1e3,maxSeconds:n,autoStart:r=false}=e,[o,a]=useState(0),[s,i]=useState(r),l=s&&(n===void 0||o<n);xi(()=>{a(p=>p+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),m=useCallback(()=>i(p=>!p),[]),f=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:f,toggle:m}}function bR(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setTimeout(()=>{n.current();},t);return ()=>{clearTimeout(r);}},[t]);}function BS(e,t){let[n,r]=useState(false),o=useRef(null),a=useRef(e);a.current=e;let s=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),r(false);},[]),i=useCallback(()=>{s(),r(true),o.current=setTimeout(()=>{a.current(),r(false);},t);},[t,s]),l=useCallback(()=>{i();},[i]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{start:i,cancel:s,reset:l,isScheduled:n}}function FS(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function KS(e,t=true){let[n,r]=useState(false);return bR(()=>{r(true);},t?e:null),n}function GS(e,t=true){let[n,r]=useState(t),[o,a]=useState(0),[s,i]=useState(0),l=useRef(e);l.current=e;let c=useRef(null),d=useRef(0),m=useRef(0),f=useRef(0),p=useRef(0),g=useCallback(v=>{let y=d.current?v-d.current:0;d.current=v,p.current++,v-f.current>=1e3&&(a(p.current),p.current=0,f.current=v),m.current++,i(m.current),l.current(y,v),c.current=requestAnimationFrame(g);},[]),h=useCallback(()=>{c.current===null&&(d.current=0,f.current=performance.now(),p.current=0,c.current=requestAnimationFrame(g),r(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,r(false));},[]);return useEffect(()=>(t&&h(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,h]),{start:h,stop:b,isRunning:n,frameCount:s,fps:o}}function $S(e,t={}){let{duration:n=300,easing:r="easeOutCubic"}=t,[o,a]=useState(e),s=useRef(e),i=useRef(null),l=useRef(null),c={linear:d=>d,easeInCubic:d=>d*d*d,easeOutCubic:d=>1-Math.pow(1-d,3),easeInOutCubic:d=>d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2};return useEffect(()=>{if(o===e)return;s.current=o,i.current=null;let d=m=>{i.current===null&&(i.current=m);let f=m-i.current,p=Math.min(f/n,1),g=c[r](p),h=s.current+(e-s.current)*g;a(h),p<1&&(l.current=requestAnimationFrame(d));};return l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r]),o}function US(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1}=t,[a,s]=useState(e),i=useRef(0),l=useRef(null),c=useRef(null);return useEffect(()=>{if(Math.abs(a-e)<.01&&Math.abs(i.current)<.01){s(e);return}let d=m=>{c.current===null&&(c.current=m);let f=Math.min((m-c.current)/1e3,.064);c.current=m;let p=(e-a)*n,g=i.current*r,h=(p-g)/o;i.current+=h*f;let b=a+i.current*f;s(b),Math.abs(b-e)>.01||Math.abs(i.current)>.01?l.current=requestAnimationFrame(d):(s(e),i.current=0);};return c.current=null,l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r,o,a]),a}var yR=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function WS(e,t={}){let{events:n=yR,initialState:r=false,enabled:o=true}=t,[a,s]=useState(r),i=useRef(null),l=useCallback(()=>{s(false),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{s(true);},e);},[e]);return useEffect(()=>{if(o)return l(),n.forEach(c=>{window.addEventListener(c,l);}),()=>{i.current&&clearTimeout(i.current),n.forEach(c=>{window.removeEventListener(c,l);});}},[o,n,l]),a}function _S(e,t,n,r={}){let{events:o=yR,initialState:a=false,enabled:s=true}=r,[i,l]=useState(a),c=useRef(null),d=useRef(a),m=useCallback(()=>{d.current&&(d.current=false,n?.()),l(false),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d.current=true,l(true),t?.();},e);},[e,t,n]);return useEffect(()=>{if(s)return m(),o.forEach(f=>{window.addEventListener(f,m);}),()=>{c.current&&clearTimeout(c.current),o.forEach(f=>{window.removeEventListener(f,m);});}},[s,o,m]),i}function wR(){let[e,t]=useState(()=>typeof document>"u"?"visible":document.visibilityState);return useEffect(()=>{let n=()=>{t(document.visibilityState);};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}},[]),e}function XS(){return wR()==="visible"}function qS(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function ZS(){let[e,t]=useState(()=>typeof navigator>"u"?true:navigator.onLine);return useEffect(()=>{let n=()=>t(true),r=()=>t(false);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r);}},[]),e}function QS(e,t){let[n,r]=useState(()=>typeof navigator>"u"?true:navigator.onLine),o=useCallback(()=>{r(true),e?.();},[e]),a=useCallback(()=>{r(false),t?.();},[t]);return useEffect(()=>(window.addEventListener("online",o),window.addEventListener("offline",a),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a);}),[o,a]),n}function NR(e){let[t,n]=useState(false),r=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),o=useCallback(async()=>{let i=e?.current||document.documentElement;try{i.requestFullscreen?await i.requestFullscreen():i.webkitRequestFullscreen?await i.webkitRequestFullscreen():i.mozRequestFullScreen?await i.mozRequestFullScreen():i.msRequestFullscreen&&await i.msRequestFullscreen();}catch(l){console.error("Failed to enter fullscreen:",l);}},[e]),a=useCallback(async()=>{try{document.exitFullscreen?await document.exitFullscreen():document.webkitExitFullscreen?await document.webkitExitFullscreen():document.mozCancelFullScreen?await document.mozCancelFullScreen():document.msExitFullscreen&&await document.msExitFullscreen();}catch(i){console.error("Failed to exit fullscreen:",i);}},[]),s=useCallback(async()=>{t?await a():await o();},[t,o,a]);return useEffect(()=>{let i=()=>{n(!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement));};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i);}},[]),{isFullscreen:t,enter:o,exit:a,toggle:s,isSupported:r}}function nD(){let e=useRef(null),t=NR(e);return {ref:e,...t}}function aD(e={}){let{watch:t=false,immediate:n=true,enableHighAccuracy:r=true,maximumAge:o=0,timeout:a=1e4}=e,[s,i]=useState({isLoading:false,position:null,error:null,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null}),l=typeof navigator<"u"&&"geolocation"in navigator,c=useCallback(f=>{i({isLoading:false,position:f,error:null,latitude:f.coords.latitude,longitude:f.coords.longitude,accuracy:f.coords.accuracy,altitude:f.coords.altitude,altitudeAccuracy:f.coords.altitudeAccuracy,heading:f.coords.heading,speed:f.coords.speed,timestamp:f.timestamp});},[]),d=useCallback(f=>{i(p=>({...p,isLoading:false,error:f}));},[]),m=useCallback(()=>{l&&(i(f=>({...f,isLoading:true,error:null})),navigator.geolocation.getCurrentPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a}));},[l,c,d,r,o,a]);return useEffect(()=>{if(l&&(n&&m(),t)){let f=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(f);}}},[t,n,l,m,c,d,r,o,a]),{...s,getCurrentPosition:m,isSupported:l}}function sD(e,t,n,r){if(e===null||t===null||n===null||r===null)return null;let o=6371e3,a=e*Math.PI/180,s=n*Math.PI/180,i=(n-e)*Math.PI/180,l=(r-t)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return o*d}function iD(e){let[t,n]=useState(null),[r,o]=useState(true),a=typeof navigator<"u"&&"permissions"in navigator,s=useCallback(async()=>{if(!a)return o(false),null;try{o(!0);let i=await navigator.permissions.query({name:e});return n(i.state),o(!1),i.state}catch(i){return console.error(`Permission query failed for ${e}:`,i),o(false),null}},[e,a]);return useEffect(()=>{if(!a){o(false);return}let i=null,l=()=>{i&&n(i.state);};return navigator.permissions.query({name:e}).then(c=>{i=c,n(c.state),o(false),c.addEventListener("change",l);}).catch(()=>{o(false);}),()=>{i&&i.removeEventListener("change",l);}},[e,a]),{state:t,isGranted:t==="granted",isDenied:t==="denied",isPrompt:t==="prompt",isLoading:r,isSupported:a,query:s}}function lD(){let[e,t]=useState(typeof Notification<"u"?Notification.permission:"default"),n=typeof Notification<"u",r=useCallback(async()=>{if(!n)return "default";let o=await Notification.requestPermission();return t(o),o},[n]);return useEffect(()=>{n&&t(Notification.permission);},[n]),{permission:e,request:r,isSupported:n}}function cD(e){let[t,n]=useState(null),[r,o]=useState(null),[a,s]=useState(false),i=typeof navigator<"u"&&"mediaDevices"in navigator,l=useCallback(async()=>{if(!i)return null;s(true),o(null);try{let d=await navigator.mediaDevices.getUserMedia(e);return n(d),s(!1),d}catch(d){let m=d instanceof Error?d:new Error(String(d));return o(m),s(false),null}},[e,i]),c=useCallback(()=>{t&&(t.getTracks().forEach(d=>d.stop()),n(null));},[t]);return useEffect(()=>()=>{t&&t.getTracks().forEach(d=>d.stop());},[t]),{stream:t,error:r,isLoading:a,request:l,stop:c,isSupported:i}}function uD(e={}){let{voice:t=null,rate:n=1,pitch:r=1,volume:o=1,lang:a="en-US"}=e,[s,i]=useState(false),[l,c]=useState(false),[d,m]=useState([]),f=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!f)return;let v=()=>{m(window.speechSynthesis.getVoices());};return v(),window.speechSynthesis.addEventListener("voiceschanged",v),()=>{window.speechSynthesis.removeEventListener("voiceschanged",v);}},[f]);let p=useCallback(v=>{if(!f)return;window.speechSynthesis.cancel();let y=new SpeechSynthesisUtterance(v);y.voice=t,y.rate=n,y.pitch=r,y.volume=o,y.lang=a,y.onstart=()=>i(true),y.onend=()=>{i(false),c(false);},y.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(y);},[f,t,n,r,o,a]),g=useCallback(()=>{f&&(window.speechSynthesis.cancel(),i(false),c(false));},[f]),h=useCallback(()=>{f&&(window.speechSynthesis.pause(),c(true));},[f]),b=useCallback(()=>{f&&(window.speechSynthesis.resume(),c(false));},[f]);return {speak:p,stop:g,pause:h,resume:b,isSpeaking:s,isPaused:l,isSupported:f,voices:d}}function mD(e={}){let{lang:t="en-US",continuous:n=false,interimResults:r=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,m]=useState(null),f=useRef(null),p=typeof window<"u"?window.SpeechRecognition||window.webkitSpeechRecognition:null,g=p!==null;useEffect(()=>{if(!g||!p)return;let R=new p;return R.lang=t,R.continuous=n,R.interimResults=r,R.onstart=()=>{a(true),m(null);},R.onend=()=>{a(false);},R.onerror=w=>{m(new Error(w.error)),a(false);},R.onresult=w=>{let C="",x="";for(let N=w.resultIndex;N<w.results.length;N++){let T=w.results[N];T.isFinal?x+=T[0].transcript:C+=T[0].transcript;}x&&i(N=>N+x),c(C);},f.current=R,()=>{R.abort();}},[g,p,t,n,r]);let h=useCallback(()=>{if(f.current&&!o)try{f.current.start();}catch{}},[o]),b=useCallback(()=>{f.current&&f.current.stop();},[]),v=useCallback(()=>{f.current&&f.current.abort();},[]),y=useCallback(()=>{i(""),c(""),m(null);},[]);return {start:h,stop:b,abort:v,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:y}}export{Ju as Accordion,em as AccordionItem,Lh as ActionBar,Sh as ActionBarButton,bh as ActionGroup,Kx as ActionSheet,zR as Alert,BR as AlertDescription,OR as AlertTitle,Tv as AreaChart,Nm as AspectRatio,Jg as Autocomplete,wr as Avatar,Cr as AvatarFallback,$p as AvatarGroup,Jr as AvatarImage,xg as BackTop,GR as Badge,Dx as Banner,wv as BarChart,Jh as BatteryMeter,Ey as Blockquote,Ox as BottomNavigation,ny as Bounce,vm as Breadcrumb,Cm as BreadcrumbEllipsis,xm as BreadcrumbItem,ym as BreadcrumbLink,hm as BreadcrumbList,Rm as BreadcrumbPage,wm as BreadcrumbSeparator,oe as Button,ph as ButtonGroup,sg as COUNTRIES,so as Calendar,bd as Card,yd as CardContent,xd as CardDescription,Rd as CardFooter,vd as CardHeader,hd as CardTitle,Dv as Carousel,Hv as CarouselContent,Iv as CarouselItem,jl as CarouselNext,Yl as CarouselPrevious,Ko as Checkbox,yy as Checkmark,Xp as Chip,tf as CircularProgress,_o as CloseButton,mb as Code,Zx as Collapse,sm as Collapsible,im as CollapsibleContent,$i as CollapsibleTrigger,ox as ColorArea,ch as ColorField,_f as ColorPicker,ix as ColorSlider,ta as ColorSwatch,Uf as ColorSwatchPicker,cx as ColorWheel,Zi as Command,Ow as CommandDialog,Lp as CommandEmpty,Sp as CommandGroup,Pp as CommandInput,Hp as CommandItem,Ep as CommandList,Dp as CommandSeparator,Ip as CommandShortcut,Ry as Confetti,Al as ConfirmDialog,Pu as ContextMenu,Ou as ContextMenuCheckboxItem,Iu as ContextMenuContent,Lu as ContextMenuGroup,zu as ContextMenuItem,Fu as ContextMenuLabel,Su as ContextMenuPortal,Hu as ContextMenuRadioGroup,Bu as ContextMenuRadioItem,Ku as ContextMenuSeparator,Gu as ContextMenuShortcut,Du as ContextMenuSub,Au as ContextMenuSubContent,Vu as ContextMenuSubTrigger,Eu as ContextMenuTrigger,Kh as ContextualHelp,vv as CopyButton,iy as Counter,Zf as CurrencyInput,pa as DEFAULT_COLORS,Mw as DataTable,oh as DateField,rg as DateInput,Op as DatePicker,Ob as DateRangePicker,Nl as DefaultErrorFallback,Va as Dialog,Md as DialogClose,Aa as DialogContent,Ed as DialogDescription,kd as DialogFooter,Nd as DialogHeader,ki as DialogOverlay,Ni as DialogPortal,Pd as DialogTitle,Td as DialogTrigger,Qh as DiskUsageMeter,Yi as Drawer,qm as DrawerBody,ep as DrawerClose,jm as DrawerContent,Jm as DrawerDescription,Zm as DrawerFooter,ip as DrawerGroup,lp as DrawerGroupLabel,Xm as DrawerHeader,cp as DrawerInset,rp as DrawerMenu,sp as DrawerMenuButton,op as DrawerMenuItem,hw as DrawerProvider,np as DrawerSeparator,_m as DrawerSidebar,Qm as DrawerTitle,tp as DrawerToggle,Ym as DrawerTrigger,to as Dropdown,ro as DropdownContent,tu as DropdownGroup,Yn as DropdownItem,T0 as DropdownLabel,Hi as DropdownSection,Jd as DropdownSeparator,eu as DropdownShortcut,nu as DropdownSub,ou as DropdownSubContent,ru as DropdownSubTrigger,no as DropdownTrigger,ql as EMOJIS,Bs as EMOJI_CATEGORIES,Av as EmojiPicker,gf as EmptyState,hM as ErrorBoundary,Qx as Expand,EE as FAB,jx as Fade,hl as FieldContext,Ff as FileUpload,ey as Flip,Rc as FloatingActionButton,eb as Form,vl as FormContext,ob as FormControl,ab as FormDescription,tb as FormField,nb as FormItem,rb as FormLabel,sb as FormMessage,yv as FullCalendar,wy as Glow,Xh as GridList,Ty as H1,My as H2,Ny as H3,ky as H4,pm as HoverCard,gm as HoverCardContent,fm as HoverCardTrigger,Th as IllustratedMessage,gb as Image,Kv as ImageCropper,zl as ImageViewer,iv as ImageViewerTrigger,cv as Indicator,dv as IndicatorWrapper,$b as InfiniteScroll,Ph as InlineAlert,Ly as InlineCode,za as Input,of as InputOTP,af as InputOTPGroup,lf as InputOTPSeparator,sf as InputOTPSlot,Ev as KanbanBoard,gv as Kbd,Rr as Label,mx as LabeledValue,fx as LabeledValueGroup,Dy as Large,Sy as Lead,Rv as LineChart,vg as Link,kC as List,Rf as ListItem,wf as ListItemText,Ah as ListView,Rb as Listbox,wb as ListboxItem,Ab as Loading,Eb as LoadingOverlay,il as MASK_PRESETS,eg as MaskedInput,Tg as Menubar,Vg as MenubarCheckboxItem,Hg as MenubarContent,Ng as MenubarGroup,Ig as MenubarItem,zg as MenubarLabel,Mg as MenubarMenu,kg as MenubarPortal,Eg as MenubarRadioGroup,Ag as MenubarRadioItem,Og as MenubarSeparator,Bg as MenubarShortcut,Pg as MenubarSub,Dg as MenubarSubContent,Sg as MenubarSubTrigger,Lg as MenubarTrigger,ti as Meter,jb as Modal,Jb as ModalBody,Vl as ModalClose,Zb as ModalContent,nv as ModalDescription,ev as ModalFooter,Qb as ModalHeader,Il as ModalOverlay,Hl as ModalPortal,Xb as ModalRoot,tv as ModalTitle,qb as ModalTrigger,Iy as Muted,Sb as NProgress,dg as Navbar,ug as NavbarBrand,mg as NavbarContent,pg as NavbarItem,fg as NavbarLink,Dm as NavigationMenu,zm as NavigationMenuContent,Fm as NavigationMenuIndicator,Im as NavigationMenuItem,Bm as NavigationMenuLink,Hm as NavigationMenuList,Am as NavigationMenuTrigger,_i as NavigationMenuViewport,kx as NotificationCenter,Ex as NotificationCenterContent,gE as NotificationCenterProvider,Px as NotificationCenterTrigger,xc as NotificationItem,Lx as NotificationList,Jv as NumberField,Ap as NumberInput,wp as Pagination,Cp as PaginationContent,kp as PaginationEllipsis,Tp as PaginationItem,os as PaginationLink,Np as PaginationNext,Mp as PaginationPrevious,Py as Paragraph,by as Parallax,Vp as PasswordInput,ig as PhoneInput,Cv as PieChart,sy as Pop,nt as Popover,oo as PopoverAnchor,rt as PopoverContent,Lt as PopoverTrigger,es as Progress,Yx as PullToRefresh,oy as Pulse,$v as QRCode,Uu as RadioGroup,Wu as RadioGroupItem,Oh as RangeSlider,Wp as Rating,cC as ResizableHandle,lC as ResizablePanel,iC as ResizablePanelGroup,Ov as RichTextEditor,ty as Ripple,Jx as Rotate,qx as Scale,ze as ScrollArea,gy as ScrollProgress,fy as ScrollReveal,pv as ScrollShadow,xx as SearchBar,nh as SearchField,Vf as SegmentedControl,Af as SegmentedControlItem,Xd as Select,Gn as Separator,ry as Shake,bu as Sheet,hu as SheetClose,Ru as SheetContent,Mu as SheetDescription,Cu as SheetFooter,wu as SheetHeader,xu as SheetOverlay,Oi as SheetPortal,Tu as SheetTitle,vu as SheetTrigger,xy as Shimmer,Ga as Skeleton,Xx as Slide,Za as Slider,Hy as Small,fb as Snippet,aM as SortableList,Cy as Sparkles,Ha as Spinner,Cx as SpotlightSearch,hf as StatCard,Rh as StatusLight,$g as Step,Kg as Steps,Ux as SwipeActions,Id as Switch,up as Table,pp as TableBody,hp as TableCaption,vp as TableCell,fp as TableFooter,bp as TableHead,mp as TableHeader,gp as TableRow,cu as Tabs,mu as TabsContent,du as TabsList,uu as TabsTrigger,Uh as TagGroup,mf as TagInput,UR as TextBadge,Xv as TextField,cy as TextReveal,Vd as Textarea,Uv as ThemeProvider,Wv as ThemeToggle,sh as TimeField,jf as TimeInput,Bb as TimePicker,Nf as Timeline,Ef as TimelineContent,Pf as TimelineItem,Lf as TimelineOpposite,I0 as Toaster,_u as Toggle,ju as ToggleGroup,Xu as ToggleGroupItem,Un as Tooltip,_n as TooltipContent,$n as TooltipProvider,Wn as TooltipTrigger,qg as Tree,ly as Typewriter,Vy as UL,cb as User,CM as VirtualList,ay as Wiggle,dy as WordRotate,Eh as actionBarVariants,gh as actionGroupVariants,Fx as actionSheetItemVariants,VR as alertVariants,us as applyMask,Qg as autocompleteInputVariants,Gp as avatarGroupVariants,hg as backTopVariants,FR as badgeIndicatorVariants,Sx as bannerVariants,zx as bottomNavigationVariants,uh as buttonGroupVariants,bn as buttonVariants,N0 as calculatePasswordStrength,gd as cardVariants,Lv as carouselVariants,ma as chartContainerVariants,jp as chipVariants,ef as circularProgressVariants,Um as closeButtonVariants,u as cn,ub as codeVariants,ex as colorAreaVariants,lh as colorFieldVariants,sx as colorSliderVariants,$f as colorSwatchPickerVariants,Gf as colorSwatchVariants,lx as colorWheelVariants,av as confirmDialogIconVariants,pc as contextualHelpTriggerVariants,bv as copyButtonVariants,Xf as currencyInputVariants,rh as dateFieldVariants,tg as dateInputVariants,pu as defaultPasswordRequirements,ap as drawerMenuButtonVariants,Vv as emojiPickerVariants,ff as emptyStateVariants,ya as fabVariants,zf as fileUploadVariants,sl as formatCurrency,ps as formatDate,cs as formatFileSize,gs as formatPhoneNumber,xv as fullCalendarVariants,Of as getFileIcon,Jf as getMaskPlaceholder,k0 as getPasswordStrengthColor,P0 as getPasswordStrengthLabel,jh as gridListItemVariants,Yh as gridListVariants,nx as hexToRgb,ri as hsvToRgb,Ch as illustratedMessageVariants,Fv as imageCropperVariants,wl as imageVariants,lv as indicatorVariants,Ll as infiniteScrollLoaderVariants,Gb as infiniteScrollVariants,kh as inlineAlertVariants,rf as inputOTPVariants,Yv as inputSizeVariants,kv as kanbanBoardVariants,Wl as kanbanCardVariants,Pv as kanbanColumnVariants,fv as kbdVariants,jv as labelSizeVariants,px as labeledValueGroupVariants,ux as labeledValueVariants,bg as linkVariants,yf as listItemVariants,nl as listVariants,Vh as listViewItemVariants,Ih as listViewVariants,xb as listboxItemVariants,hb as listboxVariants,Pb as loadingOverlayVariants,Vb as loadingVariants,Qf as maskedInputVariants,Zh as meterVariants,Dl as modalContentVariants,cg as navbarVariants,Om as navigationMenuLinkStyle,Vm as navigationMenuTriggerStyle,Lb as nprogressVariants,Qv as numberFieldVariants,ng as parseDate,qf as parseFormattedValue,ag as phoneInputVariants,_x as pullToRefreshVariants,ec as qrCodeVariants,zh as rangeSliderVariants,Up as ratingVariants,rx as rgbToHex,tx as rgbToHsv,zv as richTextEditorVariants,mv as scrollShadowVariants,hx as searchBarVariants,th as searchFieldVariants,Hf as segmentedControlItemVariants,Df as segmentedControlVariants,jd as selectVariants,yu as sheetVariants,zd as skeletonVariants,pb as snippetVariants,Mb as sortableItemVariants,Tb as sortableListVariants,ud as spinnerVariants,vf as statCardVariants,yh as statusLightVariants,Gg as stepVariants,Fg as stepsVariants,Cc as swipeActionVariants,$x as swipeActionsVariants,Ba as switchColors,fc as tagGroupItemVariants,$h as tagGroupVariants,uf as tagVariants,$R as textBadgeVariants,_v as textFieldVariants,Ak as themeToggleVariants,ah as timeFieldVariants,Yf as timeInputVariants,kf as timelineItemVariants,Mf as timelineVariants,Xa as toggleVariants,_g as treeItemVariants,Wg as treeVariants,ll as unmask,$S as useAnimatedValue,dR as useAsync,SS as useAsyncRetry,eS as useBodyScrollLock,fS as useBooleanToggle,fL as useBreakpoint,gL as useBreakpoints,aP as useButtonGroup,_l as useCarousel,SL as useClickOutside,DL as useClickOutsideMultiple,JE as useConfetti,zM as useConfirmDialog,IL as useCopy,HL as useCopyToClipboard,zS as useCountdown,bS as useCounter,pS as useCycle,CL as useDebounce,TL as useDebouncedCallback,ML as useDebouncedCallbackWithControls,FS as useDelayedValue,eR as useDisclosure,uS as useDisclosureOpen,sD as useDistance,XS as useDocumentIsVisible,wR as useDocumentVisibility,qS as useDocumentVisibilityCallback,dw as useDrawer,lS as useElementSize,OL as useEventListener,BL as useEventListenerRef,HS as useFetch,Rs as useFieldContext,qL as useFocusTrap,ZL as useFocusTrapRef,xl as useFormContext,NR as useFullscreen,nD as useFullscreenRef,aD as useGeolocation,VL as useHotkeys,AL as useHotkeysMap,GL as useHover,WL as useHoverDelay,UL as useHoverProps,$L as useHoverRef,WS as useIdle,_S as useIdleCallback,vS as useIncrementCounter,qy as useIntersectionObserver,nS as useIntersectionObserverRef,xi as useInterval,AS as useIntervalControls,aL as useIsDesktop,rL as useIsMobile,oL as useIsTablet,FL as useKeyPress,zL as useKeyPressed,rN as useKeyboardShortcut,rS as useLazyLoad,CS as useList,hL as useLocalStorage,KL as useLongPress,TS as useMap,cD as useMediaPermission,Vo as useMediaQuery,YL as useMouse,jL as useMouseElement,XL as useMouseElementRef,IS as useMutation,oS as useMutationObserver,aS as useMutationObserverRef,ai as useNotificationCenter,lD as useNotificationPermission,ZS as useOnlineStatus,QS as useOnlineStatusCallback,iD as usePermission,sL as usePrefersColorScheme,iL as usePrefersReducedMotion,hS as usePrevious,yS as usePreviousDistinct,xS as usePreviousWithInitial,PS as useQueue,GS as useRafLoop,MS as useRecord,sS as useResizeObserver,iS as useResizeObserverRef,Yy as useScrollLock,QL as useScrollPosition,kS as useSelection,yL as useSessionStorage,sR as useSet,mD as useSpeechRecognition,uD as useSpeechSynthesis,iE as useSpotlight,US as useSpringValue,ES as useStack,PL as useThrottle,EL as useThrottledCallback,bR as useTimeout,BS as useTimeoutControls,KS as useTimeoutFlag,OS as useTimer,mS as useToggle,pL as useWindowHeight,JL as useWindowScroll,Ta as useWindowSize,mL as useWindowWidth,lb as userVariants,Bf as validateFile,WT as validators,Fb as virtualListVariants};//# sourceMappingURL=index.js.map
73
73
  //# sourceMappingURL=index.js.map