@reeverdev/ui 0.2.218 → 0.2.220

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 Z from'react';import {createContext,useState,useEffect,useContext,useCallback,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,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,Calendar,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,Play,Pause,SkipBack,SkipForward,VolumeX,Volume2,PictureInPicture,Minimize,Maximize,Shuffle,Repeat,Volume1,Printer,FileWarning,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as ja from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay,closestCenter}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import {HexColorPicker,HexColorInput}from'react-colorful';import {themes,Highlight}from'prism-react-renderer';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import gM from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import TM from'@tiptap/starter-kit';import MM from'@tiptap/extension-link';import NM from'@tiptap/extension-underline';import kM from'@tiptap/extension-text-align';import PM from'@tiptap/extension-placeholder';import XM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import rN 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 zo from'canvas-confetti';function u(...e){return twMerge(clsx(e))}var my=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"}}),py={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},fy=Z.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=py[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(my({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})]})});fy.displayName="Alert";var gy=Z.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:u("mb-1 font-medium leading-none tracking-tight",e),...t}));gy.displayName="AlertTitle";var by=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("text-sm [&_p]:leading-relaxed",e),...t}));by.displayName="AlertDescription";var vy=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border"},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"}}),hy={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},xy={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"},yy=Z.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,showPing:l=false,...c},d)=>jsxs("div",{ref:d,className:u("relative inline-flex",e),...c,children:[t,jsxs("span",{className:u(vy({variant:r,color:o,size:i?void 0:a,placement:s}),i&&hy[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:u("absolute inset-0 rounded-full animate-ping opacity-75",xy[o||"default"])}),!i&&n]})]}));yy.displayName="Badge";var Ry=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"}}),wy=Z.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:u(Ry({color:t,size:n}),e),...r}));wy.displayName="TextBadge";var Zc=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"}}),Ty={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=Z.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(Zc({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",Ty[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 Jc=cva("inline-flex",{variants:{variant:{default:"",attached:""},orientation:{horizontal:"flex-row",vertical:"flex-col"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"},{variant:"attached",orientation:"horizontal",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},{variant:"attached",orientation:"vertical",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),ed=Z.createContext({});function hi(){return Z.useContext(ed)}var td=Z.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(ed.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:u(Jc({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));td.displayName="ButtonGroup";var no=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 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 border-zinc-300 dark:border-zinc-700 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"},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:"border-zinc-300 dark:border-zinc-700 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 hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:text-white dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},{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:"border-green-600 dark:border-green-500 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 hover:bg-green-600 hover:text-white hover:border-green-600 dark:text-green-500 dark:hover:bg-green-500 dark:hover:text-white dark:hover:border-green-500"},{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:"border-amber-600 dark:border-amber-500 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 hover:bg-amber-600 hover:text-white hover:border-amber-600 dark:text-amber-500 dark:hover:bg-amber-500 dark:hover:text-white dark:hover:border-amber-500"},{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:"border-red-600 dark:border-red-500 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 hover:bg-red-600 hover:text-white hover:border-red-600 dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white dark:hover:border-red-500"},{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:"border-blue-600 dark:border-blue-500 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 hover:bg-blue-600 hover:text-white hover:border-blue-600 dark:text-blue-500 dark:hover:bg-blue-500 dark:hover:text-white dark:hover:border-blue-500"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),me=Z.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,isIconOnly:f,...p},g)=>{let h=hi(),b=d||h.disabled||s,v=m,R=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",w=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?b?jsx("span",{role:"link","aria-disabled":"true",className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R,"pointer-events-none opacity-50 cursor-not-allowed"),style:v,children:w}):jsx("a",{href:a,className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R),style:v,...p,children:w}):jsx("button",{type:"button",className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R),ref:g,disabled:b,style:v,...p,children:w})});me.displayName="Button";var ad=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"lg"}}),sd=Z.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:u(ad({radius:t,className:e})),...n}));sd.displayName="Card";var id=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex flex-col space-y-1.5 p-6",e),...t}));id.displayName="CardHeader";var ld=Z.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:u("text-2xl font-semibold leading-none tracking-tight",e),...t}));ld.displayName="CardTitle";var cd=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));cd.displayName="CardDescription";var dd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("p-6 pt-0",e),...t}));dd.displayName="CardContent";var ud=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center p-6 pt-0",e),...t}));ud.displayName="CardFooter";var Uo=Z.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]=Z.useState(n),h=t!==void 0,b=h?t:p,[v,R]=Z.useState(false),x=Z.useId(),w=()=>{if(o)return;let P=b==="indeterminate"?true:!b;h||g(P),r?.(P);},C=P=>{P.key==="Enter"&&P.preventDefault(),d?.(P);},y=b===true,T=b==="indeterminate",D=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":T?"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",T&&"bg-background text-foreground",!l&&e),style:{borderColor:v?"var(--color-foreground)":void 0},onClick:w,onKeyDown:C,onFocus:()=>R(true),onBlur:()=>R(false),...m,children:(y||T)&&jsx("span",{className:"flex items-center justify-center text-current",children:T?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:[D,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,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})]})]}):D});Uo.displayName="Checkbox";var Dy=cva("flex w-full border border-input bg-background px-3 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:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),ao=Z.forwardRef(({className:e,type:t,size:n,radius:r,label:o,isRequired:a,description:s,errorMessage:i,isInvalid:l,onFocus:c,onBlur:d,style:m,...f},p)=>{let[g,h]=Z.useState(false),b=Z.useId(),v=f.id||b,R=l||!!i,x=jsx("input",{id:v,type:t,className:u(Dy({size:n,radius:r}),R&&"border-danger focus:border-danger",!o&&e),ref:p,required:a,"aria-invalid":R,"aria-describedby":s||i?`${v}-description`:void 0,style:{...m,borderColor:R?void 0:g?"var(--color-foreground)":void 0},onFocus:w=>{h(true),c?.(w);},onBlur:w=>{h(false),d?.(w);},...f});return !o&&!s&&!i?x:jsxs("div",{className:u("flex flex-col gap-1.5",e),children:[o&&jsxs("label",{htmlFor:v,className:"text-sm font-medium leading-none",children:[o,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),x,(s||i)&&jsx("p",{id:`${v}-description`,className:u("text-xs",R?"text-danger":"text-muted-foreground"),children:i||s})]})});ao.displayName="Input";var Iy=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Er=Z.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:u(Iy(),e),...t}));Er.displayName="Label";var er=Z.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})});er.displayName="Separator";var zy="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",Aa={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"},gd={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"}},bd=Z.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]=Z.useState(a),v=o!==void 0,R=v?o:h,x=()=>{if(i)return;let T=!R;v||b(T),s?.(T);},w=T=>{T.key==="Enter"&&T.preventDefault(),m?.(T);},C=t&&Aa[t]?Aa[t]:Aa.default,y=gd[n]||gd.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(zy,y.track,R?r?"":C:"bg-input",e),style:r&&R?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:w,...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}})]})});bd.displayName="Switch";var Ky=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"md"}}),vd=Z.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=Z.useState(false);return jsx("textarea",{className:u(Ky({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 xd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Ba=Z.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:u(xd({variant:t,className:e})),...n}));Ba.displayName="Skeleton";var _y=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),yd=Z.createContext(null),Rd=()=>{let e=Z.useContext(yd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Sr=Z.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=Z.useState("idle");return jsx(yd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:u(_y({size:t,radius:n,className:e})),...r})})});Sr.displayName="Avatar";var so=Z.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Rd();return Z.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})});so.displayName="AvatarImage";var Lr=Z.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Rd(),[s,i]=Z.useState(t===0);return Z.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})});Lr.displayName="AvatarFallback";var Cd=Z.createContext({delayDuration:700,skipDelayDuration:300}),tr=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Cd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});tr.displayName="TooltipProvider";var Td=Z.createContext(null),Md=()=>{let e=Z.useContext(Td);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Je=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=Z.useContext(Cd),[s,i]=Z.useState(n),l=t!==void 0,c=l?t:s,d=Z.useRef(null),m=Z.useId(),f=Z.useRef(null),p=o??a.delayDuration,g=Z.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 Z.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Td.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:m},children:e})};Je.displayName="Tooltip";var wn=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=Md();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 Cn=Z.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}=Md(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);if(Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),x=0,w=0;switch(t){case "top":x=v.top-R.height-n;break;case "bottom":x=v.bottom+n;break;case "left":w=v.left-R.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-R.width/2;break;case "end":w=v.right-R.width-o;break}else switch(r){case "start":x=v.top+o;break;case "center":x=v.top+v.height/2-R.height/2;break;case "end":x=v.bottom-R.height-o;break}f({top:x,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 ja.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)});Cn.displayName="TooltipContent";var Wy={sm:"20px",md:"40px",lg:"60px"},Ae=Z.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",showShadow:r=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=Z.useRef(null),[d,m]=Z.useState(false),[f,p]=Z.useState({top:false,bottom:false,left:false,right:false}),g=Z.useId().replace(/:/g,"");Z.useImperativeHandle(l,()=>c.current);let h=Z.useCallback(()=>{let C=c.current;if(!C||!r)return;let{scrollTop:y,scrollLeft:T,scrollHeight:D,scrollWidth:P,clientHeight:S,clientWidth:L}=C;p({top:y>0,bottom:y<D-S-1,left:T>0,right:T<P-L-1});},[r]);Z.useEffect(()=>{if(!r)return;let C=c.current;if(C)return h(),C.addEventListener("scroll",h),window.addEventListener("resize",h),()=>{C.removeEventListener("scroll",h),window.removeEventListener("resize",h);}},[r,h]);let b=n==="visible"||n==="hover"&&d,v=b?"rgba(0,0,0,0.3)":"transparent",R=b?"rgba(255,255,255,0.3)":"transparent",x=`
1
+ import*as Z from'react';import {createContext,useState,useEffect,useContext,useCallback,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,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,Calendar,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,Play,Pause,SkipBack,SkipForward,VolumeX,Volume2,PictureInPicture,Minimize,Maximize,Shuffle,Repeat,Volume1,Printer,FileWarning,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as ja from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay,closestCenter}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import {HexColorPicker,HexColorInput}from'react-colorful';import {themes,Highlight}from'prism-react-renderer';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import gM from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import TM from'@tiptap/starter-kit';import MM from'@tiptap/extension-link';import NM from'@tiptap/extension-underline';import kM from'@tiptap/extension-text-align';import PM from'@tiptap/extension-placeholder';import XM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import rN 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 zo from'canvas-confetti';function u(...e){return twMerge(clsx(e))}var my=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"}}),py={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},fy=Z.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=py[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(my({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})]})});fy.displayName="Alert";var gy=Z.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:u("mb-1 font-medium leading-none tracking-tight",e),...t}));gy.displayName="AlertTitle";var by=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("text-sm [&_p]:leading-relaxed",e),...t}));by.displayName="AlertDescription";var vy=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border"},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"}}),hy={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},xy={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"},yy=Z.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,showPing:l=false,...c},d)=>jsxs("div",{ref:d,className:u("relative inline-flex",e),...c,children:[t,jsxs("span",{className:u(vy({variant:r,color:o,size:i?void 0:a,placement:s}),i&&hy[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:u("absolute inset-0 rounded-full animate-ping opacity-75",xy[o||"default"])}),!i&&n]})]}));yy.displayName="Badge";var Ry=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"}}),wy=Z.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:u(Ry({color:t,size:n}),e),...r}));wy.displayName="TextBadge";var Zc=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"}}),Ty={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=Z.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(Zc({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",Ty[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 Jc=cva("inline-flex",{variants:{variant:{default:"",attached:""},orientation:{horizontal:"flex-row",vertical:"flex-col"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"},{variant:"attached",orientation:"horizontal",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},{variant:"attached",orientation:"vertical",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),ed=Z.createContext({});function hi(){return Z.useContext(ed)}var td=Z.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(ed.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:u(Jc({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));td.displayName="ButtonGroup";var no=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 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 border-zinc-300 dark:border-zinc-700 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"},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:"border-zinc-300 dark:border-zinc-700 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 hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:text-white dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},{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:"border-green-600 dark:border-green-500 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 hover:bg-green-600 hover:text-white hover:border-green-600 dark:text-green-500 dark:hover:bg-green-500 dark:hover:text-white dark:hover:border-green-500"},{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:"border-amber-600 dark:border-amber-500 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 hover:bg-amber-600 hover:text-white hover:border-amber-600 dark:text-amber-500 dark:hover:bg-amber-500 dark:hover:text-white dark:hover:border-amber-500"},{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:"border-red-600 dark:border-red-500 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 hover:bg-red-600 hover:text-white hover:border-red-600 dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white dark:hover:border-red-500"},{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:"border-blue-600 dark:border-blue-500 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 hover:bg-blue-600 hover:text-white hover:border-blue-600 dark:text-blue-500 dark:hover:bg-blue-500 dark:hover:text-white dark:hover:border-blue-500"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),me=Z.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,isIconOnly:f,...p},g)=>{let h=hi(),b=d||h.disabled||s,v=m,R=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",w=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?b?jsx("span",{role:"link","aria-disabled":"true",className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R,"pointer-events-none opacity-50 cursor-not-allowed"),style:v,children:w}):jsx("a",{href:a,className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R),style:v,...p,children:w}):jsx("button",{type:"button",className:u(no({variant:t,color:n,size:r,radius:o,className:e}),R),ref:g,disabled:b,style:v,...p,children:w})});me.displayName="Button";var ad=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"lg"}}),sd=Z.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:u(ad({radius:t,className:e})),...n}));sd.displayName="Card";var id=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex flex-col space-y-1.5 p-6",e),...t}));id.displayName="CardHeader";var ld=Z.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:u("text-2xl font-semibold leading-none tracking-tight",e),...t}));ld.displayName="CardTitle";var cd=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));cd.displayName="CardDescription";var dd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("p-6 pt-0",e),...t}));dd.displayName="CardContent";var ud=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center p-6 pt-0",e),...t}));ud.displayName="CardFooter";var Uo=Z.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]=Z.useState(n),h=t!==void 0,b=h?t:p,[v,R]=Z.useState(false),x=Z.useId(),w=()=>{if(o)return;let E=b==="indeterminate"?true:!b;h||g(E),r?.(E);},C=E=>{E.key==="Enter"&&E.preventDefault(),d?.(E);},y=b===true,T=b==="indeterminate",D=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":T?"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",T&&"bg-background text-foreground",!l&&e),style:{borderColor:v?"var(--color-foreground)":void 0},onClick:w,onKeyDown:C,onFocus:()=>R(true),onBlur:()=>R(false),...m,children:(y||T)&&jsx("span",{className:"flex items-center justify-center text-current",children:T?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:[D,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,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})]})]}):D});Uo.displayName="Checkbox";var Dy=cva("flex w-full border border-input bg-background px-3 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:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),ao=Z.forwardRef(({className:e,type:t,size:n,radius:r,label:o,isRequired:a,description:s,errorMessage:i,isInvalid:l,onFocus:c,onBlur:d,style:m,...f},p)=>{let[g,h]=Z.useState(false),b=Z.useId(),v=f.id||b,R=l||!!i,x=jsx("input",{id:v,type:t,className:u(Dy({size:n,radius:r}),R&&"border-danger focus:border-danger",!o&&e),ref:p,required:a,"aria-invalid":R,"aria-describedby":s||i?`${v}-description`:void 0,style:{...m,borderColor:R?void 0:g?"var(--color-foreground)":void 0},onFocus:w=>{h(true),c?.(w);},onBlur:w=>{h(false),d?.(w);},...f});return !o&&!s&&!i?x:jsxs("div",{className:u("flex flex-col gap-1.5",e),children:[o&&jsxs("label",{htmlFor:v,className:"text-sm font-medium leading-none",children:[o,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),x,(s||i)&&jsx("p",{id:`${v}-description`,className:u("text-xs",R?"text-danger":"text-muted-foreground"),children:i||s})]})});ao.displayName="Input";var Iy=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Er=Z.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:u(Iy(),e),...t}));Er.displayName="Label";var er=Z.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})});er.displayName="Separator";var zy="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",Aa={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"},gd={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"}},bd=Z.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]=Z.useState(a),v=o!==void 0,R=v?o:h,x=()=>{if(i)return;let T=!R;v||b(T),s?.(T);},w=T=>{T.key==="Enter"&&T.preventDefault(),m?.(T);},C=t&&Aa[t]?Aa[t]:Aa.default,y=gd[n]||gd.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(zy,y.track,R?r?"":C:"bg-input",e),style:r&&R?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:w,...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}})]})});bd.displayName="Switch";var Ky=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"md"}}),vd=Z.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=Z.useState(false);return jsx("textarea",{className:u(Ky({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 xd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Ba=Z.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:u(xd({variant:t,className:e})),...n}));Ba.displayName="Skeleton";var _y=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),yd=Z.createContext(null),Rd=()=>{let e=Z.useContext(yd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Sr=Z.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=Z.useState("idle");return jsx(yd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:u(_y({size:t,radius:n,className:e})),...r})})});Sr.displayName="Avatar";var so=Z.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Rd();return Z.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})});so.displayName="AvatarImage";var Lr=Z.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Rd(),[s,i]=Z.useState(t===0);return Z.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})});Lr.displayName="AvatarFallback";var Cd=Z.createContext({delayDuration:700,skipDelayDuration:300}),tr=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Cd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});tr.displayName="TooltipProvider";var Td=Z.createContext(null),Md=()=>{let e=Z.useContext(Td);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Rn=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=Z.useContext(Cd),[s,i]=Z.useState(n),l=t!==void 0,c=l?t:s,d=Z.useRef(null),m=Z.useId(),f=Z.useRef(null),p=o??a.delayDuration,g=Z.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 Z.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Td.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:m},children:e})};Rn.displayName="Tooltip";var wn=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=Md();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 Cn=Z.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}=Md(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);if(Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),x=0,w=0;switch(t){case "top":x=v.top-R.height-n;break;case "bottom":x=v.bottom+n;break;case "left":w=v.left-R.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-R.width/2;break;case "end":w=v.right-R.width-o;break}else switch(r){case "start":x=v.top+o;break;case "center":x=v.top+v.height/2-R.height/2;break;case "end":x=v.bottom-R.height-o;break}f({top:x,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 ja.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)});Cn.displayName="TooltipContent";var Wy={sm:"20px",md:"40px",lg:"60px"},Ae=Z.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",showShadow:r=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=Z.useRef(null),[d,m]=Z.useState(false),[f,p]=Z.useState({top:false,bottom:false,left:false,right:false}),g=Z.useId().replace(/:/g,"");Z.useImperativeHandle(l,()=>c.current);let h=Z.useCallback(()=>{let C=c.current;if(!C||!r)return;let{scrollTop:y,scrollLeft:T,scrollHeight:D,scrollWidth:E,clientHeight:L,clientWidth:S}=C;p({top:y>0,bottom:y<D-L-1,left:T>0,right:T<E-S-1});},[r]);Z.useEffect(()=>{if(!r)return;let C=c.current;if(C)return h(),C.addEventListener("scroll",h),window.addEventListener("resize",h),()=>{C.removeEventListener("scroll",h),window.removeEventListener("resize",h);}},[r,h]);let b=n==="visible"||n==="hover"&&d,v=b?"rgba(0,0,0,0.3)":"transparent",R=b?"rgba(255,255,255,0.3)":"transparent",x=`
2
2
  #${g} {
3
3
  scrollbar-width: thin;
4
4
  scrollbar-color: ${v} transparent;
@@ -40,19 +40,19 @@ import*as Z from'react';import {createContext,useState,useEffect,useContext,useC
40
40
  scrollbar-width: none;
41
41
  }
42
42
  `:""}
43
- `;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:x}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),style:{...s,...(()=>{if(!r)return {};let C=Wy[o],y=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",D=[y&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,y&&f.bottom&&`linear-gradient(to top, transparent, black ${C})`,T&&f.left&&`linear-gradient(to right, transparent, black ${C})`,T&&f.right&&`linear-gradient(to left, transparent, black ${C})`].filter(Boolean);return D.length===0?{}:{maskImage:D.join(", "),WebkitMaskImage:D.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:u(t==="vertical"&&"h-full w-full overflow-y-auto overflow-x-hidden",t==="horizontal"&&"w-full overflow-x-auto overflow-y-hidden",t==="both"&&"h-full w-full overflow-auto",e),...i,children:a})]})});Ae.displayName="ScrollArea";var Sd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),$a=Z.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,size:p,radius:g,className:h,...b},v)=>{let[R,x]=Z.useState(false),[w,C]=Z.useState(""),[y,T]=Z.useState(r||""),[D,P]=Z.useState(r||[]),[S,L]=Z.useState({top:0,left:0,width:0}),N=Z.useRef(null),M=Z.useRef(null),E=Z.useRef(null),k=Z.useRef(null),H=n!==void 0?n:y,I=n!==void 0?n:D,A=n!==void 0,O=B=>{d&&H===B?(A||T(""),o?.("")):(A||T(B),o?.(B)),x(false),C("");},V=B=>{let q=I.includes(B)?I.filter(ee=>ee!==B):[...I,B];A||P(q),o?.(q);},z=(B,q)=>{q.stopPropagation();let ee=I.filter(Y=>Y!==B);A||P(ee),o?.(ee);},K=B=>{B.stopPropagation(),t?(A||P([]),o?.([])):(A||T(""),o?.(""));},G=e.find(B=>B.value===H),X$1=e.filter(B=>I.includes(B.value)),F=X$1.slice(0,m),$=X$1.length-m,j=s?e.filter(B=>B.label.toLowerCase().includes(w.toLowerCase())):e;Z.useEffect(()=>{if(R&&M.current){let B=M.current.getBoundingClientRect();L({top:B.bottom+4,left:B.left,width:B.width}),s&&setTimeout(()=>k.current?.focus(),0);}R||C("");},[R,s]),Z.useEffect(()=>{let B=q=>{let ee=q.target,Y=N.current&&!N.current.contains(ee),he=E.current&&!E.current.contains(ee);Y&&he&&(x(false),C(""));};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]),Z.useEffect(()=>{if(!R)return;let B=q=>{E.current?.contains(q.target)||(x(false),C(""));};return window.addEventListener("scroll",B,true),()=>window.removeEventListener("scroll",B,true)},[R]);let _=t?I.length>0:!!H;return jsxs("div",{ref:N,className:u("relative",h),...b,children:[jsxs("div",{ref:B=>{M.current=B,typeof v=="function"?v(B):v&&(v.current=B);},role:"combobox","aria-expanded":R,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!R),className:u(Sd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:X$1.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[F.map(B=>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:[B.label,jsx("span",{role:"button",tabIndex:0,onClick:q=>z(B.value,q),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&z(B.value,q);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},B.value)),$>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",$," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&_&&jsx("span",{role:"button",tabIndex:0,onClick:K,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&K(B);},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",R&&"rotate-180")})]})]}),R&&!c&&typeof document<"u"&&ja.createPortal(jsxs("div",{ref:E,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:S.top,left:S.left,minWidth:S.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:k,type:"text",value:w,onChange:B=>C(B.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(Ae,{style:{maxHeight:f},onWheel:B=>B.stopPropagation(),children:jsx("div",{className:"p-1",children:j.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):j.map(B=>{let q=t?I.includes(B.value):H===B.value;return jsxs("div",{role:"option","aria-selected":q,onClick:()=>{B.disabled||(t?V(B.value):O(B.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",B.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:q&&jsx(Check,{className:"h-4 w-4"})}),B.label]},B.value)})})})]}),document.body)]})});$a.displayName="Select";var Ld=Z.createContext(null),jo=()=>{let e=Z.useContext(Ld);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},Ci=Z.createContext({radius:"md"}),Ti=Z.createContext(null),Zt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),m=Z.useRef(null),f=Z.useId(),p=Z.useRef(new Map),g=Z.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=Z.useCallback((v,R)=>{p.current.set(v,R);},[]),b=Z.useCallback(v=>{p.current.delete(v);},[]);return jsx(Ld.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};Zt.displayName="Dropdown";var Qt=Z.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=jo();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})});Qt.displayName="DropdownTrigger";var t0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Jt=Z.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:x,items:w}=jo(),[C,y]=Z.useState({top:0,left:0}),[T,D]=Z.useState(t),[P,S]=Z.useState(false),L=Z.useRef(0);if(Z.useEffect(()=>{S(true);},[]),Z.useEffect(()=>{p&&(L.current=w.current.size);},[p,w]),Z.useEffect(()=>{if(!p||!h.current||!b.current)return;let M=()=>{if(!h.current||!b.current)return;let E=h.current.getBoundingClientRect(),k=b.current.getBoundingClientRect(),H=window.innerWidth,I=window.innerHeight,A=0,O=0,V=t;switch(t){case "top":A=E.top-k.height-n,A<a&&(A=E.bottom+n,V="bottom");break;case "bottom":A=E.bottom+n,A+k.height>I-a&&(A=E.top-k.height-n,V="top");break;case "left":O=E.left-k.width-n,O<a&&(O=E.right+n,V="right");break;case "right":O=E.right+n,O+k.width>H-a&&(O=E.left-k.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":O=E.left+o;break;case "center":O=E.left+E.width/2-k.width/2;break;case "end":O=E.right-k.width-o;break}O<a?O=a:O+k.width>H-a&&(O=H-k.width-a);}else {switch(r){case "start":A=E.top+o;break;case "center":A=E.top+E.height/2-k.height/2;break;case "end":A=E.bottom-k.height-o;break}A<a?A=a:A+k.height>I-a&&(A=I-k.height-a);}y({top:A,left:O}),D(V);};return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[p,t,n,r,o,a,h]),Z.useEffect(()=>{if(!p)return;let M=E=>{let k=E.target;b.current&&!b.current.contains(k)&&h.current&&!h.current.contains(k)&&(s?.(),g(false));};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[p,g,s,h,b]),Z.useEffect(()=>{if(!p)return;let M=E=>{let k=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),H=k.length;if(H!==0)switch(E.key){case "Escape":E.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":E.preventDefault(),R===-1||R>=H-1?x(l?0:Math.min(R+1,H-1)):x(R+1);break;case "ArrowUp":E.preventDefault(),R<=0?x(l?H-1:0):x(R-1);break;case "Home":E.preventDefault(),x(0);break;case "End":E.preventDefault(),x(H-1);break;case "Enter":case " ":E.preventDefault(),R>=0&&R<H&&k[R]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,g,i,R,x,w,l,h]),Z.useEffect(()=>{p&&R>=0&&Array.from(w.current.entries()).sort(([E],[k])=>E-k).map(([,E])=>E)[R]?.focus();},[p,R,w]),!P||!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"}[T];return ja.createPortal(jsx("div",{ref:M=>{b.current=M,typeof f=="function"?f(M):f&&(f.current=M);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",t0[c],N,e),style:{top:C.top,left:C.left},...m,children:jsx(Ci.Provider,{value:{radius:c},children:d})}),document.body)});Jt.displayName="DropdownContent";var Dd=0,Hd={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Dt=Z.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}=jo(),{radius:b}=Z.useContext(Ci),[v]=Z.useState(()=>Dd++),R=Z.useRef(null);Z.useEffect(()=>(!n&&R.current&&g(v,R.current),()=>{h(v);}),[n,v,g,h]);let x=y=>{if(n){y.preventDefault();return}o?.(y),r?.(),m(false);},w=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",Hd[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Dt.displayName="DropdownItem";var Mi=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Mi.displayName="DropdownSection";var Id=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Id.displayName="DropdownSeparator";var Vd=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});Vd.displayName="DropdownShortcut";var Ad=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Ad.displayName="DropdownGroup";var zd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),{contentRef:s}=jo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Ti.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};zd.displayName="DropdownSub";var Od=Z.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Ti),{setActiveIndex:d,registerItem:m,unregisterItem:f}=jo(),{radius:p}=Z.useContext(Ci),[g]=Z.useState(()=>Dd++),h=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:R}=c;Z.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let x=y=>{o?.(y),n||(d(g),v(true));},w=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",Hd[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:x,onMouseLeave:w,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Od.displayName="DropdownSubTrigger";var Bd=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Ti);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=Z.useState({top:0,left:0}),[h,b]=Z.useState(false),v=Z.useRef(null),R=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!c||!m.current||!v.current)return;(()=>{if(!m.current||!v.current)return;let y=m.current.getBoundingClientRect(),T=v.current.getBoundingClientRect(),D=window.innerWidth,P=window.innerHeight,S=y.top+n,L=y.right+t;L+T.width>D-r&&(L=y.left-T.width-t),S+T.height>P-r&&(S=P-T.height-r),S<r&&(S=r),g({top:S,left:L});})();},[c,t,n,r,m]);let x=C=>{o?.(C),R.current&&(clearTimeout(R.current),R.current=null),d(true);},w=C=>{a?.(C);let y=C.relatedTarget;m.current?.contains(y)||f?.current?.contains(y)||(R.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),!h||!c?null:ja.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:x,onMouseLeave:w,...s}),document.body)});Bd.displayName="DropdownSubContent";var n0=Mi;var $d=Z.createContext(null),Ni=()=>{let e=Z.useContext($d);if(!e)throw new Error("Popover components must be used within a Popover");return e},vt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx($d.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};vt.displayName="Popover";var nr=Z.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ni(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},m={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&Z.isValidElement(e)?Z.cloneElement(e,{...m,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...m,children:e})});nr.displayName="PopoverTrigger";var Tn=Z.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Ni();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Tn.displayName="PopoverAnchor";var ht=Z.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}=Ni(),[v,R]=Z.useState({top:0,left:0}),[x,w]=Z.useState(false),[C,y]=Z.useState(null);if(Z.useEffect(()=>{w(true);},[]),Z.useEffect(()=>{if(!p||!h.current||!C)return;let D=()=>{if(!h.current||!C)return;let P=h.current.getBoundingClientRect(),S=C.getBoundingClientRect(),L=0,N=0;switch(n){case "top":L=P.top-S.height-r;break;case "bottom":L=P.bottom+r;break;case "left":N=P.left-S.width-r;break;case "right":N=P.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":N=P.left+a;break;case "center":N=P.left+P.width/2-S.width/2;break;case "end":N=P.right-S.width-a;break}else switch(o){case "start":L=P.top+a;break;case "center":L=P.top+P.height/2-S.height/2;break;case "end":L=P.bottom-S.height-a;break}R({top:L,left:N});};return D(),window.addEventListener("resize",D),window.addEventListener("scroll",D,true),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,true);}},[p,n,r,o,a,h,C]),Z.useEffect(()=>{if(!p)return;let D=P=>{let S=P.target;C&&C.contains(S)||h.current&&h.current.contains(S)||S.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",D),()=>document.removeEventListener("mouseup",D)},[p,g,s,h,C]),Z.useEffect(()=>{if(!p)return;let D=P=>{P.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[p,g,i]),!x||!p)return null;let T={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 ja.createPortal(jsx("div",{ref:D=>{y(P=>P!==D?D:P),typeof f=="function"?f(D):f&&(f.current=D);},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",T,e),style:{...t,top:v.top,left:v.left},...m,children:d}),document.body)});ht.displayName="PopoverContent";var Gd=Z.createContext(null),Pi=()=>{let e=Z.useContext(Gd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Ud=Z.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]=Z.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(Gd.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})})});Ud.displayName="Tabs";var ki={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"}},jd=Z.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Pi(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let R=g.getBoundingClientRect(),x=v.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-R.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-R.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-R.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.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",bordered:"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",ki[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",ki[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});jd.displayName="TabsList";var _d=Z.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Pi(),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",bordered:"border border-transparent data-[state=active]:border-current 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",ki[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});_d.displayName="TabsTrigger";var Wd=Z.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Pi(),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});Wd.displayName="TabsContent";var Yd=[{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 o0(e,t=Yd){return e?t.filter(r=>r.test(e)).length/t.length:0}function a0(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function s0(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Wo=0,Ei=null;function sn(){Wo===0&&(Ei=document.body.style.overflow,document.body.style.overflow="hidden"),Wo++;}function ln(){Wo--,Wo<=0&&(Wo=0,document.body.style.overflow=Ei??"",Ei=null);}var qd=Z.createContext(null),Ua=()=>{let e=Z.useContext(qd);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},Zd=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=Z.useState(t),s=e!==void 0,i=s?e:o,l=Z.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(qd.Provider,{value:{open:i,onOpenChange:l},children:r})};Zd.displayName="Sheet";var Qd=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Ua();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});Qd.displayName="SheetTrigger";var Jd=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Ua();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});Jd.displayName="SheetClose";var Li=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};Li.displayName="SheetPortal";var eu=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ua();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});eu.displayName="SheetOverlay";var tu=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"}}),c0=(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],nu=Z.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=Ua(),[d,m]=Z.useState(false),[,f]=Z.useState(false);return Z.useEffect(()=>{if(l)m(true),f(true),sn();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{ln();}},[l]),Z.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(Li,{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(tu({side:e}),c0(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]})]})});nu.displayName="SheetContent";var ru=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});ru.displayName="SheetHeader";var ou=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ou.displayName="SheetFooter";var au=Z.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));au.displayName="SheetTitle";var su=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));su.displayName="SheetDescription";var m0=({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 iu=Z.createContext(null),_a=()=>{let e=Z.useContext(iu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Di=Z.createContext(null),lu=({children:e,onOpenChange:t})=>{let[n,r]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(iu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};lu.displayName="ContextMenu";var cu=Z.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=_a(),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})});cu.displayName="ContextMenuTrigger";var du=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));du.displayName="ContextMenuGroup";var uu=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};uu.displayName="ContextMenuPortal";var mu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Di.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};mu.displayName="ContextMenuSub";var pu=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=_a(),[d,m]=Z.useState(false),[f,p]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{m(true);},[]),Z.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]),Z.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]),Z.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:ja.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)});pu.displayName="ContextMenuContent";var fu=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Di);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"})]})});fu.displayName="ContextMenuSubTrigger";var gu=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=Z.useContext(Di);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=Z.useState({top:0,left:0}),[f,p]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let R=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=R.top,C=R.right+t;C+x.width>window.innerWidth&&(C=R.left-x.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:ja.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)});gu.displayName="ContextMenuSubContent";var bu=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=_a(),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})});bu.displayName="ContextMenuItem";var vu=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=_a(),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]})});vu.displayName="ContextMenuCheckboxItem";var hu=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));hu.displayName="ContextMenuSection";var xu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));xu.displayName="ContextMenuSeparator";var yu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});yu.displayName="ContextMenuShortcut";var wu=Z.createContext(null),v0=()=>{let e=Z.useContext(wu);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},Cu=Z.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]=Z.useState(n),p=t!==void 0,g=p?t:m,h=Z.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(wu.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});Cu.displayName="RadioGroup";var Tu=Z.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=v0(),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}})]})});Tu.displayName="RadioGroupItem";var Ya=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",bordered:"border border-current 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"}}),Mu=Z.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=Z.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(Ya({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Mu.displayName="Toggle";var Nu=Z.createContext(null),w0=()=>{let e=Z.useContext(Nu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},ku=Z.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=Z.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(Nu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});ku.displayName="ToggleGroup";var Pu=Z.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(Ya({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Pu.displayName="ToggleGroupItem";var en=Z.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]=Z.useState(n),h=t!==void 0,b=h?t:p,v=Z.useRef(null),[R,x]=Z.useState(false),[w,C]=Z.useState(null),y=(E,k)=>{if(!v.current)return b[0];let H=v.current.getBoundingClientRect(),I;c==="horizontal"?I=(E-H.left)/H.width:I=1-(k-H.top)/H.height,I=Math.max(0,Math.min(1,I));let A=a+I*(s-a),O=Math.round(A/i)*i;return Math.max(a,Math.min(s,O))},T=(E,k)=>{let H=[...b];H[k]=E,k>0&&E<b[k-1]&&(H[k]=b[k-1]),k<b.length-1&&E>b[k+1]&&(H[k]=b[k+1]),h||g(H),r?.(H);},D=(E,k)=>{l||(E.preventDefault(),x(true),C(k),E.target.setPointerCapture(E.pointerId));},P=E=>{if(!R||w===null||l)return;let k=y(E.clientX,E.clientY);T(k,w);},S=()=>{R&&(x(false),C(null),o?.(b));},L=E=>{if(l)return;let k=y(E.clientX,E.clientY),H=0,I=Math.abs(b[0]-k);for(let A=1;A<b.length;A++){let O=Math.abs(b[A]-k);O<I&&(I=O,H=A);}T(k,H),o?.([...b.slice(0,H),k,...b.slice(H+1)]);},N=(E,k)=>{if(l)return;let H=b[k];switch(E.key){case "ArrowRight":case "ArrowUp":E.preventDefault(),H=Math.min(s,b[k]+i);break;case "ArrowLeft":case "ArrowDown":E.preventDefault(),H=Math.max(a,b[k]-i);break;case "Home":E.preventDefault(),H=a;break;case "End":E.preventDefault(),H=s;break;default:return}T(H,k),o?.([...b.slice(0,k),H,...b.slice(k+1)]);},M=E=>(E-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:L,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${M(b[0])}%`:0,right:`${100-M(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${M(b[0])}%`:0,top:`${100-M(b[b.length-1])}%`,left:0,right:0}})}),b.map((E,k)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":E,"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&&w===k&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${M(E)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M(E)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:H=>D(H,k),onPointerMove:P,onPointerUp:S,onPointerCancel:S,onKeyDown:H=>N(H,k)},k)),d&&b.map((E,k)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${k}]`:d,value:E},k))]})});en.displayName="Slider";var Eu=Z.createContext(null),Su=()=>{let e=Z.useContext(Eu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Ii=Z.createContext(null),Lu=()=>{let e=Z.useContext(Ii);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Du=Z.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=Z.useState(()=>t==="single"?r?[r]:[]:r||[]),f=Z.useRef(new Map),p=Z.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=w=>{if(t==="single"){let y=h.includes(w)&&a?[]:[w];g||m(y),o?.(y[0]||"");}else {let C=h.includes(w)?h.filter(y=>y!==w):[...h,w];g||m(C),o?.(C);}},v=Z.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),R=Z.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=Z.useCallback(w=>{let C=p.current;if(C.length===0)return;let y=document.activeElement,T;f.current.forEach((N,M)=>{N===y&&(T=M);});let D=T?C.indexOf(T):-1,P;switch(w){case "first":P=0;break;case "last":P=C.length-1;break;case "next":P=D===-1?0:(D+1)%C.length;break;case "prev":P=D===-1?C.length-1:(D-1+C.length)%C.length;break}let S=C[P];f.current.get(S)?.focus();},[]);return jsx(Eu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:R,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Du.displayName="Accordion";var Hu=Z.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Su(),d=c.value.includes(t),m=n||c.disabled||false,f=Z.useId(),p=Z.useId();return r!==void 0?jsx(Ii.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(Iu,{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(Vu,{children:s})]})}):jsx(Ii.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})})});Hu.displayName="AccordionItem";var Iu=Z.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Su(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=Lu(),f=Z.useRef(null);Z.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"})]})})});Iu.displayName="AccordionTrigger";var Vu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Lu();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})})})});Vu.displayName="AccordionContent";var zu=Z.createContext(null),Ou=()=>{let e=Z.useContext(zu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},Bu=Z.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(n),m=t!==void 0,f=m?t:c,p=Z.useId(),g=Z.useId(),h=b=>{o||(m||d(b),r?.(b));};return jsx(zu.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(Vi,{})]}),s]})})});Bu.displayName="Collapsible";var Vi=Z.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=Ou();return jsx(me,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:u("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Vi.displayName="CollapsibleTrigger";var Fu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=Ou(),c=Z.useRef(null),[d,m]=Z.useState(0),[f,p]=Z.useState(false),[g,h]=Z.useState(a);Z.useEffect(()=>{a?(h(true),m(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);});})):(p(true),c.current?(m(c.current.scrollHeight),requestAnimationFrame(()=>{m(0);})):m(0));},[a]);let b=()=>{p(false),a||h(false);};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: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,className:"space-y-2",children:t})}):null});Fu.displayName="CollapsibleContent";var k0=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),Ku={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},Qa=Z.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=d=>`${Math.round(d)}%`,size:s,color:i="primary",...l},c)=>{let d=Math.min(Math.max(t/n*100,0),100),m=r||o,f=Ku[i]||"",p=!Ku[i];return jsxs("div",{ref:c,className:"w-full",children:[m&&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(d)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u(k0({size:s}),e),...l,children:jsx("div",{className:u("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});Qa.displayName="Progress";var ju=Z.createContext(null),_u=()=>{let e=Z.useContext(ju);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Wu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(n),c=t!==void 0,d=c?t:i,m=Z.useRef(null),f=Z.useId(),p=Z.useRef(null),g=Z.useRef(null),h=Z.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 Z.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]),Z.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(ju.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};Wu.displayName="HoverCard";var Yu=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=_u();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})});Yu.displayName="HoverCardTrigger";var Xu=Z.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}=_u(),[g,h]=Z.useState({top:0,left:0}),[b,v]=Z.useState(false),R=Z.useRef(null);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!d||!f.current||!R.current)return;(()=>{if(!f.current||!R.current)return;let T=f.current.getBoundingClientRect(),D=R.current.getBoundingClientRect(),P=0,S=0;switch(t){case "top":P=T.top-D.height-n;break;case "bottom":P=T.bottom+n;break;case "left":S=T.left-D.width-n;break;case "right":S=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":S=T.left+o;break;case "center":S=T.left+T.width/2-D.width/2;break;case "end":S=T.right-D.width-o;break}else switch(r){case "start":P=T.top+o;break;case "center":P=T.top+T.height/2-D.height/2;break;case "end":P=T.bottom-D.height-o;break}h({top:P,left:S});})();},[d,t,n,r,o,f]);let x=y=>{a?.(y),m(true);},w=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 ja.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:x,onMouseLeave:w,...l,children:i}),document.body)});Xu.displayName="HoverCardContent";var qu=Z.createContext({size:"md",variant:"default",radius:"md"}),es=()=>Z.useContext(qu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var S0=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),L0=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"}}),D0=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"}}),Zu=Z.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(qu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));Zu.displayName="Breadcrumb";var Qu=Z.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=es();return jsx("ol",{ref:n,className:u(S0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});Qu.displayName="BreadcrumbList";var Ju=Z.forwardRef(({className:e,...t},n)=>{let{size:r}=es();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})});Ju.displayName="BreadcrumbItem";var em=Z.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));em.displayName="BreadcrumbLink";var tm=Z.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}));tm.displayName="BreadcrumbPage";var nm=({children:e,className:t,...n})=>{let{size:r}=es();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(L0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};nm.displayName="BreadcrumbSeparator";var rm=({className:e,...t})=>{let{size:n}=es();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(D0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};rm.displayName="BreadcrumbEllipsis";var sm=Z.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})}));sm.displayName="AspectRatio";var cm=Z.createContext(null),zi=()=>{let e=Z.useContext(cm);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},dm=Z.createContext(null),um=()=>{let e=Z.useContext(dm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},mm=Z.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=Z.useState(null);return jsx(cm.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(Oi,{})]})})});mm.displayName="NavigationMenu";var pm=Z.forwardRef(({className:e,...t},n)=>{let{orientation:r}=zi();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})});pm.displayName="NavigationMenuList";var fm=Z.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=zi(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(dm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});fm.displayName="NavigationMenuItem";var gm=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"),bm=Z.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=um(),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(gm(),"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"})]})});bm.displayName="NavigationMenuTrigger";var vm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=um(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.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?ja.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});vm.displayName="NavigationMenuContent";var hm=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"),xm=Z.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(hm(),t&&"bg-accent text-accent-foreground",e),...n}));xm.displayName="NavigationMenuLink";var Oi=Z.forwardRef((e,t)=>null);Oi.displayName="NavigationMenuViewport";var ym=Z.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=zi();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});ym.displayName="NavigationMenuIndicator";var Tm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 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 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Kt=Z.forwardRef(({className:e,size:t,...n},r)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:r,type:"button",className:u(Tm({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Kt.displayName="CloseButton";var ts=Z.createContext(null);function G0(){let e=Z.useContext(ts);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Fn(){return Z.useContext(ts)}var U0="16rem",j0="18rem",_0="3rem",W0="b",Y0={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},X0={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Bi=Z.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]=Z.useState(false),[x,w]=Z.useState(false),[C,y]=Z.useState(e),T=t??C,D=Z.useCallback(N=>{let M=typeof N=="function"?N(T):N;n?n(M):y(M);},[n,T]);Z.useEffect(()=>{let N=()=>{R(window.innerWidth<768);};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);let P=Z.useCallback(()=>b?D(N=>!N):v?w(N=>!N):D(N=>!N),[v,D,w,b]);Z.useEffect(()=>{if(b)return;let N=M=>{M.key===W0&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),P());};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[P,b]);let S=T?"expanded":"collapsed",L=Z.useMemo(()=>({placement:r,state:S,open:T,setOpen:D,isMobile:v,openMobile:x,setOpenMobile:w,toggleDrawer:P,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,S,T,D,v,x,w,P,l,h,o,a,s,i]);return b?jsx(ts.Provider,{value:L,children:jsx(Drawer.Root,{open:T,onOpenChange:D,direction:r,dismissible:s,children:f})}):jsx(ts.Provider,{value:L,children:jsx(tr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":U0,"--drawer-width-icon":_0,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Bi.displayName="Drawer";var Nm=Z.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Fn();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(q0,{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})})]})});Nm.displayName="DrawerSidebar";var q0=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return sn(),()=>ln()},[t]),!o||!t?null:ja.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":j0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},km=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Fn();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"})]})});km.displayName="DrawerTrigger";var Pm=Z.forwardRef(({className:e,children:t,...n},r)=>{let o=Fn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",m=d?Y0[i]:X0[i],f={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},p={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",f[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:m,height:"100%"}:{},...c?{maxHeight:m}:{},...n.style},...n,children:[c&&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})});Pm.displayName="DrawerContent";var Em=Z.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Fn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:u("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Kt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Em.displayName="DrawerHeader";var Sm=Z.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}));Sm.displayName="DrawerBody";var Lm=Z.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}));Lm.displayName="DrawerFooter";var Dm=Z.forwardRef(({className:e,...t},n)=>Fn()?.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}));Dm.displayName="DrawerTitle";var Hm=Z.forwardRef(({className:e,...t},n)=>Fn()?.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}));Hm.displayName="DrawerDescription";var Im=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Fn();return jsx(Kt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});Im.displayName="DrawerClose";var Vm=Z.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Fn();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"})]})});Vm.displayName="DrawerToggle";var Am=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));Am.displayName="DrawerSeparator";var zm=Z.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}));zm.displayName="DrawerMenu";var Om=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));Om.displayName="DrawerMenuItem";var Bm=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",bordered:"bg-background shadow-[0_0_0_1px_currentColor] 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"}}),Fm=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Fn(),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(Bm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Je,{children:[jsx(wn,{children:m}),jsx(Cn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});Fm.displayName="DrawerMenuButton";var Km=Z.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}));Km.displayName="DrawerGroup";var $m=Z.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}));$m.displayName="DrawerGroupLabel";var Gm=Z.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}));Gm.displayName="DrawerInset";var Z0=Bi;var jm=Z.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})}));jm.displayName="Table";var _m=Z.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));_m.displayName="TableHeader";var Wm=Z.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));Wm.displayName="TableBody";var Ym=Z.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}));Ym.displayName="TableFooter";var Xm=Z.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}));Xm.displayName="TableRow";var qm=Z.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}));qm.displayName="TableHead";var Zm=Z.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Zm.displayName="TableCell";var Qm=Z.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));Qm.displayName="TableCaption";function rR({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,...R},x){let[w,C]=Z.useState(new Set),[y,T]=Z.useState({columnId:null,direction:null}),[D,P]=Z.useState({pageIndex:0,pageSize:m[0]||10}),S=o??w,L=l??y,N=f??D,M=F=>{a?a(F):C(F);},E=F=>{c?c(F):T(F);},k=F=>{p?p(F):P(F);},H=Z.useMemo(()=>{if(!L.columnId||!L.direction)return t;let F=n.find($=>$.id===L.columnId);return F?[...t].sort(($,j)=>{let _=F.accessor($),B=F.accessor(j);if(_===B)return 0;if(_==null)return 1;if(B==null)return -1;let q=String(_).localeCompare(String(B),void 0,{numeric:true});return L.direction==="asc"?q:-q}):t},[t,L,n]),I=Z.useMemo(()=>{if(!d)return H;let F=N.pageIndex*N.pageSize;return H.slice(F,F+N.pageSize)},[H,d,N]),A=Math.ceil(H.length/N.pageSize),O=F=>{if(F===true){let $=new Set(I.map((j,_)=>s(j,_)));M($);}else M(new Set);},V=(F,$)=>{let j=new Set(S);$?j.add(F):j.delete(F),M(j);},z=I.length>0&&I.every((F,$)=>S.has(s(F,$))),K=I.some((F,$)=>S.has(s(F,$))),G=F=>{if(!n.find(_=>_.id===F)?.sortable&&!i)return;let j="asc";L.columnId===F&&(L.direction==="asc"?j="desc":L.direction==="desc"&&(j=null)),E({columnId:j?F:null,direction:j});},X=F=>L.columnId!==F?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):L.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,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(Uo,{checked:z?true:K?"indeterminate":false,onCheckedChange:O,"aria-label":"Select all"})}),n.map(F=>{let $=F.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",$&&"cursor-pointer select-none hover:text-foreground"),style:{width:F.width},onClick:()=>$&&G(F.id),children:jsxs("div",{className:"flex items-center gap-2",children:[F.header,$&&X(F.id)]})},F.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..."})}):I.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):I.map((F,$)=>{let j=s(F,$),_=S.has(j);return jsxs("tr",{className:u("border-b transition-colors",v&&"hover:bg-muted/50",b&&$%2===1&&"bg-muted/30",_&&"bg-muted"),"data-state":_?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Uo,{checked:_,onCheckedChange:B=>V(j,!!B),"aria-label":`Select row ${$+1}`})}),n.map(B=>jsx("td",{className:"p-4 align-middle",children:B.cell?B.cell(F,$):B.accessor(F)},B.id))]},j)})})]})}),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:N.pageSize,onChange:F=>k({pageIndex:0,pageSize:Number(F.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(F=>jsx("option",{value:F,children:F},F))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",N.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>k({...N,pageIndex:N.pageIndex-1}),disabled:N.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>k({...N,pageIndex:N.pageIndex+1}),disabled:N.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var oR=Z.forwardRef(rR);var Fi=["January","February","March","April","May","June","July","August","September","October","November","December"];function uR({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let o=getMonth(e),a=getYear(e),s=c=>{let d=setMonth(e,c);t(d);},i=c=>{let d=setYear(e,c);t(d);},l=Z.useMemo(()=>{let c=[];for(let d=r;d>=n;d--)c.push(d);return c},[n,r]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(Zt,{children:[jsx(Qt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:Fi[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Jt,{className:"min-w-[120px] p-0",children:jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:Fi.map((c,d)=>jsx(Dt,{onSelect:()=>s(d),className:u("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(Zt,{children:[jsx(Qt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[60px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:a}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Jt,{className:"min-w-[80px] p-0",children:jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Dt,{onSelect:()=>i(c),className:u("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function mR(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-1 mb-2",children:[jsx(uR,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-6 w-6 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-3.5 w-3.5"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-6 w-6 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-3.5 w-3.5"})})]})]});let l=Fi[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 lo({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=Z.useMemo(()=>mR(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-8 font-normal text-xs text-center",week:"flex w-full mt-0.5",day:u("relative h-8 w-8 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-8 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10","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 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...s,MonthCaption:l},...i})}lo.displayName="Calendar";var np=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});np.displayName="Pagination";var rp=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));rp.displayName="PaginationContent";var op=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));op.displayName="PaginationItem";var bR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},ns=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:u(no({variant:t?"solid":"light",size:n,radius:r}),o&&bR[n],e),...a});ns.displayName="PaginationLink";var ap=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to previous page",isIconOnly:false,className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});ap.displayName="PaginationPrevious";var sp=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to next page",isIconOnly:false,className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});sp.displayName="PaginationNext";var vR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},ip=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:u("flex items-center justify-center",vR[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});ip.displayName="PaginationEllipsis";var Yo=Z.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}));Yo.displayName="VisuallyHidden";var cp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},xR={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"},dp=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"),Ui=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"}}),os=Z.createContext(null),Ir=()=>{let e=Z.useContext(os);if(!e)throw new Error("Modal components must be used within a Modal");return e},mp=Z.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]=Z.useState(false),b=e!==void 0,v=b?e:g,[R,x]=Z.useState(false),w=Z.useRef(null),C=Z.useId(),y=Z.useId();Z.useEffect(()=>{x(true);},[]);let T=Z.useCallback(L=>{b||h(L),t?.(L);},[b,t]);Z.useEffect(()=>{if(v)return sn(),()=>ln()},[v]),Z.useEffect(()=>{if(!v||i)return;let L=N=>{N.key==="Escape"&&T(false);};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[v,i,T]);let D=L=>{s&&L.target===L.currentTarget&&T(false);},P=n?Z.isValidElement(n)?Z.cloneElement(n,{onClick:L=>{n.props.onClick?.(L),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,S=()=>!R||!v?null:d==="outside"?ja.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(dp(),cp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:D,children:jsxs("div",{ref:L=>{w.current=L,typeof p=="function"?p(L):p&&(p.current=L);},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(Yo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Kt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):ja.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(dp(),cp[l]),onClick:D,"aria-hidden":"true"}),jsxs("div",{ref:L=>{w.current=L,typeof p=="function"?p(L):p&&(p.current=L);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":y,"data-state":v?"open":"closed",className:u(Ui({size:m}),xR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Yo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Kt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(os.Provider,{value:{open:v,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:y},children:[P,S()]})});mp.displayName="Modal";var as=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(n),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),m=Z.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(os.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};as.displayName="ModalRoot";var pp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ir();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});pp.displayName="ModalTrigger";var ji=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};ji.displayName="ModalPortal";var _i=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ir();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});_i.displayName="ModalOverlay";var fp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ir();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});fp.displayName="ModalClose";var ss=Z.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}=Ir(),[f,p]=Z.useState(false);return Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(l)return sn(),()=>ln()},[l]),Z.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(ji,{children:[jsx(_i,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Ui({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Kt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ss.displayName="ModalContent";var gp=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});gp.displayName="ModalHeader";var bp=({className:e,children:t})=>(Z.useContext(os)?.scrollBehavior??"inside")==="inside"?jsx(Ae,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});bp.displayName="ModalBody";var vp=({className:e,children:t,...n})=>{let{onOpenChange:r}=Ir();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:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};vp.displayName="ModalFooter";var hp=Z.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Ir();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});hp.displayName="ModalTitle";var xp=Z.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Ir();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});xp.displayName="ModalDescription";var Wi=Z.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}));Wi.displayName=Command.displayName;var wR=({children:e,...t})=>jsx(as,{...t,children:jsx(ss,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Wi,{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})})}),yp=Z.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})]}));yp.displayName=Command.Input.displayName;var Rp=Z.forwardRef(({className:e,children:t,...n},r)=>jsx(Ae,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:u("overflow-hidden",e),...n,children:t})}));Rp.displayName=Command.List.displayName;var wp=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));wp.displayName=Command.Empty.displayName;var Cp=Z.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}));Cp.displayName=Command.Group.displayName;var Tp=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Tp.displayName=Command.Separator.displayName;var Mp=Z.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:u("relative flex cursor-default select-none items-center gap-2 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),...o,children:[n,t&&jsx("span",{className:"flex-1",children:t}),r]}));Mp.displayName=Command.Item.displayName;var Np=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Np.displayName="CommandShortcut";var MR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},NR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Pp=Z.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,m]=Z.useState(false),[f,p]=Z.useState(false),g=MR[s],h=NR[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:u("flex w-full border border-input bg-background py-2 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",g.input,h,t&&"pr-10",e),ref:c,disabled:n,style:{...a,borderColor:f?"var(--color-foreground)":void 0},onFocus:b=>{p(true),r?.(b);},onBlur:b=>{p(false),o?.(b);},...l}),t&&jsx("button",{type:"button",className:u("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",g.button),onClick:()=>m(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});Pp.displayName="PasswordInput";var SR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},LR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Ep=Z.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,size:c="md",radius:d="md",...m},f)=>{let[p,g]=Z.useState(s),[h,b]=Z.useState(false),v=a!==void 0,R=v?a:p,x=SR[c],w=LR[d],C=N=>{N!==void 0&&(r!==void 0&&N<r&&(N=r),o!==void 0&&N>o&&(N=o)),v||g(N),i?.(N);},y=()=>{C((R??0)+n);},T=()=>{C((R??0)-n);},D=N=>{let M=N.target.value;if(M==="")C(void 0);else {let E=parseFloat(M);isNaN(E)||C(E);}},P=N=>{N.key==="ArrowUp"?(N.preventDefault(),y()):N.key==="ArrowDown"&&(N.preventDefault(),T());},S=r===void 0||(R??0)>r,L=o===void 0||(R??0)<o;return t?jsxs("div",{className:u("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:T,disabled:l||!S,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input),ref:f,value:R??"",onChange:D,onKeyDown:P,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...m}),jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:y,disabled:l||!L,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:f,value:R??"",onChange:D,onKeyDown:P,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...m})});Ep.displayName="NumberInput";var Hp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Sp=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"}}),Ip=Z.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(Sr,{className:u(Sp({size:r})),children:[m.src&&jsx(so,{src:m.src,alt:m.alt||""}),jsx(Lr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Je,{children:[jsx(wn,{children:p}),jsx(Cn,{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(Hp({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(Sr,{className:u(Sp({size:r})),children:jsxs(Lr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(tr,{delayDuration:300,children:d}):d});Ip.displayName="AvatarGroup";var Vp=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"}}),Ap=Z.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]=Z.useState(n),[b,v]=Z.useState(null),R=t!==void 0,x=R?t:g,w=b!==null?b:x,C=M=>{l||c||(R||h(M),r?.(M));},y=(M,E=false)=>{let k=i&&E?M+.5:M+1;C(k);},T=(M,E)=>{if(l||c)return;let k=M.currentTarget.getBoundingClientRect(),H=i&&M.clientX<k.left+k.width/2;v(H?E+.5:E+1);},D=()=>{v(null);},P=s==="heart"?Heart:Star,S=M=>w>=M+1?"full":w>=M+.5?"half":"empty",L=d?{color:d,fill:d}:{},N=m?{color:m}:{};return jsx("div",{ref:p,className:u(Vp({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:D,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(M,E)=>{let k=S(E);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:H=>{let I=H.currentTarget.getBoundingClientRect(),A=i&&H.clientX<I.left+I.width/2;y(E,A);},onMouseMove:H=>T(H,E),disabled:c||l,"aria-label":`Rate ${E+1} out of ${o}`,role:"radio","aria-checked":x===E+1,children:[jsx(P,{className:u("text-muted-foreground/30",k!=="empty"&&"absolute inset-0"),style:k==="empty"?N:void 0}),k!=="empty"&&jsx(P,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",k==="half"&&"clip-path-half"),style:{...L,clipPath:k==="half"?"inset(0 50% 0 0)":void 0}})]},E)})})});Ap.displayName="Rating";var Op=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 cursor-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"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:""},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-md",md:"rounded-lg",lg:"rounded-xl",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-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"secondary",className:"text-secondary-foreground !border-secondary hover:bg-secondary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{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-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/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-green-600/15 text-green-600 hover:bg-green-600/20 dark:bg-green-500/15 dark:text-green-500 dark:hover:bg-green-500/20"},{variant:"soft",color:"warning",className:"bg-amber-600/15 text-amber-600 hover:bg-amber-600/20 dark:bg-amber-500/15 dark:text-amber-500 dark:hover:bg-amber-500/20"},{variant:"soft",color:"danger",className:"bg-red-600/15 text-red-600 hover:bg-red-600/20 dark:bg-red-500/15 dark:text-red-500 dark:hover:bg-red-500/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),OR={sm:"sm",md:"sm",lg:"sm"},Bp=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:m,onClick:f,...p},g)=>{let h=a||!!f,b=v=>{v.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:h?"button":void 0,tabIndex:h&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:f,onKeyDown:h&&!d?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f?.(v));}:void 0,className:u(Op({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...p,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:m}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Kt,{size:OR[r??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});Bp.displayName="Chip";var Fp=createContext({direction:"horizontal"}),_R=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Fp.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})}),WR=Panel,YR=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Fp),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 Up=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"}}),qR={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"}},Kp={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)"},jp=Z.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=qR[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(Up({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:Kp[n]||Kp.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)})]})});jp.displayName="CircularProgress";var _p=Z.createContext(null),JR=()=>{let e=Z.useContext(_p);if(!e)throw new Error("OTP components must be used within InputOTP");return e},Wp=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"}}),Yp=Z.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,radius:d="md",children:m,...f},p)=>{let[g,h]=Z.useState(o),[b,v]=Z.useState(0),[R,x]=Z.useState(false),w=Z.useRef(null),C=r!==void 0?r:g;Z.useImperativeHandle(p,()=>w.current),Z.useEffect(()=>{v(Math.min(C.length,n-1));},[C,n]),Z.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let y=N=>{let M=N.target.value;if(i&&M){let E=new RegExp(i.replace("^","").replace("$","").replace("+",""));M=M.split("").filter(k=>E.test(k)).join("");}M=M.slice(0,n),r===void 0&&h(M),a?.(M);},T=N=>{N.key==="ArrowLeft"?v(M=>Math.max(0,M-1)):N.key==="ArrowRight"&&v(M=>Math.min(C.length,n-1,M+1));},D=()=>{w.current?.focus();},P=()=>{x(true),v(Math.min(C.length,n-1));},S=()=>{x(false);},L={value:C,activeIndex:R?b:-1,maxLength:n,disabled:l,radius:d};return jsx(_p.Provider,{value:L,children:jsxs("div",{className:u(Wp({size:c}),t),onClick:D,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:y,onKeyDown:T,onFocus:P,onBlur:S,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),m]})})});Yp.displayName="InputOTP";var Xp=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));Xp.displayName="InputOTPGroup";var ew={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},tw={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},qp=Z.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=JR(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":c,"data-filled":!!l,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:border-l",ew[i],tw[i],c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[l,d&&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"})})]})});qp.displayName="InputOTPSlot";var Zp=Z.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"})}));Zp.displayName="InputOTPSeparator";var ef=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 border-zinc-300 bg-transparent dark:border-zinc-700",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 border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover: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"}}),tf=Z.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]=Z.useState(""),R=Z.useRef(null);Z.useImperativeHandle(h,()=>R.current);let x=S=>{let L=S.trim();if(L.length<i||L.length>l||s&&r.length>=s||!d&&r.some(M=>M.text.toLowerCase()===L.toLowerCase()))return;let N={id:crypto.randomUUID(),text:L};o?.([...r,N]),v("");},w=S=>{m||f||o?.(r.filter(L=>L.id!==S));},C=S=>{if(c.includes(S.key)){if(S.key==="Tab"&&!b)return;S.preventDefault(),x(b);}S.key==="Backspace"&&!b&&r.length>0&&w(r[r.length-1].id);},y=S=>{let L=S.target.value;if(L.includes(",")){L.split(",").forEach(M=>{M.trim()&&x(M);});return}v(L);},T=S=>{S.preventDefault(),S.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(M=>{x(M);});},D=()=>{R.current?.focus();},P=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:D,children:[r.map(S=>p?p(S,()=>w(S.id)):jsxs("span",{className:u(ef({variant:t,size:n})),children:[S.text,!m&&!f&&jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),w(S.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${S.text}`,children:jsx(X,{className:"h-3 w-3"})})]},S.id)),!P&&!f&&jsx("input",{ref:R,type:"text",value:b,onChange:y,onKeyDown:C,onPaste:T,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})]})});tf.displayName="TagInput";var rf=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"}}),of=Z.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(rf({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]}));of.displayName="EmptyState";var sf=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 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 border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),lf=Z.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(sf({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})]})});lf.displayName="StatCard";var ea=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",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),Qi=({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 ww({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:m}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:b,isDragging:v}=useSortable({id:e.id}),R={transform:CSS.Transform.toString(h),transition:b};return jsxs("div",{ref:g,...f,style:R,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:u("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",v&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[r&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...p,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(Qi,{checked:l,onClick:x=>m?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function Cw({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,emptyContent:R,children:x,...w},C){let[y,T]=Z.useState(false),[D,P]=Z.useState(null);Z.useEffect(()=>{T(true);},[]);let[S,L]=Z.useState(new Set(f)),N=m!==void 0,M=N?new Set(m):S,[E,k]=Z.useState(new Set(b)),H=h!==void 0,I=H?new Set(h):E,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),O=Z.useCallback(($,j)=>{if(!r)return;let _=new Set(M),B=!_.has($.id);d?B?_.add($.id):_.delete($.id):(_.clear(),B&&_.add($.id)),N||L(_);let q=r.filter(ee=>_.has(ee.id));p?.(Array.from(_),{selected:B,selectedItems:q,item:$,event:j});},[r,M,d,N,p]),V=Z.useCallback(($,j)=>{if(!r)return;let _=new Set(I),B=!_.has($.id);B?_.add($.id):_.delete($.id),H||k(_);let q=r.filter(ee=>_.has(ee.id));v?.(Array.from(_),{checked:B,checkedItems:q,item:$,event:j});},[r,I,H,v]),z=$=>{if(!r)return;let j=r.find(_=>_.id===$.active.id);j&&P(j);},K=$=>{let{active:j,over:_}=$;if(P(null),!r||!_||j.id===_.id)return;let B=r.findIndex(ee=>ee.id===j.id),q=r.findIndex(ee=>ee.id===_.id);if(B!==-1&&q!==-1){let ee=[...r],[Y]=ee.splice(B,1);ee.splice(q,0,Y),s?.(ee);}},X=(a||c||g)&&r&&o,F=t==="cards";return r&&r.length===0&&R?jsx("div",{ref:C,className:u("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:R}):X?a?y?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:z,onDragEnd:K,children:[jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map($=>$.id),strategy:verticalListSortingStrategy,children:r.map(($,j)=>jsx(ww,{item:$,index:j,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:M.has($.id),isChecked:I.has($.id),isCards:F,onSelect:O,onCheck:V},$.id))})}),jsx(DragOverlay,{children:D&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(D,r?.indexOf(D)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:r.map(($,j)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(Qi,{checked:I.has($.id),onClick:_=>V($,_)}),jsx("div",{className:"flex-1 min-w-0",children:o($,j)})]},$.id))}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:r.map(($,j)=>{let _=M.has($.id),B=I.has($.id);return jsxs("div",{role:"listitem","aria-selected":c?_:void 0,onClick:c&&!g?q=>O($,q):void 0,className:u("flex items-center gap-3 transition-all",F&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",F&&_&&"border-primary bg-accent",!F&&c&&!g&&"cursor-pointer hover:bg-muted/50",!F&&g&&"cursor-pointer hover:bg-muted/50",!F&&_&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Qi,{checked:B,onClick:q=>V($,q)}),jsx("div",{className:"flex-1 min-w-0",children:o($,j)})]},$.id)})}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:x})}var Tw=Z.forwardRef(Cw),uf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),mf=Z.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(uf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:r})]}));mf.displayName="ListItem";var pf=Z.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]}));pf.displayName="ListItemText";var bf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),vf=Z.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(bf({position:t,className:e})),...n}));vf.displayName="Timeline";var hf=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"}}),xf=Z.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(hf({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]}));xf.displayName="TimelineItem";var yf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));yf.displayName="TimelineContent";var Rf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Rf.displayName="TimelineOpposite";var Cf=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}}),Tf=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}}),Mf=Z.createContext({}),Nf=Z.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=Z.useState(a),f=o!==void 0?o:d,p=Z.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(Mf.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(Cf({size:t,fullWidth:n,className:e})),...l,children:r})})});Nf.displayName="SegmentedControl";var kf=Z.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=Z.useContext(Mf),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(Tf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});kf.displayName="SegmentedControlItem";var Pf=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"}}),Ef=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},ms=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]},Sf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${ms(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},Lf=Z.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]=Z.useState(false),[v,R]=Z.useState(false),[x,w]=Z.useState([]),C=Z.useRef(null),y=Z.useCallback(H=>{if(!H||H.length===0)return;let I=Array.from(H),A=[],O=[];(m?I:[I[0]]).forEach(z=>{let K=Sf(z,c,d);K.length>0?O.push({file:z,errors:K}):A.push(z);}),w(O),A.length>0&&r?.(A),O.length>0&&o?.(O);},[c,d,m,r,o]),T=Z.useCallback(H=>{if(H.preventDefault(),H.stopPropagation(),!f&&(b(true),H.dataTransfer.items)){let A=Array.from(H.dataTransfer.items).some(O=>{if(O.kind!=="file")return true;if(d&&d.length>0){let V=O.type;return !d.some(z=>z.endsWith("/*")?V.startsWith(z.slice(0,-2)):V===z)}return false});R(A);}},[f,d]),D=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!f&&(H.dataTransfer.dropEffect="copy");},[f]),P=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation();let I=H.currentTarget.getBoundingClientRect(),A=H.clientX,O=H.clientY;(A<I.left||A>I.right||O<I.top||O>I.bottom)&&(b(false),R(false));},[]),S=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),b(false),R(false),!f&&y(H.dataTransfer.files);},[f,y]),L=Z.useCallback(()=>{f||C.current?.click();},[f]),N=Z.useCallback(H=>{y(H.target.files),H.target.value="";},[y]),M=Z.useCallback(H=>{f||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),C.current?.click());},[f]),E=v?"error":h?"active":t,k=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:D,onDragLeave:P,onDrop:S,onClick:L,onKeyDown:M,className:u(Pf({variant:E,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:k,multiple:m,disabled:f,onChange:N,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 ${ms(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),x.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:x.map(({file:H,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:H.name}),":"," ",I.map(A=>A.message).join(", ")]},H.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(H=>{let I=Ef(H.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",H.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(I,{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:H.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[ms(H.file.size),H.error&&jsx("span",{className:"ml-2 text-danger",children:H.error})]}),H.progress!==void 0&&H.progress<100&&jsx(Qa,{value:H.progress,className:"mt-2 h-1"})]}),jsxs(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(H.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},H.id)})})]})});Lf.displayName="FileUpload";var Iw=`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")`,Hf=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}}),ra=Z.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...m},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:u(Hf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?Iw:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...m,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));ra.displayName="ColorSwatch";var If=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Vf=Z.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,selectedRingColor:c,className:d,style:m,...f},p)=>{let[g,h]=Z.useState(t),b=e??g,v=Z.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),R=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:u(If({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...m},...f,children:a.map(x=>{let w=b?R(b)===R(x):false;return jsx(ra,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:v,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});Vf.displayName="ColorSwatchPicker";var zw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Af={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},zf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=zw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=Z.useState(e??t),f=Z.useId();Z.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",Af[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(vt,{children:[jsx(nr,{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",Af[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(ht,{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(Er,{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 text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Er,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(ra,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});zf.displayName="ColorPicker";var Of=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"}}),el=e=>String(e).padStart(2,"0"),$w=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},Gw=(e,t)=>`${el(e)}:${el(t)}`,Bf=Z.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]=Z.useState(n??""),[g,h]=Z.useState(false);Z.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=$w(f||"00:00"),R=P=>{let S=P.target.value;p(S),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(S)&&r?.(S);},x=(P,S)=>{let L=Math.max(0,Math.min(23,P)),N=Math.max(0,Math.min(59,S)),M=Gw(L,N);p(M),r?.(M);},w=()=>x(b+1,v),C=()=>x(b-1,v),y=()=>x(b,v+a),T=()=>x(b,v-a),D=({value:P,onIncrement:S,onDecrement:L})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:S,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:el(P)}),jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L,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(Of({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(vt,{open:g,onOpenChange:h,children:[jsxs(nr,{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(ht,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(D,{value:b,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(D,{value:v,onIncrement:y,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(me,{variant:"bordered",size:"sm",onClick:()=>{let P=new Date;x(P.getHours(),P.getMinutes());},children:"Now"}),jsx(me,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});Bf.displayName="TimeInput";var Ff=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 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"}}),jw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},_w=(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}},tl=(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},Kf=(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},$f=Z.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=".",radius:h="md",disabled:b,placeholder:v,...R},x)=>{let[w,C]=Z.useState(r),[y,T]=Z.useState(""),[D,P]=Z.useState(false),S=n!==void 0?n:w,L=f??_w(a,s);Z.useEffect(()=>{!D&&S!==void 0&&T(tl(S,i,p,g));},[S,i,p,g,D]);let N=I=>{let A=I.target.value;if(!A){T(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(A))return;T(A);let V=Kf(A,p,g);if(V!==void 0){let z=V;l!==void 0&&V<l&&(z=l),c!==void 0&&V>c&&(z=c),n===void 0&&C(z),o?.(z);}},M=()=>{P(true),S!==void 0&&T(S.toString().replace(".",g));},E=()=>{P(false),T(S!==void 0?tl(S,i,p,g):"");},k=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:L}),H=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:L});return jsxs("div",{className:"relative flex items-center",children:[k&&jsx("div",{className:"absolute left-3 pointer-events-none",children:k}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:y,onChange:N,onFocus:M,onBlur:E,disabled:b,placeholder:v??`0${g}${"0".repeat(i)}`,className:u(Ff({size:t}),jw[h],k&&"pl-8",H&&"pr-8","text-right",e),style:{borderColor:D?"var(--color-foreground)":void 0},...R}),H&&jsx("div",{className:"absolute right-3 pointer-events-none",children:H})]})});$f.displayName="CurrencyInput";var Gf=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"}}),nl={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:"#####-####"}},Xw=(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}},cr=e=>["#","A","*"].includes(e),fs=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(cr(s)){if(o<e.length){let i=e[o];Xw(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},rl=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];cr(o)&&(n+=e[r]);}return n},Uf=(e,t)=>e.split("").map(n=>cr(n)?t:n).join(""),qw=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)cr(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,cr(t[i])&&s++;for(;a<t.length&&!cr(t[a]);)a++;return Math.min(a,e.length)},jf=Z.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 nl?nl[a].mask:a,[g,h]=Z.useState(r),[b,v]=Z.useState(""),[R,x]=Z.useState(false),w=Z.useRef(null),C=n!==void 0?n:g;Z.useImperativeHandle(f,()=>w.current),Z.useEffect(()=>{let P=fs(C,p,true);v(P);},[C,p]);let y=P=>{let S=P.target.value,L=P.target.selectionStart??0,N=S.replace(/[^\w]/g,""),M=fs(N,p,true),E=rl(M,p);v(M),n===void 0&&h(l?M:E),o?.(E,M),requestAnimationFrame(()=>{if(w.current){let k=qw(M,p,L);w.current.setSelectionRange(k,k);}});},T=P=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(P.key)||P.ctrlKey||P.metaKey)return;let S=w.current;if(!S)return;let L=S.selectionStart??0;if(P.key==="Backspace"&&L>0){let N=L-1;for(;N>0&&!cr(p[N]);)N--;let M=rl(b,p),E=0;for(let I=0;I<N&&I<p.length;I++)cr(p[I])&&E++;let k=M.slice(0,Math.max(0,E-1))+M.slice(E),H=fs(k,p,true);v(H),n===void 0&&h(l?H:k),o?.(k,H),P.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(N,N);});}},D=i?Uf(p,s):d;return jsx("input",{ref:w,type:"text",value:b,onChange:y,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:D,className:u(Gf({size:t}),e),style:{borderColor:R?"var(--color-foreground)":void 0},...m})});jf.displayName="MaskedInput";var tC=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"}}),Wf=[{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},nC=e=>e.replace(/#/g,"_"),Yf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Wf,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,radius:p="md",...g},h)=>{let[b,v]=Z.useState(r),[R,x]=Z.useState(a??s),[w,C]=Z.useState(false),[y,T]=Z.useState(false),[D,P]=Z.useState(false),[S,L]=Z.useState({top:0,left:0,width:0}),N=Z.useRef(null),M=Z.useRef(null),E=n!==void 0?n:b,k=a??R,H=l.find(G=>G.code===k)??l[0],I=gs(E,H.format);Z.useEffect(()=>{P(true);},[]),Z.useEffect(()=>{if(y&&N.current){let G=N.current.getBoundingClientRect();L({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[y]),Z.useEffect(()=>{if(!y)return;let G=X=>{N.current&&!N.current.contains(X.target)&&M.current&&!M.current.contains(X.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[y]),Z.useEffect(()=>{if(!y)return;let G=X=>{X.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[y]);let A=G=>{let F=G.target.value.replace(/\D/g,"");n===void 0&&v(F);let $=gs(F,H.format),j=`${H.dialCode} ${$}`;o?.(F,j,H);},O=G=>{let X=l.find(j=>j.code===G);if(!X)return;a===void 0&&x(G),i?.(X);let F=gs(E,X.format),$=`${X.dialCode} ${F}`;o?.(E,$,X),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",z=w||y;return jsxs("div",{className:u("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],m&&"cursor-not-allowed opacity-50"),style:{borderColor:z?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:N,type:"button",disabled:m,onClick:()=>T(!y),className:u("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",V),style:{borderColor:z?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:H.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:H.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]}),D&&y&&ja.createPortal(jsx("div",{ref:M,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:S.top,left:S.left,minWidth:S.width},children:jsx(Ae,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===k,onClick:()=>O(G.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:G.code===k&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:G.flag}),jsx("span",{className:"flex-1",children:G.name}),jsx("span",{className:"text-xs text-muted-foreground",children:G.dialCode})]})]},G.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:H.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:m,placeholder:f??nC(H.format),className:u("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});Yf.displayName="PhoneInput";var qf=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",bordered:"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:"bordered",size:"md",sticky:false}}),Zf=Z.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.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(qf({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})]})});Zf.displayName="Navbar";var Qf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));Qf.displayName="NavbarBrand";var Jf=Z.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})});Jf.displayName="NavbarContent";var eg=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));eg.displayName="NavbarItem";var tg=Z.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}));tg.displayName="NavbarLink";var lC={none:"",hover:"hover:underline",always:"underline"},ng={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},og=Z.forwardRef(({className:e,color:t="primary",underline:n="hover",isExternal:r,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=r?{target:"_blank",rel:"noopener noreferrer"}:{},m=t in ng,f=m?i:{color:t,...i};return jsxs("a",{ref:c,className:u("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m&&ng[t],lC[n],a&&"pointer-events-none opacity-50",e),style:f,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});og.displayName="Link";var ag=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"}}),sg=Z.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]=Z.useState(false);Z.useEffect(()=>{let R=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return R.addEventListener("scroll",x,{passive:true}),x(),()=>{R.removeEventListener("scroll",x);}},[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(ag({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(me,{ref:p,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:b,"aria-label":"Back to top",className:"shadow-lg",...f,children:r||jsx(ArrowUp,{className:v})})})});sg.displayName="BackTop";var bC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),vC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),ig=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"}}),lg=Z.createContext(null),ur=()=>{let e=Z.useContext(lg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},cg=Z.createContext(null),aa=()=>{let e=Z.useContext(cg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},al=Z.createContext(null),dg=Z.createContext(null),ug=Z.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=Z.useState(null);return jsx(lg.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",bC({radius:n}),e),...r,children:t})})});ug.displayName="Menubar";var mg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=ur(),r=Z.useId(),o=Z.useRef(null),a=t===r,s=Z.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(cg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};mg.displayName="MenubarMenu";var pg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));pg.displayName="MenubarGroup";var fg=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};fg.displayName="MenubarPortal";var gg=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(al.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};gg.displayName="MenubarSub";var bg=Z.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(dg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));bg.displayName="MenubarRadioGroup";var vg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=ur(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=aa(),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",vC({radius:i}),e),onClick:f,onMouseEnter:p,...r})});vg.displayName="MenubarTrigger";var hg=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=ur(),l=Z.useContext(al);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"})]})});hg.displayName="MenubarSubTrigger";var xg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=ur(),i=Z.useContext(al);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let x=d.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=x.top,y=x.right+t;y+w.width>window.innerWidth&&(y=x.left-w.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:ja.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",ig({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});xg.displayName="MenubarSubContent";var yg=Z.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=ur(),{triggerRef:l,open:c,onOpenChange:d}=aa(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.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(),x=v.bottom+r,w=v.left+n;t==="center"?w=v.left+v.width/2-R.width/2:t==="end"&&(w=v.right-R.width-n),f({top:x,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]),Z.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]),Z.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:ja.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",ig({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});yg.displayName="MenubarContent";var Rg=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=ur(),{onOpenChange:l}=aa(),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})});Rg.displayName="MenubarItem";var wg=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=ur(),{onOpenChange:c}=aa(),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]})});wg.displayName="MenubarCheckboxItem";var Cg=Z.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=ur(),{onOpenChange:l}=aa(),c=Z.useContext(dg),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]})});Cg.displayName="MenubarRadioItem";var sl=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));sl.displayName="MenubarSection";var hC=sl,Tg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Tg.displayName="MenubarSeparator";var Mg=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mg.displayName="MenubarShortcut";var Ng=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=Z.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:u(Ng({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.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 Pg=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"}}),yC=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"}}),RC=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"}}),Eg=Z.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(Pg({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(yC({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(RC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Eg.displayName="Step";var Lg=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"}}),Dg=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}}),Hg=Z.createContext(null),EC=()=>{let e=Z.useContext(Hg);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},SC=({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"})})}),Ig=({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:x,allowDrop:w,onDragStart:C,onDragOver:y,onDragEnter:T,onDragLeave:D,onDragEnd:P,showLine:S,showIcon:L,showHandle:N,dragIcon:M,icon:E,leafIcon:k,folderIcon:H,folderOpenIcon:I,blockNode:A,disabled:O,size:V,getAllKeys:z}=EC(),K=e.children&&e.children.length>0,G=e.isLeaf??!K,X=o.has(e.key),F=s.has(e.key),$=c.has(e.key),j=d.has(e.key),_=g?.key===e.key,B=b===e.key,q=!!(O||e.disabled),ee=l&&e.selectable!==false,Y=f&&e.checkable!==false,he=Z.useMemo(()=>q?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,q]),Q=Z.useMemo(()=>M!==void 0?M:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[M,p]),ne=Z.useMemo(()=>e.icon?e.icon:E?typeof E=="function"?E({expanded:X,isLeaf:G}):E:G?k:X?I:H,[e.icon,E,X,G,k,H,I]),Me=U=>{if(!he)return;U.stopPropagation(),U.dataTransfer.effectAllowed="move";let de=U.currentTarget,ue=de.cloneNode(true),Be=document.documentElement.classList.contains("dark"),$e=Be?"#0a0a0a":"#ffffff",Rn=Be?"#27272a":"#e4e4e7";ue.style.cssText=`
43
+ `;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:x}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),style:{...s,...(()=>{if(!r)return {};let C=Wy[o],y=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",D=[y&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,y&&f.bottom&&`linear-gradient(to top, transparent, black ${C})`,T&&f.left&&`linear-gradient(to right, transparent, black ${C})`,T&&f.right&&`linear-gradient(to left, transparent, black ${C})`].filter(Boolean);return D.length===0?{}:{maskImage:D.join(", "),WebkitMaskImage:D.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:u(t==="vertical"&&"h-full w-full overflow-y-auto overflow-x-hidden",t==="horizontal"&&"w-full overflow-x-auto overflow-y-hidden",t==="both"&&"h-full w-full overflow-auto",e),...i,children:a})]})});Ae.displayName="ScrollArea";var Sd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),$a=Z.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,size:p,radius:g,className:h,...b},v)=>{let[R,x]=Z.useState(false),[w,C]=Z.useState(""),[y,T]=Z.useState(r||""),[D,E]=Z.useState(r||[]),[L,S]=Z.useState({top:0,left:0,width:0}),N=Z.useRef(null),M=Z.useRef(null),k=Z.useRef(null),P=Z.useRef(null),H=n!==void 0?n:y,I=n!==void 0?n:D,A=n!==void 0,O=B=>{d&&H===B?(A||T(""),o?.("")):(A||T(B),o?.(B)),x(false),C("");},V=B=>{let q=I.includes(B)?I.filter(ee=>ee!==B):[...I,B];A||E(q),o?.(q);},z=(B,q)=>{q.stopPropagation();let ee=I.filter(Y=>Y!==B);A||E(ee),o?.(ee);},K=B=>{B.stopPropagation(),t?(A||E([]),o?.([])):(A||T(""),o?.(""));},G=e.find(B=>B.value===H),X$1=e.filter(B=>I.includes(B.value)),F=X$1.slice(0,m),$=X$1.length-m,j=s?e.filter(B=>B.label.toLowerCase().includes(w.toLowerCase())):e;Z.useEffect(()=>{if(R&&M.current){let B=M.current.getBoundingClientRect();S({top:B.bottom+4,left:B.left,width:B.width}),s&&setTimeout(()=>P.current?.focus(),0);}R||C("");},[R,s]),Z.useEffect(()=>{let B=q=>{let ee=q.target,Y=N.current&&!N.current.contains(ee),ve=k.current&&!k.current.contains(ee);Y&&ve&&(x(false),C(""));};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]),Z.useEffect(()=>{if(!R)return;let B=q=>{k.current?.contains(q.target)||(x(false),C(""));};return window.addEventListener("scroll",B,true),()=>window.removeEventListener("scroll",B,true)},[R]);let _=t?I.length>0:!!H;return jsxs("div",{ref:N,className:u("relative",h),...b,children:[jsxs("div",{ref:B=>{M.current=B,typeof v=="function"?v(B):v&&(v.current=B);},role:"combobox","aria-expanded":R,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!R),className:u(Sd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:u(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:X$1.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[F.map(B=>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:[B.label,jsx("span",{role:"button",tabIndex:0,onClick:q=>z(B.value,q),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&z(B.value,q);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},B.value)),$>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",$," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&_&&jsx("span",{role:"button",tabIndex:0,onClick:K,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&K(B);},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",R&&"rotate-180")})]})]}),R&&!c&&typeof document<"u"&&ja.createPortal(jsxs("div",{ref:k,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:L.top,left:L.left,minWidth:L.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:P,type:"text",value:w,onChange:B=>C(B.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(Ae,{style:{maxHeight:f},onWheel:B=>B.stopPropagation(),children:jsx("div",{className:"p-1",children:j.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):j.map(B=>{let q=t?I.includes(B.value):H===B.value;return jsxs("div",{role:"option","aria-selected":q,onClick:()=>{B.disabled||(t?V(B.value):O(B.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",B.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:q&&jsx(Check,{className:"h-4 w-4"})}),B.label]},B.value)})})})]}),document.body)]})});$a.displayName="Select";var Ld=Z.createContext(null),jo=()=>{let e=Z.useContext(Ld);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},Ci=Z.createContext({radius:"md"}),Ti=Z.createContext(null),qt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),m=Z.useRef(null),f=Z.useId(),p=Z.useRef(new Map),g=Z.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=Z.useCallback((v,R)=>{p.current.set(v,R);},[]),b=Z.useCallback(v=>{p.current.delete(v);},[]);return jsx(Ld.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:m,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};qt.displayName="Dropdown";var Zt=Z.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=jo();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})});Zt.displayName="DropdownTrigger";var t0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Qt=Z.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:x,items:w}=jo(),[C,y]=Z.useState({top:0,left:0}),[T,D]=Z.useState(t),[E,L]=Z.useState(false),S=Z.useRef(0);if(Z.useEffect(()=>{L(true);},[]),Z.useEffect(()=>{p&&(S.current=w.current.size);},[p,w]),Z.useEffect(()=>{if(!p||!h.current||!b.current)return;let M=()=>{if(!h.current||!b.current)return;let k=h.current.getBoundingClientRect(),P=b.current.getBoundingClientRect(),H=window.innerWidth,I=window.innerHeight,A=0,O=0,V=t;switch(t){case "top":A=k.top-P.height-n,A<a&&(A=k.bottom+n,V="bottom");break;case "bottom":A=k.bottom+n,A+P.height>I-a&&(A=k.top-P.height-n,V="top");break;case "left":O=k.left-P.width-n,O<a&&(O=k.right+n,V="right");break;case "right":O=k.right+n,O+P.width>H-a&&(O=k.left-P.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":O=k.left+o;break;case "center":O=k.left+k.width/2-P.width/2;break;case "end":O=k.right-P.width-o;break}O<a?O=a:O+P.width>H-a&&(O=H-P.width-a);}else {switch(r){case "start":A=k.top+o;break;case "center":A=k.top+k.height/2-P.height/2;break;case "end":A=k.bottom-P.height-o;break}A<a?A=a:A+P.height>I-a&&(A=I-P.height-a);}y({top:A,left:O}),D(V);};return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[p,t,n,r,o,a,h]),Z.useEffect(()=>{if(!p)return;let M=k=>{let P=k.target;b.current&&!b.current.contains(P)&&h.current&&!h.current.contains(P)&&(s?.(),g(false));};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[p,g,s,h,b]),Z.useEffect(()=>{if(!p)return;let M=k=>{let P=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),H=P.length;if(H!==0)switch(k.key){case "Escape":k.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":k.preventDefault(),R===-1||R>=H-1?x(l?0:Math.min(R+1,H-1)):x(R+1);break;case "ArrowUp":k.preventDefault(),R<=0?x(l?H-1:0):x(R-1);break;case "Home":k.preventDefault(),x(0);break;case "End":k.preventDefault(),x(H-1);break;case "Enter":case " ":k.preventDefault(),R>=0&&R<H&&P[R]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,g,i,R,x,w,l,h]),Z.useEffect(()=>{p&&R>=0&&Array.from(w.current.entries()).sort(([k],[P])=>k-P).map(([,k])=>k)[R]?.focus();},[p,R,w]),!E||!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"}[T];return ja.createPortal(jsx("div",{ref:M=>{b.current=M,typeof f=="function"?f(M):f&&(f.current=M);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:u("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",t0[c],N,e),style:{top:C.top,left:C.left},...m,children:jsx(Ci.Provider,{value:{radius:c},children:d})}),document.body)});Qt.displayName="DropdownContent";var Dd=0,Hd={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Lt=Z.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}=jo(),{radius:b}=Z.useContext(Ci),[v]=Z.useState(()=>Dd++),R=Z.useRef(null);Z.useEffect(()=>(!n&&R.current&&g(v,R.current),()=>{h(v);}),[n,v,g,h]);let x=y=>{if(n){y.preventDefault();return}o?.(y),r?.(),m(false);},w=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",Hd[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Lt.displayName="DropdownItem";var Mi=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Mi.displayName="DropdownSection";var Id=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Id.displayName="DropdownSeparator";var Vd=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest opacity-60",e),...t});Vd.displayName="DropdownShortcut";var Ad=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Ad.displayName="DropdownGroup";var zd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),{contentRef:s}=jo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(m=>{i||a(m),r?.(m);},[i,r]);return jsx(Ti.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};zd.displayName="DropdownSub";var Od=Z.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Ti),{setActiveIndex:d,registerItem:m,unregisterItem:f}=jo(),{radius:p}=Z.useContext(Ci),[g]=Z.useState(()=>Dd++),h=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:R}=c;Z.useEffect(()=>(!n&&h.current&&m(g,h.current),()=>{f(g);}),[n,g,m,f]);let x=y=>{o?.(y),n||(d(g),v(true));},w=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",Hd[p],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:x,onMouseLeave:w,onKeyDown:C,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Od.displayName="DropdownSubTrigger";var Bd=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Ti);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:m,parentMenuRef:f}=l,[p,g]=Z.useState({top:0,left:0}),[h,b]=Z.useState(false),v=Z.useRef(null),R=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!c||!m.current||!v.current)return;(()=>{if(!m.current||!v.current)return;let y=m.current.getBoundingClientRect(),T=v.current.getBoundingClientRect(),D=window.innerWidth,E=window.innerHeight,L=y.top+n,S=y.right+t;S+T.width>D-r&&(S=y.left-T.width-t),L+T.height>E-r&&(L=E-T.height-r),L<r&&(L=r),g({top:L,left:S});})();},[c,t,n,r,m]);let x=C=>{o?.(C),R.current&&(clearTimeout(R.current),R.current=null),d(true);},w=C=>{a?.(C);let y=C.relatedTarget;m.current?.contains(y)||f?.current?.contains(y)||(R.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),!h||!c?null:ja.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:x,onMouseLeave:w,...s}),document.body)});Bd.displayName="DropdownSubContent";var n0=Mi;var $d=Z.createContext(null),Ni=()=>{let e=Z.useContext($d);if(!e)throw new Error("Popover components must be used within a Popover");return e},bt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(m=>{s||a(m),r?.(m);},[s,r]);return jsx($d.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};bt.displayName="Popover";var nr=Z.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ni(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},m={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&Z.isValidElement(e)?Z.cloneElement(e,{...m,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...m,children:e})});nr.displayName="PopoverTrigger";var Tn=Z.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Ni();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Tn.displayName="PopoverAnchor";var vt=Z.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}=Ni(),[v,R]=Z.useState({top:0,left:0}),[x,w]=Z.useState(false),[C,y]=Z.useState(null);if(Z.useEffect(()=>{w(true);},[]),Z.useEffect(()=>{if(!p||!h.current||!C)return;let D=()=>{if(!h.current||!C)return;let E=h.current.getBoundingClientRect(),L=C.getBoundingClientRect(),S=0,N=0;switch(n){case "top":S=E.top-L.height-r;break;case "bottom":S=E.bottom+r;break;case "left":N=E.left-L.width-r;break;case "right":N=E.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":N=E.left+a;break;case "center":N=E.left+E.width/2-L.width/2;break;case "end":N=E.right-L.width-a;break}else switch(o){case "start":S=E.top+a;break;case "center":S=E.top+E.height/2-L.height/2;break;case "end":S=E.bottom-L.height-a;break}R({top:S,left:N});};return D(),window.addEventListener("resize",D),window.addEventListener("scroll",D,true),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,true);}},[p,n,r,o,a,h,C]),Z.useEffect(()=>{if(!p)return;let D=E=>{let L=E.target;C&&C.contains(L)||h.current&&h.current.contains(L)||L.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",D),()=>document.removeEventListener("mouseup",D)},[p,g,s,h,C]),Z.useEffect(()=>{if(!p)return;let D=E=>{E.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[p,g,i]),!x||!p)return null;let T={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 ja.createPortal(jsx("div",{ref:D=>{y(E=>E!==D?D:E),typeof f=="function"?f(D):f&&(f.current=D);},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",T,e),style:{...t,top:v.top,left:v.left},...m,children:d}),document.body)});vt.displayName="PopoverContent";var Gd=Z.createContext(null),Pi=()=>{let e=Z.useContext(Gd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Ud=Z.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]=Z.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||m(h),r?.(h);};return jsx(Gd.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})})});Ud.displayName="Tabs";var ki={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"}},jd=Z.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=Pi(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let R=g.getBoundingClientRect(),x=v.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-R.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-R.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-R.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.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",bordered:"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",ki[a].list,m[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:u("absolute transition-all duration-200 ease-out",ki[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});jd.displayName="TabsList";var _d=Z.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=Pi(),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",bordered:"border border-transparent data-[state=active]:border-current 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",ki[c].trigger,m[l],e),onClick:f=>{r?.(f),i(t);},...o})});_d.displayName="TabsTrigger";var Wd=Z.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=Pi(),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});Wd.displayName="TabsContent";var Yd=[{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 o0(e,t=Yd){return e?t.filter(r=>r.test(e)).length/t.length:0}function a0(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function s0(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Wo=0,Ei=null;function an(){Wo===0&&(Ei=document.body.style.overflow,document.body.style.overflow="hidden"),Wo++;}function sn(){Wo--,Wo<=0&&(Wo=0,document.body.style.overflow=Ei??"",Ei=null);}var qd=Z.createContext(null),Ua=()=>{let e=Z.useContext(qd);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},Zd=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=Z.useState(t),s=e!==void 0,i=s?e:o,l=Z.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(qd.Provider,{value:{open:i,onOpenChange:l},children:r})};Zd.displayName="Sheet";var Qd=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Ua();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});Qd.displayName="SheetTrigger";var Jd=Z.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Ua();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});Jd.displayName="SheetClose";var Li=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};Li.displayName="SheetPortal";var eu=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ua();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});eu.displayName="SheetOverlay";var tu=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"}}),c0=(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],nu=Z.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=Ua(),[d,m]=Z.useState(false),[,f]=Z.useState(false);return Z.useEffect(()=>{if(l)m(true),f(true),an();else {f(true);let p=setTimeout(()=>{m(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{sn();}},[l]),Z.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(Li,{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(tu({side:e}),c0(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]})]})});nu.displayName="SheetContent";var ru=({className:e,...t})=>jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",e),...t});ru.displayName="SheetHeader";var ou=({className:e,...t})=>jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ou.displayName="SheetFooter";var au=Z.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));au.displayName="SheetTitle";var su=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-sm text-muted-foreground",e),...t}));su.displayName="SheetDescription";var m0=({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 iu=Z.createContext(null),_a=()=>{let e=Z.useContext(iu);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Di=Z.createContext(null),lu=({children:e,onOpenChange:t})=>{let[n,r]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(iu.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};lu.displayName="ContextMenu";var cu=Z.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=_a(),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})});cu.displayName="ContextMenuTrigger";var du=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));du.displayName="ContextMenuGroup";var uu=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};uu.displayName="ContextMenuPortal";var mu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Di.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};mu.displayName="ContextMenuSub";var pu=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=_a(),[d,m]=Z.useState(false),[f,p]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{m(true);},[]),Z.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]),Z.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]),Z.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:ja.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)});pu.displayName="ContextMenuContent";var fu=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Di);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"})]})});fu.displayName="ContextMenuSubTrigger";var gu=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=Z.useContext(Di);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,m]=Z.useState({top:0,left:0}),[f,p]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let R=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=R.top,C=R.right+t;C+x.width>window.innerWidth&&(C=R.left-x.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:ja.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)});gu.displayName="ContextMenuSubContent";var bu=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=_a(),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})});bu.displayName="ContextMenuItem";var vu=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=_a(),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]})});vu.displayName="ContextMenuCheckboxItem";var hu=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));hu.displayName="ContextMenuSection";var xu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-border",e),...t}));xu.displayName="ContextMenuSeparator";var yu=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});yu.displayName="ContextMenuShortcut";var wu=Z.createContext(null),v0=()=>{let e=Z.useContext(wu);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},Cu=Z.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]=Z.useState(n),p=t!==void 0,g=p?t:m,h=Z.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(wu.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});Cu.displayName="RadioGroup";var Tu=Z.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=v0(),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}})]})});Tu.displayName="RadioGroupItem";var Ya=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",bordered:"border border-current 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"}}),Mu=Z.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,m]=Z.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(Ya({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Mu.displayName="Toggle";var Nu=Z.createContext(null),w0=()=>{let e=Z.useContext(Nu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},ku=Z.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[m,f]=Z.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(Nu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});ku.displayName="ToggleGroup";var Pu=Z.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(Ya({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});Pu.displayName="ToggleGroupItem";var Jt=Z.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]=Z.useState(n),h=t!==void 0,b=h?t:p,v=Z.useRef(null),[R,x]=Z.useState(false),[w,C]=Z.useState(null),y=(k,P)=>{if(!v.current)return b[0];let H=v.current.getBoundingClientRect(),I;c==="horizontal"?I=(k-H.left)/H.width:I=1-(P-H.top)/H.height,I=Math.max(0,Math.min(1,I));let A=a+I*(s-a),O=Math.round(A/i)*i;return Math.max(a,Math.min(s,O))},T=(k,P)=>{let H=[...b];H[P]=k,P>0&&k<b[P-1]&&(H[P]=b[P-1]),P<b.length-1&&k>b[P+1]&&(H[P]=b[P+1]),h||g(H),r?.(H);},D=(k,P)=>{l||(k.preventDefault(),x(true),C(P),k.target.setPointerCapture(k.pointerId));},E=k=>{if(!R||w===null||l)return;let P=y(k.clientX,k.clientY);T(P,w);},L=()=>{R&&(x(false),C(null),o?.(b));},S=k=>{if(l)return;let P=y(k.clientX,k.clientY),H=0,I=Math.abs(b[0]-P);for(let A=1;A<b.length;A++){let O=Math.abs(b[A]-P);O<I&&(I=O,H=A);}T(P,H),o?.([...b.slice(0,H),P,...b.slice(H+1)]);},N=(k,P)=>{if(l)return;let H=b[P];switch(k.key){case "ArrowRight":case "ArrowUp":k.preventDefault(),H=Math.min(s,b[P]+i);break;case "ArrowLeft":case "ArrowDown":k.preventDefault(),H=Math.max(a,b[P]-i);break;case "Home":k.preventDefault(),H=a;break;case "End":k.preventDefault(),H=s;break;default:return}T(H,P),o?.([...b.slice(0,P),H,...b.slice(P+1)]);},M=k=>(k-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:S,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${M(b[0])}%`:0,right:`${100-M(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${M(b[0])}%`:0,top:`${100-M(b[b.length-1])}%`,left:0,right:0}})}),b.map((k,P)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":k,"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&&w===P&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${M(k)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M(k)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:H=>D(H,P),onPointerMove:E,onPointerUp:L,onPointerCancel:L,onKeyDown:H=>N(H,P)},P)),d&&b.map((k,P)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${P}]`:d,value:k},P))]})});Jt.displayName="Slider";var Eu=Z.createContext(null),Su=()=>{let e=Z.useContext(Eu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Ii=Z.createContext(null),Lu=()=>{let e=Z.useContext(Ii);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Du=Z.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,m]=Z.useState(()=>t==="single"?r?[r]:[]:r||[]),f=Z.useRef(new Map),p=Z.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=w=>{if(t==="single"){let y=h.includes(w)&&a?[]:[w];g||m(y),o?.(y[0]||"");}else {let C=h.includes(w)?h.filter(y=>y!==w):[...h,w];g||m(C),o?.(C);}},v=Z.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),R=Z.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=Z.useCallback(w=>{let C=p.current;if(C.length===0)return;let y=document.activeElement,T;f.current.forEach((N,M)=>{N===y&&(T=M);});let D=T?C.indexOf(T):-1,E;switch(w){case "first":E=0;break;case "last":E=C.length-1;break;case "next":E=D===-1?0:(D+1)%C.length;break;case "prev":E=D===-1?C.length-1:(D-1+C.length)%C.length;break}let L=C[E];f.current.get(L)?.focus();},[]);return jsx(Eu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:R,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:u("w-full",e),...l,children:i})})});Du.displayName="Accordion";var Hu=Z.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=Su(),d=c.value.includes(t),m=n||c.disabled||false,f=Z.useId(),p=Z.useId();return r!==void 0?jsx(Ii.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(Iu,{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(Vu,{children:s})]})}):jsx(Ii.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})})});Hu.displayName="AccordionItem";var Iu=Z.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=Su(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:m}=Lu(),f=Z.useRef(null);Z.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"})]})})});Iu.displayName="AccordionTrigger";var Vu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Lu();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})})})});Vu.displayName="AccordionContent";var zu=Z.createContext(null),Ou=()=>{let e=Z.useContext(zu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},Bu=Z.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(n),m=t!==void 0,f=m?t:c,p=Z.useId(),g=Z.useId(),h=b=>{o||(m||d(b),r?.(b));};return jsx(zu.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(Vi,{})]}),s]})})});Bu.displayName="Collapsible";var Vi=Z.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=Ou();return jsx(me,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,disabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:u("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Vi.displayName="CollapsibleTrigger";var Fu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=Ou(),c=Z.useRef(null),[d,m]=Z.useState(0),[f,p]=Z.useState(false),[g,h]=Z.useState(a);Z.useEffect(()=>{a?(h(true),m(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&m(c.current.scrollHeight);});})):(p(true),c.current?(m(c.current.scrollHeight),requestAnimationFrame(()=>{m(0);})):m(0));},[a]);let b=()=>{p(false),a||h(false);};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: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,className:"space-y-2",children:t})}):null});Fu.displayName="CollapsibleContent";var k0=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),Ku={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},Qa=Z.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=d=>`${Math.round(d)}%`,size:s,color:i="primary",...l},c)=>{let d=Math.min(Math.max(t/n*100,0),100),m=r||o,f=Ku[i]||"",p=!Ku[i];return jsxs("div",{ref:c,className:"w-full",children:[m&&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(d)})]}),jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:u(k0({size:s}),e),...l,children:jsx("div",{className:u("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});Qa.displayName="Progress";var ju=Z.createContext(null),_u=()=>{let e=Z.useContext(ju);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Wu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(n),c=t!==void 0,d=c?t:i,m=Z.useRef(null),f=Z.useId(),p=Z.useRef(null),g=Z.useRef(null),h=Z.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 Z.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]),Z.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(ju.Provider,{value:{open:d,onOpenChange:h,triggerRef:m,contentId:f},children:e})};Wu.displayName="HoverCard";var Yu=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=_u();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})});Yu.displayName="HoverCardTrigger";var Xu=Z.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}=_u(),[g,h]=Z.useState({top:0,left:0}),[b,v]=Z.useState(false),R=Z.useRef(null);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!d||!f.current||!R.current)return;(()=>{if(!f.current||!R.current)return;let T=f.current.getBoundingClientRect(),D=R.current.getBoundingClientRect(),E=0,L=0;switch(t){case "top":E=T.top-D.height-n;break;case "bottom":E=T.bottom+n;break;case "left":L=T.left-D.width-n;break;case "right":L=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":L=T.left+o;break;case "center":L=T.left+T.width/2-D.width/2;break;case "end":L=T.right-D.width-o;break}else switch(r){case "start":E=T.top+o;break;case "center":E=T.top+T.height/2-D.height/2;break;case "end":E=T.bottom-D.height-o;break}h({top:E,left:L});})();},[d,t,n,r,o,f]);let x=y=>{a?.(y),m(true);},w=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 ja.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:x,onMouseLeave:w,...l,children:i}),document.body)});Xu.displayName="HoverCardContent";var qu=Z.createContext({size:"md",variant:"default",radius:"md"}),es=()=>Z.useContext(qu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var S0=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),L0=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"}}),D0=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"}}),Zu=Z.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(qu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));Zu.displayName="Breadcrumb";var Qu=Z.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=es();return jsx("ol",{ref:n,className:u(S0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});Qu.displayName="BreadcrumbList";var Ju=Z.forwardRef(({className:e,...t},n)=>{let{size:r}=es();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})});Ju.displayName="BreadcrumbItem";var em=Z.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:u("transition-colors hover:text-foreground cursor-pointer",e),...t}));em.displayName="BreadcrumbLink";var tm=Z.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}));tm.displayName="BreadcrumbPage";var nm=({children:e,className:t,...n})=>{let{size:r}=es();return jsx("li",{role:"presentation","aria-hidden":"true",className:u(L0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};nm.displayName="BreadcrumbSeparator";var rm=({className:e,...t})=>{let{size:n}=es();return jsxs("span",{role:"presentation","aria-hidden":"true",className:u(D0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};rm.displayName="BreadcrumbEllipsis";var sm=Z.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})}));sm.displayName="AspectRatio";var cm=Z.createContext(null),zi=()=>{let e=Z.useContext(cm);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},dm=Z.createContext(null),um=()=>{let e=Z.useContext(dm);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},mm=Z.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=Z.useState(null);return jsx(cm.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(Oi,{})]})})});mm.displayName="NavigationMenu";var pm=Z.forwardRef(({className:e,...t},n)=>{let{orientation:r}=zi();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})});pm.displayName="NavigationMenuList";var fm=Z.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=zi(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(dm.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:u("relative",e),...n,children:t})})});fm.displayName="NavigationMenuItem";var gm=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"),bm=Z.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=um(),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(gm(),"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"})]})});bm.displayName="NavigationMenuTrigger";var vm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=um(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.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?ja.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});vm.displayName="NavigationMenuContent";var hm=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"),xm=Z.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:u(hm(),t&&"bg-accent text-accent-foreground",e),...n}));xm.displayName="NavigationMenuLink";var Oi=Z.forwardRef((e,t)=>null);Oi.displayName="NavigationMenuViewport";var ym=Z.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=zi();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});ym.displayName="NavigationMenuIndicator";var Tm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 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 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Ft=Z.forwardRef(({className:e,size:t,...n},r)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:r,type:"button",className:u(Tm({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Ft.displayName="CloseButton";var ts=Z.createContext(null);function G0(){let e=Z.useContext(ts);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Fn(){return Z.useContext(ts)}var U0="16rem",j0="18rem",_0="3rem",W0="b",Y0={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},X0={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Bi=Z.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]=Z.useState(false),[x,w]=Z.useState(false),[C,y]=Z.useState(e),T=t??C,D=Z.useCallback(N=>{let M=typeof N=="function"?N(T):N;n?n(M):y(M);},[n,T]);Z.useEffect(()=>{let N=()=>{R(window.innerWidth<768);};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);let E=Z.useCallback(()=>b?D(N=>!N):v?w(N=>!N):D(N=>!N),[v,D,w,b]);Z.useEffect(()=>{if(b)return;let N=M=>{M.key===W0&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),E());};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[E,b]);let L=T?"expanded":"collapsed",S=Z.useMemo(()=>({placement:r,state:L,open:T,setOpen:D,isMobile:v,openMobile:x,setOpenMobile:w,toggleDrawer:E,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,L,T,D,v,x,w,E,l,h,o,a,s,i]);return b?jsx(ts.Provider,{value:S,children:jsx(Drawer.Root,{open:T,onOpenChange:D,direction:r,dismissible:s,children:f})}):jsx(ts.Provider,{value:S,children:jsx(tr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":U0,"--drawer-width-icon":_0,...m},className:u("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Bi.displayName="Drawer";var Nm=Z.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Fn();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(q0,{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})})]})});Nm.displayName="DrawerSidebar";var q0=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return an(),()=>sn()},[t]),!o||!t?null:ja.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":j0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},km=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Fn();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"})]})});km.displayName="DrawerTrigger";var Pm=Z.forwardRef(({className:e,children:t,...n},r)=>{let o=Fn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",m=d?Y0[i]:X0[i],f={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},p={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",f[l])}),jsxs(Drawer.Content,{ref:r,className:u("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:m,height:"100%"}:{},...c?{maxHeight:m}:{},...n.style},...n,children:[c&&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})});Pm.displayName="DrawerContent";var Em=Z.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Fn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:u("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Ft,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Em.displayName="DrawerHeader";var Sm=Z.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}));Sm.displayName="DrawerBody";var Lm=Z.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}));Lm.displayName="DrawerFooter";var Dm=Z.forwardRef(({className:e,...t},n)=>Fn()?.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}));Dm.displayName="DrawerTitle";var Hm=Z.forwardRef(({className:e,...t},n)=>Fn()?.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}));Hm.displayName="DrawerDescription";var Im=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Fn();return jsx(Ft,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});Im.displayName="DrawerClose";var Vm=Z.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Fn();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"})]})});Vm.displayName="DrawerToggle";var Am=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:u("mx-4 h-px bg-border",e),...t}));Am.displayName="DrawerSeparator";var zm=Z.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}));zm.displayName="DrawerMenu";var Om=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:u("group/menu-item relative",e),...t}));Om.displayName="DrawerMenuItem";var Bm=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",bordered:"bg-background shadow-[0_0_0_1px_currentColor] 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"}}),Fm=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Fn(),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(Bm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Rn,{children:[jsx(wn,{children:m}),jsx(Cn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):m});Fm.displayName="DrawerMenuButton";var Km=Z.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}));Km.displayName="DrawerGroup";var $m=Z.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}));$m.displayName="DrawerGroupLabel";var Gm=Z.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}));Gm.displayName="DrawerInset";var Z0=Bi;var jm=Z.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})}));jm.displayName="Table";var _m=Z.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:u("[&_tr]:border-b",e),...t}));_m.displayName="TableHeader";var Wm=Z.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:u("[&_tr:last-child]:border-0",e),...t}));Wm.displayName="TableBody";var Ym=Z.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}));Ym.displayName="TableFooter";var Xm=Z.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}));Xm.displayName="TableRow";var qm=Z.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}));qm.displayName="TableHead";var Zm=Z.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Zm.displayName="TableCell";var Qm=Z.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:u("mt-4 text-sm text-muted-foreground",e),...t}));Qm.displayName="TableCaption";function rR({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,...R},x){let[w,C]=Z.useState(new Set),[y,T]=Z.useState({columnId:null,direction:null}),[D,E]=Z.useState({pageIndex:0,pageSize:m[0]||10}),L=o??w,S=l??y,N=f??D,M=F=>{a?a(F):C(F);},k=F=>{c?c(F):T(F);},P=F=>{p?p(F):E(F);},H=Z.useMemo(()=>{if(!S.columnId||!S.direction)return t;let F=n.find($=>$.id===S.columnId);return F?[...t].sort(($,j)=>{let _=F.accessor($),B=F.accessor(j);if(_===B)return 0;if(_==null)return 1;if(B==null)return -1;let q=String(_).localeCompare(String(B),void 0,{numeric:true});return S.direction==="asc"?q:-q}):t},[t,S,n]),I=Z.useMemo(()=>{if(!d)return H;let F=N.pageIndex*N.pageSize;return H.slice(F,F+N.pageSize)},[H,d,N]),A=Math.ceil(H.length/N.pageSize),O=F=>{if(F===true){let $=new Set(I.map((j,_)=>s(j,_)));M($);}else M(new Set);},V=(F,$)=>{let j=new Set(L);$?j.add(F):j.delete(F),M(j);},z=I.length>0&&I.every((F,$)=>L.has(s(F,$))),K=I.some((F,$)=>L.has(s(F,$))),G=F=>{if(!n.find(_=>_.id===F)?.sortable&&!i)return;let j="asc";S.columnId===F&&(S.direction==="asc"?j="desc":S.direction==="desc"&&(j=null)),k({columnId:j?F:null,direction:j});},X=F=>S.columnId!==F?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):S.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,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(Uo,{checked:z?true:K?"indeterminate":false,onCheckedChange:O,"aria-label":"Select all"})}),n.map(F=>{let $=F.sortable??i;return jsx("th",{className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground",$&&"cursor-pointer select-none hover:text-foreground"),style:{width:F.width},onClick:()=>$&&G(F.id),children:jsxs("div",{className:"flex items-center gap-2",children:[F.header,$&&X(F.id)]})},F.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..."})}):I.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):I.map((F,$)=>{let j=s(F,$),_=L.has(j);return jsxs("tr",{className:u("border-b transition-colors",v&&"hover:bg-muted/50",b&&$%2===1&&"bg-muted/30",_&&"bg-muted"),"data-state":_?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Uo,{checked:_,onCheckedChange:B=>V(j,!!B),"aria-label":`Select row ${$+1}`})}),n.map(B=>jsx("td",{className:"p-4 align-middle",children:B.cell?B.cell(F,$):B.accessor(F)},B.id))]},j)})})]})}),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:N.pageSize,onChange:F=>P({pageIndex:0,pageSize:Number(F.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:m.map(F=>jsx("option",{value:F,children:F},F))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",N.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...N,pageIndex:N.pageIndex-1}),disabled:N.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...N,pageIndex:N.pageIndex+1}),disabled:N.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var oR=Z.forwardRef(rR);var Fi=["January","February","March","April","May","June","July","August","September","October","November","December"];function uR({currentMonth:e,onMonthChange:t,startYear:n,endYear:r}){let o=getMonth(e),a=getYear(e),s=c=>{let d=setMonth(e,c);t(d);},i=c=>{let d=setYear(e,c);t(d);},l=Z.useMemo(()=>{let c=[];for(let d=r;d>=n;d--)c.push(d);return c},[n,r]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(qt,{children:[jsx(Zt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[85px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:Fi[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Qt,{className:"min-w-[120px] p-0",children:jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:Fi.map((c,d)=>jsx(Lt,{onSelect:()=>s(d),className:u("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(qt,{children:[jsx(Zt,{children:jsxs("div",{className:u("inline-flex items-center justify-between gap-1 px-1.5 py-1 rounded-md","text-xs font-medium w-[60px]","border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:a}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Qt,{className:"min-w-[80px] p-0",children:jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Lt,{onSelect:()=>i(c),className:u("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function mR(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-1 mb-2",children:[jsx(uR,{currentMonth:o.date,onMonthChange:a,startYear:t,endYear:n}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!i,onClick:()=>i&&a(i),className:u("h-6 w-6 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-3.5 w-3.5"})}),jsx("button",{type:"button",disabled:!s,onClick:()=>s&&a(s),className:u("h-6 w-6 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-3.5 w-3.5"})})]})]});let l=Fi[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 lo({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=Z.useMemo(()=>mR(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-8 font-normal text-xs text-center",week:"flex w-full mt-0.5",day:u("relative h-8 w-8 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-8 p-0 font-normal rounded-md text-sm","inline-flex items-center justify-center","hover:bg-primary/10","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 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...s,MonthCaption:l},...i})}lo.displayName="Calendar";var np=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:u("mx-auto flex w-full justify-center",e),...t});np.displayName="Pagination";var rp=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:u("flex flex-row items-center gap-1",e),...t}));rp.displayName="PaginationContent";var op=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:u("",e),...t}));op.displayName="PaginationItem";var bR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},ns=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:u(no({variant:t?"solid":"light",size:n,radius:r}),o&&bR[n],e),...a});ns.displayName="PaginationLink";var ap=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to previous page",isIconOnly:false,className:u("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});ap.displayName="PaginationPrevious";var sp=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to next page",isIconOnly:false,className:u("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});sp.displayName="PaginationNext";var vR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},ip=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:u("flex items-center justify-center",vR[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});ip.displayName="PaginationEllipsis";var Yo=Z.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}));Yo.displayName="VisuallyHidden";var cp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},xR={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"},dp=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"),Ui=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"}}),os=Z.createContext(null),Ir=()=>{let e=Z.useContext(os);if(!e)throw new Error("Modal components must be used within a Modal");return e},mp=Z.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]=Z.useState(false),b=e!==void 0,v=b?e:g,[R,x]=Z.useState(false),w=Z.useRef(null),C=Z.useId(),y=Z.useId();Z.useEffect(()=>{x(true);},[]);let T=Z.useCallback(S=>{b||h(S),t?.(S);},[b,t]);Z.useEffect(()=>{if(v)return an(),()=>sn()},[v]),Z.useEffect(()=>{if(!v||i)return;let S=N=>{N.key==="Escape"&&T(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[v,i,T]);let D=S=>{s&&S.target===S.currentTarget&&T(false);},E=n?Z.isValidElement(n)?Z.cloneElement(n,{onClick:S=>{n.props.onClick?.(S),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,L=()=>!R||!v?null:d==="outside"?ja.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(dp(),cp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:D,children:jsxs("div",{ref:S=>{w.current=S,typeof p=="function"?p(S):p&&(p.current=S);},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(Yo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Ft,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):ja.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(dp(),cp[l]),onClick:D,"aria-hidden":"true"}),jsxs("div",{ref:S=>{w.current=S,typeof p=="function"?p(S):p&&(p.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":y,"data-state":v?"open":"closed",className:u(Ui({size:m}),xR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Yo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Ft,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(os.Provider,{value:{open:v,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:y},children:[E,L()]})});mp.displayName="Modal";var as=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(n),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),m=Z.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(os.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};as.displayName="ModalRoot";var pp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ir();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});pp.displayName="ModalTrigger";var ji=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};ji.displayName="ModalPortal";var _i=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Ir();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});_i.displayName="ModalOverlay";var fp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Ir();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});fp.displayName="ModalClose";var ss=Z.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}=Ir(),[f,p]=Z.useState(false);return Z.useEffect(()=>{p(true);},[]),Z.useEffect(()=>{if(l)return an(),()=>sn()},[l]),Z.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(ji,{children:[jsx(_i,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Ui({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Ft,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ss.displayName="ModalContent";var gp=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});gp.displayName="ModalHeader";var bp=({className:e,children:t})=>(Z.useContext(os)?.scrollBehavior??"inside")==="inside"?jsx(Ae,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});bp.displayName="ModalBody";var vp=({className:e,children:t,...n})=>{let{onOpenChange:r}=Ir();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:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};vp.displayName="ModalFooter";var hp=Z.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Ir();return jsx("h2",{ref:n,id:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});hp.displayName="ModalTitle";var xp=Z.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Ir();return jsx("p",{ref:n,id:r,className:u("text-sm text-muted-foreground",e),...t})});xp.displayName="ModalDescription";var Wi=Z.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}));Wi.displayName=Command.displayName;var wR=({children:e,...t})=>jsx(as,{...t,children:jsx(ss,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Wi,{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})})}),yp=Z.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})]}));yp.displayName=Command.Input.displayName;var Rp=Z.forwardRef(({className:e,children:t,...n},r)=>jsx(Ae,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:u("overflow-hidden",e),...n,children:t})}));Rp.displayName=Command.List.displayName;var wp=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));wp.displayName=Command.Empty.displayName;var Cp=Z.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}));Cp.displayName=Command.Group.displayName;var Tp=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:u("-mx-1 h-px bg-border",e),...t}));Tp.displayName=Command.Separator.displayName;var Mp=Z.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:u("relative flex cursor-default select-none items-center gap-2 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),...o,children:[n,t&&jsx("span",{className:"flex-1",children:t}),r]}));Mp.displayName=Command.Item.displayName;var Np=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Np.displayName="CommandShortcut";var MR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},NR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Pp=Z.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,m]=Z.useState(false),[f,p]=Z.useState(false),g=MR[s],h=NR[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:u("flex w-full border border-input bg-background py-2 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",g.input,h,t&&"pr-10",e),ref:c,disabled:n,style:{...a,borderColor:f?"var(--color-foreground)":void 0},onFocus:b=>{p(true),r?.(b);},onBlur:b=>{p(false),o?.(b);},...l}),t&&jsx("button",{type:"button",className:u("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",g.button),onClick:()=>m(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});Pp.displayName="PasswordInput";var SR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},LR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Ep=Z.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,disabled:l,size:c="md",radius:d="md",...m},f)=>{let[p,g]=Z.useState(s),[h,b]=Z.useState(false),v=a!==void 0,R=v?a:p,x=SR[c],w=LR[d],C=N=>{N!==void 0&&(r!==void 0&&N<r&&(N=r),o!==void 0&&N>o&&(N=o)),v||g(N),i?.(N);},y=()=>{C((R??0)+n);},T=()=>{C((R??0)-n);},D=N=>{let M=N.target.value;if(M==="")C(void 0);else {let k=parseFloat(M);isNaN(k)||C(k);}},E=N=>{N.key==="ArrowUp"?(N.preventDefault(),y()):N.key==="ArrowDown"&&(N.preventDefault(),T());},L=r===void 0||(R??0)>r,S=o===void 0||(R??0)<o;return t?jsxs("div",{className:u("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:T,disabled:l||!L,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input),ref:f,value:R??"",onChange:D,onKeyDown:E,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...m}),jsx("button",{type:"button",className:u("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:y,disabled:l||!S,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:u("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:f,value:R??"",onChange:D,onKeyDown:E,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...m})});Ep.displayName="NumberInput";var Hp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),Sp=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"}}),Ip=Z.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(Sr,{className:u(Sp({size:r})),children:[m.src&&jsx(so,{src:m.src,alt:m.alt||""}),jsx(Lr,{className:"text-xs",children:m.fallback||m.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&m.alt?jsxs(Rn,{children:[jsx(wn,{children:p}),jsx(Cn,{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(Hp({size:r,className:e})),...a,children:[i.map((m,f)=>c(m,f)),l>0&&jsx(Sr,{className:u(Sp({size:r})),children:jsxs(Lr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(tr,{delayDuration:300,children:d}):d});Ip.displayName="AvatarGroup";var Vp=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"}}),Ap=Z.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]=Z.useState(n),[b,v]=Z.useState(null),R=t!==void 0,x=R?t:g,w=b!==null?b:x,C=M=>{l||c||(R||h(M),r?.(M));},y=(M,k=false)=>{let P=i&&k?M+.5:M+1;C(P);},T=(M,k)=>{if(l||c)return;let P=M.currentTarget.getBoundingClientRect(),H=i&&M.clientX<P.left+P.width/2;v(H?k+.5:k+1);},D=()=>{v(null);},E=s==="heart"?Heart:Star,L=M=>w>=M+1?"full":w>=M+.5?"half":"empty",S=d?{color:d,fill:d}:{},N=m?{color:m}:{};return jsx("div",{ref:p,className:u(Vp({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:D,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(M,k)=>{let P=L(k);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:H=>{let I=H.currentTarget.getBoundingClientRect(),A=i&&H.clientX<I.left+I.width/2;y(k,A);},onMouseMove:H=>T(H,k),disabled:c||l,"aria-label":`Rate ${k+1} out of ${o}`,role:"radio","aria-checked":x===k+1,children:[jsx(E,{className:u("text-muted-foreground/30",P!=="empty"&&"absolute inset-0"),style:P==="empty"?N:void 0}),P!=="empty"&&jsx(E,{className:u("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",P==="half"&&"clip-path-half"),style:{...S,clipPath:P==="half"?"inset(0 50% 0 0)":void 0}})]},k)})})});Ap.displayName="Rating";var Op=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 cursor-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"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:""},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-md",md:"rounded-lg",lg:"rounded-xl",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-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"secondary",className:"text-secondary-foreground !border-secondary hover:bg-secondary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{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-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/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-green-600/15 text-green-600 hover:bg-green-600/20 dark:bg-green-500/15 dark:text-green-500 dark:hover:bg-green-500/20"},{variant:"soft",color:"warning",className:"bg-amber-600/15 text-amber-600 hover:bg-amber-600/20 dark:bg-amber-500/15 dark:text-amber-500 dark:hover:bg-amber-500/20"},{variant:"soft",color:"danger",className:"bg-red-600/15 text-red-600 hover:bg-red-600/20 dark:bg-red-500/15 dark:text-red-500 dark:hover:bg-red-500/20"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),OR={sm:"sm",md:"sm",lg:"sm"},Bp=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:m,onClick:f,...p},g)=>{let h=a||!!f,b=v=>{v.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:h?"button":void 0,tabIndex:h&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:f,onKeyDown:h&&!d?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f?.(v));}:void 0,className:u(Op({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...p,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:m}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Ft,{size:OR[r??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});Bp.displayName="Chip";var Fp=createContext({direction:"horizontal"}),_R=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Fp.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})}),WR=Panel,YR=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Fp),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 Up=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"}}),qR={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"}},Kp={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)"},jp=Z.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=qR[t],f=(m.size-m.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:u(Up({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:Kp[n]||Kp.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)})]})});jp.displayName="CircularProgress";var _p=Z.createContext(null),JR=()=>{let e=Z.useContext(_p);if(!e)throw new Error("OTP components must be used within InputOTP");return e},Wp=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"}}),Yp=Z.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,disabled:l=false,size:c,radius:d="md",children:m,...f},p)=>{let[g,h]=Z.useState(o),[b,v]=Z.useState(0),[R,x]=Z.useState(false),w=Z.useRef(null),C=r!==void 0?r:g;Z.useImperativeHandle(p,()=>w.current),Z.useEffect(()=>{v(Math.min(C.length,n-1));},[C,n]),Z.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let y=N=>{let M=N.target.value;if(i&&M){let k=new RegExp(i.replace("^","").replace("$","").replace("+",""));M=M.split("").filter(P=>k.test(P)).join("");}M=M.slice(0,n),r===void 0&&h(M),a?.(M);},T=N=>{N.key==="ArrowLeft"?v(M=>Math.max(0,M-1)):N.key==="ArrowRight"&&v(M=>Math.min(C.length,n-1,M+1));},D=()=>{w.current?.focus();},E=()=>{x(true),v(Math.min(C.length,n-1));},L=()=>{x(false);},S={value:C,activeIndex:R?b:-1,maxLength:n,disabled:l,radius:d};return jsx(_p.Provider,{value:S,children:jsxs("div",{className:u(Wp({size:c}),t),onClick:D,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:y,onKeyDown:T,onFocus:E,onBlur:L,disabled:l,maxLength:n,className:u("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),m]})})});Yp.displayName="InputOTP";var Xp=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center",e),...t}));Xp.displayName="InputOTPGroup";var ew={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},tw={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},qp=Z.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=JR(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":c,"data-filled":!!l,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:border-l",ew[i],tw[i],c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[l,d&&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"})})]})});qp.displayName="InputOTPSlot";var Zp=Z.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"})}));Zp.displayName="InputOTPSeparator";var ef=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 border-zinc-300 bg-transparent dark:border-zinc-700",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 border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover: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"}}),tf=Z.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]=Z.useState(""),R=Z.useRef(null);Z.useImperativeHandle(h,()=>R.current);let x=L=>{let S=L.trim();if(S.length<i||S.length>l||s&&r.length>=s||!d&&r.some(M=>M.text.toLowerCase()===S.toLowerCase()))return;let N={id:crypto.randomUUID(),text:S};o?.([...r,N]),v("");},w=L=>{m||f||o?.(r.filter(S=>S.id!==L));},C=L=>{if(c.includes(L.key)){if(L.key==="Tab"&&!b)return;L.preventDefault(),x(b);}L.key==="Backspace"&&!b&&r.length>0&&w(r[r.length-1].id);},y=L=>{let S=L.target.value;if(S.includes(",")){S.split(",").forEach(M=>{M.trim()&&x(M);});return}v(S);},T=L=>{L.preventDefault(),L.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(M=>{x(M);});},D=()=>{R.current?.focus();},E=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:D,children:[r.map(L=>p?p(L,()=>w(L.id)):jsxs("span",{className:u(ef({variant:t,size:n})),children:[L.text,!m&&!f&&jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),w(L.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${L.text}`,children:jsx(X,{className:"h-3 w-3"})})]},L.id)),!E&&!f&&jsx("input",{ref:R,type:"text",value:b,onChange:y,onKeyDown:C,onPaste:T,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})]})});tf.displayName="TagInput";var rf=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"}}),of=Z.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u(rf({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]}));of.displayName="EmptyState";var sf=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 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 border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),lf=Z.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(sf({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})]})});lf.displayName="StatCard";var ea=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",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),Qi=({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 ww({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:m}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:b,isDragging:v}=useSortable({id:e.id}),R={transform:CSS.Transform.toString(h),transition:b};return jsxs("div",{ref:g,...f,style:R,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:u("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",v&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[r&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...p,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(Qi,{checked:l,onClick:x=>m?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function Cw({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,emptyContent:R,children:x,...w},C){let[y,T]=Z.useState(false),[D,E]=Z.useState(null);Z.useEffect(()=>{T(true);},[]);let[L,S]=Z.useState(new Set(f)),N=m!==void 0,M=N?new Set(m):L,[k,P]=Z.useState(new Set(b)),H=h!==void 0,I=H?new Set(h):k,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),O=Z.useCallback(($,j)=>{if(!r)return;let _=new Set(M),B=!_.has($.id);d?B?_.add($.id):_.delete($.id):(_.clear(),B&&_.add($.id)),N||S(_);let q=r.filter(ee=>_.has(ee.id));p?.(Array.from(_),{selected:B,selectedItems:q,item:$,event:j});},[r,M,d,N,p]),V=Z.useCallback(($,j)=>{if(!r)return;let _=new Set(I),B=!_.has($.id);B?_.add($.id):_.delete($.id),H||P(_);let q=r.filter(ee=>_.has(ee.id));v?.(Array.from(_),{checked:B,checkedItems:q,item:$,event:j});},[r,I,H,v]),z=$=>{if(!r)return;let j=r.find(_=>_.id===$.active.id);j&&E(j);},K=$=>{let{active:j,over:_}=$;if(E(null),!r||!_||j.id===_.id)return;let B=r.findIndex(ee=>ee.id===j.id),q=r.findIndex(ee=>ee.id===_.id);if(B!==-1&&q!==-1){let ee=[...r],[Y]=ee.splice(B,1);ee.splice(q,0,Y),s?.(ee);}},X=(a||c||g)&&r&&o,F=t==="cards";return r&&r.length===0&&R?jsx("div",{ref:C,className:u("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:R}):X?a?y?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:z,onDragEnd:K,children:[jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map($=>$.id),strategy:verticalListSortingStrategy,children:r.map(($,j)=>jsx(ww,{item:$,index:j,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:M.has($.id),isChecked:I.has($.id),isCards:F,onSelect:O,onCheck:V},$.id))})}),jsx(DragOverlay,{children:D&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(D,r?.indexOf(D)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:r.map(($,j)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(Qi,{checked:I.has($.id),onClick:_=>V($,_)}),jsx("div",{className:"flex-1 min-w-0",children:o($,j)})]},$.id))}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:r.map(($,j)=>{let _=M.has($.id),B=I.has($.id);return jsxs("div",{role:"listitem","aria-selected":c?_:void 0,onClick:c&&!g?q=>O($,q):void 0,className:u("flex items-center gap-3 transition-all",F&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",F&&_&&"border-primary bg-accent",!F&&c&&!g&&"cursor-pointer hover:bg-muted/50",!F&&g&&"cursor-pointer hover:bg-muted/50",!F&&_&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Qi,{checked:B,onClick:q=>V($,q)}),jsx("div",{className:"flex-1 min-w-0",children:o($,j)})]},$.id)})}):jsx("div",{ref:C,role:"list",className:u(ea({variant:t,size:n,className:e})),...w,children:x})}var Tw=Z.forwardRef(Cw),uf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),mf=Z.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:u(uf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:r})]}));mf.displayName="ListItem";var pf=Z.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]}));pf.displayName="ListItemText";var bf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),vf=Z.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:u(bf({position:t,className:e})),...n}));vf.displayName="Timeline";var hf=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"}}),xf=Z.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(hf({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]}));xf.displayName="TimelineItem";var yf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 pt-0.5",e),...t}));yf.displayName="TimelineContent";var Rf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Rf.displayName="TimelineOpposite";var Cf=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}}),Tf=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}}),Mf=Z.createContext({}),Nf=Z.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,m]=Z.useState(a),f=o!==void 0?o:d,p=Z.useCallback(g=>{o===void 0&&m(g),s?.(g);},[o,s]);return jsx(Mf.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:u(Cf({size:t,fullWidth:n,className:e})),...l,children:r})})});Nf.displayName="SegmentedControl";var kf=Z.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=Z.useContext(Mf),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(Tf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});kf.displayName="SegmentedControlItem";var Pf=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"}}),Ef=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},ms=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]},Sf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${ms(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},Lf=Z.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]=Z.useState(false),[v,R]=Z.useState(false),[x,w]=Z.useState([]),C=Z.useRef(null),y=Z.useCallback(H=>{if(!H||H.length===0)return;let I=Array.from(H),A=[],O=[];(m?I:[I[0]]).forEach(z=>{let K=Sf(z,c,d);K.length>0?O.push({file:z,errors:K}):A.push(z);}),w(O),A.length>0&&r?.(A),O.length>0&&o?.(O);},[c,d,m,r,o]),T=Z.useCallback(H=>{if(H.preventDefault(),H.stopPropagation(),!f&&(b(true),H.dataTransfer.items)){let A=Array.from(H.dataTransfer.items).some(O=>{if(O.kind!=="file")return true;if(d&&d.length>0){let V=O.type;return !d.some(z=>z.endsWith("/*")?V.startsWith(z.slice(0,-2)):V===z)}return false});R(A);}},[f,d]),D=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!f&&(H.dataTransfer.dropEffect="copy");},[f]),E=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation();let I=H.currentTarget.getBoundingClientRect(),A=H.clientX,O=H.clientY;(A<I.left||A>I.right||O<I.top||O>I.bottom)&&(b(false),R(false));},[]),L=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),b(false),R(false),!f&&y(H.dataTransfer.files);},[f,y]),S=Z.useCallback(()=>{f||C.current?.click();},[f]),N=Z.useCallback(H=>{y(H.target.files),H.target.value="";},[y]),M=Z.useCallback(H=>{f||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),C.current?.click());},[f]),k=v?"error":h?"active":t,P=d?.join(",");return jsxs("div",{ref:g,className:u("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:D,onDragLeave:E,onDrop:L,onClick:S,onKeyDown:M,className:u(Pf({variant:k,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:P,multiple:m,disabled:f,onChange:N,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 ${ms(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),x.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:x.map(({file:H,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:H.name}),":"," ",I.map(A=>A.message).join(", ")]},H.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(H=>{let I=Ef(H.file);return jsxs("div",{className:u("flex items-center gap-3 rounded-lg border p-3",H.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(I,{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:H.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[ms(H.file.size),H.error&&jsx("span",{className:"ml-2 text-danger",children:H.error})]}),H.progress!==void 0&&H.progress<100&&jsx(Qa,{value:H.progress,className:"mt-2 h-1"})]}),jsxs(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(H.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},H.id)})})]})});Lf.displayName="FileUpload";var Iw=`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")`,Hf=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}}),ra=Z.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...m},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:u(Hf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?Iw:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...m,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));ra.displayName="ColorSwatch";var If=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Vf=Z.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",disabled:l,selectedRingColor:c,className:d,style:m,...f},p)=>{let[g,h]=Z.useState(t),b=e??g,v=Z.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),R=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:u(If({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...m},...f,children:a.map(x=>{let w=b?R(b)===R(x):false;return jsx(ra,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:v,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});Vf.displayName="ColorSwatchPicker";var zw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Af={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},zf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=zw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,m]=Z.useState(e??t),f=Z.useId();Z.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",Af[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(bt,{children:[jsx(nr,{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",Af[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(vt,{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(Er,{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 text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Er,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(ra,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});zf.displayName="ColorPicker";var Of=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"}}),el=e=>String(e).padStart(2,"0"),$w=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},Gw=(e,t)=>`${el(e)}:${el(t)}`,Bf=Z.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]=Z.useState(n??""),[g,h]=Z.useState(false);Z.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=$w(f||"00:00"),R=E=>{let L=E.target.value;p(L),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(L)&&r?.(L);},x=(E,L)=>{let S=Math.max(0,Math.min(23,E)),N=Math.max(0,Math.min(59,L)),M=Gw(S,N);p(M),r?.(M);},w=()=>x(b+1,v),C=()=>x(b-1,v),y=()=>x(b,v+a),T=()=>x(b,v-a),D=({value:E,onIncrement:L,onDecrement:S})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L,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:el(E)}),jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:S,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(Of({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(bt,{open:g,onOpenChange:h,children:[jsxs(nr,{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(vt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(D,{value:b,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(D,{value:v,onIncrement:y,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(me,{variant:"bordered",size:"sm",onClick:()=>{let E=new Date;x(E.getHours(),E.getMinutes());},children:"Now"}),jsx(me,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});Bf.displayName="TimeInput";var Ff=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 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"}}),jw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},_w=(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}},tl=(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},Kf=(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},$f=Z.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=".",radius:h="md",disabled:b,placeholder:v,...R},x)=>{let[w,C]=Z.useState(r),[y,T]=Z.useState(""),[D,E]=Z.useState(false),L=n!==void 0?n:w,S=f??_w(a,s);Z.useEffect(()=>{!D&&L!==void 0&&T(tl(L,i,p,g));},[L,i,p,g,D]);let N=I=>{let A=I.target.value;if(!A){T(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${p}${g}.-]*$`).test(A))return;T(A);let V=Kf(A,p,g);if(V!==void 0){let z=V;l!==void 0&&V<l&&(z=l),c!==void 0&&V>c&&(z=c),n===void 0&&C(z),o?.(z);}},M=()=>{E(true),L!==void 0&&T(L.toString().replace(".",g));},k=()=>{E(false),T(L!==void 0?tl(L,i,p,g):"");},P=d&&m==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:S}),H=d&&m==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:S});return jsxs("div",{className:"relative flex items-center",children:[P&&jsx("div",{className:"absolute left-3 pointer-events-none",children:P}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:y,onChange:N,onFocus:M,onBlur:k,disabled:b,placeholder:v??`0${g}${"0".repeat(i)}`,className:u(Ff({size:t}),jw[h],P&&"pl-8",H&&"pr-8","text-right",e),style:{borderColor:D?"var(--color-foreground)":void 0},...R}),H&&jsx("div",{className:"absolute right-3 pointer-events-none",children:H})]})});$f.displayName="CurrencyInput";var Gf=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"}}),nl={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:"#####-####"}},Xw=(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}},cr=e=>["#","A","*"].includes(e),fs=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(cr(s)){if(o<e.length){let i=e[o];Xw(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},rl=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];cr(o)&&(n+=e[r]);}return n},Uf=(e,t)=>e.split("").map(n=>cr(n)?t:n).join(""),qw=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)cr(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,cr(t[i])&&s++;for(;a<t.length&&!cr(t[a]);)a++;return Math.min(a,e.length)},jf=Z.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 nl?nl[a].mask:a,[g,h]=Z.useState(r),[b,v]=Z.useState(""),[R,x]=Z.useState(false),w=Z.useRef(null),C=n!==void 0?n:g;Z.useImperativeHandle(f,()=>w.current),Z.useEffect(()=>{let E=fs(C,p,true);v(E);},[C,p]);let y=E=>{let L=E.target.value,S=E.target.selectionStart??0,N=L.replace(/[^\w]/g,""),M=fs(N,p,true),k=rl(M,p);v(M),n===void 0&&h(l?M:k),o?.(k,M),requestAnimationFrame(()=>{if(w.current){let P=qw(M,p,S);w.current.setSelectionRange(P,P);}});},T=E=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(E.key)||E.ctrlKey||E.metaKey)return;let L=w.current;if(!L)return;let S=L.selectionStart??0;if(E.key==="Backspace"&&S>0){let N=S-1;for(;N>0&&!cr(p[N]);)N--;let M=rl(b,p),k=0;for(let I=0;I<N&&I<p.length;I++)cr(p[I])&&k++;let P=M.slice(0,Math.max(0,k-1))+M.slice(k),H=fs(P,p,true);v(H),n===void 0&&h(l?H:P),o?.(P,H),E.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(N,N);});}},D=i?Uf(p,s):d;return jsx("input",{ref:w,type:"text",value:b,onChange:y,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:D,className:u(Gf({size:t}),e),style:{borderColor:R?"var(--color-foreground)":void 0},...m})});jf.displayName="MaskedInput";var tC=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"}}),Wf=[{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},nC=e=>e.replace(/#/g,"_"),Yf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Wf,showCountrySelect:c=true,showDialCode:d=false,disabled:m,placeholder:f,radius:p="md",...g},h)=>{let[b,v]=Z.useState(r),[R,x]=Z.useState(a??s),[w,C]=Z.useState(false),[y,T]=Z.useState(false),[D,E]=Z.useState(false),[L,S]=Z.useState({top:0,left:0,width:0}),N=Z.useRef(null),M=Z.useRef(null),k=n!==void 0?n:b,P=a??R,H=l.find(G=>G.code===P)??l[0],I=gs(k,H.format);Z.useEffect(()=>{E(true);},[]),Z.useEffect(()=>{if(y&&N.current){let G=N.current.getBoundingClientRect();S({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[y]),Z.useEffect(()=>{if(!y)return;let G=X=>{N.current&&!N.current.contains(X.target)&&M.current&&!M.current.contains(X.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[y]),Z.useEffect(()=>{if(!y)return;let G=X=>{X.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[y]),Z.useEffect(()=>{if(!y)return;let G=()=>{T(false);};return window.addEventListener("scroll",G,true),()=>window.removeEventListener("scroll",G,true)},[y]);let A=G=>{let F=G.target.value.replace(/\D/g,"");n===void 0&&v(F);let $=gs(F,H.format),j=`${H.dialCode} ${$}`;o?.(F,j,H);},O=G=>{let X=l.find(j=>j.code===G);if(!X)return;a===void 0&&x(G),i?.(X);let F=gs(k,X.format),$=`${X.dialCode} ${F}`;o?.(k,$,X),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",z=w||y;return jsxs("div",{className:u("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],m&&"cursor-not-allowed opacity-50"),style:{borderColor:z?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:N,type:"button",disabled:m,onClick:()=>T(!y),className:u("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",V),style:{borderColor:z?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:H.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:H.dialCode})]}),jsx(ChevronDown,{className:u("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]}),D&&y&&ja.createPortal(jsx("div",{ref:M,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:L.top,left:L.left,minWidth:L.width},children:jsx(Ae,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===P,onClick:()=>O(G.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:G.code===P&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:G.flag}),jsx("span",{className:"flex-1",children:G.name}),jsx("span",{className:"text-xs text-muted-foreground",children:G.dialCode})]})]},G.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:H.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:m,placeholder:f??nC(H.format),className:u("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});Yf.displayName="PhoneInput";var qf=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",bordered:"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:"bordered",size:"md",sticky:false}}),Zf=Z.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.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(qf({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})]})});Zf.displayName="Navbar";var Qf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex items-center gap-2 font-semibold text-lg",e),...t}));Qf.displayName="NavbarBrand";var Jf=Z.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})});Jf.displayName="NavbarContent";var eg=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:u("flex items-center",t&&"text-primary font-medium",e),...n}));eg.displayName="NavbarItem";var tg=Z.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}));tg.displayName="NavbarLink";var lC={none:"",hover:"hover:underline",always:"underline"},ng={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},og=Z.forwardRef(({className:e,color:t="primary",underline:n="hover",isExternal:r,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=r?{target:"_blank",rel:"noopener noreferrer"}:{},m=t in ng,f=m?i:{color:t,...i};return jsxs("a",{ref:c,className:u("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m&&ng[t],lC[n],a&&"pointer-events-none opacity-50",e),style:f,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});og.displayName="Link";var ag=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"}}),sg=Z.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]=Z.useState(false);Z.useEffect(()=>{let R=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return R.addEventListener("scroll",x,{passive:true}),x(),()=>{R.removeEventListener("scroll",x);}},[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(ag({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(me,{ref:p,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:b,"aria-label":"Back to top",className:"shadow-lg",...f,children:r||jsx(ArrowUp,{className:v})})})});sg.displayName="BackTop";var bC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),vC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),ig=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"}}),lg=Z.createContext(null),ur=()=>{let e=Z.useContext(lg);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},cg=Z.createContext(null),aa=()=>{let e=Z.useContext(cg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},al=Z.createContext(null),dg=Z.createContext(null),ug=Z.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=Z.useState(null);return jsx(lg.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",bC({radius:n}),e),...r,children:t})})});ug.displayName="Menubar";var mg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=ur(),r=Z.useId(),o=Z.useRef(null),a=t===r,s=Z.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(cg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};mg.displayName="MenubarMenu";var pg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));pg.displayName="MenubarGroup";var fg=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?ja.createPortal(e,t||document.body):null};fg.displayName="MenubarPortal";var gg=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(al.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};gg.displayName="MenubarSub";var bg=Z.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(dg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));bg.displayName="MenubarRadioGroup";var vg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=ur(),{menuId:l,triggerRef:c,open:d,onOpenChange:m}=aa(),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",vC({radius:i}),e),onClick:f,onMouseEnter:p,...r})});vg.displayName="MenubarTrigger";var hg=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=ur(),l=Z.useContext(al);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"})]})});hg.displayName="MenubarSubTrigger";var xg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=ur(),i=Z.useContext(al);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!h.current)return;(()=>{if(!d.current||!h.current)return;let x=d.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),C=x.top,y=x.right+t;y+w.width>window.innerWidth&&(y=x.left-w.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:ja.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",ig({radius:s}),e),style:{top:m.top,left:m.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});xg.displayName="MenubarSubContent";var yg=Z.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=ur(),{triggerRef:l,open:c,onOpenChange:d}=aa(),[m,f]=Z.useState({top:0,left:0}),[p,g]=Z.useState(false),h=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.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(),x=v.bottom+r,w=v.left+n;t==="center"?w=v.left+v.width/2-R.width/2:t==="end"&&(w=v.right-R.width-n),f({top:x,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]),Z.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]),Z.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:ja.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",ig({radius:i}),e),style:{top:m.top,left:m.left},...a,children:o}),document.body)});yg.displayName="MenubarContent";var Rg=Z.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=ur(),{onOpenChange:l}=aa(),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})});Rg.displayName="MenubarItem";var wg=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=ur(),{onOpenChange:c}=aa(),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]})});wg.displayName="MenubarCheckboxItem";var Cg=Z.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=ur(),{onOpenChange:l}=aa(),c=Z.useContext(dg),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]})});Cg.displayName="MenubarRadioItem";var sl=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:u("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));sl.displayName="MenubarSection";var hC=sl,Tg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:u("-mx-1 my-1 h-px bg-muted",e),...t}));Tg.displayName="MenubarSeparator";var Mg=({className:e,...t})=>jsx("span",{className:u("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mg.displayName="MenubarShortcut";var Ng=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=Z.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:u(Ng({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.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 Pg=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"}}),yC=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"}}),RC=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"}}),Eg=Z.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(Pg({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(yC({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(RC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Eg.displayName="Step";var Lg=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"}}),Dg=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}}),Hg=Z.createContext(null),EC=()=>{let e=Z.useContext(Hg);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},SC=({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"})})}),Ig=({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:x,allowDrop:w,onDragStart:C,onDragOver:y,onDragEnter:T,onDragLeave:D,onDragEnd:E,showLine:L,showIcon:S,showHandle:N,dragIcon:M,icon:k,leafIcon:P,folderIcon:H,folderOpenIcon:I,blockNode:A,disabled:O,size:V,getAllKeys:z}=EC(),K=e.children&&e.children.length>0,G=e.isLeaf??!K,X=o.has(e.key),F=s.has(e.key),$=c.has(e.key),j=d.has(e.key),_=g?.key===e.key,B=b===e.key,q=!!(O||e.disabled),ee=l&&e.selectable!==false,Y=f&&e.checkable!==false,ve=Z.useMemo(()=>q?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,q]),Q=Z.useMemo(()=>M!==void 0?M:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[M,p]),ne=Z.useMemo(()=>e.icon?e.icon:k?typeof k=="function"?k({expanded:X,isLeaf:G}):k:G?P:X?I:H,[e.icon,k,X,G,P,H,I]),Te=U=>{if(!ve)return;U.stopPropagation(),U.dataTransfer.effectAllowed="move";let de=U.currentTarget,ue=de.cloneNode(true),Be=document.documentElement.classList.contains("dark"),$e=Be?"#0a0a0a":"#ffffff",yn=Be?"#27272a":"#e4e4e7";ue.style.cssText=`
44
44
  position: fixed;
45
45
  top: -9999px;
46
46
  left: -9999px;
47
47
  background-color: ${$e};
48
- border: 1px solid ${Rn};
48
+ border: 1px solid ${yn};
49
49
  border-radius: 6px;
50
50
  padding: 6px 12px;
51
51
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
52
52
  width: ${de.offsetWidth}px;
53
53
  opacity: 1;
54
54
  z-index: 9999;
55
- `,document.body.appendChild(ue),U.dataTransfer.setDragImage(ue,20,15),setTimeout(()=>{document.body.removeChild(ue);},0),h(e),C?.({event:U,node:e});},fe=U=>{if(U.preventDefault(),U.stopPropagation(),!g||g.key===e.key||q)return;let de=U.currentTarget.getBoundingClientRect(),ue=U.clientY-de.top,Be=de.height,$e;ue<Be*.25?$e=-1:ue>Be*.75?$e=1:$e=0,!(w&&!w({dropNode:e,dropPosition:$e,dragNode:g}))&&(R(e.key,$e),y?.({event:U,node:e}));},Ye=U=>{U.preventDefault(),U.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:U,node:e,expandedKeys:z()});},Ze=U=>{U.stopPropagation(),D?.({event:U,node:e});},Mt=U=>{U.preventDefault(),U.stopPropagation(),!(!g||g.key===e.key||q)&&(v!==null&&x(e,v),h(null),R(null,null));},Pe=U=>{h(null),R(null,null),P?.({event:U,node:e});},ct=U=>{q||ee&&i(e.key,e,U);},J=U=>{U.stopPropagation(),!q&&!G&&a(e.key,e);},W=Z.useMemo(()=>{if(!B||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 ""}},[B,v]),ae=[...r,n];return jsxs("div",{className:"relative",children:[S&&t>0&&jsxs(Fragment,{children:[r.map((U,de)=>!U&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${de} * var(--tree-indent) + 12px)`,top:0,bottom:0}},de)),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":G?void 0:X,"aria-selected":ee?F:void 0,"aria-disabled":q,draggable:he,onDragStart:Me,onDragOver:fe,onDragEnter:Ye,onDragLeave:Ze,onDrop:Mt,onDragEnd:Pe,onClick:ct,className:u("relative",Dg({size:V,isSelected:F,isDragging:_,isDisabled:q,isHoverable:ee&&!q}),W,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[he&&N&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:J,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",X&&"rotate-90")})}),Y&&jsx(SC,{checked:$,indeterminate:j,disabled:q,onClick:U=>m(e.key,e,U)}),L&&ne&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:ne}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),K&&X&&jsx("div",{role:"group",children:e.children.map((U,de)=>jsx(Ig,{node:U,level:t+1,isLast:de===e.children.length-1,parentIsLastPath:ae},U.key))})]})},LC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},DC=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},Vg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Vg(n,t))return true;return false},Ag=Z.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:x,showLine:w=false,showIcon:C=false,showHandle:y=true,dragIcon:T,icon:D,leafIcon:P=jsx(File,{className:"h-4 w-4"}),folderIcon:S=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:L=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:N,onDragEnter:M,onDragOver:E,onDragLeave:k,onDragEnd:H,onDrop:I,blockNode:A=false,disabled:O=false,...V},z)=>{let K=Z.useCallback(()=>l?new Set(LC(r)):new Set(i),[l,i,r]),[G,X]=Z.useState(K),F=s!==void 0,$=F?new Set(s):G,j=Z.useCallback((Re,Qe)=>{let Bt=new Set($),Ge=!Bt.has(Re);Ge?Bt.add(Re):Bt.delete(Re),F||X(Bt),c?.(Array.from(Bt),{expanded:Ge,node:Qe});},[$,F,c]),[_,B]=Z.useState(new Set(p)),q=f!==void 0,ee=q?new Set(f):_,Y=Z.useCallback((Re,Qe,Bt)=>{let Ge=new Set(ee),re=!Ge.has(Re);m?re?Ge.add(Re):Ge.delete(Re):(Ge.clear(),re&&Ge.add(Re)),q||B(Ge);let we=[],Mr=Sa=>{for(let Jr of Sa)Ge.has(Jr.key)&&we.push(Jr),Jr.children&&Mr(Jr.children);};Mr(r),g?.(Array.from(Ge),{selected:re,selectedNodes:we,node:Qe,event:Bt});},[ee,m,q,g,r]),[he,Q]=Z.useState(new Set(R)),[ne,Me]=Z.useState(new Set),fe=v!==void 0,Ye=fe?new Set(Array.isArray(v)?v:v.checked):he,Ze=fe&&!Array.isArray(v)?new Set(v.halfChecked):ne,Mt=Z.useCallback((Re,Qe,Bt)=>{let Ge=new Set(Ye),re=new Set(Ze),we=!Ge.has(Re);if(we?(Ge.add(Re),re.delete(Re)):Ge.delete(Re),!b&&Qe.children){let bi=DC(Qe);for(let Jn of bi)we?(Ge.add(Jn),re.delete(Jn)):Ge.delete(Jn);}fe||(Q(Ge),Me(re));let Mr=[],Sa=bi=>{for(let Jn of bi)Ge.has(Jn.key)&&Mr.push(Jn),Jn.children&&Sa(Jn.children);};Sa(r);let Jr=b?{checked:Array.from(Ge),halfChecked:Array.from(re)}:Array.from(Ge);x?.(Jr,{checked:we,checkedNodes:Mr,node:Qe,event:Bt,halfCheckedKeys:Array.from(re)});},[Ye,Ze,b,fe,x,r]),[Pe,ct]=Z.useState(null),[J,W]=Z.useState(null),[ae,U]=Z.useState(null),de=Z.useCallback((Re,Qe)=>{W(Re),U(Qe);},[]),ue=Z.useCallback((Re,Qe)=>{!Pe||!I||Qe===0&&Vg(Pe,Re.key)||I({event:{},node:Re,dragNode:Pe,dropPosition:Qe,dropToGap:Qe!==0});},[Pe,I]),Be=Z.useCallback(()=>Array.from($),[$]),$e={expandedKeys:$,toggleExpand:j,selectedKeys:ee,handleSelect:Y,selectable:d,multiple:m,checkedKeys:Ye,halfCheckedKeys:Ze,handleCheck:Mt,checkable:h,checkStrictly:b,draggable:o,draggedNode:Pe,setDraggedNode:ct,dragOverKey:J,dragOverPosition:ae,setDragOver:de,handleDrop:ue,allowDrop:a,onDragStart:N,onDragEnter:M,onDragOver:E,onDragLeave:k,onDragEnd:H,showLine:w,showIcon:C,showHandle:y,dragIcon:T,icon:D,leafIcon:P,folderIcon:S,folderOpenIcon:L,blockNode:A,disabled:O,size:n,data:r,getAllKeys:Be},Rn=Re=>{let Qe=Re.relatedTarget,Bt=Re.currentTarget;(!Qe||!Bt.contains(Qe))&&de(null,null);};return jsx(Hg.Provider,{value:$e,children:jsx("div",{ref:z,role:"tree","aria-multiselectable":m||h,className:u(Lg({variant:t,size:n,className:e})),onDragLeave:Rn,...V,children:r.map((Re,Qe)=>jsx(Ig,{node:Re,level:0,isLast:Qe===r.length-1},Re.key))})})});Ag.displayName="Tree";var Og=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-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),OC=({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))})},BC=(e,t)=>{let[n,r]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},Bg=Z.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,...x},w)=>{let[C,y]=Z.useState(false),[T,D]=Z.useState(r),[P,S]=Z.useState([]),[L,N]=Z.useState(false),[M,E]=Z.useState(false),[k,H]=Z.useState(0),I=Z.useRef(null),A=Z.useRef(null),O=n!==void 0?n:T,V=BC(O,l);Z.useEffect(()=>{let Y=A.current;if(!Y)return;let he=()=>{H(Y.offsetWidth);};he();let Q=new ResizeObserver(he);return Q.observe(Y),()=>{Q.disconnect();}},[]),Z.useImperativeHandle(w,()=>I.current);let z=i?P:s,K=Z.useMemo(()=>i?z:z.filter(Y=>Y.label.toLowerCase().includes(O.toLowerCase())),[z,O,i]);Z.useEffect(()=>{if(!i)return;if(V.length<c){S([]);return}let Y=false;return (async()=>{N(true);try{let Q=await i(V);Y||S(Q);}catch{Y||S([]);}finally{Y||N(false);}})(),()=>{Y=true;}},[V,i,c]);let G=Y=>{n===void 0&&D(Y),o?.(Y);},X$1=Y=>{let he=Y.target.value;G(he),he.length>=c&&y(true);},F=Y=>{G(Y.label),a?.(Y),y(false);},$=()=>{G(""),I.current?.focus();},j=()=>{E(true),y(true);},_=()=>{E(false);},B=Y=>{Y.key==="Escape"&&y(false),Y.key==="ArrowDown"&&!C&&K.length>0&&y(true);},q=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ee=p&&O?"pr-8":"pr-3";return jsxs(vt,{open:C,onOpenChange:y,children:[jsxs(Tn,{ref:A,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:O,onChange:X$1,onFocus:j,onBlur:_,onKeyDown:B,disabled:R,placeholder:d,className:u(Og({size:t,fullWidth:v}),ee,e),style:{borderColor:M?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&O&&!R&&jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:q})})]}),jsx(ht,{className:"p-0",align:"start",style:{width:k>0?k:void 0},onOpenAutoFocus:Y=>Y.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ae,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:L?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(q,"animate-spin")}),f]}):K.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):K.map(Y=>jsxs(Command.Item,{value:Y.value,disabled:Y.disabled,onSelect:()=>F(Y),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",O===Y.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(OC,{text:Y.label,query:O}):Y.label})]},Y.value))})})})})]})});Bg.displayName="Autocomplete";var ul=Z.createContext(null),ml=Z.createContext(null),pl=()=>{let e=Z.useContext(ul);if(!e)throw new Error("useFormContext must be used within a Form");return e},Rs=()=>{let e=Z.useContext(ml);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},FC={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})},Fg=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[m,f]=Z.useState({}),[p,g]=Z.useState({}),[h,b]=Z.useState({}),[v,R]=Z.useState(false),x=Z.useRef(new Map),w=Z.useCallback((k,H)=>{x.current.set(k,H);},[]),C=Z.useCallback(k=>{x.current.delete(k);},[]),y=Z.useCallback(k=>{let H=x.current.get(k)||[],I=c[k];for(let A of H)if(!A.validate(I))return f(O=>({...O,[k]:A.message})),false;return f(A=>({...A,[k]:null})),true},[c]),T=Z.useCallback(()=>{let k=true,H={};return x.current.forEach((I,A)=>{let O=c[A];for(let V of I)if(!V.validate(O)){H[A]=V.message,k=false;break}H[A]||(H[A]=null);}),f(H),k},[c]),D=Z.useCallback((k,H)=>{d(I=>({...I,[k]:H})),b(I=>({...I,[k]:true})),o&&setTimeout(()=>{y(k);},0);},[o,y]),P=Z.useCallback((k,H)=>{f(I=>({...I,[k]:H}));},[]),S=Z.useCallback((k,H)=>{g(I=>({...I,[k]:H})),H&&r&&y(k);},[r,y]),L=Z.useCallback(k=>({value:c[k],error:m[k]??null,touched:p[k]??false,dirty:h[k]??false}),[c,m,p,h]),N=Z.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),M=async k=>{k.preventDefault();let H={};if(x.current.forEach((A,O)=>{H[O]=true;}),g(H),!T()){n?.(m);return}if(t){R(true);try{await t(c);}finally{R(false);}}},E={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:D,setError:P,setTouched:S,validateField:y,validateAll:T,registerField:w,unregisterField:C,getFieldState:L,reset:N};return jsx(ul.Provider,{value:E,children:jsx("form",{ref:l,onSubmit:M,className:u("space-y-4",s),...i,children:a})})});Fg.displayName="Form";var Kg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=pl(),a=Z.useId();Z.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(ml.Provider,{value:i,children:r})};Kg.displayName="FormField";var $g=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));$g.displayName="FormItem";var Gg=Z.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Rs();return jsxs(Er,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});Gg.displayName="FormLabel";var Ug=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Rs(),a=pl(),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 Z.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})};Ug.displayName="FormControl";var jg=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));jg.displayName="FormDescription";var _g=Z.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});_g.displayName="FormMessage";var Yg=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"}}),Xg=Z.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(Yg({size:t,className:e})),...i,children:[jsxs(Sr,{"data-user-avatar":true,children:[o&&jsx(so,{src:o,alt:n}),jsx(Lr,{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})]})});Xg.displayName="User";var Zg=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},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"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),Qg=Z.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:u(Zg({variant:t,size:n,radius:r,className:e})),...o}));Qg.displayName="Code";function nb(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var rb=Z.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=nb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((v,R)=>jsxs("div",{...h({line:v}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:R+1}),v.map((x,w)=>jsx("span",{...b({token:x})},w))]},R))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});rb.displayName="CodeBlock";var ob=Z.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=nb(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:r,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((b,v)=>jsx("div",{...g({line:b}),children:b.map((R,x)=>jsx("span",{...h({token:R})},x))},v))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});ob.displayName="TabbedCodeBlock";var ab=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",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"}}),sb=Z.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]=Z.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(ab({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"})})]})});sb.displayName="Snippet";var vl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),ib=Z.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]=Z.useState("loading");Z.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(vl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(vl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Ba,{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})]})});ib.displayName="Image";var cb=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"}}),db=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 JC({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=Z.useState(null),[f,p]=Z.useState(null),g=(x,w)=>{i||(m(w),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(w)));},h=(x,w)=>{x.preventDefault(),!(i||d===null||d===w)&&p(w);},b=()=>{p(null);},v=(x,w)=>{if(x.preventDefault(),i||d===null||d===w){m(null),p(null);return}let C=[...r],[y]=C.splice(d,1);C.splice(w,0,y),o?.(C),m(null),p(null);},R=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(cb({variant:t,size:n,className:e})),...l,children:r.map((x,w)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,w),onDragOver:C=>h(C,w),onDragLeave:b,onDrop:C=>v(C,w),onDragEnd:R,className:u(db({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(x,w)})]},x.id))})}var eT=Z.forwardRef(JC);var fb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{variant:"spinner",size:"md"}}),ub={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},oT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},mb={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},gb=Z.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in mb,l=i?mb[o]:"",c=i?void 0:{color:o},d=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",style:c,children:[0,1,2].map(m=>jsx("div",{className:u(oT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${m*.15}s`}},m))});case "pulse":return jsx("div",{className:u(ub[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:u(ub[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:u(fb({variant:t,size:n,className:e})),role:"status","aria-label":r||"Loading",...a,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[d(),r&&jsx("span",{className:u("text-sm",l),style:c,children:r})]})})});gb.displayName="Loading";var iT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),lT=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",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),cT=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"}}),dT=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"}}),Es={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},xl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},hl=(e,t)=>String(e).padStart(t,"0"),bb=(e,t)=>{if(!e)return "";let n=hl(e.getDate(),2),r=hl(e.getMonth()+1,2),o=hl(e.getFullYear(),4),a=Es[t],s=xl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ns=(e,t)=>{let n=Es[t],r=e.split(n);if(r.length!==3)return null;let o=xl[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},uT=e=>{let t=Es[e];return xl[e].map(r=>r==="year"?"####":"##").join(t)},ca=(e,t)=>{if(!e?.from)return "";let n=bb(e.from,t),r=e.to?bb(e.to,t):"";return n&&r?`${n} - ${r}`:n},vb=Z.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="dd.MM.yyyy",showPickerIcon:v=true,mode:R="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:y,placeholder:T,id:D,...P},S)=>{let L=Z.useId(),N=D||L,M=`${N}-description`,E=`${N}-error`,[k,H]=Z.useState(f),[I,A]=Z.useState(""),[O,V]=Z.useState(false),[z,K]=Z.useState(false),G=m!==void 0?m:k,X=a&&r,F=uT(b),$=Es[b],j=" - ";Z.useEffect(()=>{z||A(ca(G,b));},[G,b,z]);let _=ne=>{m===void 0&&H(ne),p?.(ne);},B=ne=>{_(ne),A(ca(ne,b)),ne?.from&&ne?.to&&V(false);},q=ne=>{let Me=ne.target.value;Me=Me.replace(new RegExp(`[^0-9\\${$}\\s-]`,"g"),"");let fe=`${F}${j}${F}`,Ye=Me.replace(new RegExp(`[\\${$}\\s-]`,"g"),""),Ze="",Mt=0;for(let Pe=0;Pe<fe.length&&Mt<Ye.length;Pe++)fe[Pe]==="#"?(Ze+=Ye[Mt],Mt++):Ze+=fe[Pe];if(A(Ze),Ze.length===fe.length){let Pe=Ze.split(j);if(Pe.length===2){let ct=Ns(Pe[0].trim(),b),J=Ns(Pe[1].trim(),b);if(ct&&J){if(g&&(ct<g||J<g)||h&&(ct>h||J>h))return;ct<=J&&_({from:ct,to:J});}}}},ee=()=>{K(true);},Y=()=>{K(false);let ne=`${F}${j}${F}`;if(I.length!==ne.length)A(ca(G,b));else {let Me=I.split(j);if(Me.length!==2)A(ca(G,b));else {let fe=Ns(Me[0].trim(),b),Ye=Ns(Me[1].trim(),b);(!fe||!Ye||fe>Ye)&&A(ca(G,b));}}},he=()=>{y||V(true);},Q=()=>{!y&&R==="picker"&&v&&V(true);};return jsxs("div",{className:u(iT({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:u(dT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(vt,{open:v&&O,onOpenChange:V,children:[jsxs(Tn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:S,id:N,type:"text",inputMode:R==="text"?"numeric":void 0,value:I,onChange:R==="text"?q:void 0,onClick:Q,onFocus:ee,onBlur:Y,readOnly:R==="picker","aria-invalid":a,"aria-describedby":X?E:n?M:void 0,"aria-required":o,disabled:y,placeholder:T||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:u(lT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),R==="picker"&&v&&"cursor-pointer",l),style:{borderColor:z||v&&O?"var(--color-foreground)":void 0},...P}),v&&jsx("button",{type:"button",onClick:he,disabled:y,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(cT({size:s}))})})]}),v&&jsx(ht,{className:"w-auto p-0",align:C,children:jsx(lo,{mode:"range",selected:G,onSelect:B,numberOfMonths:w,disabled:ne=>!!(g&&ne<g||h&&ne>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!X&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),X&&jsx("p",{id:E,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});vb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),hb=Z.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]=Z.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),m=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${ho(x.hours)}:${ho(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${ho(w)}:${ho(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let y=e.hours>=12;y&&x!==12?C=x+12:!y&&x===12&&(C=0);}t?.({hours:C,minutes:w});},g=x=>{let w=e?.hours??0;t?.({hours:w,minutes:x});},h=x=>{if(!e)return;let w=e.hours;x==="AM"&&e.hours>=12?w=e.hours-12:x==="PM"&&e.hours<12&&(w=e.hours+12),t?.({hours:w,minutes:e.minutes});},b=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,R=e?r?e.hours:e.hours%12||12:void 0;return jsxs(vt,{open:l,onOpenChange:c,children:[jsxs(nr,{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(ht,{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(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(me,{variant:R===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:ho(x)},x))})})]}),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(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(x=>jsx(me,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:ho(x)},x))})})]}),!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(me,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(me,{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(me,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(me,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});hb.displayName="TimePicker";var xb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function fT({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=Z.useRef(null),[p,g]=Z.useState(0);Z.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,x=Math.min(n.length-1,v+R),w=y=>{let T=y.currentTarget.scrollTop;g(T),c?.(T);},C=Z.useMemo(()=>{let y=[];for(let T=v;T<=x;T++)n[T]!==void 0&&y.push({item:n[T],index:T,style:{position:"absolute",top:T*b,left:0,right:0,height:r}});return y},[n,v,x,b,r]);return jsx("div",{ref:f,className:u(xb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:y,index:T,style:D})=>jsx("div",{style:D,children:s(y,T)},i?i(y,T):T))})})}var gT=Z.forwardRef(fT);var Rl=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),wl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Rb=Z.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,scrollbarVisibility:f="visible",...p},g)=>{let h=Z.useRef(null),b=Z.useRef(null),v=Z.useRef(false);Z.useImperativeHandle(g,()=>h.current),Z.useEffect(()=>{let w=b.current;if(!w)return;let C=new IntersectionObserver(y=>{let[T]=y;T.isIntersecting&&a&&!s&&!v.current&&(v.current=true,Promise.resolve(o()).finally(()=>{v.current=false;}));},{root:d?null:h.current,rootMargin:c||`${l}px`,threshold:0});return C.observe(w),()=>{C.disconnect();}},[a,s,o,l,c,d]);let R=jsx("div",{className:u(wl({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),x=jsxs(Fragment,{children:[r,jsx("div",{ref:b,className:"h-px w-full"}),s&&(i||R),!a&&!s&&m&&jsx("div",{className:u(wl({size:n}),"text-muted-foreground text-sm"),children:m})]});return d?jsx("div",{ref:h,className:u(Rl({variant:t,className:e})),...p,children:x}):jsx(Ae,{ref:h,visibility:f,className:u(Rl({variant:t,className:e})),...p,children:x})});Rb.displayName="InfiniteScroll";var PT=e=>e.map(t=>typeof t=="string"?{src:t}:t),Cl=Z.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=Z.useMemo(()=>PT(e),[e]),[v,R]=Z.useState(r),[x,w]=Z.useState(1),[C,y]=Z.useState(0),[T,D]=Z.useState(false),[P,S]=Z.useState(false),[L,N]=Z.useState({x:0,y:0}),[M,E]=Z.useState({x:0,y:0}),[k,H]=Z.useState(false),I=Z.useRef(null),A=b[v];Z.useEffect(()=>{H(true);},[]),Z.useEffect(()=>{R(r);},[r]),Z.useEffect(()=>{o?.(v);},[v,o]),Z.useEffect(()=>{w(1),y(0),N({x:0,y:0});},[v]),Z.useEffect(()=>{if(t)return sn(),()=>ln()},[t]);let O=Z.useCallback(()=>{R(Q=>Q>0?Q-1:b.length-1);},[b.length]),V=Z.useCallback(()=>{R(Q=>Q<b.length-1?Q+1:0);},[b.length]),z=()=>{w(Q=>Math.min(Q+.5,4));},K=()=>{w(Q=>{let ne=Math.max(Q-.5,.5);return ne===1&&N({x:0,y:0}),ne});},G=()=>{y(Q=>(Q+90)%360);},X$1=async()=>{if(A)try{let ne=await(await fetch(A.src)).blob(),Me=URL.createObjectURL(ne),fe=document.createElement("a");fe.href=Me,fe.download=A.alt||`image-${v+1}`,document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(Me);}catch{window.open(A.src,"_blank");}},F=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),D(!1);}catch{}else try{await I.current.requestFullscreen(),D(!0);}catch{}},$=Q=>{x>1&&(S(true),E({x:Q.clientX-L.x,y:Q.clientY-L.y}));},j=Q=>{P&&x>1&&N({x:Q.clientX-M.x,y:Q.clientY-M.y});},_=()=>{S(false);},B=()=>{n?.(false);},q=Q=>{p&&Q.target===Q.currentTarget&&B();},ee=Z.useCallback(Q=>{switch(Q.key){case "ArrowLeft":O();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":z();break;case "-":K();break}},[O,V,n]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[t,ee]),Z.useEffect(()=>{let Q=()=>{D(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),b.length===0)return null;let Y=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[Y,!k||!t?null:ja.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:q}),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]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:K,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(x*100),"%"]}),jsx("button",{onClick:z,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:G,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:X$1,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:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:T?"Exit fullscreen":"Fullscreen",children:T?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:B,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:I,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:$,onMouseMove:j,onMouseUp:_,onMouseLeave:_,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:O,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:V,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:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",P?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${L.x}px, ${L.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((Q,ne)=>jsx("button",{onClick:()=>R(ne),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===ne?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${ne+1}`,className:"h-full w-full object-cover"})},ne))})]})]}),document.body)]})});Cl.displayName="ImageViewer";var Cb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=Z.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(Cl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Cb.displayName="ImageViewerTrigger";var Tb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-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"}}),ST={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"},LT={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"},DT=e=>{let t=e.toLowerCase();return ST[t]||e.toUpperCase()},ua=e=>{let t=e.toLowerCase();return LT[t]||t},Ls=e=>{let t=ua(e);return ["meta","control","alt","shift"].includes(t)},Mb=Z.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Ls).map(ua),p=m.filter(h=>!Ls(h)).map(ua),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,R=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());b&&v&&R&&x&&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(Z.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:DT(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(Tb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Mb.displayName="Kbd";function HT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;Z.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Ls).map(ua),i=a.filter(c=>!Ls(c)).map(ua),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 Nb=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 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 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),kb=Z.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,m]=Z.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),m(!0),o?.(),setTimeout(()=>{m(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:u(Nb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:p,height:p}}):s??jsx(Copy,{style:{width:p,height:p}})})});kb.displayName="CopyButton";var Eb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),KT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],$T=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],GT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function UT(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 jT(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 Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Pb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ro(r,t)||Ro(o,t)||r<t&&o>t})}var Sb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=KT,date:l,onDateChange:c,onEventClick:d,onSlotClick:m,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[b,v]=Z.useState(new Date),R=l??b,x=N=>{c?c(N):v(N);},w=f===1?GT:$T,C=()=>{let N=new Date(R);a==="month"?N.setMonth(N.getMonth()-1):a==="week"?N.setDate(N.getDate()-7):N.setDate(N.getDate()-1),x(N);},y=()=>{let N=new Date(R);a==="month"?N.setMonth(N.getMonth()+1):a==="week"?N.setDate(N.getDate()+7):N.setDate(N.getDate()+1),x(N);},T=()=>{x(new Date);},D=()=>a==="day"?R.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):R.toLocaleDateString(p,{year:"numeric",month:"long"}),P=()=>{let N=UT(R.getFullYear(),R.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(M=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:M},M))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:N.map((M,E)=>{let k=Pb(o,M),H=M.getMonth()===R.getMonth(),I=Ro(M,R);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",I&&"bg-accent"),onClick:()=>m?.(M),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(M)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:M.getDate()}),jsxs("div",{className:"space-y-0.5",children:[k.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:O=>{O.stopPropagation(),d?.(A);},children:A.title},A.id)),k.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",k.length-3," more"]})]})]},E)})})]})},S=()=>{let N=jT(R,f),M=Array.from({length:24},(E,k)=>k);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"}),N.map((E,k)=>{let H=Ro(E,R);return jsxs("div",{className:u("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(E)&&"bg-primary/10",H&&!yo(E)&&"bg-accent"),onClick:()=>m?.(E),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[k]}),jsx("div",{className:u("text-lg font-semibold",yo(E)&&"text-primary",H&&!yo(E)&&"text-primary"),children:E.getDate()})]},k)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:M.map(E=>jsxs(Z.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"]}),N.map((k,H)=>{let I=new Date(k);I.setHours(E,0,0,0);let A=o.filter(O=>{let V=new Date(O.start);return Ro(V,k)&&V.getHours()===E});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(I),children:A.map(O=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:O.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),d?.(O);},children:O.title},O.id))},H)})]},E))})})]})},L=()=>{let N=Array.from({length:24},(E,k)=>k),M=Pb(o,R);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",yo(R)&&"bg-primary text-primary-foreground"),children:R.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:N.map(E=>{let k=new Date(R);k.setHours(E,0,0,0);let H=M.filter(I=>new Date(I.start).getHours()===E);return jsxs(Z.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:()=>m?.(k),children:H.map(I=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:I.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(I);},children:I.title},I.id))})]},E)})})})]})};return jsxs("div",{ref:h,className:u(Eb({variant:t,size:n,radius:r,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:D()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(me,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx($a,{options:i,value:a,onValueChange:N=>s?.(N),size:"sm",radius:"md",className:"w-[120px]"}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:y,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&P(),a==="week"&&S(),a==="day"&&L()]})});Sb.displayName="FullCalendar";var As=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),pa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),fa=["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%))"],Lb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(pa({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,{content:jsx(As,{})}),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))]})})}));Lb.displayName="LineChart";var Db=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,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(pa({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,{content:jsx(As,{})}),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))]})})}));Db.displayName="BarChart";var Hb=Z.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=fa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(pa({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(As,{})}),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}`))})]})})}));Hb.displayName="PieChart";var Ib=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,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(pa({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,{content:jsx(As,{})}),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))]})})}));Ib.displayName="AreaChart";var El={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function fM({card:e,columnId:t,radius: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("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",El[n]),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 Ab({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:u("flex flex-col min-w-[280px] w-[280px]",El[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("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})]})}),jsx(Ae,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(fM,{card:l,columnId:e.id,radius:t,renderCard:n,onCardClick:r},l.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"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(me,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Ob=Z.forwardRef(({className:e,columns:t,onCardMove:n,onCardClick:r,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},m)=>{let[f,p]=Z.useState(false),[g,h]=Z.useState(null),[b,v]=Z.useState(null);Z.useEffect(()=>{p(true);},[]);let R=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Ab,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(D=>D.cards.some(P=>P.id===T));return jsxs(DndContext,{sensors:R,collisionDetection:closestCorners,onDragStart:T=>{let{active:D}=T,P=x(D.id);if(P){let S=P.cards.find(L=>L.id===D.id);S&&(h(S),v(P.id));}},onDragOver:T=>{let{active:D,over:P}=T;if(!P)return;let S=D.id,L=P.id,N=x(S),M=x(L)||t.find(H=>H.id===L);if(!N||!M||N.id===M.id)return;let E=M.cards.findIndex(H=>H.id===L),k=E===-1?M.cards.length:E;n?.(S,N.id,M.id,k);},onDragEnd:T=>{let{active:D,over:P}=T;if(P&&D.id!==P.id){let S=x(D.id),L=x(P.id)||t.find(N=>N.id===P.id);if(S&&L){let N=L.cards.findIndex(E=>E.id===P.id),M=N===-1?L.cards.length:N;n?.(D.id,S.id,L.id,M);}}h(null),v(null);},children:[jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Ab,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))}),jsx(DragOverlay,{children:g&&b&&jsx("div",{className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",El[c]),children:a?a(g,b):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:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Ob.displayName="KanbanBoard";var Bb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Fb=Z.createContext(null);function Os(){let e=Z.useContext(Fb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Kb=Z.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]=gM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=Z.useState(false),[h,b]=Z.useState(false),[v,R]=Z.useState(0),[x,w]=Z.useState([]),C=Z.useCallback(S=>{S&&(R(S.selectedScrollSnap()),g(S.canScrollPrev()),b(S.canScrollNext()));},[]),y=Z.useCallback(()=>{f?.scrollPrev();},[f]),T=Z.useCallback(()=>{f?.scrollNext();},[f]),D=Z.useCallback(S=>{f?.scrollTo(S);},[f]),P=Z.useCallback(S=>{S.key==="ArrowLeft"?(S.preventDefault(),y()):S.key==="ArrowRight"&&(S.preventDefault(),T());},[y,T]);return Z.useEffect(()=>{!f||!l||l(f);},[f,l]),Z.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Fb.Provider,{value:{carouselRef:m,api:f,scrollPrev:y,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:x,scrollTo:D,orientation:a},children:jsxs("div",{ref:d,className:u(Bb({variant:t,className:e})),onKeyDownCapture:P,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(Sl,{}),jsx(Ll,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((S,L)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",L===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>D(L),"aria-label":`Go to slide ${L+1}`},L))})]})})});Kb.displayName="Carousel";var $b=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));$b.displayName="CarouselContent";var Gb=Z.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=Os();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});Gb.displayName="CarouselItem";var Sl=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=Os();return jsxs(me,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Sl.displayName="CarouselPrevious";var Ll=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=Os();return jsxs(me,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Ll.displayName="CarouselNext";var Ub=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"}},Hl={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}"]},jb=Z.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(r.length>0?"recent":o),[m,f]=Z.useState(""),g=m?Object.values(Hl).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:Hl[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:u(Ub({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(ao,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx(Ae,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:u("shrink-0 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(Ae,{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"})]})})]})});jb.displayName="EmojiPicker";var _b=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),WM=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"}}),YM=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"}}),at=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Je,{children:[jsx(wn,{children:jsx(me,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Cn,{side:"top",className:"text-xs",children:t})]}),Wb=Z.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:[TM.configure({heading:{levels:[1,2,3]}}),MM.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),NM,kM.configure({types:["heading","paragraph"]}),PM.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});Z.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),Z.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(tr,{children:jsxs("div",{ref:f,className:u(_b({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(WM({size:n})),children:[jsx(at,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(at,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{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(at,{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(at,{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(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(at,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(at,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(at,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(at,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(at,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(at,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(at,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(at,{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(YM({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Wb.displayName="RichTextEditor";var Xb=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function nN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function Yb(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 qb=Z.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=Z.useRef(null),[h,b]=Z.useState(),[v,R]=Z.useState(),[x,w]=Z.useState(1),[C,y]=Z.useState(0),T=L=>{let{width:N,height:M}=L.currentTarget;if(r){let E=nN(N,M,r);b(E);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},D=L=>{b(L),o?.(L);},P=async L=>{if(R(L),a&&g.current&&L.width&&L.height){let N=await Yb(g.current,L,C,x);a(N);}},S=()=>{y(L=>(L+90)%360);};return Z.useEffect(()=>{v&&g.current&&a&&Yb(g.current,v,C,x).then(L=>{a(L);});},[x,C,v,a]),jsxs("div",{ref:p,className:u(Xb({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(XM,{crop:h,onChange:D,onComplete:P,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",crossOrigin:"anonymous",onLoad:T,style:{transform:`scale(${x}) 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(en,{value:[x],onValueChange:([L])=>w(L),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(me,{variant:"bordered",size:"sm",isIconOnly:true,onClick:S,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});qb.displayName="ImageCropper";var zl=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"}}),aN={sm:96,md:128,lg:192},Qb=Z.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??aN[n??"md"];return r?jsx("div",{ref:h,className:u(zl({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(rN,{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(zl({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"})})});Qb.displayName="QRCode";var Jb=({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});Jb.displayName="ThemeProvider";var mN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),ev=Z.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.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(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className: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(Zt,{children:[jsx(Qt,{children:jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className: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(Jt,{align:"end",children:[jsxs(Dt,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Dt,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Dt,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});ev.displayName="ThemeToggle";var tv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),nv=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-9 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),rv=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"}}),ov=Z.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=Z.useId(),v=p||b,R=`${v}-description`,x=`${v}-error`,w=a&&r;return jsxs("div",{className:u(tv({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(rv({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?x:n?R:void 0,"aria-required":o,className:u(nv({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:R,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});ov.displayName="TextField";var sv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),gN=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-9 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-11 pl-12 pr-12 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),av=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"}}),bN=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"}}),vN=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"}}),iv=Z.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:x="Search...",id:w,...C},y)=>{let T=Z.useId(),D=w||T,P=`${D}-description`,S=`${D}-error`,[L,N]=Z.useState(f),M=m!==void 0?m:L,E=a&&r,k=M.length>0,H=O=>{let V=O.target.value;m===void 0&&N(V),p?.(V);},I=()=>{m===void 0&&N(""),p?.(""),g?.();},A=O=>{O.key==="Enter"?(O.preventDefault(),h?.(M)):O.key==="Escape"&&k&&(O.preventDefault(),I());};return jsxs("div",{className:u(sv({size:s}),e),children:[t&&jsxs("label",{htmlFor:D,className:u(bN({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(av({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:y,id:D,type:"search",value:M,onChange:H,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":E?S:n?P:void 0,"aria-required":o,disabled:R,className:u(gN({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&k&&!R&&jsx("button",{type:"button",onClick:I,className:u(vN({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(av({size:s}))})})]}),n&&!E&&jsx("p",{id:P,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),E&&jsx("p",{id:S,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});iv.displayName="SearchField";var lv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),xN=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",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),yN=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"}}),RN=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"}}),Us={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Ul={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},$l=(e,t)=>String(e).padStart(t,"0"),ha=(e,t)=>{if(!e)return "";let n=$l(e.getDate(),2),r=$l(e.getMonth()+1,2),o=$l(e.getFullYear(),4),a=Us[t],s=Ul[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Gl=(e,t)=>{let n=Us[t],r=e.split(n);if(r.length!==3)return null;let o=Ul[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},wN=e=>{let t=Us[e];return Ul[e].map(r=>r==="year"?"####":"##").join(t)},js=Z.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="dd.MM.yyyy",showPickerIcon:v=true,mode:R="text",fullWidth:x=false,disabled:w,placeholder:C,id:y,...T},D)=>{let P=Z.useId(),S=y||P,L=`${S}-description`,N=`${S}-error`,[M,E]=Z.useState(f??null),[k,H]=Z.useState(""),[I,A]=Z.useState(false),[O,V]=Z.useState(false),z=m!==void 0?m:M,K=a&&r,G=Us[b],X=wN(b);Z.useEffect(()=>{O||H(ha(z,b));},[z,b,O]);let F=Y=>{m===void 0&&E(Y),p?.(Y);},$=Y=>{let he=Y??null;F(he),H(ha(he,b)),A(false);},j=Y=>{let he=Y.target.value;he=he.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=he.replace(new RegExp(`\\${G}`,"g"),""),ne="",Me=0;for(let fe=0;fe<X.length&&Me<Q.length;fe++)X[fe]==="#"?(ne+=Q[Me],Me++):ne+=X[fe];if(H(ne),ne.length===X.length){let fe=Gl(ne,b);if(fe){if(g&&fe<g||h&&fe>h)return;F(fe);}}},_=()=>{V(true);},B=()=>{V(false),k.length!==X.length?H(ha(z,b)):Gl(k,b)||H(ha(z,b));},q=()=>{w||A(true);},ee=()=>{!w&&R==="picker"&&v&&A(true);};return jsxs("div",{className:u(lv({size:s}),e),children:[t&&jsxs("label",{htmlFor:S,className:u(RN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(vt,{open:v&&I,onOpenChange:A,children:[jsxs(Tn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:D,id:S,type:"text",inputMode:R==="text"?"numeric":void 0,value:k,onChange:R==="text"?j:void 0,onClick:ee,onFocus:_,onBlur:B,readOnly:R==="picker","aria-invalid":a,"aria-describedby":K?N:n?L:void 0,"aria-required":o,disabled:w,placeholder:C||b.toLowerCase(),className:u(xN({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),R==="picker"&&v&&"cursor-pointer",l),style:{borderColor:O||v&&I?"var(--color-foreground)":void 0},...T}),v&&jsx("button",{type:"button",onClick:q,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(yN({size:s}))})})]}),v&&jsx(ht,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:z??void 0,onSelect:$,disabled:Y=>!!(g&&Y<g||h&&Y>h),defaultMonth:z??void 0,showMonthAndYearPickers:true})})]}),n&&!K&&jsx("p",{id:L,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),K&&jsx("p",{id:N,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});js.displayName="DatePicker";var CN=js,TN=js;var cv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),MN=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}}),NN=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"}}),dv=Z.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:x=false,id:w,...C},y)=>{let T=Z.useId(),D=w||T,P=`${D}-description`,S=`${D}-error`,L=Z.useRef(null),N=Z.useRef(null),M=Z.useRef(null),E=Z.useRef(null),[k,H]=Z.useState(f??null),I=m!==void 0?m:k,A=a&&r,O=W=>v===24?W:W===0?12:W>12?W-12:W,V=W=>W>=12?"PM":"AM",z=(W,ae)=>ae==="AM"?W===12?0:W:W===12?12:W+12,[K,G]=Z.useState(I?String(O(I.hour)).padStart(2,"0"):""),[X,F]=Z.useState(I?String(I.minute).padStart(2,"0"):""),[$,j]=Z.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[_,B]=Z.useState(I?V(I.hour):"AM"),[q,ee]=Z.useState(false);Z.useEffect(()=>{m!==void 0&&(m?(G(String(O(m.hour)).padStart(2,"0")),F(String(m.minute).padStart(2,"0")),m.second!==void 0&&j(String(m.second).padStart(2,"0")),B(V(m.hour))):(G(""),F(""),j("")));},[m,v]);let Y=(W,ae,U,de)=>{let ue=parseInt(W,10),Be=parseInt(ae,10),$e=b?parseInt(U,10):void 0;if(isNaN(ue)||isNaN(Be)||b&&isNaN($e)){m===void 0&&H(null),p?.(null);return}let Re={hour:v===12?z(ue,de):ue,minute:Be,...b&&$e!==void 0&&{second:$e}};m===void 0&&H(Re),p?.(Re);},he=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);G(ae);let U=v===24?23:12,de=v===24?0:1;if(ae.length===2){let ue=parseInt(ae,10);ue>=de&&ue<=U&&(N.current?.focus(),N.current?.select());}},Q=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);if(F(ae),ae.length===2){let U=parseInt(ae,10);U>=0&&U<=59&&(b?(M.current?.focus(),M.current?.select()):v===12&&E.current?.focus());}},ne=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);j(ae),ae.length===2&&v===12&&E.current?.focus();},Me=()=>{if(K){let W=parseInt(K,10),ae=v===24?23:12,de=Math.min(Math.max(W,v===24?0:1),ae),ue=String(de).padStart(2,"0");G(ue),Y(ue,X,$,_);}},fe=()=>{if(X){let W=parseInt(X,10),ae=Math.min(Math.max(W,0),59),U=String(ae).padStart(2,"0");F(U),Y(K,U,$,_);}},Ye=()=>{if($){let W=parseInt($,10),ae=Math.min(Math.max(W,0),59),U=String(ae).padStart(2,"0");j(U),Y(K,X,U,_);}},Ze=()=>{let W=_==="AM"?"PM":"AM";B(W),Y(K,X,$,W);},Mt=W=>{let ae=W.key.toLowerCase();ae==="a"?(W.preventDefault(),_!=="AM"&&(B("AM"),Y(K,X,$,"AM"))):ae==="p"?(W.preventDefault(),_!=="PM"&&(B("PM"),Y(K,X,$,"PM"))):ae==="arrowup"||ae==="arrowdown"?(W.preventDefault(),Ze()):ae==="arrowleft"&&(W.preventDefault(),b?(M.current?.focus(),M.current?.select()):(N.current?.focus(),N.current?.select()));},Pe=(W,ae)=>{if(W.key==="ArrowUp"||W.key==="ArrowDown"){W.preventDefault();let U=W.key==="ArrowUp"?1:-1;if(ae==="hour"){let de=parseInt(K,10)||0,ue=v===24?23:12,Be=v===24?0:1,$e=de+U;$e>ue&&($e=Be),$e<Be&&($e=ue);let Rn=String($e).padStart(2,"0");G(Rn),Y(Rn,X,$,_);}else if(ae==="minute"){let ue=(parseInt(X,10)||0)+U;ue>59&&(ue=0),ue<0&&(ue=59);let Be=String(ue).padStart(2,"0");F(Be),Y(K,Be,$,_);}else if(ae==="second"){let ue=(parseInt($,10)||0)+U;ue>59&&(ue=0),ue<0&&(ue=59);let Be=String(ue).padStart(2,"0");j(Be),Y(K,X,Be,_);}}W.key==="ArrowRight"&&(W.preventDefault(),ae==="hour"?(N.current?.focus(),N.current?.select()):ae==="minute"&&b?(M.current?.focus(),M.current?.select()):(ae==="minute"&&!b&&v===12||ae==="second"&&v===12)&&E.current?.focus()),W.key==="ArrowLeft"&&(W.preventDefault(),ae==="minute"?(L.current?.focus(),L.current?.select()):ae==="second"&&(N.current?.focus(),N.current?.select())),W.key==="Backspace"&&W.currentTarget.value===""&&(ae==="minute"?L.current?.focus():ae==="second"&&N.current?.focus());},J=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(cv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:D,className:u(NN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(MN({size:s,isInvalid:a,disabled:R,fullWidth:x}),l),style:{borderColor:q?"var(--color-foreground)":void 0},onFocus:()=>ee(true),onBlur:W=>{W.currentTarget.contains(W.relatedTarget)||ee(false);},children:[jsx("input",{ref:L,id:D,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:K,onChange:he,onBlur:Me,onKeyDown:W=>Pe(W,"hour"),onFocus:W=>W.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?S:n?P:void 0,"aria-required":o,disabled:R,className:J}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:N,type:"text",inputMode:"numeric",placeholder:"mm",value:X,onChange:Q,onBlur:fe,onKeyDown:W=>Pe(W,"minute"),onFocus:W=>W.target.select(),"aria-label":"Minute",disabled:R,className:J}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"ss",value:$,onChange:ne,onBlur:Ye,onKeyDown:W=>Pe(W,"second"),onFocus:W=>W.target.select(),"aria-label":"Second",disabled:R,className:J})]}),v===12&&jsx("button",{ref:E,type:"button",onClick:Ze,onKeyDown:Mt,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:_})]}),n&&!A&&jsx("p",{id:P,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:S,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});dv.displayName="TimeField";var mv=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"}}),pv=Z.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=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>R(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(mv({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(Zt,{children:[jsx(Qt,{"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(Jt,{align:"end",children:g.map(w=>jsxs(Dt,{disabled:w.isDisabled,onClick:()=>R(w.key,w.onPress),children:[w.icon&&jsx("span",{className:u(v,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});pv.displayName="ActionGroup";var vv=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"}}),SN=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}}),hv=Z.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(vv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(SN({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));hv.displayName="StatusLight";var xv=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"}}),yv=Z.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(xv({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(Kt,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});yv.displayName="ActionBar";var Rv=Z.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]}));Rv.displayName="ActionBarButton";var wv=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"}}),IN=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"}}),VN=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"}}),Cv=Z.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]=Z.useState(o),x=r!==void 0,w=x?r:v,C=Z.useRef(null),[y,T]=Z.useState(false),[D,P]=Z.useState(null),S=(V,z)=>{if(!C.current)return w[0];let K=C.current.getBoundingClientRect(),G;t==="horizontal"?G=(V-K.left)/K.width:G=1-(z-K.top)/K.height,G=Math.max(0,Math.min(1,G));let X=i+G*(l-i),F=Math.round(X/c)*c;return Math.max(i,Math.min(l,F))},L=(V,z)=>{let K=[...w];K[z]=V,z===0&&V>w[1]&&(K[0]=w[1]),z===1&&V<w[0]&&(K[1]=w[0]),x||R(K),a?.(K);},N=(V,z)=>{d||(V.preventDefault(),T(true),P(z),V.target.setPointerCapture(V.pointerId));},M=V=>{if(!y||D===null||d)return;let z=S(V.clientX,V.clientY);L(z,D);},E=()=>{y&&(T(false),P(null),s?.(w));},k=V=>{if(d)return;let z=S(V.clientX,V.clientY),K=Math.abs(w[0]-z),G=Math.abs(w[1]-z),X=K<=G?0:1;L(z,X);let F=[...w];F[X]=z,s?.(F);},H=(V,z)=>{if(d)return;let K=w[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(l,w[z]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(i,w[z]-c);break;case "Home":V.preventDefault(),K=i;break;case "End":V.preventDefault(),K=l;break;default:return}L(K,z);let G=[...w];G[z]=K,s?.(G);},I=V=>(V-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],O={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(wv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(IN({orientation:t,size:n})),onClick:k,children:jsx("div",{className:u("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${I(w[0])}%`,right:`${100-I(w[1])}%`,top:0,bottom:0}:{bottom:`${I(w[0])}%`,top:`${100-I(w[1])}%`,left:0,right:0}})}),w.map((V,z)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":V,"aria-orientation":t||void 0,"aria-disabled":d,className:u(VN({size:n}),y&&D===z&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${I(V)}% - ${O/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${I(V)}% - ${O/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:K=>N(K,z),onPointerMove:M,onPointerUp:E,onPointerCancel:E,onKeyDown:K=>H(K,z)},z)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});Cv.displayName="RangeSlider";var ql=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"}}),FN=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"}}),KN={help:HelpCircle,info:Info,warning:AlertCircle},Nv=Z.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]=Z.useState(false),[b,v]=Z.useState(false),[R,x]=Z.useState({top:0,left:0}),w=Z.useRef(null),C=Z.useRef(null),y=i!==void 0?i:g,T=Z.useCallback(L=>{i===void 0&&h(L),l?.(L);},[i,l]);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!y||!w.current)return;let L=()=>{let N=w.current.getBoundingClientRect(),M=C.current?.getBoundingClientRect(),E=M?.width||288,k=M?.height||100,H=8,I=0,A=0;switch(a){case "top":I=N.top-k-H,A=N.left+N.width/2-E/2;break;case "bottom":I=N.bottom+H,A=N.left+N.width/2-E/2;break;case "left":I=N.top+N.height/2-k/2,A=N.left-E-H;break;case "right":I=N.top+N.height/2-k/2,A=N.right+H;break}if(a==="top"||a==="bottom")switch(s){case "start":A=N.left;break;case "center":A=N.left+N.width/2-E/2;break;case "end":A=N.right-E;break}if(a==="left"||a==="right")switch(s){case "start":I=N.top;break;case "center":I=N.top+N.height/2-k/2;break;case "end":I=N.bottom-k;break}A=Math.max(8,Math.min(A,window.innerWidth-E-8)),I=Math.max(8,Math.min(I,window.innerHeight-k-8)),x({top:I,left:A});};return L(),requestAnimationFrame(L),window.addEventListener("resize",L),window.addEventListener("scroll",L,true),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true);}},[y,a,s]),Z.useEffect(()=>{if(!y)return;let L=N=>{C.current&&!C.current.contains(N.target)&&w.current&&!w.current.contains(N.target)&&T(false);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[y,T]),Z.useEffect(()=>{if(!y)return;let L=N=>{N.key==="Escape"&&T(false);};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[y,T]);let D=KN[e??"help"],P=()=>{T(!y);},S=()=>{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?Z.isValidElement(o)?Z.cloneElement(o,{ref:w,onClick:L=>{o.props.onClick?.(L),P();}}):jsx("button",{ref:w,type:"button",onClick:P,className:u(ql({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:L=>{w.current=L,typeof p=="function"?p(L):p&&(p.current=L);},type:"button",onClick:P,className:u(ql({variant:e,size:t}),m),"aria-label":"Help",children:jsx(D,{className:"h-full w-full"})}),b&&y&&ja.createPortal(jsxs("div",{ref:C,className:u(FN({size:t}),f),style:{position:"fixed",top:R.top,left:R.left,transformOrigin:S()},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)]})});Nv.displayName="ContextualHelp";var Pv=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),Zl=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",bordered:"border border-current 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:"bordered",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 Ev({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]=Z.useState(new Set),v=Z.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),R=y=>{if(s==="none")return;let T;s==="single"?T=v.has(y)?new Set:new Set([y]):(T=new Set(v),T.has(y)?T.delete(y):T.add(y)),a||b(T),i?.(T);},x=(y,T)=>{T.stopPropagation(),c?.(y);},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(Pv({spacing:t}),e),...g,children:[w.map(y=>{let T=v.has(y.key),D=s!=="none";return jsxs("span",{role:D?"button":void 0,tabIndex:D&&!y.isDisabled?0:void 0,"aria-pressed":D?T:void 0,onClick:()=>!y.isDisabled&&R(y.key),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&!y.isDisabled&&(P.preventDefault(),R(y.key));},style:y.color?{backgroundColor:y.color}:void 0,className:u(Zl({variant:y.color?void 0:n,size:r,isSelected:T,isDisabled:y.isDisabled}),D&&!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:P=>x(y.key,P),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(Zl({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Ev.displayName="TagGroup";var Dv=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"}}),Hv=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 Iv({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]=Z.useState(new Set),h=Z.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(Dv({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(Hv({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)})})}Iv.displayName="GridList";var Vv=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"}}),Js=(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)]},Av=(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]},zv=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},Ov=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Bv=Z.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=Z.useRef(null),[g,h]=Z.useState(false),b=Z.useCallback(V=>{let z=zv(V);return z?Av(...z):[0,1,1]},[]),[v,R]=Z.useState(()=>b(r||o)),x=e??v[0],w=t??v[1],C=n??v[2];Z.useEffect(()=>{if(r){let V=b(r);R(V);}},[r,b]);let y=Z.useCallback((V,z)=>{if(l||!p.current)return;let K=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-K.left)/K.width)),X=Math.max(0,Math.min(1,(z-K.top)/K.height)),F=G,$=1-X;t===void 0&&n===void 0&&R([x,F,$]),a?.({hue:x,saturation:F,brightness:$});let j=Js(x,F,$);s?.(Ov(...j));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),y(V.clientX,V.clientY));},D=V=>{g&&y(V.clientX,V.clientY);},P=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[S,L,N]=Js(x,1,1),M=`rgb(${S}, ${L}, ${N})`,E=w*100,k=(1-C)*100,[H,I,A]=Js(x,w,C),O=`rgb(${H}, ${I}, ${A})`;return jsx("div",{ref:f,className:u(Vv({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:M},onPointerDown:T,onPointerMove:D,onPointerUp:P,onPointerLeave:P,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(${E}% - ${c/2}px)`,top:`calc(${k}% - ${c/2}px)`,backgroundColor:O,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Bv.displayName="ColorArea";var Kv=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"}}),YN=`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")`,Fv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",$v=Z.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=Z.useRef(null),[g,h]=Z.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,R]=Z.useState(t??b()),x=e??v,w=r==="hue"?x/360:x,C=Z.useCallback((M,E)=>{if(i||!p.current)return;let k=p.current.getBoundingClientRect(),H=a!=="vertical",I;H?I=Math.max(0,Math.min(1,(M-k.left)/k.width)):I=Math.max(0,Math.min(1,1-(E-k.top)/k.height));let A=r==="hue"?I*360:I;e===void 0&&R(A),n?.(A);},[i,a,r,e,n]),y=M=>{i||(M.preventDefault(),h(true),M.target.setPointerCapture(M.pointerId),C(M.clientX,M.clientY));},T=M=>{g&&C(M.clientX,M.clientY);},D=M=>{h(false),M.target.releasePointerCapture(M.pointerId);},P=()=>{let M=a!=="vertical",E=M?"to right":"to top";switch(r){case "hue":return M?Fv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${E}, transparent, ${o})`;case "saturation":return `linear-gradient(${E}, #808080, ${o})`;case "brightness":return `linear-gradient(${E}, #000000, ${o})`;default:return Fv}},S=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,L=a!=="vertical",N=w*100;return jsx("div",{ref:f,className:u(Kv({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"?YN:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:T,onPointerUp:D,onPointerLeave:D,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:P()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...L?{left:`calc(${N}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${N}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:S(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});$v.displayName="ColorSlider";var Gv=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"}}),ZN=(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},Uv=Z.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=Z.useRef(null),[f,p]=Z.useState(false),[g,h]=Z.useState(t),b=e??g,v=Z.useCallback((y,T)=>{if(o||!m.current)return;let D=m.current.getBoundingClientRect(),P=D.width/2,S=y-D.left,L=T-D.top,N=ZN(S,L,P);e===void 0&&h(N),n?.(N);},[o,e,n]),R=y=>{o||(y.preventDefault(),p(true),y.target.setPointerCapture(y.pointerId),v(y.clientX,y.clientY));},x=y=>{f&&v(y.clientX,y.clientY);},w=y=>{p(false),y.target.releasePointerCapture(y.pointerId);},C=()=>{let y=[];for(let T=0;T<=360;T+=30)y.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:u(Gv({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:x,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(QN,{hue:b,innerRadius:a,thumbSize:s})]})})});Uv.displayName="ColorWheel";var QN=({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 Wv=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-9 text-xs",md:"h-10 text-sm",lg:"h-11 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Lo=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"}}),Yv=Z.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,...x},w)=>{let[C,y]=Z.useState(false),[T,D]=Z.useState(t),P=e!==void 0?e:T,S=Z.useRef(null);Z.useImperativeHandle(w,()=>S.current);let L=P.length>0,N=C&&(a.length>0||s.length>0||l.length>0||L),M=V=>{e===void 0&&D(V),n?.(V);},E=()=>{M(""),S.current?.focus();},k=V=>{V?.preventDefault(),P.trim()&&(r?.(P.trim()),y(false));},H=V=>{M(V.label),o?.(V),y(false);},I=V=>{M(V),r?.(V),y(false);},A=V=>{M(V),r?.(V),y(false);},O=Z.useMemo(()=>{let V={};return a.forEach(z=>{let K=z.category||"Results";V[K]||(V[K]=[]),V[K].push(z);}),V},[a]);return jsxs(vt,{open:N,onOpenChange:y,children:[jsx(Tn,{children:jsxs("form",{onSubmit:k,className:u(Wv({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(Lo({size:g}),"ml-3")}),jsx("input",{ref:S,type:"text",value:P,onChange:V=>M(V.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"),...x}),d&&L&&!R&&jsx("button",{type:"button",onClick:E,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",Lo({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(ht,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:V=>V.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!L&&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((V,z)=>jsxs("button",{type:"button",onClick:()=>I(V),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(Lo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:u(Lo({size:g}),"opacity-0 group-hover:opacity-100")})]},z))]}),l.length>0&&!L&&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((V,z)=>jsxs("button",{type:"button",onClick:()=>A(V),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(Lo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},z))]}),L&&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(O).map(([V,z])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),z.map(K=>jsxs("button",{type:"button",onClick:()=>H(K),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[K.icon||jsx(Search,{className:u(Lo({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:K.label}),K.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:K.description})]})]},K.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});Yv.displayName="SearchBar";var Xv={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"})},Qv=Z.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]=Z.useState(""),g=Z.useRef(null),[h,b]=Z.useState(false);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{e||p("");},[e]),Z.useEffect(()=>{if(!e)return;let y=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),Z.useEffect(()=>{if(e)return sn(),()=>ln()},[e]);let v=Z.useMemo(()=>{let y={};return n.forEach(T=>{let D=T.category||"Results";y[D]||(y[D]=[]),y[D].push(T);}),y},[n]),R=y=>{y.onSelect?.(),c?.(y),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:ja.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:x}),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||Xv[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((T,D)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},D))})]},y.id))]}),w&&Object.entries(v).map(([y,T])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),T.map(D=>jsxs(Command.Item,{value:`${D.label} ${D.keywords?.join(" ")||""}`,onSelect:()=>R(D),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:D.icon||Xv[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:D.label}),D.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:D.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},D.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)});Qv.displayName="SpotlightSearch";function mk(e="k"){let[t,n]=Z.useState(false);return Z.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 Jv=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"}}),xk={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},eh=Z.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]=Z.useState(true),[v,R]=Z.useState(false);Z.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),Z.useEffect(()=>{if(d&&h){let y=setTimeout(()=>{x();},d);return ()=>clearTimeout(y)}},[d,h]);let x=()=>{R(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let w=xk[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Jv({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:x,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"})})]})});eh.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 border-zinc-300 dark:border-zinc-700 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 border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},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"}}),wk=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"}}),tc=Z.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]=Z.useState(false),x=o&&o.length>0,w=P=>{x&&R(!v),p?.(P);},C=P=>{P.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:""}},T=l==="rotate"&&v?"rotate-45":"",D=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ya({position:m})),children:[x&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((P,S)=>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:`${S*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:P.label}),P.href?jsx("a",{href:P.href,className:u(ya({variant:P.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":P.label,children:P.icon}):jsx("button",{type:"button",onClick:()=>C(P),className:u(ya({variant:P.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":P.label,children:P.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:P.label})]},P.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":x?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(wk({size:d}),T,D,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>R(false)})]})});tc.displayName="FloatingActionButton";var Ck=tc;var ah=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"}}),nh=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),sh=Z.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]=Z.useState(a||r[0]?.key),p=o!==void 0,g=p?o:m,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},b=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",v=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},R=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(ah({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let w=g===x.key,C=i==="all"||i==="active"&&w,y=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:u(nh({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,w)},x.key);let T=jsxs("div",{onClick:()=>!x.href&&h(x),className:u(nh({variant:t}),b(w),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":w?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(v(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),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"})]}),C&&x.label&&jsx("span",{className:u(R(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(w)),children:T},x.key):T})})});sh.displayName="BottomNavigation";var Mk="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",lh=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"}}),ch=Z.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:Mk,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(lh({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})})})]})]})]})});ch.displayName="ActionSheet";var uh=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),rc=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"}}),mh=Z.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=Z.useRef(null),[p,g]=Z.useState(0),[h,b]=Z.useState(false),v=Z.useRef(0),R=Z.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=S=>{i||(b(true),v.current=S.touches[0].clientX,R.current=p);},y=S=>{if(!h||i)return;let N=S.touches[0].clientX-v.current,M=R.current+N;(M>0&&n.length===0||M<0&&r.length===0)&&(M=0),M>x?M=x+(M-x)*.3:M<-w&&(M=-w+(M+w)*.3),g(M);},T=()=>{if(!h)return;b(false);let S=f.current?.offsetWidth||0,L=Math.abs(p)/S;if(l&&L>.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>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},D=(S,L)=>{S.onAction?.(),s?.(L,S.key),g(0);},P=()=>{g(0);};return jsxs("div",{ref:m,className:u(uh({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(S=>jsxs("button",{type:"button",onClick:()=>D(S,"right"),className:u(rc({variant:S.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[S.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:S.icon}),!S.icon&&S.label]},S.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(S=>jsxs("button",{type:"button",onClick:()=>D(S,"left"),className:u(rc({variant:S.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[S.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:S.icon}),!S.icon&&S.label]},S.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:T,onClick:p!==0?P:void 0,children:c})]})});mh.displayName="SwipeActions";var fh=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),Pk=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"}}),gh=Z.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=Z.useRef(null),[b,v]=Z.useState(0),[R,x]=Z.useState("idle"),w=Z.useRef(0),C=Z.useRef(false),y=()=>l||R==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=N=>{y()&&(w.current=N.touches[0].clientY,C.current=true);},D=N=>{if(!C.current||!y())return;let E=N.touches[0].clientY-w.current;if(E<0){v(0),x("idle");return}let H=Math.min(E*.5,o);v(H),x(H>=r?"ready":"pulling");},P=async()=>{if(C.current)if(C.current=false,R==="ready"){x("refreshing"),v(r*.6);try{await n();}finally{x("idle"),v(0);}}else x("idle"),v(0);},S={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],L=()=>{if(R==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(S,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let N=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(S,"text-muted-foreground transition-transform"),style:{transform:`rotate(${N}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:R==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(fh({variant:t,className:e})),...p,children:[jsx("div",{className:u(Pk({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:L()}),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:T,onTouchMove:D,onTouchEnd:P,children:f})]})});gh.displayName="PullToRefresh";var Xr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),Ek={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},bh=Z.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:Ek,custom:i,transition:Xr(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});bh.displayName="Fade";var Sk=(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]}}},vh=Z.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=Z.useMemo(()=>Sk(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Xr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});vh.displayName="Slide";var Lk={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"},Dk={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},hh=Z.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:Dk,custom:i,transition:Xr(n,r,o),className:u(a),style:{transformOrigin:Lk[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});hh.displayName="Scale";var xh=Z.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:Xr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});xh.displayName="Collapse";var yh=Z.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:Xr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});yh.displayName="Expand";var Rh=Z.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:Xr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Rh.displayName="Rotate";var wh=Z.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:Xr(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})]})})});wh.displayName="Flip";var Ch=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.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))})]})});Ch.displayName="Ripple";var Th=Z.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});Th.displayName="Bounce";var Vk={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]},Mh=Z.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:Vk[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})});Mh.displayName="Shake";var Ak={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Nh=Z.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&Ak[n],r),children:e}));Nh.displayName="Pulse";var kh=Z.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});kh.displayName="Wiggle";var Ph=Z.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]=Z.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})});Ph.displayName="Pop";var $k=(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},Eh=Z.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=Z.useRef(null),g=useInView(p,{once:true}),[h,b]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let x=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let v=useMotionValue(t),R=useTransform(v,x=>$k(x,r,s,i));return Z.useEffect(()=>{if(h){let x=animate(v,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>x.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]})})});Eh.displayName="Counter";var Sh=Z.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]=Z.useState(""),[b,v]=Z.useState(0),[R,x]=Z.useState(false),[w,C]=Z.useState(false),y=Z.useRef(null),T=useInView(y,{once:true}),[D,P]=Z.useState(!l);return Z.useEffect(()=>{if(l&&T){let S=setTimeout(()=>P(true),n*1e3);return ()=>clearTimeout(S)}},[l,T,n]),Z.useEffect(()=>{if(!D||w)return;let S=p[b],L;return R?g.length>0?L=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),v(N=>(N+1)%p.length)):g.length<S.length?L=setTimeout(()=>{h(S.slice(0,g.length+1));},t):b<p.length-1||s?L=setTimeout(()=>{x(true);},r):(C(true),m?.()),()=>clearTimeout(L)},[D,g,b,R,w,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})]})});Sh.displayName="Typewriter";var Lh=Z.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=Z.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))})})});Lh.displayName="TextReveal";var Dh=Z.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.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])})})});Dh.displayName="WordRotate";var Ah=Z.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=Z.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})})});Ah.displayName="ScrollReveal";var zh=Z.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(Uk,{progress:f,position:e})]})});zh.displayName="ScrollProgress";var Uk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=Z.useState(0);return Z.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,"%"]})},Oh=Z.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=Z.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})})});Oh.displayName="Parallax";var Kh=Z.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(ue),U.dataTransfer.setDragImage(ue,20,15),setTimeout(()=>{document.body.removeChild(ue);},0),h(e),C?.({event:U,node:e});},fe=U=>{if(U.preventDefault(),U.stopPropagation(),!g||g.key===e.key||q)return;let de=U.currentTarget.getBoundingClientRect(),ue=U.clientY-de.top,Be=de.height,$e;ue<Be*.25?$e=-1:ue>Be*.75?$e=1:$e=0,!(w&&!w({dropNode:e,dropPosition:$e,dragNode:g}))&&(R(e.key,$e),y?.({event:U,node:e}));},Ye=U=>{U.preventDefault(),U.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:U,node:e,expandedKeys:z()});},Ze=U=>{U.stopPropagation(),D?.({event:U,node:e});},Tt=U=>{U.preventDefault(),U.stopPropagation(),!(!g||g.key===e.key||q)&&(v!==null&&x(e,v),h(null),R(null,null));},ke=U=>{h(null),R(null,null),E?.({event:U,node:e});},ct=U=>{q||ee&&i(e.key,e,U);},J=U=>{U.stopPropagation(),!q&&!G&&a(e.key,e);},W=Z.useMemo(()=>{if(!B||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 ""}},[B,v]),ae=[...r,n];return jsxs("div",{className:"relative",children:[L&&t>0&&jsxs(Fragment,{children:[r.map((U,de)=>!U&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${de} * var(--tree-indent) + 12px)`,top:0,bottom:0}},de)),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":G?void 0:X,"aria-selected":ee?F:void 0,"aria-disabled":q,draggable:ve,onDragStart:Te,onDragOver:fe,onDragEnter:Ye,onDragLeave:Ze,onDrop:Tt,onDragEnd:ke,onClick:ct,className:u("relative",Dg({size:V,isSelected:F,isDragging:_,isDisabled:q,isHoverable:ee&&!q}),W,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[ve&&N&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:J,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",X&&"rotate-90")})}),Y&&jsx(SC,{checked:$,indeterminate:j,disabled:q,onClick:U=>m(e.key,e,U)}),S&&ne&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:ne}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),K&&X&&jsx("div",{role:"group",children:e.children.map((U,de)=>jsx(Ig,{node:U,level:t+1,isLast:de===e.children.length-1,parentIsLastPath:ae},U.key))})]})},LC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},DC=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},Vg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Vg(n,t))return true;return false},Ag=Z.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:x,showLine:w=false,showIcon:C=false,showHandle:y=true,dragIcon:T,icon:D,leafIcon:E=jsx(File,{className:"h-4 w-4"}),folderIcon:L=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:S=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:N,onDragEnter:M,onDragOver:k,onDragLeave:P,onDragEnd:H,onDrop:I,blockNode:A=false,disabled:O=false,...V},z)=>{let K=Z.useCallback(()=>l?new Set(LC(r)):new Set(i),[l,i,r]),[G,X]=Z.useState(K),F=s!==void 0,$=F?new Set(s):G,j=Z.useCallback((ye,Qe)=>{let Ot=new Set($),Ge=!Ot.has(ye);Ge?Ot.add(ye):Ot.delete(ye),F||X(Ot),c?.(Array.from(Ot),{expanded:Ge,node:Qe});},[$,F,c]),[_,B]=Z.useState(new Set(p)),q=f!==void 0,ee=q?new Set(f):_,Y=Z.useCallback((ye,Qe,Ot)=>{let Ge=new Set(ee),re=!Ge.has(ye);m?re?Ge.add(ye):Ge.delete(ye):(Ge.clear(),re&&Ge.add(ye)),q||B(Ge);let Re=[],Mr=Sa=>{for(let Jr of Sa)Ge.has(Jr.key)&&Re.push(Jr),Jr.children&&Mr(Jr.children);};Mr(r),g?.(Array.from(Ge),{selected:re,selectedNodes:Re,node:Qe,event:Ot});},[ee,m,q,g,r]),[ve,Q]=Z.useState(new Set(R)),[ne,Te]=Z.useState(new Set),fe=v!==void 0,Ye=fe?new Set(Array.isArray(v)?v:v.checked):ve,Ze=fe&&!Array.isArray(v)?new Set(v.halfChecked):ne,Tt=Z.useCallback((ye,Qe,Ot)=>{let Ge=new Set(Ye),re=new Set(Ze),Re=!Ge.has(ye);if(Re?(Ge.add(ye),re.delete(ye)):Ge.delete(ye),!b&&Qe.children){let bi=DC(Qe);for(let Jn of bi)Re?(Ge.add(Jn),re.delete(Jn)):Ge.delete(Jn);}fe||(Q(Ge),Te(re));let Mr=[],Sa=bi=>{for(let Jn of bi)Ge.has(Jn.key)&&Mr.push(Jn),Jn.children&&Sa(Jn.children);};Sa(r);let Jr=b?{checked:Array.from(Ge),halfChecked:Array.from(re)}:Array.from(Ge);x?.(Jr,{checked:Re,checkedNodes:Mr,node:Qe,event:Ot,halfCheckedKeys:Array.from(re)});},[Ye,Ze,b,fe,x,r]),[ke,ct]=Z.useState(null),[J,W]=Z.useState(null),[ae,U]=Z.useState(null),de=Z.useCallback((ye,Qe)=>{W(ye),U(Qe);},[]),ue=Z.useCallback((ye,Qe)=>{!ke||!I||Qe===0&&Vg(ke,ye.key)||I({event:{},node:ye,dragNode:ke,dropPosition:Qe,dropToGap:Qe!==0});},[ke,I]),Be=Z.useCallback(()=>Array.from($),[$]),$e={expandedKeys:$,toggleExpand:j,selectedKeys:ee,handleSelect:Y,selectable:d,multiple:m,checkedKeys:Ye,halfCheckedKeys:Ze,handleCheck:Tt,checkable:h,checkStrictly:b,draggable:o,draggedNode:ke,setDraggedNode:ct,dragOverKey:J,dragOverPosition:ae,setDragOver:de,handleDrop:ue,allowDrop:a,onDragStart:N,onDragEnter:M,onDragOver:k,onDragLeave:P,onDragEnd:H,showLine:w,showIcon:C,showHandle:y,dragIcon:T,icon:D,leafIcon:E,folderIcon:L,folderOpenIcon:S,blockNode:A,disabled:O,size:n,data:r,getAllKeys:Be},yn=ye=>{let Qe=ye.relatedTarget,Ot=ye.currentTarget;(!Qe||!Ot.contains(Qe))&&de(null,null);};return jsx(Hg.Provider,{value:$e,children:jsx("div",{ref:z,role:"tree","aria-multiselectable":m||h,className:u(Lg({variant:t,size:n,className:e})),onDragLeave:yn,...V,children:r.map((ye,Qe)=>jsx(Ig,{node:ye,level:0,isLast:Qe===r.length-1},ye.key))})})});Ag.displayName="Tree";var Og=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-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),OC=({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))})},BC=(e,t)=>{let[n,r]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},Bg=Z.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,...x},w)=>{let[C,y]=Z.useState(false),[T,D]=Z.useState(r),[E,L]=Z.useState([]),[S,N]=Z.useState(false),[M,k]=Z.useState(false),[P,H]=Z.useState(0),I=Z.useRef(null),A=Z.useRef(null),O=n!==void 0?n:T,V=BC(O,l);Z.useEffect(()=>{let Y=A.current;if(!Y)return;let ve=()=>{H(Y.offsetWidth);};ve();let Q=new ResizeObserver(ve);return Q.observe(Y),()=>{Q.disconnect();}},[]),Z.useImperativeHandle(w,()=>I.current);let z=i?E:s,K=Z.useMemo(()=>i?z:z.filter(Y=>Y.label.toLowerCase().includes(O.toLowerCase())),[z,O,i]);Z.useEffect(()=>{if(!i)return;if(V.length<c){L([]);return}let Y=false;return (async()=>{N(true);try{let Q=await i(V);Y||L(Q);}catch{Y||L([]);}finally{Y||N(false);}})(),()=>{Y=true;}},[V,i,c]);let G=Y=>{n===void 0&&D(Y),o?.(Y);},X$1=Y=>{let ve=Y.target.value;G(ve),ve.length>=c&&y(true);},F=Y=>{G(Y.label),a?.(Y),y(false);},$=()=>{G(""),I.current?.focus();},j=()=>{k(true),y(true);},_=()=>{k(false);},B=Y=>{Y.key==="Escape"&&y(false),Y.key==="ArrowDown"&&!C&&K.length>0&&y(true);},q=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ee=p&&O?"pr-8":"pr-3";return jsxs(bt,{open:C,onOpenChange:y,children:[jsxs(Tn,{ref:A,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:O,onChange:X$1,onFocus:j,onBlur:_,onKeyDown:B,disabled:R,placeholder:d,className:u(Og({size:t,fullWidth:v}),ee,e),style:{borderColor:M?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&O&&!R&&jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:q})})]}),jsx(vt,{className:"p-0",align:"start",style:{width:P>0?P:void 0},onOpenAutoFocus:Y=>Y.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ae,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:S?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(q,"animate-spin")}),f]}):K.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):K.map(Y=>jsxs(Command.Item,{value:Y.value,disabled:Y.disabled,onSelect:()=>F(Y),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",O===Y.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(OC,{text:Y.label,query:O}):Y.label})]},Y.value))})})})})]})});Bg.displayName="Autocomplete";var ul=Z.createContext(null),ml=Z.createContext(null),pl=()=>{let e=Z.useContext(ul);if(!e)throw new Error("useFormContext must be used within a Form");return e},Rs=()=>{let e=Z.useContext(ml);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},FC={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})},Fg=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[m,f]=Z.useState({}),[p,g]=Z.useState({}),[h,b]=Z.useState({}),[v,R]=Z.useState(false),x=Z.useRef(new Map),w=Z.useCallback((P,H)=>{x.current.set(P,H);},[]),C=Z.useCallback(P=>{x.current.delete(P);},[]),y=Z.useCallback(P=>{let H=x.current.get(P)||[],I=c[P];for(let A of H)if(!A.validate(I))return f(O=>({...O,[P]:A.message})),false;return f(A=>({...A,[P]:null})),true},[c]),T=Z.useCallback(()=>{let P=true,H={};return x.current.forEach((I,A)=>{let O=c[A];for(let V of I)if(!V.validate(O)){H[A]=V.message,P=false;break}H[A]||(H[A]=null);}),f(H),P},[c]),D=Z.useCallback((P,H)=>{d(I=>({...I,[P]:H})),b(I=>({...I,[P]:true})),o&&setTimeout(()=>{y(P);},0);},[o,y]),E=Z.useCallback((P,H)=>{f(I=>({...I,[P]:H}));},[]),L=Z.useCallback((P,H)=>{g(I=>({...I,[P]:H})),H&&r&&y(P);},[r,y]),S=Z.useCallback(P=>({value:c[P],error:m[P]??null,touched:p[P]??false,dirty:h[P]??false}),[c,m,p,h]),N=Z.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),M=async P=>{P.preventDefault();let H={};if(x.current.forEach((A,O)=>{H[O]=true;}),g(H),!T()){n?.(m);return}if(t){R(true);try{await t(c);}finally{R(false);}}},k={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:D,setError:E,setTouched:L,validateField:y,validateAll:T,registerField:w,unregisterField:C,getFieldState:S,reset:N};return jsx(ul.Provider,{value:k,children:jsx("form",{ref:l,onSubmit:M,className:u("space-y-4",s),...i,children:a})})});Fg.displayName="Form";var Kg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=pl(),a=Z.useId();Z.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(ml.Provider,{value:i,children:r})};Kg.displayName="FormField";var $g=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));$g.displayName="FormItem";var Gg=Z.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Rs();return jsxs(Er,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});Gg.displayName="FormLabel";var Ug=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Rs(),a=pl(),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 Z.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})};Ug.displayName="FormControl";var jg=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));jg.displayName="FormDescription";var _g=Z.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});_g.displayName="FormMessage";var Yg=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"}}),Xg=Z.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(Yg({size:t,className:e})),...i,children:[jsxs(Sr,{"data-user-avatar":true,children:[o&&jsx(so,{src:o,alt:n}),jsx(Lr,{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})]})});Xg.displayName="User";var Zg=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},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"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),Qg=Z.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:u(Zg({variant:t,size:n,radius:r,className:e})),...o}));Qg.displayName="Code";function nb(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var rb=Z.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=nb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((v,R)=>jsxs("div",{...h({line:v}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:R+1}),v.map((x,w)=>jsx("span",{...b({token:x})},w))]},R))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});rb.displayName="CodeBlock";var ob=Z.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=nb(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:r,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((b,v)=>jsx("div",{...g({line:b}),children:b.map((R,x)=>jsx("span",{...h({token:R})},x))},v))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});ob.displayName="TabbedCodeBlock";var ab=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",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"}}),sb=Z.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]=Z.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(ab({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"})})]})});sb.displayName="Snippet";var vl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),ib=Z.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]=Z.useState("loading");Z.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(vl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(vl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Ba,{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})]})});ib.displayName="Image";var cb=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"}}),db=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 JC({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=Z.useState(null),[f,p]=Z.useState(null),g=(x,w)=>{i||(m(w),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(w)));},h=(x,w)=>{x.preventDefault(),!(i||d===null||d===w)&&p(w);},b=()=>{p(null);},v=(x,w)=>{if(x.preventDefault(),i||d===null||d===w){m(null),p(null);return}let C=[...r],[y]=C.splice(d,1);C.splice(w,0,y),o?.(C),m(null),p(null);},R=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(cb({variant:t,size:n,className:e})),...l,children:r.map((x,w)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,w),onDragOver:C=>h(C,w),onDragLeave:b,onDrop:C=>v(C,w),onDragEnd:R,className:u(db({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(x,w)})]},x.id))})}var eT=Z.forwardRef(JC);var fb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{variant:"spinner",size:"md"}}),ub={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},oT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},mb={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},gb=Z.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in mb,l=i?mb[o]:"",c=i?void 0:{color:o},d=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",style:c,children:[0,1,2].map(m=>jsx("div",{className:u(oT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${m*.15}s`}},m))});case "pulse":return jsx("div",{className:u(ub[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:u(ub[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:u(fb({variant:t,size:n,className:e})),role:"status","aria-label":r||"Loading",...a,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[d(),r&&jsx("span",{className:u("text-sm",l),style:c,children:r})]})})});gb.displayName="Loading";var iT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),lT=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",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),cT=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"}}),dT=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"}}),Es={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},xl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},hl=(e,t)=>String(e).padStart(t,"0"),bb=(e,t)=>{if(!e)return "";let n=hl(e.getDate(),2),r=hl(e.getMonth()+1,2),o=hl(e.getFullYear(),4),a=Es[t],s=xl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ns=(e,t)=>{let n=Es[t],r=e.split(n);if(r.length!==3)return null;let o=xl[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},uT=e=>{let t=Es[e];return xl[e].map(r=>r==="year"?"####":"##").join(t)},ca=(e,t)=>{if(!e?.from)return "";let n=bb(e.from,t),r=e.to?bb(e.to,t):"";return n&&r?`${n} - ${r}`:n},vb=Z.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="dd.MM.yyyy",showPickerIcon:v=true,mode:R="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:y,placeholder:T,id:D,...E},L)=>{let S=Z.useId(),N=D||S,M=`${N}-description`,k=`${N}-error`,[P,H]=Z.useState(f),[I,A]=Z.useState(""),[O,V]=Z.useState(false),[z,K]=Z.useState(false),G=m!==void 0?m:P,X=a&&r,F=uT(b),$=Es[b],j=" - ";Z.useEffect(()=>{z||A(ca(G,b));},[G,b,z]);let _=ne=>{m===void 0&&H(ne),p?.(ne);},B=ne=>{_(ne),A(ca(ne,b)),ne?.from&&ne?.to&&V(false);},q=ne=>{let Te=ne.target.value;Te=Te.replace(new RegExp(`[^0-9\\${$}\\s-]`,"g"),"");let fe=`${F}${j}${F}`,Ye=Te.replace(new RegExp(`[\\${$}\\s-]`,"g"),""),Ze="",Tt=0;for(let ke=0;ke<fe.length&&Tt<Ye.length;ke++)fe[ke]==="#"?(Ze+=Ye[Tt],Tt++):Ze+=fe[ke];if(A(Ze),Ze.length===fe.length){let ke=Ze.split(j);if(ke.length===2){let ct=Ns(ke[0].trim(),b),J=Ns(ke[1].trim(),b);if(ct&&J){if(g&&(ct<g||J<g)||h&&(ct>h||J>h))return;ct<=J&&_({from:ct,to:J});}}}},ee=()=>{K(true);},Y=()=>{K(false);let ne=`${F}${j}${F}`;if(I.length!==ne.length)A(ca(G,b));else {let Te=I.split(j);if(Te.length!==2)A(ca(G,b));else {let fe=Ns(Te[0].trim(),b),Ye=Ns(Te[1].trim(),b);(!fe||!Ye||fe>Ye)&&A(ca(G,b));}}},ve=()=>{y||V(true);},Q=()=>{!y&&R==="picker"&&v&&V(true);};return jsxs("div",{className:u(iT({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:u(dT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(bt,{open:v&&O,onOpenChange:V,children:[jsxs(Tn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:L,id:N,type:"text",inputMode:R==="text"?"numeric":void 0,value:I,onChange:R==="text"?q:void 0,onClick:Q,onFocus:ee,onBlur:Y,readOnly:R==="picker","aria-invalid":a,"aria-describedby":X?k:n?M:void 0,"aria-required":o,disabled:y,placeholder:T||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:u(lT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),R==="picker"&&v&&"cursor-pointer",l),style:{borderColor:z||v&&O?"var(--color-foreground)":void 0},...E}),v&&jsx("button",{type:"button",onClick:ve,disabled:y,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(cT({size:s}))})})]}),v&&jsx(vt,{className:"w-auto p-0",align:C,children:jsx(lo,{mode:"range",selected:G,onSelect:B,numberOfMonths:w,disabled:ne=>!!(g&&ne<g||h&&ne>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!X&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),X&&jsx("p",{id:k,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});vb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),hb=Z.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]=Z.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),m=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${ho(x.hours)}:${ho(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${ho(w)}:${ho(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let y=e.hours>=12;y&&x!==12?C=x+12:!y&&x===12&&(C=0);}t?.({hours:C,minutes:w});},g=x=>{let w=e?.hours??0;t?.({hours:w,minutes:x});},h=x=>{if(!e)return;let w=e.hours;x==="AM"&&e.hours>=12?w=e.hours-12:x==="PM"&&e.hours<12&&(w=e.hours+12),t?.({hours:w,minutes:e.minutes});},b=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,R=e?r?e.hours:e.hours%12||12:void 0;return jsxs(bt,{open:l,onOpenChange:c,children:[jsxs(nr,{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(vt,{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(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(me,{variant:R===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:ho(x)},x))})})]}),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(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(x=>jsx(me,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:ho(x)},x))})})]}),!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(me,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(me,{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(me,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(me,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});hb.displayName="TimePicker";var xb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function fT({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=Z.useRef(null),[p,g]=Z.useState(0);Z.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,x=Math.min(n.length-1,v+R),w=y=>{let T=y.currentTarget.scrollTop;g(T),c?.(T);},C=Z.useMemo(()=>{let y=[];for(let T=v;T<=x;T++)n[T]!==void 0&&y.push({item:n[T],index:T,style:{position:"absolute",top:T*b,left:0,right:0,height:r}});return y},[n,v,x,b,r]);return jsx("div",{ref:f,className:u(xb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:y,index:T,style:D})=>jsx("div",{style:D,children:s(y,T)},i?i(y,T):T))})})}var gT=Z.forwardRef(fT);var Rl=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),wl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Rb=Z.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,scrollbarVisibility:f="visible",...p},g)=>{let h=Z.useRef(null),b=Z.useRef(null),v=Z.useRef(false);Z.useImperativeHandle(g,()=>h.current),Z.useEffect(()=>{let w=b.current;if(!w)return;let C=new IntersectionObserver(y=>{let[T]=y;T.isIntersecting&&a&&!s&&!v.current&&(v.current=true,Promise.resolve(o()).finally(()=>{v.current=false;}));},{root:d?null:h.current,rootMargin:c||`${l}px`,threshold:0});return C.observe(w),()=>{C.disconnect();}},[a,s,o,l,c,d]);let R=jsx("div",{className:u(wl({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),x=jsxs(Fragment,{children:[r,jsx("div",{ref:b,className:"h-px w-full"}),s&&(i||R),!a&&!s&&m&&jsx("div",{className:u(wl({size:n}),"text-muted-foreground text-sm"),children:m})]});return d?jsx("div",{ref:h,className:u(Rl({variant:t,className:e})),...p,children:x}):jsx(Ae,{ref:h,visibility:f,className:u(Rl({variant:t,className:e})),...p,children:x})});Rb.displayName="InfiniteScroll";var PT=e=>e.map(t=>typeof t=="string"?{src:t}:t),Cl=Z.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=Z.useMemo(()=>PT(e),[e]),[v,R]=Z.useState(r),[x,w]=Z.useState(1),[C,y]=Z.useState(0),[T,D]=Z.useState(false),[E,L]=Z.useState(false),[S,N]=Z.useState({x:0,y:0}),[M,k]=Z.useState({x:0,y:0}),[P,H]=Z.useState(false),I=Z.useRef(null),A=b[v];Z.useEffect(()=>{H(true);},[]),Z.useEffect(()=>{R(r);},[r]),Z.useEffect(()=>{o?.(v);},[v,o]),Z.useEffect(()=>{w(1),y(0),N({x:0,y:0});},[v]),Z.useEffect(()=>{if(t)return an(),()=>sn()},[t]);let O=Z.useCallback(()=>{R(Q=>Q>0?Q-1:b.length-1);},[b.length]),V=Z.useCallback(()=>{R(Q=>Q<b.length-1?Q+1:0);},[b.length]),z=()=>{w(Q=>Math.min(Q+.5,4));},K=()=>{w(Q=>{let ne=Math.max(Q-.5,.5);return ne===1&&N({x:0,y:0}),ne});},G=()=>{y(Q=>(Q+90)%360);},X$1=async()=>{if(A)try{let ne=await(await fetch(A.src)).blob(),Te=URL.createObjectURL(ne),fe=document.createElement("a");fe.href=Te,fe.download=A.alt||`image-${v+1}`,document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(Te);}catch{window.open(A.src,"_blank");}},F=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),D(!1);}catch{}else try{await I.current.requestFullscreen(),D(!0);}catch{}},$=Q=>{x>1&&(L(true),k({x:Q.clientX-S.x,y:Q.clientY-S.y}));},j=Q=>{E&&x>1&&N({x:Q.clientX-M.x,y:Q.clientY-M.y});},_=()=>{L(false);},B=()=>{n?.(false);},q=Q=>{p&&Q.target===Q.currentTarget&&B();},ee=Z.useCallback(Q=>{switch(Q.key){case "ArrowLeft":O();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":z();break;case "-":K();break}},[O,V,n]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[t,ee]),Z.useEffect(()=>{let Q=()=>{D(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),b.length===0)return null;let Y=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[Y,!P||!t?null:ja.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:q}),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]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:K,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(x*100),"%"]}),jsx("button",{onClick:z,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:G,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:X$1,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:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:T?"Exit fullscreen":"Fullscreen",children:T?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:B,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:I,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:$,onMouseMove:j,onMouseUp:_,onMouseLeave:_,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:O,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:V,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:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",E?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${S.x}px, ${S.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((Q,ne)=>jsx("button",{onClick:()=>R(ne),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===ne?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${ne+1}`,className:"h-full w-full object-cover"})},ne))})]})]}),document.body)]})});Cl.displayName="ImageViewer";var Cb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=Z.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(Cl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Cb.displayName="ImageViewerTrigger";var Tb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-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"}}),ST={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"},LT={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"},DT=e=>{let t=e.toLowerCase();return ST[t]||e.toUpperCase()},ua=e=>{let t=e.toLowerCase();return LT[t]||t},Ls=e=>{let t=ua(e);return ["meta","control","alt","shift"].includes(t)},Mb=Z.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Ls).map(ua),p=m.filter(h=>!Ls(h)).map(ua),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,R=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());b&&v&&R&&x&&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(Z.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:DT(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(Tb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Mb.displayName="Kbd";function HT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;Z.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Ls).map(ua),i=a.filter(c=>!Ls(c)).map(ua),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 Nb=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 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 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),kb=Z.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,m]=Z.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),m(!0),o?.(),setTimeout(()=>{m(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:u(Nb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:p,height:p}}):s??jsx(Copy,{style:{width:p,height:p}})})});kb.displayName="CopyButton";var Eb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),KT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],$T=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],GT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function UT(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 jT(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 Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Pb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ro(r,t)||Ro(o,t)||r<t&&o>t})}var Sb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=KT,date:l,onDateChange:c,onEventClick:d,onSlotClick:m,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[b,v]=Z.useState(new Date),R=l??b,x=N=>{c?c(N):v(N);},w=f===1?GT:$T,C=()=>{let N=new Date(R);a==="month"?N.setMonth(N.getMonth()-1):a==="week"?N.setDate(N.getDate()-7):N.setDate(N.getDate()-1),x(N);},y=()=>{let N=new Date(R);a==="month"?N.setMonth(N.getMonth()+1):a==="week"?N.setDate(N.getDate()+7):N.setDate(N.getDate()+1),x(N);},T=()=>{x(new Date);},D=()=>a==="day"?R.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):R.toLocaleDateString(p,{year:"numeric",month:"long"}),E=()=>{let N=UT(R.getFullYear(),R.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(M=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:M},M))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:N.map((M,k)=>{let P=Pb(o,M),H=M.getMonth()===R.getMonth(),I=Ro(M,R);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",I&&"bg-accent"),onClick:()=>m?.(M),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(M)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:M.getDate()}),jsxs("div",{className:"space-y-0.5",children:[P.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:O=>{O.stopPropagation(),d?.(A);},children:A.title},A.id)),P.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",P.length-3," more"]})]})]},k)})})]})},L=()=>{let N=jT(R,f),M=Array.from({length:24},(k,P)=>P);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"}),N.map((k,P)=>{let H=Ro(k,R);return jsxs("div",{className:u("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(k)&&"bg-primary/10",H&&!yo(k)&&"bg-accent"),onClick:()=>m?.(k),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[P]}),jsx("div",{className:u("text-lg font-semibold",yo(k)&&"text-primary",H&&!yo(k)&&"text-primary"),children:k.getDate()})]},P)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:M.map(k=>jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[k.toString().padStart(2,"0"),":00"]}),N.map((P,H)=>{let I=new Date(P);I.setHours(k,0,0,0);let A=o.filter(O=>{let V=new Date(O.start);return Ro(V,P)&&V.getHours()===k});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(I),children:A.map(O=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:O.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),d?.(O);},children:O.title},O.id))},H)})]},k))})})]})},S=()=>{let N=Array.from({length:24},(k,P)=>P),M=Pb(o,R);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",yo(R)&&"bg-primary text-primary-foreground"),children:R.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:N.map(k=>{let P=new Date(R);P.setHours(k,0,0,0);let H=M.filter(I=>new Date(I.start).getHours()===k);return jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[k.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(P),children:H.map(I=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:I.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(I);},children:I.title},I.id))})]},k)})})})]})};return jsxs("div",{ref:h,className:u(Eb({variant:t,size:n,radius:r,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:D()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(me,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx($a,{options:i,value:a,onValueChange:N=>s?.(N),size:"sm",radius:"md",className:"w-[120px]"}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:y,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&E(),a==="week"&&L(),a==="day"&&S()]})});Sb.displayName="FullCalendar";var As=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),pa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),fa=["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%))"],Lb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(pa({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,{content:jsx(As,{})}),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))]})})}));Lb.displayName="LineChart";var Db=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,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(pa({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,{content:jsx(As,{})}),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))]})})}));Db.displayName="BarChart";var Hb=Z.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=fa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(pa({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(As,{})}),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}`))})]})})}));Hb.displayName="PieChart";var Ib=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=fa,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(pa({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,{content:jsx(As,{})}),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))]})})}));Ib.displayName="AreaChart";var El={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function fM({card:e,columnId:t,radius: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("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",El[n]),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 Ab({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:u("flex flex-col min-w-[280px] w-[280px]",El[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("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})]})}),jsx(Ae,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(fM,{card:l,columnId:e.id,radius:t,renderCard:n,onCardClick:r},l.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"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(me,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Ob=Z.forwardRef(({className:e,columns:t,onCardMove:n,onCardClick:r,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},m)=>{let[f,p]=Z.useState(false),[g,h]=Z.useState(null),[b,v]=Z.useState(null);Z.useEffect(()=>{p(true);},[]);let R=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Ab,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(D=>D.cards.some(E=>E.id===T));return jsxs(DndContext,{sensors:R,collisionDetection:closestCorners,onDragStart:T=>{let{active:D}=T,E=x(D.id);if(E){let L=E.cards.find(S=>S.id===D.id);L&&(h(L),v(E.id));}},onDragOver:T=>{let{active:D,over:E}=T;if(!E)return;let L=D.id,S=E.id,N=x(L),M=x(S)||t.find(H=>H.id===S);if(!N||!M||N.id===M.id)return;let k=M.cards.findIndex(H=>H.id===S),P=k===-1?M.cards.length:k;n?.(L,N.id,M.id,P);},onDragEnd:T=>{let{active:D,over:E}=T;if(E&&D.id!==E.id){let L=x(D.id),S=x(E.id)||t.find(N=>N.id===E.id);if(L&&S){let N=S.cards.findIndex(k=>k.id===E.id),M=N===-1?S.cards.length:N;n?.(D.id,L.id,S.id,M);}}h(null),v(null);},children:[jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Ab,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))}),jsx(DragOverlay,{children:g&&b&&jsx("div",{className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",El[c]),children:a?a(g,b):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:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Ob.displayName="KanbanBoard";var Bb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Fb=Z.createContext(null);function Os(){let e=Z.useContext(Fb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Kb=Z.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]=gM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=Z.useState(false),[h,b]=Z.useState(false),[v,R]=Z.useState(0),[x,w]=Z.useState([]),C=Z.useCallback(L=>{L&&(R(L.selectedScrollSnap()),g(L.canScrollPrev()),b(L.canScrollNext()));},[]),y=Z.useCallback(()=>{f?.scrollPrev();},[f]),T=Z.useCallback(()=>{f?.scrollNext();},[f]),D=Z.useCallback(L=>{f?.scrollTo(L);},[f]),E=Z.useCallback(L=>{L.key==="ArrowLeft"?(L.preventDefault(),y()):L.key==="ArrowRight"&&(L.preventDefault(),T());},[y,T]);return Z.useEffect(()=>{!f||!l||l(f);},[f,l]),Z.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Fb.Provider,{value:{carouselRef:m,api:f,scrollPrev:y,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:x,scrollTo:D,orientation:a},children:jsxs("div",{ref:d,className:u(Bb({variant:t,className:e})),onKeyDownCapture:E,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(Sl,{}),jsx(Ll,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((L,S)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",S===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>D(S),"aria-label":`Go to slide ${S+1}`},S))})]})})});Kb.displayName="Carousel";var $b=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));$b.displayName="CarouselContent";var Gb=Z.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=Os();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});Gb.displayName="CarouselItem";var Sl=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=Os();return jsxs(me,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Sl.displayName="CarouselPrevious";var Ll=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=Os();return jsxs(me,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Ll.displayName="CarouselNext";var Ub=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"}},Hl={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}"]},jb=Z.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(r.length>0?"recent":o),[m,f]=Z.useState(""),g=m?Object.values(Hl).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:Hl[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:u(Ub({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(ao,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx(Ae,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:u("shrink-0 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(Ae,{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"})]})})]})});jb.displayName="EmojiPicker";var _b=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),WM=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"}}),YM=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"}}),at=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Rn,{children:[jsx(wn,{children:jsx(me,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Cn,{side:"top",className:"text-xs",children:t})]}),Wb=Z.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:[TM.configure({heading:{levels:[1,2,3]}}),MM.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),NM,kM.configure({types:["heading","paragraph"]}),PM.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});Z.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),Z.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(tr,{children:jsxs("div",{ref:f,className:u(_b({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(WM({size:n})),children:[jsx(at,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(at,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{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(at,{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(at,{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(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(at,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(at,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(at,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(at,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(at,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(at,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(at,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(er,{orientation:"vertical",className:"h-6 mx-1"}),jsx(at,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(at,{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(YM({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Wb.displayName="RichTextEditor";var Xb=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function nN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function Yb(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 qb=Z.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=Z.useRef(null),[h,b]=Z.useState(),[v,R]=Z.useState(),[x,w]=Z.useState(1),[C,y]=Z.useState(0),T=S=>{let{width:N,height:M}=S.currentTarget;if(r){let k=nN(N,M,r);b(k);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},D=S=>{b(S),o?.(S);},E=async S=>{if(R(S),a&&g.current&&S.width&&S.height){let N=await Yb(g.current,S,C,x);a(N);}},L=()=>{y(S=>(S+90)%360);};return Z.useEffect(()=>{v&&g.current&&a&&Yb(g.current,v,C,x).then(S=>{a(S);});},[x,C,v,a]),jsxs("div",{ref:p,className:u(Xb({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(XM,{crop:h,onChange:D,onComplete:E,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",crossOrigin:"anonymous",onLoad:T,style:{transform:`scale(${x}) 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(Jt,{value:[x],onValueChange:([S])=>w(S),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(me,{variant:"bordered",size:"sm",isIconOnly:true,onClick:L,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});qb.displayName="ImageCropper";var zl=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"}}),aN={sm:96,md:128,lg:192},Qb=Z.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??aN[n??"md"];return r?jsx("div",{ref:h,className:u(zl({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(rN,{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(zl({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"})})});Qb.displayName="QRCode";var Jb=({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});Jb.displayName="ThemeProvider";var mN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),ev=Z.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.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(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className: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(qt,{children:[jsx(Zt,{children:jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className: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(Qt,{align:"end",children:[jsxs(Lt,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Lt,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Lt,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});ev.displayName="ThemeToggle";var tv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),nv=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-9 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),rv=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"}}),ov=Z.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=Z.useId(),v=p||b,R=`${v}-description`,x=`${v}-error`,w=a&&r;return jsxs("div",{className:u(tv({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(rv({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?x:n?R:void 0,"aria-required":o,className:u(nv({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:R,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});ov.displayName="TextField";var sv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),gN=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-9 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-11 pl-12 pr-12 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),av=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"}}),bN=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"}}),vN=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"}}),iv=Z.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:x="Search...",id:w,...C},y)=>{let T=Z.useId(),D=w||T,E=`${D}-description`,L=`${D}-error`,[S,N]=Z.useState(f),M=m!==void 0?m:S,k=a&&r,P=M.length>0,H=O=>{let V=O.target.value;m===void 0&&N(V),p?.(V);},I=()=>{m===void 0&&N(""),p?.(""),g?.();},A=O=>{O.key==="Enter"?(O.preventDefault(),h?.(M)):O.key==="Escape"&&P&&(O.preventDefault(),I());};return jsxs("div",{className:u(sv({size:s}),e),children:[t&&jsxs("label",{htmlFor:D,className:u(bN({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(av({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:y,id:D,type:"search",value:M,onChange:H,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":k?L:n?E:void 0,"aria-required":o,disabled:R,className:u(gN({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&P&&!R&&jsx("button",{type:"button",onClick:I,className:u(vN({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(av({size:s}))})})]}),n&&!k&&jsx("p",{id:E,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),k&&jsx("p",{id:L,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});iv.displayName="SearchField";var lv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),xN=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",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),yN=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"}}),RN=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"}}),Us={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Ul={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},$l=(e,t)=>String(e).padStart(t,"0"),ha=(e,t)=>{if(!e)return "";let n=$l(e.getDate(),2),r=$l(e.getMonth()+1,2),o=$l(e.getFullYear(),4),a=Us[t],s=Ul[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Gl=(e,t)=>{let n=Us[t],r=e.split(n);if(r.length!==3)return null;let o=Ul[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},wN=e=>{let t=Us[e];return Ul[e].map(r=>r==="year"?"####":"##").join(t)},js=Z.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="dd.MM.yyyy",showPickerIcon:v=true,mode:R="text",fullWidth:x=false,disabled:w,placeholder:C,id:y,...T},D)=>{let E=Z.useId(),L=y||E,S=`${L}-description`,N=`${L}-error`,[M,k]=Z.useState(f??null),[P,H]=Z.useState(""),[I,A]=Z.useState(false),[O,V]=Z.useState(false),z=m!==void 0?m:M,K=a&&r,G=Us[b],X=wN(b);Z.useEffect(()=>{O||H(ha(z,b));},[z,b,O]);let F=Y=>{m===void 0&&k(Y),p?.(Y);},$=Y=>{let ve=Y??null;F(ve),H(ha(ve,b)),A(false);},j=Y=>{let ve=Y.target.value;ve=ve.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=ve.replace(new RegExp(`\\${G}`,"g"),""),ne="",Te=0;for(let fe=0;fe<X.length&&Te<Q.length;fe++)X[fe]==="#"?(ne+=Q[Te],Te++):ne+=X[fe];if(H(ne),ne.length===X.length){let fe=Gl(ne,b);if(fe){if(g&&fe<g||h&&fe>h)return;F(fe);}}},_=()=>{V(true);},B=()=>{V(false),P.length!==X.length?H(ha(z,b)):Gl(P,b)||H(ha(z,b));},q=()=>{w||A(true);},ee=()=>{!w&&R==="picker"&&v&&A(true);};return jsxs("div",{className:u(lv({size:s}),e),children:[t&&jsxs("label",{htmlFor:L,className:u(RN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(bt,{open:v&&I,onOpenChange:A,children:[jsxs(Tn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:D,id:L,type:"text",inputMode:R==="text"?"numeric":void 0,value:P,onChange:R==="text"?j:void 0,onClick:ee,onFocus:_,onBlur:B,readOnly:R==="picker","aria-invalid":a,"aria-describedby":K?N:n?S:void 0,"aria-required":o,disabled:w,placeholder:C||b.toLowerCase(),className:u(xN({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),R==="picker"&&v&&"cursor-pointer",l),style:{borderColor:O||v&&I?"var(--color-foreground)":void 0},...T}),v&&jsx("button",{type:"button",onClick:q,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(yN({size:s}))})})]}),v&&jsx(vt,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:z??void 0,onSelect:$,disabled:Y=>!!(g&&Y<g||h&&Y>h),defaultMonth:z??void 0,showMonthAndYearPickers:true})})]}),n&&!K&&jsx("p",{id:S,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),K&&jsx("p",{id:N,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});js.displayName="DatePicker";var CN=js,TN=js;var cv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),MN=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}}),NN=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"}}),dv=Z.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:x=false,id:w,...C},y)=>{let T=Z.useId(),D=w||T,E=`${D}-description`,L=`${D}-error`,S=Z.useRef(null),N=Z.useRef(null),M=Z.useRef(null),k=Z.useRef(null),[P,H]=Z.useState(f??null),I=m!==void 0?m:P,A=a&&r,O=W=>v===24?W:W===0?12:W>12?W-12:W,V=W=>W>=12?"PM":"AM",z=(W,ae)=>ae==="AM"?W===12?0:W:W===12?12:W+12,[K,G]=Z.useState(I?String(O(I.hour)).padStart(2,"0"):""),[X,F]=Z.useState(I?String(I.minute).padStart(2,"0"):""),[$,j]=Z.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[_,B]=Z.useState(I?V(I.hour):"AM"),[q,ee]=Z.useState(false);Z.useEffect(()=>{m!==void 0&&(m?(G(String(O(m.hour)).padStart(2,"0")),F(String(m.minute).padStart(2,"0")),m.second!==void 0&&j(String(m.second).padStart(2,"0")),B(V(m.hour))):(G(""),F(""),j("")));},[m,v]);let Y=(W,ae,U,de)=>{let ue=parseInt(W,10),Be=parseInt(ae,10),$e=b?parseInt(U,10):void 0;if(isNaN(ue)||isNaN(Be)||b&&isNaN($e)){m===void 0&&H(null),p?.(null);return}let ye={hour:v===12?z(ue,de):ue,minute:Be,...b&&$e!==void 0&&{second:$e}};m===void 0&&H(ye),p?.(ye);},ve=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);G(ae);let U=v===24?23:12,de=v===24?0:1;if(ae.length===2){let ue=parseInt(ae,10);ue>=de&&ue<=U&&(N.current?.focus(),N.current?.select());}},Q=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);if(F(ae),ae.length===2){let U=parseInt(ae,10);U>=0&&U<=59&&(b?(M.current?.focus(),M.current?.select()):v===12&&k.current?.focus());}},ne=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);j(ae),ae.length===2&&v===12&&k.current?.focus();},Te=()=>{if(K){let W=parseInt(K,10),ae=v===24?23:12,de=Math.min(Math.max(W,v===24?0:1),ae),ue=String(de).padStart(2,"0");G(ue),Y(ue,X,$,_);}},fe=()=>{if(X){let W=parseInt(X,10),ae=Math.min(Math.max(W,0),59),U=String(ae).padStart(2,"0");F(U),Y(K,U,$,_);}},Ye=()=>{if($){let W=parseInt($,10),ae=Math.min(Math.max(W,0),59),U=String(ae).padStart(2,"0");j(U),Y(K,X,U,_);}},Ze=()=>{let W=_==="AM"?"PM":"AM";B(W),Y(K,X,$,W);},Tt=W=>{let ae=W.key.toLowerCase();ae==="a"?(W.preventDefault(),_!=="AM"&&(B("AM"),Y(K,X,$,"AM"))):ae==="p"?(W.preventDefault(),_!=="PM"&&(B("PM"),Y(K,X,$,"PM"))):ae==="arrowup"||ae==="arrowdown"?(W.preventDefault(),Ze()):ae==="arrowleft"&&(W.preventDefault(),b?(M.current?.focus(),M.current?.select()):(N.current?.focus(),N.current?.select()));},ke=(W,ae)=>{if(W.key==="ArrowUp"||W.key==="ArrowDown"){W.preventDefault();let U=W.key==="ArrowUp"?1:-1;if(ae==="hour"){let de=parseInt(K,10)||0,ue=v===24?23:12,Be=v===24?0:1,$e=de+U;$e>ue&&($e=Be),$e<Be&&($e=ue);let yn=String($e).padStart(2,"0");G(yn),Y(yn,X,$,_);}else if(ae==="minute"){let ue=(parseInt(X,10)||0)+U;ue>59&&(ue=0),ue<0&&(ue=59);let Be=String(ue).padStart(2,"0");F(Be),Y(K,Be,$,_);}else if(ae==="second"){let ue=(parseInt($,10)||0)+U;ue>59&&(ue=0),ue<0&&(ue=59);let Be=String(ue).padStart(2,"0");j(Be),Y(K,X,Be,_);}}W.key==="ArrowRight"&&(W.preventDefault(),ae==="hour"?(N.current?.focus(),N.current?.select()):ae==="minute"&&b?(M.current?.focus(),M.current?.select()):(ae==="minute"&&!b&&v===12||ae==="second"&&v===12)&&k.current?.focus()),W.key==="ArrowLeft"&&(W.preventDefault(),ae==="minute"?(S.current?.focus(),S.current?.select()):ae==="second"&&(N.current?.focus(),N.current?.select())),W.key==="Backspace"&&W.currentTarget.value===""&&(ae==="minute"?S.current?.focus():ae==="second"&&N.current?.focus());},J=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(cv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:D,className:u(NN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(MN({size:s,isInvalid:a,disabled:R,fullWidth:x}),l),style:{borderColor:q?"var(--color-foreground)":void 0},onFocus:()=>ee(true),onBlur:W=>{W.currentTarget.contains(W.relatedTarget)||ee(false);},children:[jsx("input",{ref:S,id:D,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:K,onChange:ve,onBlur:Te,onKeyDown:W=>ke(W,"hour"),onFocus:W=>W.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?L:n?E:void 0,"aria-required":o,disabled:R,className:J}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:N,type:"text",inputMode:"numeric",placeholder:"mm",value:X,onChange:Q,onBlur:fe,onKeyDown:W=>ke(W,"minute"),onFocus:W=>W.target.select(),"aria-label":"Minute",disabled:R,className:J}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"ss",value:$,onChange:ne,onBlur:Ye,onKeyDown:W=>ke(W,"second"),onFocus:W=>W.target.select(),"aria-label":"Second",disabled:R,className:J})]}),v===12&&jsx("button",{ref:k,type:"button",onClick:Ze,onKeyDown:Tt,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:_})]}),n&&!A&&jsx("p",{id:E,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:L,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});dv.displayName="TimeField";var mv=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"}}),pv=Z.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=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>R(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(mv({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(qt,{children:[jsx(Zt,{"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(Qt,{align:"end",children:g.map(w=>jsxs(Lt,{disabled:w.isDisabled,onClick:()=>R(w.key,w.onPress),children:[w.icon&&jsx("span",{className:u(v,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});pv.displayName="ActionGroup";var vv=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"}}),SN=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}}),hv=Z.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(vv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(SN({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));hv.displayName="StatusLight";var xv=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"}}),yv=Z.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(xv({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(Ft,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});yv.displayName="ActionBar";var Rv=Z.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]}));Rv.displayName="ActionBarButton";var wv=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"}}),IN=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"}}),VN=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"}}),Cv=Z.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]=Z.useState(o),x=r!==void 0,w=x?r:v,C=Z.useRef(null),[y,T]=Z.useState(false),[D,E]=Z.useState(null),L=(V,z)=>{if(!C.current)return w[0];let K=C.current.getBoundingClientRect(),G;t==="horizontal"?G=(V-K.left)/K.width:G=1-(z-K.top)/K.height,G=Math.max(0,Math.min(1,G));let X=i+G*(l-i),F=Math.round(X/c)*c;return Math.max(i,Math.min(l,F))},S=(V,z)=>{let K=[...w];K[z]=V,z===0&&V>w[1]&&(K[0]=w[1]),z===1&&V<w[0]&&(K[1]=w[0]),x||R(K),a?.(K);},N=(V,z)=>{d||(V.preventDefault(),T(true),E(z),V.target.setPointerCapture(V.pointerId));},M=V=>{if(!y||D===null||d)return;let z=L(V.clientX,V.clientY);S(z,D);},k=()=>{y&&(T(false),E(null),s?.(w));},P=V=>{if(d)return;let z=L(V.clientX,V.clientY),K=Math.abs(w[0]-z),G=Math.abs(w[1]-z),X=K<=G?0:1;S(z,X);let F=[...w];F[X]=z,s?.(F);},H=(V,z)=>{if(d)return;let K=w[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(l,w[z]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(i,w[z]-c);break;case "Home":V.preventDefault(),K=i;break;case "End":V.preventDefault(),K=l;break;default:return}S(K,z);let G=[...w];G[z]=K,s?.(G);},I=V=>(V-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],O={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(wv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(IN({orientation:t,size:n})),onClick:P,children:jsx("div",{className:u("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${I(w[0])}%`,right:`${100-I(w[1])}%`,top:0,bottom:0}:{bottom:`${I(w[0])}%`,top:`${100-I(w[1])}%`,left:0,right:0}})}),w.map((V,z)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":V,"aria-orientation":t||void 0,"aria-disabled":d,className:u(VN({size:n}),y&&D===z&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${I(V)}% - ${O/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${I(V)}% - ${O/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:K=>N(K,z),onPointerMove:M,onPointerUp:k,onPointerCancel:k,onKeyDown:K=>H(K,z)},z)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});Cv.displayName="RangeSlider";var ql=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"}}),FN=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"}}),KN={help:HelpCircle,info:Info,warning:AlertCircle},Nv=Z.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]=Z.useState(false),[b,v]=Z.useState(false),[R,x]=Z.useState({top:0,left:0}),w=Z.useRef(null),C=Z.useRef(null),y=i!==void 0?i:g,T=Z.useCallback(S=>{i===void 0&&h(S),l?.(S);},[i,l]);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{if(!y||!w.current)return;let S=()=>{let N=w.current.getBoundingClientRect(),M=C.current?.getBoundingClientRect(),k=M?.width||288,P=M?.height||100,H=8,I=0,A=0;switch(a){case "top":I=N.top-P-H,A=N.left+N.width/2-k/2;break;case "bottom":I=N.bottom+H,A=N.left+N.width/2-k/2;break;case "left":I=N.top+N.height/2-P/2,A=N.left-k-H;break;case "right":I=N.top+N.height/2-P/2,A=N.right+H;break}if(a==="top"||a==="bottom")switch(s){case "start":A=N.left;break;case "center":A=N.left+N.width/2-k/2;break;case "end":A=N.right-k;break}if(a==="left"||a==="right")switch(s){case "start":I=N.top;break;case "center":I=N.top+N.height/2-P/2;break;case "end":I=N.bottom-P;break}A=Math.max(8,Math.min(A,window.innerWidth-k-8)),I=Math.max(8,Math.min(I,window.innerHeight-P-8)),x({top:I,left:A});};return S(),requestAnimationFrame(S),window.addEventListener("resize",S),window.addEventListener("scroll",S,true),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,true);}},[y,a,s]),Z.useEffect(()=>{if(!y)return;let S=N=>{C.current&&!C.current.contains(N.target)&&w.current&&!w.current.contains(N.target)&&T(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[y,T]),Z.useEffect(()=>{if(!y)return;let S=N=>{N.key==="Escape"&&T(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[y,T]);let D=KN[e??"help"],E=()=>{T(!y);},L=()=>{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?Z.isValidElement(o)?Z.cloneElement(o,{ref:w,onClick:S=>{o.props.onClick?.(S),E();}}):jsx("button",{ref:w,type:"button",onClick:E,className:u(ql({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:S=>{w.current=S,typeof p=="function"?p(S):p&&(p.current=S);},type:"button",onClick:E,className:u(ql({variant:e,size:t}),m),"aria-label":"Help",children:jsx(D,{className:"h-full w-full"})}),b&&y&&ja.createPortal(jsxs("div",{ref:C,className:u(FN({size:t}),f),style:{position:"fixed",top:R.top,left:R.left,transformOrigin:L()},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)]})});Nv.displayName="ContextualHelp";var Pv=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),Zl=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",bordered:"border border-current 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:"bordered",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 Ev({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]=Z.useState(new Set),v=Z.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),R=y=>{if(s==="none")return;let T;s==="single"?T=v.has(y)?new Set:new Set([y]):(T=new Set(v),T.has(y)?T.delete(y):T.add(y)),a||b(T),i?.(T);},x=(y,T)=>{T.stopPropagation(),c?.(y);},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(Pv({spacing:t}),e),...g,children:[w.map(y=>{let T=v.has(y.key),D=s!=="none";return jsxs("span",{role:D?"button":void 0,tabIndex:D&&!y.isDisabled?0:void 0,"aria-pressed":D?T:void 0,onClick:()=>!y.isDisabled&&R(y.key),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&!y.isDisabled&&(E.preventDefault(),R(y.key));},style:y.color?{backgroundColor:y.color}:void 0,className:u(Zl({variant:y.color?void 0:n,size:r,isSelected:T,isDisabled:y.isDisabled}),D&&!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:E=>x(y.key,E),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(Zl({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Ev.displayName="TagGroup";var Dv=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"}}),Hv=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 Iv({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]=Z.useState(new Set),h=Z.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(Dv({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(Hv({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)})})}Iv.displayName="GridList";var Vv=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"}}),Js=(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)]},Av=(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]},zv=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},Ov=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Bv=Z.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=Z.useRef(null),[g,h]=Z.useState(false),b=Z.useCallback(V=>{let z=zv(V);return z?Av(...z):[0,1,1]},[]),[v,R]=Z.useState(()=>b(r||o)),x=e??v[0],w=t??v[1],C=n??v[2];Z.useEffect(()=>{if(r){let V=b(r);R(V);}},[r,b]);let y=Z.useCallback((V,z)=>{if(l||!p.current)return;let K=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-K.left)/K.width)),X=Math.max(0,Math.min(1,(z-K.top)/K.height)),F=G,$=1-X;t===void 0&&n===void 0&&R([x,F,$]),a?.({hue:x,saturation:F,brightness:$});let j=Js(x,F,$);s?.(Ov(...j));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),y(V.clientX,V.clientY));},D=V=>{g&&y(V.clientX,V.clientY);},E=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[L,S,N]=Js(x,1,1),M=`rgb(${L}, ${S}, ${N})`,k=w*100,P=(1-C)*100,[H,I,A]=Js(x,w,C),O=`rgb(${H}, ${I}, ${A})`;return jsx("div",{ref:f,className:u(Vv({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:M},onPointerDown:T,onPointerMove:D,onPointerUp:E,onPointerLeave:E,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(${k}% - ${c/2}px)`,top:`calc(${P}% - ${c/2}px)`,backgroundColor:O,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Bv.displayName="ColorArea";var Kv=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"}}),YN=`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")`,Fv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",$v=Z.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=Z.useRef(null),[g,h]=Z.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,R]=Z.useState(t??b()),x=e??v,w=r==="hue"?x/360:x,C=Z.useCallback((M,k)=>{if(i||!p.current)return;let P=p.current.getBoundingClientRect(),H=a!=="vertical",I;H?I=Math.max(0,Math.min(1,(M-P.left)/P.width)):I=Math.max(0,Math.min(1,1-(k-P.top)/P.height));let A=r==="hue"?I*360:I;e===void 0&&R(A),n?.(A);},[i,a,r,e,n]),y=M=>{i||(M.preventDefault(),h(true),M.target.setPointerCapture(M.pointerId),C(M.clientX,M.clientY));},T=M=>{g&&C(M.clientX,M.clientY);},D=M=>{h(false),M.target.releasePointerCapture(M.pointerId);},E=()=>{let M=a!=="vertical",k=M?"to right":"to top";switch(r){case "hue":return M?Fv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${k}, transparent, ${o})`;case "saturation":return `linear-gradient(${k}, #808080, ${o})`;case "brightness":return `linear-gradient(${k}, #000000, ${o})`;default:return Fv}},L=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,S=a!=="vertical",N=w*100;return jsx("div",{ref:f,className:u(Kv({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"?YN:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:T,onPointerUp:D,onPointerLeave:D,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:E()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...S?{left:`calc(${N}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${N}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:L(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});$v.displayName="ColorSlider";var Gv=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"}}),ZN=(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},Uv=Z.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=Z.useRef(null),[f,p]=Z.useState(false),[g,h]=Z.useState(t),b=e??g,v=Z.useCallback((y,T)=>{if(o||!m.current)return;let D=m.current.getBoundingClientRect(),E=D.width/2,L=y-D.left,S=T-D.top,N=ZN(L,S,E);e===void 0&&h(N),n?.(N);},[o,e,n]),R=y=>{o||(y.preventDefault(),p(true),y.target.setPointerCapture(y.pointerId),v(y.clientX,y.clientY));},x=y=>{f&&v(y.clientX,y.clientY);},w=y=>{p(false),y.target.releasePointerCapture(y.pointerId);},C=()=>{let y=[];for(let T=0;T<=360;T+=30)y.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:u(Gv({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:x,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(QN,{hue:b,innerRadius:a,thumbSize:s})]})})});Uv.displayName="ColorWheel";var QN=({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 Wv=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-9 text-xs",md:"h-10 text-sm",lg:"h-11 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Lo=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"}}),Yv=Z.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,...x},w)=>{let[C,y]=Z.useState(false),[T,D]=Z.useState(t),E=e!==void 0?e:T,L=Z.useRef(null);Z.useImperativeHandle(w,()=>L.current);let S=E.length>0,N=C&&(a.length>0||s.length>0||l.length>0||S),M=V=>{e===void 0&&D(V),n?.(V);},k=()=>{M(""),L.current?.focus();},P=V=>{V?.preventDefault(),E.trim()&&(r?.(E.trim()),y(false));},H=V=>{M(V.label),o?.(V),y(false);},I=V=>{M(V),r?.(V),y(false);},A=V=>{M(V),r?.(V),y(false);},O=Z.useMemo(()=>{let V={};return a.forEach(z=>{let K=z.category||"Results";V[K]||(V[K]=[]),V[K].push(z);}),V},[a]);return jsxs(bt,{open:N,onOpenChange:y,children:[jsx(Tn,{children:jsxs("form",{onSubmit:P,className:u(Wv({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(Lo({size:g}),"ml-3")}),jsx("input",{ref:L,type:"text",value:E,onChange:V=>M(V.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"),...x}),d&&S&&!R&&jsx("button",{type:"button",onClick:k,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",Lo({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(vt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:V=>V.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!S&&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((V,z)=>jsxs("button",{type:"button",onClick:()=>I(V),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(Lo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:u(Lo({size:g}),"opacity-0 group-hover:opacity-100")})]},z))]}),l.length>0&&!S&&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((V,z)=>jsxs("button",{type:"button",onClick:()=>A(V),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(Lo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},z))]}),S&&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(O).map(([V,z])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),z.map(K=>jsxs("button",{type:"button",onClick:()=>H(K),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[K.icon||jsx(Search,{className:u(Lo({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:K.label}),K.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:K.description})]})]},K.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});Yv.displayName="SearchBar";var Xv={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"})},Qv=Z.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]=Z.useState(""),g=Z.useRef(null),[h,b]=Z.useState(false);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{e||p("");},[e]),Z.useEffect(()=>{if(!e)return;let y=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),Z.useEffect(()=>{if(e)return an(),()=>sn()},[e]);let v=Z.useMemo(()=>{let y={};return n.forEach(T=>{let D=T.category||"Results";y[D]||(y[D]=[]),y[D].push(T);}),y},[n]),R=y=>{y.onSelect?.(),c?.(y),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:ja.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:x}),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||Xv[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((T,D)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},D))})]},y.id))]}),w&&Object.entries(v).map(([y,T])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),T.map(D=>jsxs(Command.Item,{value:`${D.label} ${D.keywords?.join(" ")||""}`,onSelect:()=>R(D),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:D.icon||Xv[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:D.label}),D.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:D.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},D.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)});Qv.displayName="SpotlightSearch";function mk(e="k"){let[t,n]=Z.useState(false);return Z.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 Jv=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"}}),xk={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},eh=Z.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]=Z.useState(true),[v,R]=Z.useState(false);Z.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),Z.useEffect(()=>{if(d&&h){let y=setTimeout(()=>{x();},d);return ()=>clearTimeout(y)}},[d,h]);let x=()=>{R(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let w=xk[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Jv({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:x,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"})})]})});eh.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 border-zinc-300 dark:border-zinc-700 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 border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},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"}}),wk=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"}}),tc=Z.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]=Z.useState(false),x=o&&o.length>0,w=E=>{x&&R(!v),p?.(E);},C=E=>{E.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:""}},T=l==="rotate"&&v?"rotate-45":"",D=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ya({position:m})),children:[x&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((E,L)=>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:`${L*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:E.label}),E.href?jsx("a",{href:E.href,className:u(ya({variant:E.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":E.label,children:E.icon}):jsx("button",{type:"button",onClick:()=>C(E),className:u(ya({variant:E.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":E.label,children:E.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:E.label})]},E.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":x?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(wk({size:d}),T,D,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>R(false)})]})});tc.displayName="FloatingActionButton";var Ck=tc;var ah=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"}}),nh=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),sh=Z.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]=Z.useState(a||r[0]?.key),p=o!==void 0,g=p?o:m,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},b=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",v=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},R=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(ah({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let w=g===x.key,C=i==="all"||i==="active"&&w,y=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:u(nh({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,w)},x.key);let T=jsxs("div",{onClick:()=>!x.href&&h(x),className:u(nh({variant:t}),b(w),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":w?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(v(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),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"})]}),C&&x.label&&jsx("span",{className:u(R(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(w)),children:T},x.key):T})})});sh.displayName="BottomNavigation";var Mk="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",lh=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"}}),ch=Z.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:Mk,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(lh({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})})})]})]})]})});ch.displayName="ActionSheet";var uh=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),rc=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"}}),mh=Z.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=Z.useRef(null),[p,g]=Z.useState(0),[h,b]=Z.useState(false),v=Z.useRef(0),R=Z.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=L=>{i||(b(true),v.current=L.touches[0].clientX,R.current=p);},y=L=>{if(!h||i)return;let N=L.touches[0].clientX-v.current,M=R.current+N;(M>0&&n.length===0||M<0&&r.length===0)&&(M=0),M>x?M=x+(M-x)*.3:M<-w&&(M=-w+(M+w)*.3),g(M);},T=()=>{if(!h)return;b(false);let L=f.current?.offsetWidth||0,S=Math.abs(p)/L;if(l&&S>.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>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},D=(L,S)=>{L.onAction?.(),s?.(S,L.key),g(0);},E=()=>{g(0);};return jsxs("div",{ref:m,className:u(uh({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(L=>jsxs("button",{type:"button",onClick:()=>D(L,"right"),className:u(rc({variant:L.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[L.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:L.icon}),!L.icon&&L.label]},L.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(L=>jsxs("button",{type:"button",onClick:()=>D(L,"left"),className:u(rc({variant:L.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[L.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:L.icon}),!L.icon&&L.label]},L.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:T,onClick:p!==0?E:void 0,children:c})]})});mh.displayName="SwipeActions";var fh=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),Pk=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"}}),gh=Z.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=Z.useRef(null),[b,v]=Z.useState(0),[R,x]=Z.useState("idle"),w=Z.useRef(0),C=Z.useRef(false),y=()=>l||R==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=N=>{y()&&(w.current=N.touches[0].clientY,C.current=true);},D=N=>{if(!C.current||!y())return;let k=N.touches[0].clientY-w.current;if(k<0){v(0),x("idle");return}let H=Math.min(k*.5,o);v(H),x(H>=r?"ready":"pulling");},E=async()=>{if(C.current)if(C.current=false,R==="ready"){x("refreshing"),v(r*.6);try{await n();}finally{x("idle"),v(0);}}else x("idle"),v(0);},L={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],S=()=>{if(R==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(L,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let N=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(L,"text-muted-foreground transition-transform"),style:{transform:`rotate(${N}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:R==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(fh({variant:t,className:e})),...p,children:[jsx("div",{className:u(Pk({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:S()}),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:T,onTouchMove:D,onTouchEnd:E,children:f})]})});gh.displayName="PullToRefresh";var Xr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),Ek={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},bh=Z.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:Ek,custom:i,transition:Xr(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});bh.displayName="Fade";var Sk=(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]}}},vh=Z.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=Z.useMemo(()=>Sk(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Xr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});vh.displayName="Slide";var Lk={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"},Dk={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},hh=Z.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:Dk,custom:i,transition:Xr(n,r,o),className:u(a),style:{transformOrigin:Lk[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});hh.displayName="Scale";var xh=Z.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:Xr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});xh.displayName="Collapse";var yh=Z.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:Xr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});yh.displayName="Expand";var Rh=Z.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:Xr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Rh.displayName="Rotate";var wh=Z.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:Xr(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})]})})});wh.displayName="Flip";var Ch=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.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))})]})});Ch.displayName="Ripple";var Th=Z.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});Th.displayName="Bounce";var Vk={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]},Mh=Z.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:Vk[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})});Mh.displayName="Shake";var Ak={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Nh=Z.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&Ak[n],r),children:e}));Nh.displayName="Pulse";var kh=Z.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});kh.displayName="Wiggle";var Ph=Z.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]=Z.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})});Ph.displayName="Pop";var $k=(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},Eh=Z.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=Z.useRef(null),g=useInView(p,{once:true}),[h,b]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let x=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let v=useMotionValue(t),R=useTransform(v,x=>$k(x,r,s,i));return Z.useEffect(()=>{if(h){let x=animate(v,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>x.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]})})});Eh.displayName="Counter";var Sh=Z.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]=Z.useState(""),[b,v]=Z.useState(0),[R,x]=Z.useState(false),[w,C]=Z.useState(false),y=Z.useRef(null),T=useInView(y,{once:true}),[D,E]=Z.useState(!l);return Z.useEffect(()=>{if(l&&T){let L=setTimeout(()=>E(true),n*1e3);return ()=>clearTimeout(L)}},[l,T,n]),Z.useEffect(()=>{if(!D||w)return;let L=p[b],S;return R?g.length>0?S=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),v(N=>(N+1)%p.length)):g.length<L.length?S=setTimeout(()=>{h(L.slice(0,g.length+1));},t):b<p.length-1||s?S=setTimeout(()=>{x(true);},r):(C(true),m?.()),()=>clearTimeout(S)},[D,g,b,R,w,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})]})});Sh.displayName="Typewriter";var Lh=Z.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=Z.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))})})});Lh.displayName="TextReveal";var Dh=Z.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.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])})})});Dh.displayName="WordRotate";var Ah=Z.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=Z.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})})});Ah.displayName="ScrollReveal";var zh=Z.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(Uk,{progress:f,position:e})]})});zh.displayName="ScrollProgress";var Uk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=Z.useState(0);return Z.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,"%"]})},Oh=Z.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=Z.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})})});Oh.displayName="Parallax";var Kh=Z.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 Z from'react';import {createContext,useState,useEffect,useContext,useC
69
69
  0% { transform: translateY(-100%); }
70
70
  100% { transform: translateY(100%); }
71
71
  }
72
- `})]})});Kh.displayName="Shimmer";var jk={sm:24,md:40,lg:56,xl:80},_k={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"}},$h=Z.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=jk[t],d=_k[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?.()})]})});$h.displayName="Checkmark";var Oo={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},Gh=Z.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=Z.useCallback(()=>{let i={...Oo,...n};zo(i),o?.();},[n,o]);return Z.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});Gh.displayName="Confetti";var Wk=()=>{let e=Z.useCallback(r=>{let o={...Oo,...r};zo(o);},[]),t=Z.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);zo({...Oo,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),zo({...Oo,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=Z.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&zo({...Oo,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&zo({...Oo,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},Uh=Z.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})});Uh.displayName="Glow";var Fh=(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}),jh=Z.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]=Z.useState([]);return Z.useEffect(()=>{let d=Array.from({length:t},()=>Fh(r,o));c(d);let m=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=Fh(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))]})});jh.displayName="Sparkles";var _h=Z.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}));_h.displayName="H1";var Wh=Z.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}));Wh.displayName="H2";var Yh=Z.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}));Yh.displayName="H3";var Xh=Z.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}));Xh.displayName="H4";var qh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));qh.displayName="Paragraph";var Zh=Z.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}));Zh.displayName="Blockquote";var Qh=Z.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}));Qh.displayName="InlineCode";var Jh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-xl text-muted-foreground",e),...n,children:t}));Jh.displayName="Lead";var ex=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("text-lg font-semibold",e),...n,children:t}));ex.displayName="Large";var tx=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:u("text-sm font-medium leading-none",e),...n,children:t}));tx.displayName="Small";var nx=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-sm text-muted-foreground",e),...n,children:t}));nx.displayName="Muted";var rx=Z.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}));rx.displayName="UL";var Yk=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cc={default:["bg-muted","bg-emerald-200 dark:bg-emerald-900","bg-emerald-300 dark:bg-emerald-700","bg-emerald-500 dark:bg-emerald-500","bg-emerald-700 dark:bg-emerald-300"],success:["bg-muted","bg-green-200 dark:bg-green-900","bg-green-300 dark:bg-green-700","bg-green-500 dark:bg-green-500","bg-green-700 dark:bg-green-300"],warning:["bg-muted","bg-amber-200 dark:bg-amber-900","bg-amber-300 dark:bg-amber-700","bg-amber-500 dark:bg-amber-500","bg-amber-700 dark:bg-amber-300"],danger:["bg-muted","bg-red-200 dark:bg-red-900","bg-red-300 dark:bg-red-700","bg-red-500 dark:bg-red-500","bg-red-700 dark:bg-red-300"],primary:["bg-muted","bg-primary/20","bg-primary/40","bg-primary/60","bg-primary/80"],secondary:["bg-muted","bg-secondary/40","bg-secondary/60","bg-secondary/80","bg-secondary"]},dc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function ox(e){return e.toISOString().split("T")[0]}function qk(e){return e instanceof Date?e:new Date(e)}function Zk(e,t){let n=[],r=new Date(e);for(r.setDate(r.getDate()-r.getDay());r<=t;){let o=[];for(let a=0;a<7;a++)o.push(new Date(r)),r.setDate(r.getDate()+1);n.push(o);}return n}function Qk(e){let t=[],n=-1;return e.forEach((r,o)=>{let a=r.find(s=>s.getDate()<=7);a&&a.getMonth()!==n&&(n=a.getMonth(),t.push({month:Xk[n],position:o}));}),t}var ax=Z.forwardRef(({className:e,values:t,startDate:n,endDate:r,color:o="default",levels:a=5,showMonthLabels:s=true,showWeekdayLabels:i=true,showTooltip:l=true,tooltipFormatter:c,colorScale:d,gap:m=3,cellSize:f=12,radius:p="sm",onCellClick:g,emptyColor:h,showLegend:b=true,legendLabels:v={less:"Less",more:"More"},...R},x)=>{let w=r?new Date(r):new Date,C=n?new Date(n):new Date(w.getFullYear()-1,w.getMonth(),w.getDate()),y=Z.useMemo(()=>{let E=new Map;return t.forEach(k=>{let H=qk(k.date),I=ox(H);E.set(I,(E.get(I)||0)+k.count);}),E},[t]),T=Z.useMemo(()=>y.size===0?0:Math.max(...Array.from(y.values())),[y]),D=Z.useMemo(()=>Zk(C,w),[C,w]),P=Z.useMemo(()=>Qk(D),[D]),S=E=>{if(E===0)return h||d?.[0]||cc[o][0];let k=d||cc[o],H=Math.min(Math.ceil(E/T*(a-1)),a-1);return k[H]||k[k.length-1]},L=(E,k)=>{if(c)return c(E,k);let H=E.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"});return jsxs("span",{children:[jsx("span",{className:"font-medium",children:k})," contributions on ",H]})},N=(E,k,H)=>{let I=ox(E),A=y.get(I)||0;if(!(E>=C&&E<=w))return jsx("div",{style:{width:f,height:f}},`${k}-${H}`);let V=jsx("div",{className:u("transition-all duration-200",dc[p],S(A),g&&"cursor-pointer hover:ring-2 hover:ring-ring hover:ring-offset-1"),style:{width:f,height:f},onClick:()=>g?.(E,A),role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:z=>{g&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),g(E,A));}});return l?jsxs(Je,{children:[jsx(wn,{className:u("transition-all duration-200 border-0 bg-transparent p-0",dc[p],S(A),g&&"cursor-pointer hover:ring-2 hover:ring-ring hover:ring-offset-1"),style:{width:f,height:f},onClick:()=>g?.(E,A),onKeyDown:z=>{g&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),g(E,A));}}),jsx(Cn,{children:L(E,A)})]},`${k}-${H}`):jsx(Z.Fragment,{children:V},`${k}-${H}`)},M=d||cc[o];return jsxs("div",{ref:x,className:u("inline-flex flex-col",e),...R,children:[jsxs("div",{className:"flex",children:[i&&jsx("div",{className:"flex flex-col justify-between pr-2",style:{gap:m,marginTop:s?20:0},children:Yk.map((E,k)=>jsx("div",{className:u("text-xs text-muted-foreground",k%2===1&&"invisible"),style:{height:f,lineHeight:`${f}px`},children:E},E))}),jsxs("div",{className:"flex flex-col",children:[s&&jsx("div",{className:"flex mb-1",style:{gap:m,height:16},children:P.map(({month:E,position:k},H)=>jsx("div",{className:"text-xs text-muted-foreground",style:{position:"relative",left:k*(f+m),marginLeft:H===0?0:-k*(f+m)},children:E},`${E}-${H}`))}),jsx("div",{className:"flex",style:{gap:m},children:D.map((E,k)=>jsx("div",{className:"flex flex-col",style:{gap:m},children:E.map((H,I)=>N(H,k,I))},k))})]})]}),b&&jsxs("div",{className:"flex items-center justify-end mt-4 gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground",children:v.less}),jsx("div",{className:"flex",style:{gap:m/2},children:M.slice(0,a).map((E,k)=>jsx("div",{className:u(dc[p],E),style:{width:f,height:f}},k))}),jsx("span",{className:"text-xs text-muted-foreground",children:v.more})]})]})});ax.displayName="HeatmapCalendar";var sx=Z.forwardRef(({className:e,beforeImage:t,afterImage:n,beforeAlt:r="Before",afterAlt:o="After",defaultPosition:a=50,position:s,onPositionChange:i,orientation:l="horizontal",showLabels:c=true,beforeLabel:d="Before",afterLabel:m="After",handleVariant:f="default",handleColor:p="default",aspectRatio:g,disableKeyboard:h=false,handleWidth:b=4,...v},R)=>{let[x,w]=Z.useState(a),C=s!==void 0,y=C?s:x,T=Z.useRef(null),[D,P]=Z.useState(false),S=V=>{let z=Math.max(0,Math.min(100,V));C||w(z),i?.(z);},L=(V,z)=>{if(!T.current)return y;let K=T.current.getBoundingClientRect();return l==="horizontal"?(V-K.left)/K.width*100:(z-K.top)/K.height*100},N=V=>{V.preventDefault(),P(true),V.target.setPointerCapture(V.pointerId);let z=L(V.clientX,V.clientY);S(z);},M=V=>{if(!D)return;let z=L(V.clientX,V.clientY);S(z);},E=()=>{P(false);},k=V=>{if(h)return;let z=V.shiftKey?10:1,K=y;switch(V.key){case "ArrowLeft":case "ArrowUp":V.preventDefault(),K=y-z;break;case "ArrowRight":case "ArrowDown":V.preventDefault(),K=y+z;break;case "Home":V.preventDefault(),K=0;break;case "End":V.preventDefault(),K=100;break;default:return}S(K);},H={default:"bg-border",primary:"bg-primary",white:"bg-white",black:"bg-black"},I={default:"bg-background border-border text-foreground",primary:"bg-primary border-primary text-primary-foreground",white:"bg-white border-white text-black",black:"bg-black border-black text-white"},A=()=>{let V=l==="horizontal",z=u("absolute z-10 flex items-center justify-center",V?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize",H[p]),K=V?{left:`${y}%`,width:b,transform:"translateX(-50%)"}:{top:`${y}%`,height:b,transform:"translateY(-50%)"};return f==="minimal"?jsx("div",{className:z,style:K}):f==="arrows"?jsx("div",{className:z,style:K,children:jsxs("div",{className:u("absolute flex items-center justify-center gap-0.5 rounded-full p-1.5 shadow-md border-2",I[p],V?"flex-row":"flex-col"),children:[jsx("svg",{className:u("w-3 h-3",V?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M15 18l-6-6 6-6"})}),jsx("svg",{className:u("w-3 h-3",V?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M9 18l6-6-6-6"})})]})}):jsx("div",{className:z,style:K,children:jsx("div",{className:u("absolute rounded-full p-2 shadow-md border-2",I[p]),children:jsxs("svg",{className:u("w-4 h-4",V?"":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M8 3L4 7l4 4"}),jsx("path",{d:"M16 3l4 4-4 4"}),jsx("path",{d:"M4 7h16"}),jsx("path",{d:"M8 17l-4 4 4 4"}),jsx("path",{d:"M16 17l4 4-4 4"}),jsx("path",{d:"M4 21h16"})]})})})},O=l==="horizontal";return jsx("div",{ref:R,className:u("relative select-none overflow-hidden rounded-lg",D&&"cursor-grabbing",e),style:g?{aspectRatio:g}:void 0,...v,children:jsxs("div",{ref:T,className:"relative w-full h-full",role:"slider",tabIndex:0,"aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100,"aria-orientation":l,"aria-label":"Comparison slider",onPointerDown:N,onPointerMove:M,onPointerUp:E,onPointerCancel:E,onKeyDown:k,children:[jsx("img",{src:n,alt:o,className:"absolute inset-0 w-full h-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 overflow-hidden",style:O?{width:`${y}%`}:{height:`${y}%`},children:jsx("img",{src:t,alt:r,className:u("absolute inset-0 object-cover",O?"w-[var(--container-width)] h-full":"w-full h-[var(--container-height)]"),style:O?{"--container-width":T.current?`${T.current.offsetWidth}px`:"100%"}:{"--container-height":T.current?`${T.current.offsetHeight}px`:"100%"},draggable:false})}),A(),c&&jsxs(Fragment,{children:[jsx("div",{className:u("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none","top-3 left-3"),children:d}),jsx("div",{className:u("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none",O?"top-3 right-3":"bottom-3 left-3"),children:m})]})]})})});sx.displayName="ComparisonSlider";function lx(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${n}:${r.toString().padStart(2,"0")}`}var dP={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},cx=Z.forwardRef(({className:e,src:t,poster:n,autoPlay:r=false,muted:o=false,loop:a=false,controls:s=true,preload:i="metadata",aspectRatio:l="16/9",defaultVolume:c=1,playbackSpeeds:d=[.5,.75,1,1.25,1.5,2],showPiP:m=true,showFullscreen:f=true,showVolume:p=true,showPlaybackSpeed:g=true,showSkipButtons:h=false,skipInterval:b=10,onPlay:v,onPause:R,onEnded:x,onVideoTimeUpdate:w,onVolumeChange:C,controlsHideTimeout:y=3e3,keyboardShortcuts:T=true,doubleClickFullscreen:D=true,radius:P="lg",...S},L)=>{let N=Z.useRef(null),M=Z.useRef(null),E=Z.useRef(),[k,H]=Z.useState(false),[I,A]=Z.useState(0),[O,V]=Z.useState(0),[z,K]=Z.useState(c),[G,X]=Z.useState(o),[F,$]=Z.useState(false),[j,_]=Z.useState(true),[B,q]=Z.useState(true),[ee,Y]=Z.useState(1),[he,Q]=Z.useState(0),ne=Z.useMemo(()=>typeof t=="string"?[{src:t,type:void 0,label:void 0}]:t,[t]),[Me,fe]=Z.useState(0),Ye=Z.useCallback(()=>{E.current&&clearTimeout(E.current),q(true),k&&y>0&&(E.current=setTimeout(()=>{q(false);},y));},[k,y]);Z.useEffect(()=>(Ye(),()=>{E.current&&clearTimeout(E.current);}),[k,Ye]);let Ze=()=>{M.current&&(V(M.current.duration),_(false));},Mt=()=>{if(M.current){A(M.current.currentTime),w?.(M.current.currentTime,M.current.duration);let re=M.current.buffered.length>0?M.current.buffered.end(M.current.buffered.length-1):0;Q(re/M.current.duration*100);}},Pe=()=>{H(true),v?.();},ct=()=>{H(false),R?.();},J=()=>{H(false),x?.();},W=()=>{_(true);},ae=()=>{_(false);},U=()=>{M.current&&(k?M.current.pause():M.current.play());},de=re=>{if(M.current){let we=re[0]/100*O;M.current.currentTime=we,A(we);}},ue=re=>{let we=re[0]/100;K(we),X(we===0),M.current&&(M.current.volume=we,M.current.muted=we===0),C?.(we,we===0);},Be=()=>{if(M.current){let re=!G;M.current.muted=re,X(re),re?M.current.volume=0:M.current.volume=z||1,C?.(re?0:z,re);}},$e=async()=>{if(N.current)try{F?await document.exitFullscreen():await N.current.requestFullscreen();}catch{}},Rn=async()=>{if(M.current)try{document.pictureInPictureElement?await document.exitPictureInPicture():await M.current.requestPictureInPicture();}catch{}},Re=re=>{M.current&&(M.current.currentTime=Math.max(0,Math.min(O,M.current.currentTime+re)));},Qe=re=>{M.current&&(M.current.playbackRate=re,Y(re));};Z.useEffect(()=>{let re=()=>{$(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",re),()=>{document.removeEventListener("fullscreenchange",re);}},[]),Z.useEffect(()=>{if(!T)return;let re=we=>{if(!(!N.current?.contains(document.activeElement)&&document.activeElement!==N.current))switch(we.key.toLowerCase()){case " ":case "k":we.preventDefault(),U();break;case "f":we.preventDefault(),$e();break;case "m":we.preventDefault(),Be();break;case "arrowleft":we.preventDefault(),Re(-b);break;case "arrowright":we.preventDefault(),Re(b);break;case "arrowup":we.preventDefault(),ue([Math.min(100,z*100+10)]);break;case "arrowdown":we.preventDefault(),ue([Math.max(0,z*100-10)]);break}};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re);}},[T,k,z,b]);let Bt=()=>{D&&$e();},Ge=O>0?I/O*100:0;return jsxs("div",{ref:re=>{N.current=re,typeof L=="function"?L(re):L&&(L.current=re);},className:u("relative bg-black overflow-hidden group",dP[P],e),style:{aspectRatio:l},onMouseMove:Ye,onMouseLeave:()=>k&&q(false),tabIndex:0,...S,children:[jsx("video",{ref:M,className:"w-full h-full object-contain",poster:n,autoPlay:r,muted:o,loop:a,preload:i,playsInline:true,onClick:U,onDoubleClick:Bt,onLoadedMetadata:Ze,onTimeUpdate:Mt,onPlay:Pe,onPause:ct,onEnded:J,onWaiting:W,onCanPlay:ae,children:ne.map((re,we)=>jsx("source",{src:re.src,type:re.type},we))}),j&&jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20",children:jsx(Loader2,{className:"w-12 h-12 text-white animate-spin"})}),!k&&!j&&jsx("button",{type:"button",className:"absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity cursor-pointer",onClick:U,children:jsx("div",{className:"w-16 h-16 rounded-full bg-white/90 flex items-center justify-center",children:jsx(Play,{className:"w-8 h-8 text-black ml-1",fill:"currentColor"})})}),s&&jsxs("div",{className:u("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-16 transition-opacity duration-300",B?"opacity-100":"opacity-0 pointer-events-none"),children:[jsxs("div",{className:"relative mb-3 group/progress",children:[jsx("div",{className:"absolute top-1/2 left-0 h-1 bg-white/30 rounded-full -translate-y-1/2",style:{width:`${he}%`}}),jsx(en,{value:[Ge],onValueChange:de,min:0,max:100,step:.1,className:"h-1 group-hover/progress:h-2 transition-all cursor-pointer [&_[role=slider]]:w-3 [&_[role=slider]]:h-3 [&_[role=slider]]:opacity-0 group-hover/progress:[&_[role=slider]]:opacity-100 [&_[role=slider]]:transition-opacity"})]}),jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:U,children:k?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5",fill:"currentColor"})}),h&&jsxs(Fragment,{children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Re(-b),children:jsx(SkipBack,{className:"w-5 h-5"})}),jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Re(b),children:jsx(SkipForward,{className:"w-5 h-5"})})]}),p&&jsxs("div",{className:"flex items-center gap-1 group/volume",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:Be,children:G||z===0?jsx(VolumeX,{className:"w-5 h-5"}):jsx(Volume2,{className:"w-5 h-5"})}),jsx("div",{className:"w-0 overflow-hidden group-hover/volume:w-20 transition-all",children:jsx(en,{value:[G?0:z*100],onValueChange:ue,min:0,max:100,step:1,className:"w-20"})})]}),jsxs("div",{className:"text-white text-sm ml-2",children:[lx(I)," / ",lx(O)]})]}),jsxs("div",{className:"flex items-center gap-1",children:[g&&jsxs(Zt,{children:[jsx(Qt,{children:jsxs("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer flex items-center gap-1",children:[jsx(Settings,{className:"w-5 h-5"}),jsxs("span",{className:"text-xs",children:[ee,"x"]})]})}),jsx(Jt,{align:"end",className:"min-w-[100px]",children:d.map(re=>jsxs(Dt,{onSelect:()=>Qe(re),className:u(ee===re&&"bg-primary/10 text-primary"),children:[re,"x"]},re))})]}),ne.length>1&&jsxs(Zt,{children:[jsx(Qt,{children:jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer text-xs",children:ne[Me]?.quality||ne[Me]?.label||"Quality"})}),jsx(Jt,{align:"end",className:"min-w-[100px]",children:ne.map((re,we)=>jsx(Dt,{onSelect:()=>{let Mr=M.current?.currentTime||0;fe(we),setTimeout(()=>{M.current&&(M.current.currentTime=Mr,k&&M.current.play());},100);},className:u(Me===we&&"bg-primary/10 text-primary"),children:re.quality||re.label||`Source ${we+1}`},we))})]}),m&&document.pictureInPictureEnabled&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:Rn,children:jsx(PictureInPicture,{className:"w-5 h-5"})}),f&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:$e,children:F?jsx(Minimize,{className:"w-5 h-5"}):jsx(Maximize,{className:"w-5 h-5"})})]})]})]})]})});cx.displayName="VideoPlayer";function Ta(e){if(!e||!isFinite(e))return "0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}var dx={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},yP={default:{progress:"bg-foreground",waveformActive:"bg-foreground",waveformInactive:"bg-muted-foreground/30"},primary:{progress:"bg-primary",waveformActive:"bg-primary",waveformInactive:"bg-primary/20"},success:{progress:"bg-green-500",waveformActive:"bg-green-500",waveformInactive:"bg-green-500/20"},warning:{progress:"bg-amber-500",waveformActive:"bg-amber-500",waveformInactive:"bg-amber-500/20"},danger:{progress:"bg-red-500",waveformActive:"bg-red-500",waveformInactive:"bg-red-500/20"}},ux=Z.forwardRef(({className:e,src:t,autoPlay:n=false,defaultVolume:r=1,loop:o=false,muted:a=false,showWaveform:s=true,waveformData:i,waveformBars:l=50,showTrackInfo:c=true,showVolume:d=true,showSkipButtons:m=false,skipInterval:f=10,showLoop:p=true,showShuffle:g=false,showDownload:h=false,variant:b="default",color:v="default",onPlay:R,onPause:x,onEnded:w,onAudioTimeUpdate:C,radius:y="lg",...T},D)=>{let P=Z.useRef(null),S=Z.useRef(null),[L,N]=Z.useState(false),[M,E]=Z.useState(0),[k,H]=Z.useState(0),[I,A]=Z.useState(r),[O,V]=Z.useState(a),[z,K]=Z.useState(true),[G,X]=Z.useState(o),[F,$]=Z.useState(false),j=Z.useMemo(()=>typeof t=="string"?{src:t}:t,[t]),_=Z.useMemo(()=>{if(i)return i;let U=[];for(let de=0;de<l;de++)U.push(.2+Math.random()*.8);return U},[i,l]),B=()=>{P.current&&(H(P.current.duration),K(false));},q=()=>{P.current&&(E(P.current.currentTime),C?.(P.current.currentTime,P.current.duration));},ee=()=>{N(true),R?.();},Y=()=>{N(false),x?.();},he=()=>{N(false),w?.();},Q=()=>{K(false);},ne=()=>{P.current&&(L?P.current.pause():P.current.play());},Me=U=>{if(P.current&&k){let de=U/100*k;P.current.currentTime=de,E(de);}},fe=U=>{if(!S.current||!k)return;let de=S.current.getBoundingClientRect(),ue=(U.clientX-de.left)/de.width*100;Me(ue);},Ye=U=>{let de=U[0]/100;A(de),V(de===0),P.current&&(P.current.volume=de,P.current.muted=de===0);},Ze=()=>{if(P.current){let U=!O;P.current.muted=U,V(U);}},Mt=()=>{if(P.current){let U=!G;P.current.loop=U,X(U);}},Pe=U=>{P.current&&(P.current.currentTime=Math.max(0,Math.min(k,P.current.currentTime+U)));},ct=()=>{let U=document.createElement("a");U.href=j.src,U.download=j.title||"audio",document.body.appendChild(U),U.click(),document.body.removeChild(U);},J=k>0?M/k*100:0,W=yP[v],ae=O||I===0?VolumeX:I<.5?Volume1:Volume2;return b==="compact"?jsxs("div",{ref:D,className:u("flex items-center gap-3 p-2 bg-muted/50",dx[y],e),...T,children:[jsx("audio",{ref:P,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:he,onCanPlay:Q}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded-full transition-colors cursor-pointer",onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-4 h-4 animate-spin"}):L?jsx(Pause,{className:"w-4 h-4",fill:"currentColor"}):jsx(Play,{className:"w-4 h-4",fill:"currentColor"})}),jsx("div",{className:"flex-1",children:jsx(en,{value:[J],onValueChange:U=>Me(U[0]),min:0,max:100,step:.1,className:"h-1"})}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(M)})]}):b==="minimal"?jsxs("div",{ref:D,className:u("flex items-center gap-4",e),...T,children:[jsx("audio",{ref:P,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:he,onCanPlay:Q}),jsx("button",{type:"button",className:u("p-3 rounded-full transition-colors cursor-pointer",W.progress,"text-white hover:opacity-90"),onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-5 h-5 animate-spin"}):L?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[c&&j.title&&jsx("span",{className:"text-sm font-medium truncate",children:j.title}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(M)}),jsx(en,{value:[J],onValueChange:U=>Me(U[0]),min:0,max:100,step:.1,className:"flex-1"}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(k)})]})]})]}):jsxs("div",{ref:D,className:u("p-4 bg-card border border-border",dx[y],e),...T,children:[jsx("audio",{ref:P,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:he,onCanPlay:Q}),c&&(j.title||j.artist||j.artwork)&&jsxs("div",{className:"flex items-center gap-4 mb-4",children:[j.artwork&&jsx("img",{src:j.artwork,alt:j.title||"Album artwork",className:"w-16 h-16 rounded-md object-cover"}),jsxs("div",{className:"flex-1 min-w-0",children:[j.title&&jsx("h3",{className:"font-medium truncate",children:j.title}),j.artist&&jsx("p",{className:"text-sm text-muted-foreground truncate",children:j.artist}),j.album&&jsx("p",{className:"text-xs text-muted-foreground truncate",children:j.album})]})]}),s?jsx("div",{ref:S,className:"relative h-16 mb-4 flex items-end gap-[2px] cursor-pointer",onClick:fe,children:_.map((U,de)=>{let Be=(de+1)/_.length*100<=J;return jsx("div",{className:u("flex-1 rounded-sm transition-colors",Be?W.waveformActive:W.waveformInactive),style:{height:`${U*100}%`,minHeight:4}},de)})}):jsx("div",{className:"mb-4",children:jsx(en,{value:[J],onValueChange:U=>Me(U[0]),min:0,max:100,step:.1})}),jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-4",children:[jsx("span",{children:Ta(M)}),jsx("span",{children:Ta(k)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-1",children:[g&&jsx("button",{type:"button",className:u("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",F&&"text-primary"),onClick:()=>$(!F),children:jsx(Shuffle,{className:"w-4 h-4"})}),m&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>Pe(-f),children:jsx(SkipBack,{className:"w-5 h-5"})})]}),jsx("button",{type:"button",className:u("p-4 rounded-full transition-colors cursor-pointer",W.progress,"text-white hover:opacity-90"),onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-6 h-6 animate-spin"}):L?jsx(Pause,{className:"w-6 h-6",fill:"currentColor"}):jsx(Play,{className:"w-6 h-6 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex items-center gap-1",children:[m&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>Pe(f),children:jsx(SkipForward,{className:"w-5 h-5"})}),p&&jsx("button",{type:"button",className:u("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",G&&"text-primary"),onClick:Mt,children:jsx(Repeat,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"flex items-center justify-between mt-4",children:[d?jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx("button",{type:"button",className:"p-1 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Ze,children:jsx(ae,{className:"w-4 h-4"})}),jsx(en,{value:[O?0:I*100],onValueChange:Ye,min:0,max:100,step:1,className:"w-24"})]}):jsx("div",{}),h&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:ct,children:jsx(Download,{className:"w-4 h-4"})})]})]})});ux.displayName="AudioPlayer";var HP={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},mx=Z.forwardRef(({className:e,src:t,defaultPage:n=1,defaultZoom:r=100,showToolbar:o=true,showNavigation:a=true,showZoomControls:s=true,showDownload:i=true,showPrint:l=true,showFullscreen:c=true,showRotate:d=true,showSearch:m=false,zoomStep:f=25,minZoom:p=25,maxZoom:g=400,toolbarPosition:h="top",height:b="600px",onPageChange:v,onZoomChange:R,onLoad:x,onError:w,errorMessage:C="Failed to load PDF. Please try again.",loadingMessage:y="Loading PDF...",fileName:T="document.pdf",radius:D="lg",...P},S)=>{let L=Z.useRef(null),N=Z.useRef(null),[M,E]=Z.useState(n),[k,H]=Z.useState(1),[I,A]=Z.useState(r),[O,V]=Z.useState(0),[z,K]=Z.useState(false),[G,X]=Z.useState(true),[F,$]=Z.useState(false),[j,_]=Z.useState(String(n)),B=J=>{let W=Math.max(1,Math.min(k,J));E(W),_(String(W)),v?.(W);},q=J=>{_(J.target.value);},ee=()=>{let J=parseInt(j,10);isNaN(J)?_(String(M)):B(J);},Y=J=>{J.key==="Enter"&&ee();},he=()=>{let J=Math.min(g,I+f);A(J),R?.(J);},Q=()=>{let J=Math.max(p,I-f);A(J),R?.(J);},ne=()=>{V(J=>(J+90)%360);},Me=async()=>{if(L.current)try{z?await document.exitFullscreen():await L.current.requestFullscreen();}catch{}};Z.useEffect(()=>{let J=()=>{K(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",J),()=>{document.removeEventListener("fullscreenchange",J);}},[]);let fe=()=>{let J=document.createElement("a");J.href=t,J.download=T,document.body.appendChild(J),J.click(),document.body.removeChild(J);},Ye=()=>{N.current?.contentWindow&&N.current.contentWindow.print();},Ze=()=>{X(false),$(false),x?.();},Mt=()=>{X(false),$(true),w?.(new Error("Failed to load PDF"));},Pe=Z.useMemo(()=>{let J=new URL(t,window.location.href);return J.hash=`page=${M}&zoom=${I}`,J.toString()},[t,M,I]),ct=jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 bg-muted/50 border-b border-border",children:[a&&jsxs("div",{className:"flex items-center gap-2",children:[jsx(Je,{content:"Previous page",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>B(M-1),disabled:M<=1,children:jsx(ChevronLeft,{className:"w-4 h-4"})})}),jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(ao,{value:j,onChange:q,onBlur:ee,onKeyDown:Y,className:"w-12 h-7 text-center text-sm px-1"}),jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",k]})]}),jsx(Je,{content:"Next page",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>B(M+1),disabled:M>=k,children:jsx(ChevronRight,{className:"w-4 h-4"})})})]}),s&&jsxs("div",{className:"flex items-center gap-2",children:[jsx(Je,{content:"Zoom out",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:Q,disabled:I<=p,children:jsx(ZoomOut,{className:"w-4 h-4"})})}),jsxs("span",{className:"text-sm text-muted-foreground min-w-[50px] text-center",children:[I,"%"]}),jsx(Je,{content:"Zoom in",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:he,disabled:I>=g,children:jsx(ZoomIn,{className:"w-4 h-4"})})})]}),jsxs("div",{className:"flex items-center gap-1",children:[m&&jsx(Je,{content:"Search",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",children:jsx(Search,{className:"w-4 h-4"})})}),d&&jsx(Je,{content:"Rotate",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:ne,children:jsx(RotateCw,{className:"w-4 h-4"})})}),l&&jsx(Je,{content:"Print",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Ye,children:jsx(Printer,{className:"w-4 h-4"})})}),i&&jsx(Je,{content:"Download",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:fe,children:jsx(Download,{className:"w-4 h-4"})})}),c&&jsx(Je,{content:z?"Exit fullscreen":"Fullscreen",children:jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Me,children:z?jsx(Minimize,{className:"w-4 h-4"}):jsx(Maximize,{className:"w-4 h-4"})})})]})]});return jsxs("div",{ref:J=>{L.current=J,typeof S=="function"?S(J):S&&(S.current=J);},className:u("flex flex-col bg-card border border-border overflow-hidden",HP[D],e),style:{height:z?"100vh":b},...P,children:[o&&h==="top"&&ct,jsxs("div",{className:"flex-1 relative overflow-hidden bg-muted/30",children:[G&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background/80 z-10",children:[jsx(Loader2,{className:"w-8 h-8 animate-spin text-muted-foreground mb-2"}),jsx("span",{className:"text-sm text-muted-foreground",children:y})]}),F&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background z-10",children:[jsx(FileWarning,{className:"w-12 h-12 text-muted-foreground mb-3"}),jsx("span",{className:"text-sm text-muted-foreground",children:C}),jsx("button",{type:"button",className:"mt-3 px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors cursor-pointer",onClick:()=>{X(true),$(false);},children:"Try again"})]}),jsx("iframe",{ref:N,src:Pe,className:"w-full h-full border-0",style:{transform:`rotate(${O}deg) scale(${I/100})`,transformOrigin:"center center"},onLoad:Ze,onError:Mt,title:"PDF Viewer"})]}),o&&h==="bottom"&&ct]})});mx.displayName="PDFViewer";function Fo(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 zP(){return Fo("(max-width: 767px)")}function OP(){return Fo("(min-width: 768px) and (max-width: 1023px)")}function BP(){return Fo("(min-width: 1024px)")}function FP(){return Fo("(prefers-color-scheme: dark)")?"dark":"light"}function KP(){return Fo("(prefers-reduced-motion: reduce)")}function Ma(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 _P(){let{width:e}=Ma();return e}function WP(){let{height:e}=Ma();return e}function YP(e){let{width:t}=Ma();return t>=e}function XP(){let{width:e}=Ma();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function QP(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 eE(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 rE(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function oE(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 aE(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 lE(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 cE(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 uE(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 mE(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 pE(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 fE(){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 fx(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 gx(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 gE(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=fx(e);useEffect(()=>{if(!r)return;let c=m=>{gx(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 bE(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:fx(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:m,handler:f}of i)if(gx(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 vE(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 hE(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 xE(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 yE(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 RE(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 wE(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 CE(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 TE(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function ME(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 kE(){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 PE(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 EE(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 hx=["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 SE(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(hx)).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 LE(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(hx)).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 DE(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 HE(){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 Tx(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 IE(e=true){let{lock:t,unlock:n}=Tx();useEffect(()=>{e?t():n();},[e,t,n]);}function kx(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 AE(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 zE(e="200px"){let{ref:t,isIntersecting:n}=kx({rootMargin:e,once:true});return {ref:t,isVisible:n}}function OE(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 BE(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 FE(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 KE(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 $E(){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 Lx(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 jE(e){return Lx({...e,defaultOpen:true})}function _E(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function WE(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 YE(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 qE(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 ZE(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function QE(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function JE(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function eS(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 rS(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(T=>{let D=[...T];return D.splice(C,0,y),D});},[]),i=useCallback((C,y)=>{n(T=>{let D=[...T];return D[C]=y,D});},[]),l=useCallback(C=>{n(y=>y.filter((T,D)=>D!==C));},[]),c=useCallback(C=>{n(y=>{let T=y.indexOf(C);return T===-1?y:y.filter((D,P)=>P!==T)});},[]),d=useCallback(C=>{n(y=>y.filter(T=>!C(T)));},[]),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(T=>{let D=[...T],[P]=D.splice(C,1);return D.splice(y,0,P),D});},[]),v=useCallback((C,y)=>{n(T=>{let D=[...T];return [D[C],D[y]]=[D[y],D[C]],D});},[]),R=useCallback(C=>t.filter(C),[t]),x=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:R,find:x,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,R,x,w])}function oS(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 aS(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 zx(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 iS(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=zx(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 lS(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 cS(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 Kx(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 uS(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 {...Kx(s,false),retryCount:r}}var Ux=new Map,mS=300*1e3;function pS(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=Ux.get(h);if(b&&Date.now()-b.timestamp<mS){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(),x=o?o(R):R;Ux.set(h,{data:x,timestamp:Date.now()}),f.current&&d({data:x,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 fS(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 fi(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 bS(e,t){let[n,r]=useState(false);fi(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 vS(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;fi(()=>{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 hS(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);fi(()=>{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 Wx(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 xS(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 yS(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function RS(e,t=true){let[n,r]=useState(false);return Wx(()=>{r(true);},t?e:null),n}function wS(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 CS(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 TS(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 Zx=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function MS(e,t={}){let{events:n=Zx,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 NS(e,t,n,r={}){let{events:o=Zx,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 Jx(){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 ES(){return Jx()==="visible"}function SS(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function LS(){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 DS(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 ry(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 AS(){let e=useRef(null),t=ry(e);return {ref:e,...t}}function BS(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 FS(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 KS(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 $S(){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 GS(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 jS(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 _S(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 x=new p;return x.lang=t,x.continuous=n,x.interimResults=r,x.onstart=()=>{a(true),m(null);},x.onend=()=>{a(false);},x.onerror=w=>{m(new Error(w.error)),a(false);},x.onresult=w=>{let C="",y="";for(let T=w.resultIndex;T<w.results.length;T++){let D=w.results[T];D.isFinal?y+=D[0].transcript:C+=D[0].transcript;}y&&i(T=>T+y),c(C);},f.current=x,()=>{x.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{Du as Accordion,Hu as AccordionItem,yv as ActionBar,Rv as ActionBarButton,pv as ActionGroup,ch as ActionSheet,fy as Alert,by as AlertDescription,gy as AlertTitle,Ib as AreaChart,sm as AspectRatio,ux as AudioPlayer,Bg as Autocomplete,Sr as Avatar,Lr as AvatarFallback,Ip as AvatarGroup,so as AvatarImage,sg as BackTop,yy as Badge,eh as Banner,Db as BarChart,Zh as Blockquote,sh as BottomNavigation,Th as Bounce,Zu as Breadcrumb,rm as BreadcrumbEllipsis,Ju as BreadcrumbItem,em as BreadcrumbLink,Qu as BreadcrumbList,tm as BreadcrumbPage,nm as BreadcrumbSeparator,me as Button,td as ButtonGroup,Wf as COUNTRIES,lo as Calendar,sd as Card,dd as CardContent,cd as CardDescription,ud as CardFooter,id as CardHeader,ld as CardTitle,Kb as Carousel,$b as CarouselContent,Gb as CarouselItem,Ll as CarouselNext,Sl as CarouselPrevious,Uo as Checkbox,$h as Checkmark,Bp as Chip,jp as CircularProgress,Kt as CloseButton,Qg as Code,rb as CodeBlock,xh as Collapse,Bu as Collapsible,Fu as CollapsibleContent,Vi as CollapsibleTrigger,Bv as ColorArea,zf as ColorPicker,$v as ColorSlider,ra as ColorSwatch,Vf as ColorSwatchPicker,Uv as ColorWheel,Wi as Command,wR as CommandDialog,wp as CommandEmpty,Cp as CommandGroup,yp as CommandInput,Mp as CommandItem,Rp as CommandList,Tp as CommandSeparator,Np as CommandShortcut,sx as ComparisonSlider,Gh as Confetti,lu as ContextMenu,vu as ContextMenuCheckboxItem,pu as ContextMenuContent,du as ContextMenuGroup,bu as ContextMenuItem,uu as ContextMenuPortal,hu as ContextMenuSection,xu as ContextMenuSeparator,yu as ContextMenuShortcut,mu as ContextMenuSub,gu as ContextMenuSubContent,fu as ContextMenuSubTrigger,cu as ContextMenuTrigger,Nv as ContextualHelp,kb as CopyButton,Eh as Counter,$f as CurrencyInput,fa as DEFAULT_COLORS,oR as DataTable,TN as DateField,CN as DateInput,js as DatePicker,vb as DateRangePicker,Bi as Drawer,Sm as DrawerBody,Im as DrawerClose,Pm as DrawerContent,Hm as DrawerDescription,Lm as DrawerFooter,Km as DrawerGroup,$m as DrawerGroupLabel,Em as DrawerHeader,Gm as DrawerInset,zm as DrawerMenu,Fm as DrawerMenuButton,Om as DrawerMenuItem,Z0 as DrawerProvider,Am as DrawerSeparator,Nm as DrawerSidebar,Dm as DrawerTitle,Vm as DrawerToggle,km as DrawerTrigger,Zt as Dropdown,Jt as DropdownContent,Ad as DropdownGroup,Dt as DropdownItem,n0 as DropdownLabel,Mi as DropdownSection,Id as DropdownSeparator,Vd as DropdownShortcut,zd as DropdownSub,Bd as DropdownSubContent,Od as DropdownSubTrigger,Qt as DropdownTrigger,Hl as EMOJIS,Bs as EMOJI_CATEGORIES,jb as EmojiPicker,of as EmptyState,yh as Expand,Ck as FAB,bh as Fade,ml as FieldContext,Lf as FileUpload,wh as Flip,tc as FloatingActionButton,Fg as Form,ul as FormContext,Ug as FormControl,jg as FormDescription,Kg as FormField,$g as FormItem,Gg as FormLabel,_g as FormMessage,Sb as FullCalendar,Uh as Glow,Iv as GridList,_h as H1,Wh as H2,Yh as H3,Xh as H4,ax as HeatmapCalendar,Wu as HoverCard,Xu as HoverCardContent,Yu as HoverCardTrigger,ib as Image,qb as ImageCropper,Cl as ImageViewer,Cb as ImageViewerTrigger,Rb as InfiniteScroll,Qh as InlineCode,ao as Input,Yp as InputOTP,Xp as InputOTPGroup,Zp as InputOTPSeparator,qp as InputOTPSlot,Ob as KanbanBoard,Mb as Kbd,Er as Label,ex as Large,Jh as Lead,Lb as LineChart,og as Link,Tw as List,mf as ListItem,pf as ListItemText,gb as Loading,nl as MASK_PRESETS,jf as MaskedInput,ug as Menubar,wg as MenubarCheckboxItem,yg as MenubarContent,pg as MenubarGroup,Rg as MenubarItem,hC as MenubarLabel,mg as MenubarMenu,fg as MenubarPortal,bg as MenubarRadioGroup,Cg as MenubarRadioItem,sl as MenubarSection,Tg as MenubarSeparator,Mg as MenubarShortcut,gg as MenubarSub,xg as MenubarSubContent,hg as MenubarSubTrigger,vg as MenubarTrigger,mp as Modal,bp as ModalBody,fp as ModalClose,ss as ModalContent,xp as ModalDescription,vp as ModalFooter,gp as ModalHeader,_i as ModalOverlay,ji as ModalPortal,as as ModalRoot,hp as ModalTitle,pp as ModalTrigger,nx as Muted,Zf as Navbar,Qf as NavbarBrand,Jf as NavbarContent,eg as NavbarItem,tg as NavbarLink,mm as NavigationMenu,vm as NavigationMenuContent,ym as NavigationMenuIndicator,fm as NavigationMenuItem,xm as NavigationMenuLink,pm as NavigationMenuList,bm as NavigationMenuTrigger,Oi as NavigationMenuViewport,Ep as NumberInput,mx as PDFViewer,np as Pagination,rp as PaginationContent,ip as PaginationEllipsis,op as PaginationItem,ns as PaginationLink,sp as PaginationNext,ap as PaginationPrevious,qh as Paragraph,Oh as Parallax,Pp as PasswordInput,Yf as PhoneInput,Hb as PieChart,Ph as Pop,vt as Popover,Tn as PopoverAnchor,ht as PopoverContent,nr as PopoverTrigger,Qa as Progress,gh as PullToRefresh,Nh as Pulse,Qb as QRCode,Cu as RadioGroup,Tu as RadioGroupItem,Cv as RangeSlider,Ap as Rating,YR as ResizableHandle,WR as ResizablePanel,_R as ResizablePanelGroup,Wb as RichTextEditor,Ch as Ripple,Rh as Rotate,hh as Scale,Ae as ScrollArea,zh as ScrollProgress,Ah as ScrollReveal,Yv as SearchBar,iv as SearchField,Nf as SegmentedControl,kf as SegmentedControlItem,$a as Select,er as Separator,Mh as Shake,Zd as Sheet,Jd as SheetClose,nu as SheetContent,su as SheetDescription,ou as SheetFooter,ru as SheetHeader,eu as SheetOverlay,Li as SheetPortal,au as SheetTitle,Qd as SheetTrigger,Kh as Shimmer,Ba as Skeleton,vh as Slide,en as Slider,tx as Small,sb as Snippet,eT as SortableList,jh as Sparkles,Ha as Spinner,Qv as SpotlightSearch,lf as StatCard,hv as StatusLight,Eg as Step,kg as Steps,mh as SwipeActions,bd as Switch,ob as TabbedCodeBlock,jm as Table,Wm as TableBody,Qm as TableCaption,Zm as TableCell,Ym as TableFooter,qm as TableHead,_m as TableHeader,Xm as TableRow,Ud as Tabs,Wd as TabsContent,jd as TabsList,_d as TabsTrigger,Ev as TagGroup,tf as TagInput,wy as TextBadge,ov as TextField,Lh as TextReveal,vd as Textarea,Jb as ThemeProvider,ev as ThemeToggle,dv as TimeField,Bf as TimeInput,hb as TimePicker,vf as Timeline,yf as TimelineContent,xf as TimelineItem,Rf as TimelineOpposite,m0 as Toaster,Mu as Toggle,ku as ToggleGroup,Pu as ToggleGroupItem,Je as Tooltip,Cn as TooltipContent,tr as TooltipProvider,wn as TooltipTrigger,Ag as Tree,Sh as Typewriter,rx as UL,Xg as User,cx as VideoPlayer,gT as VirtualList,kh as Wiggle,Dh as WordRotate,xv as actionBarVariants,mv as actionGroupVariants,lh as actionSheetItemVariants,my as alertVariants,fs as applyMask,Og as autocompleteInputVariants,Hp as avatarGroupVariants,ag as backTopVariants,vy as badgeIndicatorVariants,Jv as bannerVariants,ah as bottomNavigationVariants,Jc as buttonGroupVariants,no as buttonVariants,o0 as calculatePasswordStrength,ad as cardVariants,Bb as carouselVariants,pa as chartContainerVariants,Op as chipVariants,Up as circularProgressVariants,Tm as closeButtonVariants,u as cn,Zg as codeVariants,Vv as colorAreaVariants,Kv as colorSliderVariants,If as colorSwatchPickerVariants,Hf as colorSwatchVariants,Gv as colorWheelVariants,ql as contextualHelpTriggerVariants,Nb as copyButtonVariants,Ff as currencyInputVariants,lv as datePickerVariants,Yd as defaultPasswordRequirements,Bm as drawerMenuButtonVariants,Ub as emojiPickerVariants,rf as emptyStateVariants,ya as fabVariants,Pf as fileUploadVariants,tl as formatCurrency,ha as formatDate,ms as formatFileSize,gs as formatPhoneNumber,Eb as fullCalendarVariants,Ef as getFileIcon,Uf as getMaskPlaceholder,a0 as getPasswordStrengthColor,s0 as getPasswordStrengthLabel,Hv as gridListItemVariants,Dv as gridListVariants,zv as hexToRgb,Js as hsvToRgb,Xb as imageCropperVariants,vl as imageVariants,wl as infiniteScrollLoaderVariants,Rl as infiniteScrollVariants,Wp as inputOTPVariants,nv as inputSizeVariants,Tb as kbdVariants,rv as labelSizeVariants,uf as listItemVariants,ea as listVariants,fb as loadingVariants,Gf as maskedInputVariants,Ui as modalContentVariants,qf as navbarVariants,hm as navigationMenuLinkStyle,gm as navigationMenuTriggerStyle,Gl as parseDate,Kf as parseFormattedValue,tC as phoneInputVariants,fh as pullToRefreshVariants,zl as qrCodeVariants,wv as rangeSliderVariants,Vp as ratingVariants,Ov as rgbToHex,Av as rgbToHsv,_b as richTextEditorVariants,Wv as searchBarVariants,sv as searchFieldVariants,Tf as segmentedControlItemVariants,Cf as segmentedControlVariants,Sd as selectVariants,tu as sheetVariants,xd as skeletonVariants,ab as snippetVariants,db as sortableItemVariants,cb as sortableListVariants,Zc as spinnerVariants,sf as statCardVariants,vv as statusLightVariants,Pg as stepVariants,Ng as stepsVariants,rc as swipeActionVariants,uh as swipeActionsVariants,Aa as switchColors,Zl as tagGroupItemVariants,Pv as tagGroupVariants,ef as tagVariants,Ry as textBadgeVariants,tv as textFieldVariants,mN as themeToggleVariants,cv as timeFieldVariants,Of as timeInputVariants,hf as timelineItemVariants,bf as timelineVariants,Ya as toggleVariants,Dg as treeItemVariants,Lg as treeVariants,rl as unmask,CS as useAnimatedValue,Kx as useAsync,uS as useAsyncRetry,IE as useBodyScrollLock,YE as useBooleanToggle,YP as useBreakpoint,XP as useBreakpoints,hi as useButtonGroup,Os as useCarousel,uE as useClickOutside,mE as useClickOutsideMultiple,Wk as useConfetti,fE as useCopy,pE as useCopyToClipboard,vS as useCountdown,qE as useCounter,WE as useCycle,rE as useDebounce,oE as useDebouncedCallback,aE as useDebouncedCallbackWithControls,yS as useDelayedValue,Lx as useDisclosure,jE as useDisclosureOpen,FS as useDistance,ES as useDocumentIsVisible,Jx as useDocumentVisibility,SS as useDocumentVisibilityCallback,G0 as useDrawer,$E as useElementSize,hE as useEventListener,xE as useEventListenerRef,pS as useFetch,Rs as useFieldContext,SE as useFocusTrap,LE as useFocusTrapRef,pl as useFormContext,ry as useFullscreen,AS as useFullscreenRef,BS as useGeolocation,gE as useHotkeys,bE as useHotkeysMap,wE as useHover,ME as useHoverDelay,TE as useHoverProps,CE as useHoverRef,MS as useIdle,NS as useIdleCallback,ZE as useIncrementCounter,kx as useIntersectionObserver,AE as useIntersectionObserverRef,fi as useInterval,bS as useIntervalControls,BP as useIsDesktop,zP as useIsMobile,OP as useIsTablet,yE as useKeyPress,vE as useKeyPressed,HT as useKeyboardShortcut,zE as useLazyLoad,rS as useList,QP as useLocalStorage,RE as useLongPress,oS as useMap,GS as useMediaPermission,Fo as useMediaQuery,kE as useMouse,PE as useMouseElement,EE as useMouseElementRef,fS as useMutation,OE as useMutationObserver,BE as useMutationObserverRef,$S as useNotificationPermission,LS as useOnlineStatus,DS as useOnlineStatusCallback,KS as usePermission,FP as usePrefersColorScheme,KP as usePrefersReducedMotion,QE as usePrevious,eS as usePreviousDistinct,JE as usePreviousWithInitial,lS as useQueue,wS as useRafLoop,aS as useRecord,FE as useResizeObserver,KE as useResizeObserverRef,Tx as useScrollLock,DE as useScrollPosition,iS as useSelection,eE as useSessionStorage,zx as useSet,_S as useSpeechRecognition,jS as useSpeechSynthesis,mk as useSpotlight,TS as useSpringValue,cS as useStack,lE as useThrottle,cE as useThrottledCallback,Wx as useTimeout,xS as useTimeoutControls,RS as useTimeoutFlag,hS as useTimer,_E as useToggle,WP as useWindowHeight,HE as useWindowScroll,Ma as useWindowSize,_P as useWindowWidth,Yg as userVariants,Sf as validateFile,FC as validators,xb as virtualListVariants};//# sourceMappingURL=index.js.map
72
+ `})]})});Kh.displayName="Shimmer";var jk={sm:24,md:40,lg:56,xl:80},_k={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"}},$h=Z.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=jk[t],d=_k[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?.()})]})});$h.displayName="Checkmark";var Oo={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},Gh=Z.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=Z.useCallback(()=>{let i={...Oo,...n};zo(i),o?.();},[n,o]);return Z.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});Gh.displayName="Confetti";var Wk=()=>{let e=Z.useCallback(r=>{let o={...Oo,...r};zo(o);},[]),t=Z.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);zo({...Oo,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),zo({...Oo,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=Z.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&zo({...Oo,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&zo({...Oo,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},Uh=Z.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})});Uh.displayName="Glow";var Fh=(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}),jh=Z.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]=Z.useState([]);return Z.useEffect(()=>{let d=Array.from({length:t},()=>Fh(r,o));c(d);let m=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=Fh(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))]})});jh.displayName="Sparkles";var _h=Z.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}));_h.displayName="H1";var Wh=Z.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}));Wh.displayName="H2";var Yh=Z.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}));Yh.displayName="H3";var Xh=Z.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}));Xh.displayName="H4";var qh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));qh.displayName="Paragraph";var Zh=Z.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}));Zh.displayName="Blockquote";var Qh=Z.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}));Qh.displayName="InlineCode";var Jh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-xl text-muted-foreground",e),...n,children:t}));Jh.displayName="Lead";var ex=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:u("text-lg font-semibold",e),...n,children:t}));ex.displayName="Large";var tx=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:u("text-sm font-medium leading-none",e),...n,children:t}));tx.displayName="Small";var nx=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:u("text-sm text-muted-foreground",e),...n,children:t}));nx.displayName="Muted";var rx=Z.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}));rx.displayName="UL";var Yk=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cc={default:["bg-muted","bg-emerald-200 dark:bg-emerald-900","bg-emerald-300 dark:bg-emerald-700","bg-emerald-500 dark:bg-emerald-500","bg-emerald-700 dark:bg-emerald-300"],success:["bg-muted","bg-green-200 dark:bg-green-900","bg-green-300 dark:bg-green-700","bg-green-500 dark:bg-green-500","bg-green-700 dark:bg-green-300"],warning:["bg-muted","bg-amber-200 dark:bg-amber-900","bg-amber-300 dark:bg-amber-700","bg-amber-500 dark:bg-amber-500","bg-amber-700 dark:bg-amber-300"],danger:["bg-muted","bg-red-200 dark:bg-red-900","bg-red-300 dark:bg-red-700","bg-red-500 dark:bg-red-500","bg-red-700 dark:bg-red-300"],primary:["bg-muted","bg-primary/20","bg-primary/40","bg-primary/60","bg-primary/80"],secondary:["bg-muted","bg-secondary/40","bg-secondary/60","bg-secondary/80","bg-secondary"]},dc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function ox(e){return e.toISOString().split("T")[0]}function qk(e){return e instanceof Date?e:new Date(e)}function Zk(e,t){let n=[],r=new Date(e);for(r.setDate(r.getDate()-r.getDay());r<=t;){let o=[];for(let a=0;a<7;a++)o.push(new Date(r)),r.setDate(r.getDate()+1);n.push(o);}return n}function Qk(e){let t=[],n=-1;return e.forEach((r,o)=>{let a=r.find(s=>s.getDate()<=7);a&&a.getMonth()!==n&&(n=a.getMonth(),t.push({month:Xk[n],position:o}));}),t}var ax=Z.forwardRef(({className:e,values:t,startDate:n,endDate:r,color:o="default",levels:a=5,showMonthLabels:s=true,showWeekdayLabels:i=true,showTooltip:l=true,tooltipFormatter:c,colorScale:d,gap:m=3,cellSize:f=12,radius:p="sm",onCellClick:g,emptyColor:h,showLegend:b=true,legendLabels:v={less:"Less",more:"More"},...R},x)=>{let w=r?new Date(r):new Date,C=n?new Date(n):new Date(w.getFullYear()-1,w.getMonth(),w.getDate()),y=Z.useMemo(()=>{let k=new Map;return t.forEach(P=>{let H=qk(P.date),I=ox(H);k.set(I,(k.get(I)||0)+P.count);}),k},[t]),T=Z.useMemo(()=>y.size===0?0:Math.max(...Array.from(y.values())),[y]),D=Z.useMemo(()=>Zk(C,w),[C,w]),E=Z.useMemo(()=>Qk(D),[D]),L=k=>{if(k===0)return h||d?.[0]||cc[o][0];let P=d||cc[o],H=Math.min(Math.ceil(k/T*(a-1)),a-1);return P[H]||P[P.length-1]},S=(k,P)=>{if(c)return c(k,P);let H=k.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"});return jsxs("span",{children:[jsx("span",{className:"font-medium",children:P})," contributions on ",H]})},N=(k,P,H)=>{let I=ox(k),A=y.get(I)||0;if(!(k>=C&&k<=w))return jsx("div",{style:{width:f,height:f}},`${P}-${H}`);let V=jsx("div",{className:u("transition-all duration-200",dc[p],L(A),g&&"cursor-pointer hover:ring-2 hover:ring-ring hover:ring-offset-1"),style:{width:f,height:f},onClick:()=>g?.(k,A),role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:z=>{g&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),g(k,A));}});return l?jsxs(Rn,{children:[jsx(wn,{className:u("transition-all duration-200 border-0 bg-transparent p-0",dc[p],L(A),g&&"cursor-pointer hover:ring-2 hover:ring-ring hover:ring-offset-1"),style:{width:f,height:f},onClick:()=>g?.(k,A),onKeyDown:z=>{g&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),g(k,A));}}),jsx(Cn,{children:S(k,A)})]},`${P}-${H}`):jsx(Z.Fragment,{children:V},`${P}-${H}`)},M=d||cc[o];return jsxs("div",{ref:x,className:u("inline-flex flex-col",e),...R,children:[jsxs("div",{className:"flex",children:[i&&jsx("div",{className:"flex flex-col justify-between pr-2",style:{gap:m,marginTop:s?20:0},children:Yk.map((k,P)=>jsx("div",{className:u("text-xs text-muted-foreground",P%2===1&&"invisible"),style:{height:f,lineHeight:`${f}px`},children:k},k))}),jsxs("div",{className:"flex flex-col",children:[s&&jsx("div",{className:"flex mb-1",style:{gap:m,height:16},children:E.map(({month:k,position:P},H)=>jsx("div",{className:"text-xs text-muted-foreground",style:{position:"relative",left:P*(f+m),marginLeft:H===0?0:-P*(f+m)},children:k},`${k}-${H}`))}),jsx("div",{className:"flex",style:{gap:m},children:D.map((k,P)=>jsx("div",{className:"flex flex-col",style:{gap:m},children:k.map((H,I)=>N(H,P,I))},P))})]})]}),b&&jsxs("div",{className:"flex items-center justify-end mt-4 gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground",children:v.less}),jsx("div",{className:"flex",style:{gap:m/2},children:M.slice(0,a).map((k,P)=>jsx("div",{className:u(dc[p],k),style:{width:f,height:f}},P))}),jsx("span",{className:"text-xs text-muted-foreground",children:v.more})]})]})});ax.displayName="HeatmapCalendar";var sx=Z.forwardRef(({className:e,beforeImage:t,afterImage:n,beforeAlt:r="Before",afterAlt:o="After",defaultPosition:a=50,position:s,onPositionChange:i,orientation:l="horizontal",showLabels:c=true,beforeLabel:d="Before",afterLabel:m="After",handleVariant:f="default",handleColor:p="default",aspectRatio:g,disableKeyboard:h=false,handleWidth:b=4,...v},R)=>{let[x,w]=Z.useState(a),C=s!==void 0,y=C?s:x,T=Z.useRef(null),[D,E]=Z.useState(false),L=V=>{let z=Math.max(0,Math.min(100,V));C||w(z),i?.(z);},S=(V,z)=>{if(!T.current)return y;let K=T.current.getBoundingClientRect();return l==="horizontal"?(V-K.left)/K.width*100:(z-K.top)/K.height*100},N=V=>{V.preventDefault(),E(true),V.target.setPointerCapture(V.pointerId);let z=S(V.clientX,V.clientY);L(z);},M=V=>{if(!D)return;let z=S(V.clientX,V.clientY);L(z);},k=()=>{E(false);},P=V=>{if(h)return;let z=V.shiftKey?10:1,K=y;switch(V.key){case "ArrowLeft":case "ArrowUp":V.preventDefault(),K=y-z;break;case "ArrowRight":case "ArrowDown":V.preventDefault(),K=y+z;break;case "Home":V.preventDefault(),K=0;break;case "End":V.preventDefault(),K=100;break;default:return}L(K);},H={default:"bg-border",primary:"bg-primary",white:"bg-white",black:"bg-black"},I={default:"bg-background border-border text-foreground",primary:"bg-primary border-primary text-primary-foreground",white:"bg-white border-white text-black",black:"bg-black border-black text-white"},A=()=>{let V=l==="horizontal",z=u("absolute z-10 flex items-center justify-center",V?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize",H[p]),K=V?{left:`${y}%`,width:b,transform:"translateX(-50%)"}:{top:`${y}%`,height:b,transform:"translateY(-50%)"};return f==="minimal"?jsx("div",{className:z,style:K}):f==="arrows"?jsx("div",{className:z,style:K,children:jsxs("div",{className:u("absolute flex items-center justify-center gap-0.5 rounded-full p-1.5 shadow-md border-2",I[p],V?"flex-row":"flex-col"),children:[jsx("svg",{className:u("w-3 h-3",V?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M15 18l-6-6 6-6"})}),jsx("svg",{className:u("w-3 h-3",V?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M9 18l6-6-6-6"})})]})}):jsx("div",{className:z,style:K,children:jsx("div",{className:u("absolute rounded-full p-2 shadow-md border-2",I[p]),children:jsxs("svg",{className:u("w-4 h-4",V?"":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M8 3L4 7l4 4"}),jsx("path",{d:"M16 3l4 4-4 4"}),jsx("path",{d:"M4 7h16"}),jsx("path",{d:"M8 17l-4 4 4 4"}),jsx("path",{d:"M16 17l4 4-4 4"}),jsx("path",{d:"M4 21h16"})]})})})},O=l==="horizontal";return jsx("div",{ref:R,className:u("relative select-none overflow-hidden rounded-lg",D&&"cursor-grabbing",e),style:g?{aspectRatio:g}:void 0,...v,children:jsxs("div",{ref:T,className:"relative w-full h-full",role:"slider",tabIndex:0,"aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100,"aria-orientation":l,"aria-label":"Comparison slider",onPointerDown:N,onPointerMove:M,onPointerUp:k,onPointerCancel:k,onKeyDown:P,children:[jsx("img",{src:n,alt:o,className:"absolute inset-0 w-full h-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 overflow-hidden",style:O?{width:`${y}%`}:{height:`${y}%`},children:jsx("img",{src:t,alt:r,className:u("absolute inset-0 object-cover",O?"w-[var(--container-width)] h-full":"w-full h-[var(--container-height)]"),style:O?{"--container-width":T.current?`${T.current.offsetWidth}px`:"100%"}:{"--container-height":T.current?`${T.current.offsetHeight}px`:"100%"},draggable:false})}),A(),c&&jsxs(Fragment,{children:[jsx("div",{className:u("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none","top-3 left-3"),children:d}),jsx("div",{className:u("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none",O?"top-3 right-3":"bottom-3 left-3"),children:m})]})]})})});sx.displayName="ComparisonSlider";function lx(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${n}:${r.toString().padStart(2,"0")}`}var dP={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},cx=Z.forwardRef(({className:e,src:t,poster:n,autoPlay:r=false,muted:o=false,loop:a=false,controls:s=true,preload:i="metadata",aspectRatio:l="16/9",defaultVolume:c=1,playbackSpeeds:d=[.5,.75,1,1.25,1.5,2],showPiP:m=true,showFullscreen:f=true,showVolume:p=true,showPlaybackSpeed:g=true,showSkipButtons:h=false,skipInterval:b=10,onPlay:v,onPause:R,onEnded:x,onVideoTimeUpdate:w,onVideoVolumeChange:C,controlsHideTimeout:y=3e3,keyboardShortcuts:T=true,doubleClickFullscreen:D=true,radius:E="lg",...L},S)=>{let N=Z.useRef(null),M=Z.useRef(null),k=Z.useRef(null),[P,H]=Z.useState(false),[I,A]=Z.useState(0),[O,V]=Z.useState(0),[z,K]=Z.useState(c),[G,X]=Z.useState(o),[F,$]=Z.useState(false),[j,_]=Z.useState(true),[B,q]=Z.useState(true),[ee,Y]=Z.useState(1),[ve,Q]=Z.useState(0),ne=Z.useMemo(()=>typeof t=="string"?[{src:t,type:void 0,label:void 0}]:t,[t]),[Te,fe]=Z.useState(0),Ye=Z.useCallback(()=>{k.current&&clearTimeout(k.current),q(true),P&&y>0&&(k.current=setTimeout(()=>{q(false);},y));},[P,y]);Z.useEffect(()=>(Ye(),()=>{k.current&&clearTimeout(k.current);}),[P,Ye]);let Ze=()=>{M.current&&(V(M.current.duration),_(false));},Tt=()=>{if(M.current){A(M.current.currentTime),w?.(M.current.currentTime,M.current.duration);let re=M.current.buffered.length>0?M.current.buffered.end(M.current.buffered.length-1):0;Q(re/M.current.duration*100);}},ke=()=>{H(true),v?.();},ct=()=>{H(false),R?.();},J=()=>{H(false),x?.();},W=()=>{_(true);},ae=()=>{_(false);},U=()=>{M.current&&(P?M.current.pause():M.current.play());},de=re=>{if(M.current){let Re=re[0]/100*O;M.current.currentTime=Re,A(Re);}},ue=re=>{let Re=re[0]/100;K(Re),X(Re===0),M.current&&(M.current.volume=Re,M.current.muted=Re===0),C?.(Re,Re===0);},Be=()=>{if(M.current){let re=!G;M.current.muted=re,X(re),re?M.current.volume=0:M.current.volume=z||1,C?.(re?0:z,re);}},$e=async()=>{if(N.current)try{F?await document.exitFullscreen():await N.current.requestFullscreen();}catch{}},yn=async()=>{if(M.current)try{document.pictureInPictureElement?await document.exitPictureInPicture():await M.current.requestPictureInPicture();}catch{}},ye=re=>{M.current&&(M.current.currentTime=Math.max(0,Math.min(O,M.current.currentTime+re)));},Qe=re=>{M.current&&(M.current.playbackRate=re,Y(re));};Z.useEffect(()=>{let re=()=>{$(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",re),()=>{document.removeEventListener("fullscreenchange",re);}},[]),Z.useEffect(()=>{if(!T)return;let re=Re=>{if(!(!N.current?.contains(document.activeElement)&&document.activeElement!==N.current))switch(Re.key.toLowerCase()){case " ":case "k":Re.preventDefault(),U();break;case "f":Re.preventDefault(),$e();break;case "m":Re.preventDefault(),Be();break;case "arrowleft":Re.preventDefault(),ye(-b);break;case "arrowright":Re.preventDefault(),ye(b);break;case "arrowup":Re.preventDefault(),ue([Math.min(100,z*100+10)]);break;case "arrowdown":Re.preventDefault(),ue([Math.max(0,z*100-10)]);break}};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re);}},[T,P,z,b]);let Ot=()=>{D&&$e();},Ge=O>0?I/O*100:0;return jsxs("div",{ref:re=>{N.current=re,typeof S=="function"?S(re):S&&(S.current=re);},className:u("relative bg-black overflow-hidden group",dP[E],e),style:{aspectRatio:l},onMouseMove:Ye,onMouseLeave:()=>P&&q(false),tabIndex:0,...L,children:[jsx("video",{ref:M,className:"w-full h-full object-contain",poster:n,autoPlay:r,muted:o,loop:a,preload:i,playsInline:true,onClick:U,onDoubleClick:Ot,onLoadedMetadata:Ze,onTimeUpdate:Tt,onPlay:ke,onPause:ct,onEnded:J,onWaiting:W,onCanPlay:ae,children:ne.map((re,Re)=>jsx("source",{src:re.src,type:re.type},Re))}),j&&jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20",children:jsx(Loader2,{className:"w-12 h-12 text-white animate-spin"})}),!P&&!j&&jsx("button",{type:"button",className:"absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity cursor-pointer",onClick:U,children:jsx("div",{className:"w-16 h-16 rounded-full bg-white/90 flex items-center justify-center",children:jsx(Play,{className:"w-8 h-8 text-black ml-1",fill:"currentColor"})})}),s&&jsxs("div",{className:u("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-16 transition-opacity duration-300",B?"opacity-100":"opacity-0 pointer-events-none"),children:[jsxs("div",{className:"relative mb-3 group/progress",children:[jsx("div",{className:"absolute top-1/2 left-0 h-1 bg-white/30 rounded-full -translate-y-1/2",style:{width:`${ve}%`}}),jsx(Jt,{value:[Ge],onValueChange:de,min:0,max:100,step:.1,className:"h-1 group-hover/progress:h-2 transition-all cursor-pointer [&_[role=slider]]:w-3 [&_[role=slider]]:h-3 [&_[role=slider]]:opacity-0 group-hover/progress:[&_[role=slider]]:opacity-100 [&_[role=slider]]:transition-opacity"})]}),jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:U,children:P?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5",fill:"currentColor"})}),h&&jsxs(Fragment,{children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>ye(-b),children:jsx(SkipBack,{className:"w-5 h-5"})}),jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>ye(b),children:jsx(SkipForward,{className:"w-5 h-5"})})]}),p&&jsxs("div",{className:"flex items-center gap-1 group/volume",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:Be,children:G||z===0?jsx(VolumeX,{className:"w-5 h-5"}):jsx(Volume2,{className:"w-5 h-5"})}),jsx("div",{className:"w-0 overflow-hidden group-hover/volume:w-20 transition-all",children:jsx(Jt,{value:[G?0:z*100],onValueChange:ue,min:0,max:100,step:1,className:"w-20"})})]}),jsxs("div",{className:"text-white text-sm ml-2",children:[lx(I)," / ",lx(O)]})]}),jsxs("div",{className:"flex items-center gap-1",children:[g&&jsxs(qt,{children:[jsx(Zt,{children:jsxs("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer flex items-center gap-1",children:[jsx(Settings,{className:"w-5 h-5"}),jsxs("span",{className:"text-xs",children:[ee,"x"]})]})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:d.map(re=>jsxs(Lt,{onSelect:()=>Qe(re),className:u(ee===re&&"bg-primary/10 text-primary"),children:[re,"x"]},re))})]}),ne.length>1&&jsxs(qt,{children:[jsx(Zt,{children:jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer text-xs",children:ne[Te]?.quality||ne[Te]?.label||"Quality"})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:ne.map((re,Re)=>jsx(Lt,{onSelect:()=>{let Mr=M.current?.currentTime||0;fe(Re),setTimeout(()=>{M.current&&(M.current.currentTime=Mr,P&&M.current.play());},100);},className:u(Te===Re&&"bg-primary/10 text-primary"),children:re.quality||re.label||`Source ${Re+1}`},Re))})]}),m&&document.pictureInPictureEnabled&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:yn,children:jsx(PictureInPicture,{className:"w-5 h-5"})}),f&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:$e,children:F?jsx(Minimize,{className:"w-5 h-5"}):jsx(Maximize,{className:"w-5 h-5"})})]})]})]})]})});cx.displayName="VideoPlayer";function Ta(e){if(!e||!isFinite(e))return "0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}var dx={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},yP={default:{progress:"bg-foreground",waveformActive:"bg-foreground",waveformInactive:"bg-muted-foreground/30"},primary:{progress:"bg-primary",waveformActive:"bg-primary",waveformInactive:"bg-primary/20"},success:{progress:"bg-green-500",waveformActive:"bg-green-500",waveformInactive:"bg-green-500/20"},warning:{progress:"bg-amber-500",waveformActive:"bg-amber-500",waveformInactive:"bg-amber-500/20"},danger:{progress:"bg-red-500",waveformActive:"bg-red-500",waveformInactive:"bg-red-500/20"}},ux=Z.forwardRef(({className:e,src:t,autoPlay:n=false,defaultVolume:r=1,loop:o=false,muted:a=false,showWaveform:s=true,waveformData:i,waveformBars:l=50,showTrackInfo:c=true,showVolume:d=true,showSkipButtons:m=false,skipInterval:f=10,showLoop:p=true,showShuffle:g=false,showDownload:h=false,variant:b="default",color:v="default",onPlay:R,onPause:x,onEnded:w,onAudioTimeUpdate:C,radius:y="lg",...T},D)=>{let E=Z.useRef(null),L=Z.useRef(null),[S,N]=Z.useState(false),[M,k]=Z.useState(0),[P,H]=Z.useState(0),[I,A]=Z.useState(r),[O,V]=Z.useState(a),[z,K]=Z.useState(true),[G,X]=Z.useState(o),[F,$]=Z.useState(false),j=Z.useMemo(()=>typeof t=="string"?{src:t}:t,[t]),_=Z.useMemo(()=>{if(i)return i;let U=[];for(let de=0;de<l;de++)U.push(.2+Math.random()*.8);return U},[i,l]),B=()=>{E.current&&(H(E.current.duration),K(false));},q=()=>{E.current&&(k(E.current.currentTime),C?.(E.current.currentTime,E.current.duration));},ee=()=>{N(true),R?.();},Y=()=>{N(false),x?.();},ve=()=>{N(false),w?.();},Q=()=>{K(false);},ne=()=>{E.current&&(S?E.current.pause():E.current.play());},Te=U=>{if(E.current&&P){let de=U/100*P;E.current.currentTime=de,k(de);}},fe=U=>{if(!L.current||!P)return;let de=L.current.getBoundingClientRect(),ue=(U.clientX-de.left)/de.width*100;Te(ue);},Ye=U=>{let de=U[0]/100;A(de),V(de===0),E.current&&(E.current.volume=de,E.current.muted=de===0);},Ze=()=>{if(E.current){let U=!O;E.current.muted=U,V(U);}},Tt=()=>{if(E.current){let U=!G;E.current.loop=U,X(U);}},ke=U=>{E.current&&(E.current.currentTime=Math.max(0,Math.min(P,E.current.currentTime+U)));},ct=()=>{let U=document.createElement("a");U.href=j.src,U.download=j.title||"audio",document.body.appendChild(U),U.click(),document.body.removeChild(U);},J=P>0?M/P*100:0,W=yP[v],ae=O||I===0?VolumeX:I<.5?Volume1:Volume2;return b==="compact"?jsxs("div",{ref:D,className:u("flex items-center gap-3 p-2 bg-muted/50",dx[y],e),...T,children:[jsx("audio",{ref:E,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:ve,onCanPlay:Q}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded-full transition-colors cursor-pointer",onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-4 h-4 animate-spin"}):S?jsx(Pause,{className:"w-4 h-4",fill:"currentColor"}):jsx(Play,{className:"w-4 h-4",fill:"currentColor"})}),jsx("div",{className:"flex-1",children:jsx(Jt,{value:[J],onValueChange:U=>Te(U[0]),min:0,max:100,step:.1,className:"h-1"})}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(M)})]}):b==="minimal"?jsxs("div",{ref:D,className:u("flex items-center gap-4",e),...T,children:[jsx("audio",{ref:E,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:ve,onCanPlay:Q}),jsx("button",{type:"button",className:u("p-3 rounded-full transition-colors cursor-pointer",W.progress,"text-white hover:opacity-90"),onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-5 h-5 animate-spin"}):S?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[c&&j.title&&jsx("span",{className:"text-sm font-medium truncate",children:j.title}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(M)}),jsx(Jt,{value:[J],onValueChange:U=>Te(U[0]),min:0,max:100,step:.1,className:"flex-1"}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ta(P)})]})]})]}):jsxs("div",{ref:D,className:u("p-4 bg-card border border-border",dx[y],e),...T,children:[jsx("audio",{ref:E,src:j.src,autoPlay:n,loop:G,muted:a,onLoadedMetadata:B,onTimeUpdate:q,onPlay:ee,onPause:Y,onEnded:ve,onCanPlay:Q}),c&&(j.title||j.artist||j.artwork)&&jsxs("div",{className:"flex items-center gap-4 mb-4",children:[j.artwork&&jsx("img",{src:j.artwork,alt:j.title||"Album artwork",className:"w-16 h-16 rounded-md object-cover"}),jsxs("div",{className:"flex-1 min-w-0",children:[j.title&&jsx("h3",{className:"font-medium truncate",children:j.title}),j.artist&&jsx("p",{className:"text-sm text-muted-foreground truncate",children:j.artist}),j.album&&jsx("p",{className:"text-xs text-muted-foreground truncate",children:j.album})]})]}),s?jsx("div",{ref:L,className:"relative h-16 mb-4 flex items-end gap-[2px] cursor-pointer",onClick:fe,children:_.map((U,de)=>{let Be=(de+1)/_.length*100<=J;return jsx("div",{className:u("flex-1 rounded-sm transition-colors",Be?W.waveformActive:W.waveformInactive),style:{height:`${U*100}%`,minHeight:4}},de)})}):jsx("div",{className:"mb-4",children:jsx(Jt,{value:[J],onValueChange:U=>Te(U[0]),min:0,max:100,step:.1})}),jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-4",children:[jsx("span",{children:Ta(M)}),jsx("span",{children:Ta(P)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-1",children:[g&&jsx("button",{type:"button",className:u("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",F&&"text-primary"),onClick:()=>$(!F),children:jsx(Shuffle,{className:"w-4 h-4"})}),m&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>ke(-f),children:jsx(SkipBack,{className:"w-5 h-5"})})]}),jsx("button",{type:"button",className:u("p-4 rounded-full transition-colors cursor-pointer",W.progress,"text-white hover:opacity-90"),onClick:ne,disabled:z,children:z?jsx(Loader2,{className:"w-6 h-6 animate-spin"}):S?jsx(Pause,{className:"w-6 h-6",fill:"currentColor"}):jsx(Play,{className:"w-6 h-6 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex items-center gap-1",children:[m&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>ke(f),children:jsx(SkipForward,{className:"w-5 h-5"})}),p&&jsx("button",{type:"button",className:u("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",G&&"text-primary"),onClick:Tt,children:jsx(Repeat,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"flex items-center justify-between mt-4",children:[d?jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx("button",{type:"button",className:"p-1 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Ze,children:jsx(ae,{className:"w-4 h-4"})}),jsx(Jt,{value:[O?0:I*100],onValueChange:Ye,min:0,max:100,step:1,className:"w-24"})]}):jsx("div",{}),h&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:ct,children:jsx(Download,{className:"w-4 h-4"})})]})]})});ux.displayName="AudioPlayer";var HP={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},mx=Z.forwardRef(({className:e,src:t,defaultPage:n=1,defaultZoom:r=100,showToolbar:o=true,showNavigation:a=true,showZoomControls:s=true,showDownload:i=true,showPrint:l=true,showFullscreen:c=true,showRotate:d=true,showSearch:m=false,zoomStep:f=25,minZoom:p=25,maxZoom:g=400,toolbarPosition:h="top",height:b="600px",onPageChange:v,onZoomChange:R,onPDFLoad:x,onPDFError:w,errorMessage:C="Failed to load PDF. Please try again.",loadingMessage:y="Loading PDF...",fileName:T="document.pdf",totalPages:D=1,radius:E="lg",...L},S)=>{let N=Z.useRef(null),M=Z.useRef(null),[k,P]=Z.useState(n),[H]=Z.useState(D),[I,A]=Z.useState(r),[O,V]=Z.useState(0),[z,K]=Z.useState(false),[G,X]=Z.useState(true),[F,$]=Z.useState(false),[j,_]=Z.useState(String(n)),B=J=>{let W=Math.max(1,Math.min(H,J));P(W),_(String(W)),v?.(W);},q=J=>{_(J.target.value);},ee=()=>{let J=parseInt(j,10);isNaN(J)?_(String(k)):B(J);},Y=J=>{J.key==="Enter"&&ee();},ve=()=>{let J=Math.min(g,I+f);A(J),R?.(J);},Q=()=>{let J=Math.max(p,I-f);A(J),R?.(J);},ne=()=>{V(J=>(J+90)%360);},Te=async()=>{if(N.current)try{z?await document.exitFullscreen():await N.current.requestFullscreen();}catch{}};Z.useEffect(()=>{let J=()=>{K(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",J),()=>{document.removeEventListener("fullscreenchange",J);}},[]);let fe=()=>{let J=document.createElement("a");J.href=t,J.download=T,document.body.appendChild(J),J.click(),document.body.removeChild(J);},Ye=()=>{M.current?.contentWindow&&M.current.contentWindow.print();},Ze=()=>{X(false),$(false),x?.();},Tt=()=>{X(false),$(true),w?.(new Error("Failed to load PDF"));},ke=Z.useMemo(()=>{let J=new URL(t,window.location.href);return J.hash=`page=${k}&zoom=${I}`,J.toString()},[t,k,I]),ct=jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 bg-muted/50 border-b border-border",children:[a&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>B(k-1),disabled:k<=1,title:"Previous page",children:jsx(ChevronLeft,{className:"w-4 h-4"})}),jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(ao,{value:j,onChange:q,onBlur:ee,onKeyDown:Y,className:"w-12 h-7 text-center text-sm px-1"}),jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",H]})]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>B(k+1),disabled:k>=H,title:"Next page",children:jsx(ChevronRight,{className:"w-4 h-4"})})]}),s&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:Q,disabled:I<=p,title:"Zoom out",children:jsx(ZoomOut,{className:"w-4 h-4"})}),jsxs("span",{className:"text-sm text-muted-foreground min-w-[50px] text-center",children:[I,"%"]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:ve,disabled:I>=g,title:"Zoom in",children:jsx(ZoomIn,{className:"w-4 h-4"})})]}),jsxs("div",{className:"flex items-center gap-1",children:[m&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",title:"Search",children:jsx(Search,{className:"w-4 h-4"})}),d&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:ne,title:"Rotate",children:jsx(RotateCw,{className:"w-4 h-4"})}),l&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Ye,title:"Print",children:jsx(Printer,{className:"w-4 h-4"})}),i&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:fe,title:"Download",children:jsx(Download,{className:"w-4 h-4"})}),c&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Te,title:z?"Exit fullscreen":"Fullscreen",children:z?jsx(Minimize,{className:"w-4 h-4"}):jsx(Maximize,{className:"w-4 h-4"})})]})]});return jsxs("div",{ref:J=>{N.current=J,typeof S=="function"?S(J):S&&(S.current=J);},className:u("flex flex-col bg-card border border-border overflow-hidden",HP[E],e),style:{height:z?"100vh":b},...L,children:[o&&h==="top"&&ct,jsxs("div",{className:"flex-1 relative overflow-hidden bg-muted/30",children:[G&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background/80 z-10",children:[jsx(Loader2,{className:"w-8 h-8 animate-spin text-muted-foreground mb-2"}),jsx("span",{className:"text-sm text-muted-foreground",children:y})]}),F&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background z-10",children:[jsx(FileWarning,{className:"w-12 h-12 text-muted-foreground mb-3"}),jsx("span",{className:"text-sm text-muted-foreground",children:C}),jsx("button",{type:"button",className:"mt-3 px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors cursor-pointer",onClick:()=>{X(true),$(false);},children:"Try again"})]}),jsx("iframe",{ref:M,src:ke,className:"w-full h-full border-0",style:{transform:`rotate(${O}deg) scale(${I/100})`,transformOrigin:"center center"},onLoad:Ze,onError:Tt,title:"PDF Viewer"})]}),o&&h==="bottom"&&ct]})});mx.displayName="PDFViewer";function Fo(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 zP(){return Fo("(max-width: 767px)")}function OP(){return Fo("(min-width: 768px) and (max-width: 1023px)")}function BP(){return Fo("(min-width: 1024px)")}function FP(){return Fo("(prefers-color-scheme: dark)")?"dark":"light"}function KP(){return Fo("(prefers-reduced-motion: reduce)")}function Ma(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 _P(){let{width:e}=Ma();return e}function WP(){let{height:e}=Ma();return e}function YP(e){let{width:t}=Ma();return t>=e}function XP(){let{width:e}=Ma();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function QP(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 eE(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 rE(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function oE(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 aE(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 lE(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 cE(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 uE(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 mE(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 pE(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 fE(){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 fx(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 gx(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 gE(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=fx(e);useEffect(()=>{if(!r)return;let c=m=>{gx(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 bE(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:fx(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:m,handler:f}of i)if(gx(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 vE(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 hE(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 xE(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 yE(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 RE(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 wE(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 CE(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 TE(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function ME(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 kE(){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 PE(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 EE(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 hx=["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 SE(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(hx)).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 LE(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(hx)).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 DE(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 HE(){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 Tx(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 IE(e=true){let{lock:t,unlock:n}=Tx();useEffect(()=>{e?t():n();},[e,t,n]);}function kx(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 AE(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 zE(e="200px"){let{ref:t,isIntersecting:n}=kx({rootMargin:e,once:true});return {ref:t,isVisible:n}}function OE(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 BE(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 FE(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 KE(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 $E(){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 Lx(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 jE(e){return Lx({...e,defaultOpen:true})}function _E(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function WE(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 YE(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 qE(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 ZE(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function QE(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function JE(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function eS(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 rS(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(T=>{let D=[...T];return D.splice(C,0,y),D});},[]),i=useCallback((C,y)=>{n(T=>{let D=[...T];return D[C]=y,D});},[]),l=useCallback(C=>{n(y=>y.filter((T,D)=>D!==C));},[]),c=useCallback(C=>{n(y=>{let T=y.indexOf(C);return T===-1?y:y.filter((D,E)=>E!==T)});},[]),d=useCallback(C=>{n(y=>y.filter(T=>!C(T)));},[]),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(T=>{let D=[...T],[E]=D.splice(C,1);return D.splice(y,0,E),D});},[]),v=useCallback((C,y)=>{n(T=>{let D=[...T];return [D[C],D[y]]=[D[y],D[C]],D});},[]),R=useCallback(C=>t.filter(C),[t]),x=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:R,find:x,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,R,x,w])}function oS(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 aS(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 zx(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 iS(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=zx(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 lS(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 cS(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 Kx(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 uS(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 {...Kx(s,false),retryCount:r}}var Ux=new Map,mS=300*1e3;function pS(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=Ux.get(h);if(b&&Date.now()-b.timestamp<mS){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(),x=o?o(R):R;Ux.set(h,{data:x,timestamp:Date.now()}),f.current&&d({data:x,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 fS(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 fi(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 bS(e,t){let[n,r]=useState(false);fi(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 vS(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;fi(()=>{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 hS(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);fi(()=>{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 Wx(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 xS(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 yS(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function RS(e,t=true){let[n,r]=useState(false);return Wx(()=>{r(true);},t?e:null),n}function wS(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 CS(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 TS(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 Zx=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function MS(e,t={}){let{events:n=Zx,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 NS(e,t,n,r={}){let{events:o=Zx,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 Jx(){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 ES(){return Jx()==="visible"}function SS(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function LS(){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 DS(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 ry(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 AS(){let e=useRef(null),t=ry(e);return {ref:e,...t}}function BS(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 FS(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 KS(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 $S(){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 GS(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 jS(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 _S(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 x=new p;return x.lang=t,x.continuous=n,x.interimResults=r,x.onstart=()=>{a(true),m(null);},x.onend=()=>{a(false);},x.onerror=w=>{m(new Error(w.error)),a(false);},x.onresult=w=>{let C="",y="";for(let T=w.resultIndex;T<w.results.length;T++){let D=w.results[T];D.isFinal?y+=D[0].transcript:C+=D[0].transcript;}y&&i(T=>T+y),c(C);},f.current=x,()=>{x.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{Du as Accordion,Hu as AccordionItem,yv as ActionBar,Rv as ActionBarButton,pv as ActionGroup,ch as ActionSheet,fy as Alert,by as AlertDescription,gy as AlertTitle,Ib as AreaChart,sm as AspectRatio,ux as AudioPlayer,Bg as Autocomplete,Sr as Avatar,Lr as AvatarFallback,Ip as AvatarGroup,so as AvatarImage,sg as BackTop,yy as Badge,eh as Banner,Db as BarChart,Zh as Blockquote,sh as BottomNavigation,Th as Bounce,Zu as Breadcrumb,rm as BreadcrumbEllipsis,Ju as BreadcrumbItem,em as BreadcrumbLink,Qu as BreadcrumbList,tm as BreadcrumbPage,nm as BreadcrumbSeparator,me as Button,td as ButtonGroup,Wf as COUNTRIES,lo as Calendar,sd as Card,dd as CardContent,cd as CardDescription,ud as CardFooter,id as CardHeader,ld as CardTitle,Kb as Carousel,$b as CarouselContent,Gb as CarouselItem,Ll as CarouselNext,Sl as CarouselPrevious,Uo as Checkbox,$h as Checkmark,Bp as Chip,jp as CircularProgress,Ft as CloseButton,Qg as Code,rb as CodeBlock,xh as Collapse,Bu as Collapsible,Fu as CollapsibleContent,Vi as CollapsibleTrigger,Bv as ColorArea,zf as ColorPicker,$v as ColorSlider,ra as ColorSwatch,Vf as ColorSwatchPicker,Uv as ColorWheel,Wi as Command,wR as CommandDialog,wp as CommandEmpty,Cp as CommandGroup,yp as CommandInput,Mp as CommandItem,Rp as CommandList,Tp as CommandSeparator,Np as CommandShortcut,sx as ComparisonSlider,Gh as Confetti,lu as ContextMenu,vu as ContextMenuCheckboxItem,pu as ContextMenuContent,du as ContextMenuGroup,bu as ContextMenuItem,uu as ContextMenuPortal,hu as ContextMenuSection,xu as ContextMenuSeparator,yu as ContextMenuShortcut,mu as ContextMenuSub,gu as ContextMenuSubContent,fu as ContextMenuSubTrigger,cu as ContextMenuTrigger,Nv as ContextualHelp,kb as CopyButton,Eh as Counter,$f as CurrencyInput,fa as DEFAULT_COLORS,oR as DataTable,TN as DateField,CN as DateInput,js as DatePicker,vb as DateRangePicker,Bi as Drawer,Sm as DrawerBody,Im as DrawerClose,Pm as DrawerContent,Hm as DrawerDescription,Lm as DrawerFooter,Km as DrawerGroup,$m as DrawerGroupLabel,Em as DrawerHeader,Gm as DrawerInset,zm as DrawerMenu,Fm as DrawerMenuButton,Om as DrawerMenuItem,Z0 as DrawerProvider,Am as DrawerSeparator,Nm as DrawerSidebar,Dm as DrawerTitle,Vm as DrawerToggle,km as DrawerTrigger,qt as Dropdown,Qt as DropdownContent,Ad as DropdownGroup,Lt as DropdownItem,n0 as DropdownLabel,Mi as DropdownSection,Id as DropdownSeparator,Vd as DropdownShortcut,zd as DropdownSub,Bd as DropdownSubContent,Od as DropdownSubTrigger,Zt as DropdownTrigger,Hl as EMOJIS,Bs as EMOJI_CATEGORIES,jb as EmojiPicker,of as EmptyState,yh as Expand,Ck as FAB,bh as Fade,ml as FieldContext,Lf as FileUpload,wh as Flip,tc as FloatingActionButton,Fg as Form,ul as FormContext,Ug as FormControl,jg as FormDescription,Kg as FormField,$g as FormItem,Gg as FormLabel,_g as FormMessage,Sb as FullCalendar,Uh as Glow,Iv as GridList,_h as H1,Wh as H2,Yh as H3,Xh as H4,ax as HeatmapCalendar,Wu as HoverCard,Xu as HoverCardContent,Yu as HoverCardTrigger,ib as Image,qb as ImageCropper,Cl as ImageViewer,Cb as ImageViewerTrigger,Rb as InfiniteScroll,Qh as InlineCode,ao as Input,Yp as InputOTP,Xp as InputOTPGroup,Zp as InputOTPSeparator,qp as InputOTPSlot,Ob as KanbanBoard,Mb as Kbd,Er as Label,ex as Large,Jh as Lead,Lb as LineChart,og as Link,Tw as List,mf as ListItem,pf as ListItemText,gb as Loading,nl as MASK_PRESETS,jf as MaskedInput,ug as Menubar,wg as MenubarCheckboxItem,yg as MenubarContent,pg as MenubarGroup,Rg as MenubarItem,hC as MenubarLabel,mg as MenubarMenu,fg as MenubarPortal,bg as MenubarRadioGroup,Cg as MenubarRadioItem,sl as MenubarSection,Tg as MenubarSeparator,Mg as MenubarShortcut,gg as MenubarSub,xg as MenubarSubContent,hg as MenubarSubTrigger,vg as MenubarTrigger,mp as Modal,bp as ModalBody,fp as ModalClose,ss as ModalContent,xp as ModalDescription,vp as ModalFooter,gp as ModalHeader,_i as ModalOverlay,ji as ModalPortal,as as ModalRoot,hp as ModalTitle,pp as ModalTrigger,nx as Muted,Zf as Navbar,Qf as NavbarBrand,Jf as NavbarContent,eg as NavbarItem,tg as NavbarLink,mm as NavigationMenu,vm as NavigationMenuContent,ym as NavigationMenuIndicator,fm as NavigationMenuItem,xm as NavigationMenuLink,pm as NavigationMenuList,bm as NavigationMenuTrigger,Oi as NavigationMenuViewport,Ep as NumberInput,mx as PDFViewer,np as Pagination,rp as PaginationContent,ip as PaginationEllipsis,op as PaginationItem,ns as PaginationLink,sp as PaginationNext,ap as PaginationPrevious,qh as Paragraph,Oh as Parallax,Pp as PasswordInput,Yf as PhoneInput,Hb as PieChart,Ph as Pop,bt as Popover,Tn as PopoverAnchor,vt as PopoverContent,nr as PopoverTrigger,Qa as Progress,gh as PullToRefresh,Nh as Pulse,Qb as QRCode,Cu as RadioGroup,Tu as RadioGroupItem,Cv as RangeSlider,Ap as Rating,YR as ResizableHandle,WR as ResizablePanel,_R as ResizablePanelGroup,Wb as RichTextEditor,Ch as Ripple,Rh as Rotate,hh as Scale,Ae as ScrollArea,zh as ScrollProgress,Ah as ScrollReveal,Yv as SearchBar,iv as SearchField,Nf as SegmentedControl,kf as SegmentedControlItem,$a as Select,er as Separator,Mh as Shake,Zd as Sheet,Jd as SheetClose,nu as SheetContent,su as SheetDescription,ou as SheetFooter,ru as SheetHeader,eu as SheetOverlay,Li as SheetPortal,au as SheetTitle,Qd as SheetTrigger,Kh as Shimmer,Ba as Skeleton,vh as Slide,Jt as Slider,tx as Small,sb as Snippet,eT as SortableList,jh as Sparkles,Ha as Spinner,Qv as SpotlightSearch,lf as StatCard,hv as StatusLight,Eg as Step,kg as Steps,mh as SwipeActions,bd as Switch,ob as TabbedCodeBlock,jm as Table,Wm as TableBody,Qm as TableCaption,Zm as TableCell,Ym as TableFooter,qm as TableHead,_m as TableHeader,Xm as TableRow,Ud as Tabs,Wd as TabsContent,jd as TabsList,_d as TabsTrigger,Ev as TagGroup,tf as TagInput,wy as TextBadge,ov as TextField,Lh as TextReveal,vd as Textarea,Jb as ThemeProvider,ev as ThemeToggle,dv as TimeField,Bf as TimeInput,hb as TimePicker,vf as Timeline,yf as TimelineContent,xf as TimelineItem,Rf as TimelineOpposite,m0 as Toaster,Mu as Toggle,ku as ToggleGroup,Pu as ToggleGroupItem,Rn as Tooltip,Cn as TooltipContent,tr as TooltipProvider,wn as TooltipTrigger,Ag as Tree,Sh as Typewriter,rx as UL,Xg as User,cx as VideoPlayer,gT as VirtualList,kh as Wiggle,Dh as WordRotate,xv as actionBarVariants,mv as actionGroupVariants,lh as actionSheetItemVariants,my as alertVariants,fs as applyMask,Og as autocompleteInputVariants,Hp as avatarGroupVariants,ag as backTopVariants,vy as badgeIndicatorVariants,Jv as bannerVariants,ah as bottomNavigationVariants,Jc as buttonGroupVariants,no as buttonVariants,o0 as calculatePasswordStrength,ad as cardVariants,Bb as carouselVariants,pa as chartContainerVariants,Op as chipVariants,Up as circularProgressVariants,Tm as closeButtonVariants,u as cn,Zg as codeVariants,Vv as colorAreaVariants,Kv as colorSliderVariants,If as colorSwatchPickerVariants,Hf as colorSwatchVariants,Gv as colorWheelVariants,ql as contextualHelpTriggerVariants,Nb as copyButtonVariants,Ff as currencyInputVariants,lv as datePickerVariants,Yd as defaultPasswordRequirements,Bm as drawerMenuButtonVariants,Ub as emojiPickerVariants,rf as emptyStateVariants,ya as fabVariants,Pf as fileUploadVariants,tl as formatCurrency,ha as formatDate,ms as formatFileSize,gs as formatPhoneNumber,Eb as fullCalendarVariants,Ef as getFileIcon,Uf as getMaskPlaceholder,a0 as getPasswordStrengthColor,s0 as getPasswordStrengthLabel,Hv as gridListItemVariants,Dv as gridListVariants,zv as hexToRgb,Js as hsvToRgb,Xb as imageCropperVariants,vl as imageVariants,wl as infiniteScrollLoaderVariants,Rl as infiniteScrollVariants,Wp as inputOTPVariants,nv as inputSizeVariants,Tb as kbdVariants,rv as labelSizeVariants,uf as listItemVariants,ea as listVariants,fb as loadingVariants,Gf as maskedInputVariants,Ui as modalContentVariants,qf as navbarVariants,hm as navigationMenuLinkStyle,gm as navigationMenuTriggerStyle,Gl as parseDate,Kf as parseFormattedValue,tC as phoneInputVariants,fh as pullToRefreshVariants,zl as qrCodeVariants,wv as rangeSliderVariants,Vp as ratingVariants,Ov as rgbToHex,Av as rgbToHsv,_b as richTextEditorVariants,Wv as searchBarVariants,sv as searchFieldVariants,Tf as segmentedControlItemVariants,Cf as segmentedControlVariants,Sd as selectVariants,tu as sheetVariants,xd as skeletonVariants,ab as snippetVariants,db as sortableItemVariants,cb as sortableListVariants,Zc as spinnerVariants,sf as statCardVariants,vv as statusLightVariants,Pg as stepVariants,Ng as stepsVariants,rc as swipeActionVariants,uh as swipeActionsVariants,Aa as switchColors,Zl as tagGroupItemVariants,Pv as tagGroupVariants,ef as tagVariants,Ry as textBadgeVariants,tv as textFieldVariants,mN as themeToggleVariants,cv as timeFieldVariants,Of as timeInputVariants,hf as timelineItemVariants,bf as timelineVariants,Ya as toggleVariants,Dg as treeItemVariants,Lg as treeVariants,rl as unmask,CS as useAnimatedValue,Kx as useAsync,uS as useAsyncRetry,IE as useBodyScrollLock,YE as useBooleanToggle,YP as useBreakpoint,XP as useBreakpoints,hi as useButtonGroup,Os as useCarousel,uE as useClickOutside,mE as useClickOutsideMultiple,Wk as useConfetti,fE as useCopy,pE as useCopyToClipboard,vS as useCountdown,qE as useCounter,WE as useCycle,rE as useDebounce,oE as useDebouncedCallback,aE as useDebouncedCallbackWithControls,yS as useDelayedValue,Lx as useDisclosure,jE as useDisclosureOpen,FS as useDistance,ES as useDocumentIsVisible,Jx as useDocumentVisibility,SS as useDocumentVisibilityCallback,G0 as useDrawer,$E as useElementSize,hE as useEventListener,xE as useEventListenerRef,pS as useFetch,Rs as useFieldContext,SE as useFocusTrap,LE as useFocusTrapRef,pl as useFormContext,ry as useFullscreen,AS as useFullscreenRef,BS as useGeolocation,gE as useHotkeys,bE as useHotkeysMap,wE as useHover,ME as useHoverDelay,TE as useHoverProps,CE as useHoverRef,MS as useIdle,NS as useIdleCallback,ZE as useIncrementCounter,kx as useIntersectionObserver,AE as useIntersectionObserverRef,fi as useInterval,bS as useIntervalControls,BP as useIsDesktop,zP as useIsMobile,OP as useIsTablet,yE as useKeyPress,vE as useKeyPressed,HT as useKeyboardShortcut,zE as useLazyLoad,rS as useList,QP as useLocalStorage,RE as useLongPress,oS as useMap,GS as useMediaPermission,Fo as useMediaQuery,kE as useMouse,PE as useMouseElement,EE as useMouseElementRef,fS as useMutation,OE as useMutationObserver,BE as useMutationObserverRef,$S as useNotificationPermission,LS as useOnlineStatus,DS as useOnlineStatusCallback,KS as usePermission,FP as usePrefersColorScheme,KP as usePrefersReducedMotion,QE as usePrevious,eS as usePreviousDistinct,JE as usePreviousWithInitial,lS as useQueue,wS as useRafLoop,aS as useRecord,FE as useResizeObserver,KE as useResizeObserverRef,Tx as useScrollLock,DE as useScrollPosition,iS as useSelection,eE as useSessionStorage,zx as useSet,_S as useSpeechRecognition,jS as useSpeechSynthesis,mk as useSpotlight,TS as useSpringValue,cS as useStack,lE as useThrottle,cE as useThrottledCallback,Wx as useTimeout,xS as useTimeoutControls,RS as useTimeoutFlag,hS as useTimer,_E as useToggle,WP as useWindowHeight,HE as useWindowScroll,Ma as useWindowSize,_P as useWindowWidth,Yg as userVariants,Sf as validateFile,FC as validators,xb as virtualListVariants};//# sourceMappingURL=index.js.map
73
73
  //# sourceMappingURL=index.js.map