@reeverdev/ui 0.2.211 → 0.2.212
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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -30
- package/dist/index.d.ts +1 -30
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as q 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,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 Da 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 jT from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import eM from'@tiptap/starter-kit';import tM from'@tiptap/extension-link';import nM from'@tiptap/extension-underline';import rM from'@tiptap/extension-text-align';import oM from'@tiptap/extension-placeholder';import MM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import HM 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 Co from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var Ux=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"}}),jx={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},_x=q.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=jx[n],u=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(Ux({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[u&&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})]})});_x.displayName="Alert";var Wx=q.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));Wx.displayName="AlertTitle";var Yx=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("text-sm [&_p]:leading-relaxed",e),...t}));Yx.displayName="AlertDescription";var qx=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"}}),Xx={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},Zx={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"},Qx=q.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:m("relative inline-flex",e),...c,children:[t,jsxs("span",{className:m(qx({variant:r,color:o,size:i?void 0:a,placement:s}),i&&Xx[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:m("absolute inset-0 rounded-full animate-ping opacity-75",Zx[o||"default"])}),!i&&n]})]}));Qx.displayName="Badge";var Jx=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"}}),ey=q.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:m(Jx({color:t,size:n}),e),...r}));ey.displayName="TextBadge";var Ic=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"}}),ny={sm:"text-xs",md:"text-sm",lg:"text-base"},xa=q.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:m(Ic({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:m("inline-flex",e),...i,children:c});let d=jsx("span",{className:m("text-muted-foreground",ny[t]),children:o}),u=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:m("inline-flex items-center",u?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(u?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});xa.displayName="Spinner";var Ac=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"}}),zc=q.createContext({});function ai(){return q.useContext(zc)}var Oc=q.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(zc.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:m(Ac({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));Oc.displayName="ButtonGroup";var Gr=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"}}),se=q.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:u,isIconOnly:f,...p},g)=>{let h=ai(),b=d||h.disabled||s,v=u,y=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",w=s?jsxs(Fragment,{children:[jsx(xa,{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:m(Gr({variant:t,color:n,size:r,radius:o,className:e}),y,"pointer-events-none opacity-50 cursor-not-allowed"),style:v,children:w}):jsx("a",{href:a,className:m(Gr({variant:t,color:n,size:r,radius:o,className:e}),y),style:v,...p,children:w}):jsx("button",{type:"button",className:m(Gr({variant:t,color:n,size:r,radius:o,className:e}),y),ref:g,disabled:b,style:v,...p,children:w})});se.displayName="Button";var $c=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"}}),Gc=q.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:m($c({radius:t,className:e})),...n}));Gc.displayName="Card";var Uc=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex flex-col space-y-1.5 p-6",e),...t}));Uc.displayName="CardHeader";var jc=q.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));jc.displayName="CardTitle";var _c=q.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));_c.displayName="CardDescription";var Wc=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("p-6 pt-0",e),...t}));Wc.displayName="CardContent";var Yc=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center p-6 pt-0",e),...t}));Yc.displayName="CardFooter";var So=q.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,...u},f)=>{let[p,g]=q.useState(n),h=t!==void 0,b=h?t:p,[v,y]=q.useState(false),x=q.useId(),w=()=>{if(o)return;let L=b==="indeterminate"?true:!b;h||g(L),r?.(L);},C=L=>{L.key==="Enter"&&L.preventDefault(),d?.(L);},R=b===true,T=b==="indeterminate",k=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":T?"mixed":R,"aria-required":a,disabled:o,ref:f,className:m("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",R&&"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:()=>y(true),onBlur:()=>y(false),...u,children:(R||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:R,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:m("flex items-start gap-2",e),children:[k,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,className:m("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})]})]}):k});So.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"}}),Ra=q.forwardRef(({className:e,type:t,size:n,radius:r,label:o,isRequired:a,description:s,errorMessage:i,isInvalid:l,onFocus:c,onBlur:d,style:u,...f},p)=>{let[g,h]=q.useState(false),b=q.useId(),v=f.id||b,y=l||!!i,x=jsx("input",{id:v,type:t,className:m(dy({size:n,radius:r}),y&&"border-danger focus:border-danger",!o&&e),ref:p,required:a,"aria-invalid":y,"aria-describedby":s||i?`${v}-description`:void 0,style:{...u,borderColor:y?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:m("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:m("text-xs",y?"text-danger":"text-muted-foreground"),children:i||s})]})});Ra.displayName="Input";var my=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),br=q.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:m(my(),e),...t}));br.displayName="Label";var On=q.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:m("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:m("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});On.displayName="Separator";var gy="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",Ca={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"},Qc={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"}},Jc=q.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:u,style:f,...p},g)=>{let[h,b]=q.useState(a),v=o!==void 0,y=v?o:h,x=()=>{if(i)return;let T=!y;v||b(T),s?.(T);},w=T=>{T.key==="Enter"&&T.preventDefault(),u?.(T);},C=t&&Ca[t]?Ca[t]:Ca.default,R=Qc[n]||Qc.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-required":l,"data-state":y?"checked":"unchecked",disabled:i,ref:g,className:m(gy,R.track,y?r?"":C:"bg-input",e),style:r&&y?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:w,...p,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",R.thumb,y?R.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:y,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Jc.displayName="Switch";var xy=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"}}),ed=q.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=q.useState(false);return jsx("textarea",{className:m(xy({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})});ed.displayName="Textarea";var nd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Na=q.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:m(nd({variant:t,className:e})),...n}));Na.displayName="Skeleton";var Ty=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"}}),rd=q.createContext(null),od=()=>{let e=q.useContext(rd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},vr=q.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=q.useState("idle");return jsx(rd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(Ty({size:t,radius:n,className:e})),...r})})});vr.displayName="Avatar";var _r=q.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=od();return q.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:m("aspect-square h-full w-full object-cover",e),...o})});_r.displayName="AvatarImage";var hr=q.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=od(),[s,i]=q.useState(t===0);return q.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:m("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});hr.displayName="AvatarFallback";var sd=q.createContext({delayDuration:700,skipDelayDuration:300}),Bn=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(sd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});Bn.displayName="TooltipProvider";var id=q.createContext(null),ld=()=>{let e=q.useContext(id);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Fn=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=q.useContext(sd),[s,i]=q.useState(n),l=t!==void 0,c=l?t:s,d=q.useRef(null),u=q.useId(),f=q.useRef(null),p=o??a.delayDuration,g=q.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 q.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(id.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:u},children:e})};Fn.displayName="Tooltip";var Kn=q.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=ld();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})});Kn.displayName="TooltipTrigger";var $n=q.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}=ld(),[u,f]=q.useState({top:0,left:0}),[p,g]=q.useState(false),h=q.useRef(null);if(q.useEffect(()=>{g(true);},[]),q.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=0,w=0;switch(t){case "top":x=v.top-y.height-n;break;case "bottom":x=v.bottom+n;break;case "left":w=v.left-y.width-n;break;case "right":w=v.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":w=v.left+o;break;case "center":w=v.left+v.width/2-y.width/2;break;case "end":w=v.right-y.width-o;break}else switch(r){case "start":x=v.top+o;break;case "center":x=v.top+v.height/2-y.height/2;break;case "end":x=v.bottom-y.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 Da.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:m("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:u.top,left:u.left},...s,children:a}),document.body)});$n.displayName="TooltipContent";var My={sm:"20px",md:"40px",lg:"60px"},Ne=q.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",showShadow:r=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=q.useRef(null),[d,u]=q.useState(false),[f,p]=q.useState({top:false,bottom:false,left:false,right:false}),g=q.useId().replace(/:/g,"");q.useImperativeHandle(l,()=>c.current);let h=q.useCallback(()=>{let C=c.current;if(!C||!r)return;let{scrollTop:R,scrollLeft:T,scrollHeight:k,scrollWidth:L,clientHeight:N,clientWidth:P}=C;p({top:R>0,bottom:R<k-N-1,left:T>0,right:T<L-P-1});},[r]);q.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",y=b?"rgba(255,255,255,0.3)":"transparent",x=`
|
|
1
|
+
import*as X 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 as X$1,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,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 Ea 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 zT from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import _T from'@tiptap/starter-kit';import WT from'@tiptap/extension-link';import YT from'@tiptap/extension-underline';import XT from'@tiptap/extension-text-align';import qT from'@tiptap/extension-placeholder';import vM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import MM 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 Ro from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var Ax=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"}}),zx={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Ox=X.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=zx[n],u=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(Ax({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[u&&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})]})});Ox.displayName="Alert";var Bx=X.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));Bx.displayName="AlertTitle";var Fx=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("text-sm [&_p]:leading-relaxed",e),...t}));Fx.displayName="AlertDescription";var Kx=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"}}),$x={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},Gx={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"},Ux=X.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:m("relative inline-flex",e),...c,children:[t,jsxs("span",{className:m(Kx({variant:r,color:o,size:i?void 0:a,placement:s}),i&&$x[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:m("absolute inset-0 rounded-full animate-ping opacity-75",Gx[o||"default"])}),!i&&n]})]}));Ux.displayName="Badge";var jx=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"}}),_x=X.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:m(jx({color:t,size:n}),e),...r}));_x.displayName="TextBadge";var Sc=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"}}),Yx={sm:"text-xs",md:"text-sm",lg:"text-base"},ba=X.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:m(Sc({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:m("inline-flex",e),...i,children:c});let d=jsx("span",{className:m("text-muted-foreground",Yx[t]),children:o}),u=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:m("inline-flex items-center",u?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(u?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});ba.displayName="Spinner";var Dc=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"}}),Hc=X.createContext({});function ni(){return X.useContext(Hc)}var Ic=X.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(Hc.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:m(Dc({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));Ic.displayName="ButtonGroup";var Kr=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"}}),se=X.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:u,isIconOnly:f,...p},g)=>{let h=ni(),b=d||h.disabled||s,v=u,y=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",w=s?jsxs(Fragment,{children:[jsx(ba,{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:m(Kr({variant:t,color:n,size:r,radius:o,className:e}),y,"pointer-events-none opacity-50 cursor-not-allowed"),style:v,children:w}):jsx("a",{href:a,className:m(Kr({variant:t,color:n,size:r,radius:o,className:e}),y),style:v,...p,children:w}):jsx("button",{type:"button",className:m(Kr({variant:t,color:n,size:r,radius:o,className:e}),y),ref:g,disabled:b,style:v,...p,children:w})});se.displayName="Button";var Oc=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"}}),Bc=X.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:m(Oc({radius:t,className:e})),...n}));Bc.displayName="Card";var Fc=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex flex-col space-y-1.5 p-6",e),...t}));Fc.displayName="CardHeader";var Kc=X.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));Kc.displayName="CardTitle";var $c=X.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));$c.displayName="CardDescription";var Gc=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("p-6 pt-0",e),...t}));Gc.displayName="CardContent";var Uc=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center p-6 pt-0",e),...t}));Uc.displayName="CardFooter";var Po=X.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,...u},f)=>{let[p,g]=X.useState(n),h=t!==void 0,b=h?t:p,[v,y]=X.useState(false),x=X.useId(),w=()=>{if(o)return;let S=b==="indeterminate"?true:!b;h||g(S),r?.(S);},C=S=>{S.key==="Enter"&&S.preventDefault(),d?.(S);},R=b===true,T=b==="indeterminate",k=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":T?"mixed":R,"aria-required":a,disabled:o,ref:f,className:m("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",R&&"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:()=>y(true),onBlur:()=>y(false),...u,children:(R||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:R,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:m("flex items-start gap-2",e),children:[k,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,className:m("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})]})]}):k});Po.displayName="Checkbox";var ny=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"}}),ha=X.forwardRef(({className:e,type:t,size:n,radius:r,label:o,isRequired:a,description:s,errorMessage:i,isInvalid:l,onFocus:c,onBlur:d,style:u,...f},p)=>{let[g,h]=X.useState(false),b=X.useId(),v=f.id||b,y=l||!!i,x=jsx("input",{id:v,type:t,className:m(ny({size:n,radius:r}),y&&"border-danger focus:border-danger",!o&&e),ref:p,required:a,"aria-invalid":y,"aria-describedby":s||i?`${v}-description`:void 0,style:{...u,borderColor:y?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:m("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:m("text-xs",y?"text-danger":"text-muted-foreground"),children:i||s})]})});ha.displayName="Input";var oy=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),fr=X.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:m(oy(),e),...t}));fr.displayName="Label";var zn=X.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:m("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:m("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});zn.displayName="Separator";var iy="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",ya={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"},Yc={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"}},Xc=X.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:u,style:f,...p},g)=>{let[h,b]=X.useState(a),v=o!==void 0,y=v?o:h,x=()=>{if(i)return;let T=!y;v||b(T),s?.(T);},w=T=>{T.key==="Enter"&&T.preventDefault(),u?.(T);},C=t&&ya[t]?ya[t]:ya.default,R=Yc[n]||Yc.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-required":l,"data-state":y?"checked":"unchecked",disabled:i,ref:g,className:m(iy,R.track,y?r?"":C:"bg-input",e),style:r&&y?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:w,...p,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",R.thumb,y?R.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:y,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});Xc.displayName="Switch";var uy=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"}}),qc=X.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=X.useState(false);return jsx("textarea",{className:m(uy({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})});qc.displayName="Textarea";var Qc=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Ca=X.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:m(Qc({variant:t,className:e})),...n}));Ca.displayName="Skeleton";var by=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"}}),Jc=X.createContext(null),ed=()=>{let e=X.useContext(Jc);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},gr=X.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=X.useState("idle");return jsx(Jc.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(by({size:t,radius:n,className:e})),...r})})});gr.displayName="Avatar";var Ur=X.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=ed();return X.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:m("aspect-square h-full w-full object-cover",e),...o})});Ur.displayName="AvatarImage";var br=X.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=ed(),[s,i]=X.useState(t===0);return X.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:m("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});br.displayName="AvatarFallback";var nd=X.createContext({delayDuration:700,skipDelayDuration:300}),On=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(nd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});On.displayName="TooltipProvider";var rd=X.createContext(null),od=()=>{let e=X.useContext(rd);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},Bn=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=X.useContext(nd),[s,i]=X.useState(n),l=t!==void 0,c=l?t:s,d=X.useRef(null),u=X.useId(),f=X.useRef(null),p=o??a.delayDuration,g=X.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 X.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(rd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:u},children:e})};Bn.displayName="Tooltip";var Fn=X.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=od();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})});Fn.displayName="TooltipTrigger";var Kn=X.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}=od(),[u,f]=X.useState({top:0,left:0}),[p,g]=X.useState(false),h=X.useRef(null);if(X.useEffect(()=>{g(true);},[]),X.useEffect(()=>{if(!l||!c.current||!h.current)return;let v=c.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=0,w=0;switch(t){case "top":x=v.top-y.height-n;break;case "bottom":x=v.bottom+n;break;case "left":w=v.left-y.width-n;break;case "right":w=v.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":w=v.left+o;break;case "center":w=v.left+v.width/2-y.width/2;break;case "end":w=v.right-y.width-o;break}else switch(r){case "start":x=v.top+o;break;case "center":x=v.top+v.height/2-y.height/2;break;case "end":x=v.bottom-y.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 Ea.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:m("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:u.top,left:u.left},...s,children:a}),document.body)});Kn.displayName="TooltipContent";var vy={sm:"20px",md:"40px",lg:"60px"},Ne=X.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",showShadow:r=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=X.useRef(null),[d,u]=X.useState(false),[f,p]=X.useState({top:false,bottom:false,left:false,right:false}),g=X.useId().replace(/:/g,"");X.useImperativeHandle(l,()=>c.current);let h=X.useCallback(()=>{let C=c.current;if(!C||!r)return;let{scrollTop:R,scrollLeft:T,scrollHeight:k,scrollWidth:S,clientHeight:N,clientWidth:P}=C;p({top:R>0,bottom:R<k-N-1,left:T>0,right:T<S-P-1});},[r]);X.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",y=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 q 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:()=>u(true),onMouseLeave:()=>u(false),style:{...s,...(()=>{if(!r)return {};let C=My[o],R=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",k=[R&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&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 k.length===0?{}:{maskImage:k.join(", "),WebkitMaskImage:k.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:m(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})]})});Ne.displayName="ScrollArea";var pd=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"}}),Ea=q.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:u=3,maxDropdownHeight:f=240,size:p,radius:g,className:h,...b},v)=>{let[y,x]=q.useState(false),[w,C]=q.useState(""),[R,T]=q.useState(r||""),[k,L]=q.useState(r||[]),[N,P]=q.useState({top:0,left:0,width:0}),M=q.useRef(null),S=q.useRef(null),H=q.useRef(null),D=q.useRef(null),E=n!==void 0?n:R,I=n!==void 0?n:k,A=n!==void 0,O=F=>{d&&E===F?(A||T(""),o?.("")):(A||T(F),o?.(F)),x(false),C("");},V=F=>{let X=I.includes(F)?I.filter(ae=>ae!==F):[...I,F];A||L(X),o?.(X);},K=(F,X)=>{X.stopPropagation();let ae=I.filter(j=>j!==F);A||L(ae),o?.(ae);},$=F=>{F.stopPropagation(),t?(A||L([]),o?.([])):(A||T(""),o?.(""));},G=e.find(F=>F.value===E),Y=e.filter(F=>I.includes(F.value)),B=Y.slice(0,u),z=Y.length-u,_=s?e.filter(F=>F.label.toLowerCase().includes(w.toLowerCase())):e;q.useEffect(()=>{if(y&&S.current){let F=S.current.getBoundingClientRect();P({top:F.bottom+4,left:F.left,width:F.width}),s&&setTimeout(()=>D.current?.focus(),0);}y||C("");},[y,s]),q.useEffect(()=>{let F=X=>{let ae=X.target,j=M.current&&!M.current.contains(ae),we=H.current&&!H.current.contains(ae);j&&we&&(x(false),C(""));};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]),q.useEffect(()=>{if(!y)return;let F=X=>{H.current?.contains(X.target)||(x(false),C(""));};return window.addEventListener("scroll",F,true),()=>window.removeEventListener("scroll",F,true)},[y]);let U=t?I.length>0:!!E;return jsxs("div",{ref:M,className:m("relative",h),...b,children:[jsxs("div",{ref:F=>{S.current=F,typeof v=="function"?v(F):v&&(v.current=F);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:m(pd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:m(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:Y.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[B.map(F=>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:[F.label,jsx("span",{role:"button",tabIndex:0,onClick:X=>K(F.value,X),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&K(F.value,X);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},F.value)),z>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",z," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&U&&jsx("span",{role:"button",tabIndex:0,onClick:$,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&$(F);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]})]}),y&&!c&&typeof document<"u"&&Da.createPortal(jsxs("div",{ref:H,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:N.top,left:N.left,minWidth:N.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:D,type:"text",value:w,onChange:F=>C(F.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(Ne,{style:{maxHeight:f},onWheel:F=>F.stopPropagation(),children:jsx("div",{className:"p-1",children:_.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):_.map(F=>{let X=t?I.includes(F.value):E===F.value;return jsxs("div",{role:"option","aria-selected":X,onClick:()=>{F.disabled||(t?V(F.value):O(F.value));},className:m("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",F.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:X&&jsx(Check,{className:"h-4 w-4"})}),F.label]},F.value)})})})]}),document.body)]})});Ea.displayName="Select";var fd=q.createContext(null),Lo=()=>{let e=q.useContext(fd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},di=q.createContext({radius:"md"}),ui=q.createContext(null),yn=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),[s,i]=q.useState(-1),l=t!==void 0,c=l?t:o,d=q.useRef(null),u=q.useRef(null),f=q.useId(),p=q.useRef(new Map),g=q.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=q.useCallback((v,y)=>{p.current.set(v,y);},[]),b=q.useCallback(v=>{p.current.delete(v);},[]);return jsx(fd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};yn.displayName="Dropdown";var Rn=q.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Lo();return jsx("div",{ref:u=>{i.current=u,typeof o=="function"?o(u):o&&(o.current=u);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:u=>{t?.(u),s(!a);},onKeyDown:u=>{n?.(u),(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),s(true)),(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});Rn.displayName="DropdownTrigger";var Hy={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},wn=q.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,...u},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:b,contentId:v,activeIndex:y,setActiveIndex:x,items:w}=Lo(),[C,R]=q.useState({top:0,left:0}),[T,k]=q.useState(t),[L,N]=q.useState(false),P=q.useRef(0);if(q.useEffect(()=>{N(true);},[]),q.useEffect(()=>{p&&(P.current=w.current.size);},[p,w]),q.useEffect(()=>{if(!p||!h.current||!b.current)return;let S=()=>{if(!h.current||!b.current)return;let H=h.current.getBoundingClientRect(),D=b.current.getBoundingClientRect(),E=window.innerWidth,I=window.innerHeight,A=0,O=0,V=t;switch(t){case "top":A=H.top-D.height-n,A<a&&(A=H.bottom+n,V="bottom");break;case "bottom":A=H.bottom+n,A+D.height>I-a&&(A=H.top-D.height-n,V="top");break;case "left":O=H.left-D.width-n,O<a&&(O=H.right+n,V="right");break;case "right":O=H.right+n,O+D.width>E-a&&(O=H.left-D.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":O=H.left+o;break;case "center":O=H.left+H.width/2-D.width/2;break;case "end":O=H.right-D.width-o;break}O<a?O=a:O+D.width>E-a&&(O=E-D.width-a);}else {switch(r){case "start":A=H.top+o;break;case "center":A=H.top+H.height/2-D.height/2;break;case "end":A=H.bottom-D.height-o;break}A<a?A=a:A+D.height>I-a&&(A=I-D.height-a);}R({top:A,left:O}),k(V);};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,true),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,true);}},[p,t,n,r,o,a,h]),q.useEffect(()=>{if(!p)return;let S=H=>{let D=H.target;b.current&&!b.current.contains(D)&&h.current&&!h.current.contains(D)&&(s?.(),g(false));};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[p,g,s,h,b]),q.useEffect(()=>{if(!p)return;let S=H=>{let D=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),E=D.length;if(E!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),y===-1||y>=E-1?x(l?0:Math.min(y+1,E-1)):x(y+1);break;case "ArrowUp":H.preventDefault(),y<=0?x(l?E-1:0):x(y-1);break;case "Home":H.preventDefault(),x(0);break;case "End":H.preventDefault(),x(E-1);break;case "Enter":case " ":H.preventDefault(),y>=0&&y<E&&D[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[p,g,i,y,x,w,l,h]),q.useEffect(()=>{p&&y>=0&&Array.from(w.current.entries()).sort(([H],[D])=>H-D).map(([,H])=>H)[y]?.focus();},[p,y,w]),!L||!p)return null;let M={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 Da.createPortal(jsx("div",{ref:S=>{b.current=S,typeof f=="function"?f(S):f&&(f.current=S);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",Hy[c],M,e),style:{top:C.top,left:C.left},...u,children:jsx(di.Provider,{value:{radius:c},children:d})}),document.body)});wn.displayName="DropdownContent";var gd=0,bd={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Ft=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:u,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=Lo(),{radius:b}=q.useContext(di),[v]=q.useState(()=>gd++),y=q.useRef(null);q.useEffect(()=>(!n&&y.current&&g(v,y.current),()=>{h(v);}),[n,v,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),u(false);},w=R=>{a?.(R),n||p(v);};return jsxs("div",{ref:R=>{y.current=R,typeof d=="function"?d(R):d&&(d.current=R);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===v?"":void 0,className:m("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",bd[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Ft.displayName="DropdownItem";var mi=q.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));mi.displayName="DropdownSection";var vd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));vd.displayName="DropdownSeparator";var hd=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});hd.displayName="DropdownShortcut";var xd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));xd.displayName="DropdownGroup";var yd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),{contentRef:s}=Lo(),i=t!==void 0,l=i?t:o,c=q.useRef(null),d=q.useCallback(u=>{i||a(u),r?.(u);},[i,r]);return jsx(ui.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};yd.displayName="DropdownSub";var Rd=q.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=q.useContext(ui),{setActiveIndex:d,registerItem:u,unregisterItem:f}=Lo(),{radius:p}=q.useContext(di),[g]=q.useState(()=>gd++),h=q.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:y}=c;q.useEffect(()=>(!n&&h.current&&u(g,h.current),()=>{f(g);}),[n,g,u,f]);let x=R=>{o?.(R),n||(d(g),v(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(true));};return jsxs("div",{ref:R=>{h.current=R,y.current=R,typeof l=="function"?l(R):l&&(l.current=R);},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:m("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",bd[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"})]})});Rd.displayName="DropdownSubTrigger";var wd=q.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=q.useContext(ui);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:f}=l,[p,g]=q.useState({top:0,left:0}),[h,b]=q.useState(false),v=q.useRef(null),y=q.useRef(null);q.useEffect(()=>{b(true);},[]),q.useEffect(()=>{if(!c||!u.current||!v.current)return;(()=>{if(!u.current||!v.current)return;let R=u.current.getBoundingClientRect(),T=v.current.getBoundingClientRect(),k=window.innerWidth,L=window.innerHeight,N=R.top+n,P=R.right+t;P+T.width>k-r&&(P=R.left-T.width-t),N+T.height>L-r&&(N=L-T.height-r),N<r&&(N=r),g({top:N,left:P});})();},[c,t,n,r,u]);let x=C=>{o?.(C),y.current&&(clearTimeout(y.current),y.current=null),d(true);},w=C=>{a?.(C);let R=C.relatedTarget;u.current?.contains(R)||f?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return q.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Da.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:m("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)});wd.displayName="DropdownSubContent";var Iy=mi;var Md=q.createContext(null),pi=()=>{let e=q.useContext(Md);if(!e)throw new Error("Popover components must be used within a Popover");return e},rt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),s=t!==void 0,i=s?t:o,l=q.useRef(null),c=q.useId(),d=q.useCallback(u=>{s||a(u),r?.(u);},[s,r]);return jsx(Md.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};rt.displayName="Popover";var Gn=q.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=pi(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},u={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&q.isValidElement(e)?q.cloneElement(e,{...u,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...u,children:e})});Gn.displayName="PopoverTrigger";var nn=q.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=pi();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});nn.displayName="PopoverAnchor";var ot=q.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,...u},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:b}=pi(),[v,y]=q.useState({top:0,left:0}),[x,w]=q.useState(false),[C,R]=q.useState(null);if(q.useEffect(()=>{w(true);},[]),q.useEffect(()=>{if(!p||!h.current||!C)return;let k=()=>{if(!h.current||!C)return;let L=h.current.getBoundingClientRect(),N=C.getBoundingClientRect(),P=0,M=0;switch(n){case "top":P=L.top-N.height-r;break;case "bottom":P=L.bottom+r;break;case "left":M=L.left-N.width-r;break;case "right":M=L.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":M=L.left+a;break;case "center":M=L.left+L.width/2-N.width/2;break;case "end":M=L.right-N.width-a;break}else switch(o){case "start":P=L.top+a;break;case "center":P=L.top+L.height/2-N.height/2;break;case "end":P=L.bottom-N.height-a;break}y({top:P,left:M});};return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,true),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true);}},[p,n,r,o,a,h,C]),q.useEffect(()=>{if(!p)return;let k=L=>{let N=L.target;C&&C.contains(N)||h.current&&h.current.contains(N)||N.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",k),()=>document.removeEventListener("mouseup",k)},[p,g,s,h,C]),q.useEffect(()=>{if(!p)return;let k=L=>{L.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[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 Da.createPortal(jsx("div",{ref:k=>{R(L=>L!==k?k:L),typeof f=="function"?f(k):f&&(f.current=k);},id:b,role:"dialog","data-state":p?"open":"closed","data-side":n,className:m("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},...u,children:d}),document.body)});ot.displayName="PopoverContent";var Nd=q.createContext(null),gi=()=>{let e=q.useContext(Nd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},kd=q.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,u]=q.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||u(h),r?.(h);};return jsx(Nd.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:m(s==="vertical"&&"flex gap-4",e),...l,children:i})})});kd.displayName="Tabs";var fi={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"}},Pd=q.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=gi(),l=q.useRef(null),[c,d]=q.useState({opacity:0});q.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let y=g.getBoundingClientRect(),x=v.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-y.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.left-y.left}px)`,opacity:1});}};h();let b=new ResizeObserver(h);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let u={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:m("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",fi[a].list,u[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",fi[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});Pd.displayName="TabsList";var Ed=q.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=gi(),d=s===t,u={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:m("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",fi[c].trigger,u[l],e),onClick:f=>{r?.(f),i(t);},...o})});Ed.displayName="TabsTrigger";var Sd=q.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=gi(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:m("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});Sd.displayName="TabsContent";var Ld=[{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 Ay(e,t=Ld){return e?t.filter(r=>r.test(e)).length/t.length:0}function zy(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function Oy(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Ho=0,bi=null;function Kt(){Ho===0&&(bi=document.body.style.overflow,document.body.style.overflow="hidden"),Ho++;}function $t(){Ho--,Ho<=0&&(Ho=0,document.body.style.overflow=bi??"",bi=null);}var Hd=q.createContext(null),La=()=>{let e=q.useContext(Hd);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},Id=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=q.useState(t),s=e!==void 0,i=s?e:o,l=q.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(Hd.Provider,{value:{open:i,onOpenChange:l},children:r})};Id.displayName="Sheet";var Vd=q.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=La();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});Vd.displayName="SheetTrigger";var Ad=q.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=La();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});Ad.displayName="SheetClose";var hi=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Da.createPortal(e,t||document.body):null};hi.displayName="SheetPortal";var zd=q.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=La();return r?jsx("div",{ref:n,className:m("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});zd.displayName="SheetOverlay";var Od=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"}}),Ky=(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],Bd=q.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=La(),[d,u]=q.useState(false),[,f]=q.useState(false);return q.useEffect(()=>{if(l)u(true),f(true),Kt();else {f(true);let p=setTimeout(()=>{u(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{$t();}},[l]),q.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(hi,{children:[jsx("div",{className:m("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:m(Od({side:e}),Ky(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]})]})});Bd.displayName="SheetContent";var Fd=({className:e,...t})=>jsx("div",{className:m("flex flex-col space-y-2 text-center sm:text-left",e),...t});Fd.displayName="SheetHeader";var Kd=({className:e,...t})=>jsx("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kd.displayName="SheetFooter";var $d=q.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:m("text-lg font-semibold text-foreground",e),...t}));$d.displayName="SheetTitle";var Gd=q.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));Gd.displayName="SheetDescription";var Uy=({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 Ud=q.createContext(null),Ha=()=>{let e=q.useContext(Ud);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},xi=q.createContext(null),jd=({children:e,onOpenChange:t})=>{let[n,r]=q.useState(false),[o,a]=q.useState({x:0,y:0}),s=q.useId(),i=q.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(Ud.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};jd.displayName="ContextMenu";var _d=q.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Ha(),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})});_d.displayName="ContextMenuTrigger";var Wd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Wd.displayName="ContextMenuGroup";var Yd=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Da.createPortal(e,t||document.body):null};Yd.displayName="ContextMenuPortal";var qd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),s=t!==void 0,i=s?t:o,l=q.useRef(null),c=q.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(xi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};qd.displayName="ContextMenuSub";var Xd=q.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Ha(),[d,u]=q.useState(false),[f,p]=q.useState(l),g=q.useRef(null);return q.useEffect(()=>{u(true);},[]),q.useEffect(()=>{if(!s||!g.current){p(l);return}let b=g.current.getBoundingClientRect(),{x:v,y}=l;v+b.width>window.innerWidth&&(v=window.innerWidth-b.width-8),y+b.height>window.innerHeight&&(y=window.innerHeight-b.height-8),p({x:v,y});},[s,l]),q.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]),q.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:Da.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:m("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)});Xd.displayName="ContextMenuContent";var Zd=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=q.useContext(xi);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=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:m("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:u,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Zd.displayName="ContextMenuSubTrigger";var Qd=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=q.useContext(xi);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,u]=q.useState({top:0,left:0}),[f,p]=q.useState(false),g=q.useRef(null);q.useEffect(()=>{p(true);},[]),q.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let y=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=y.top,C=y.right+t;C+x.width>window.innerWidth&&(C=y.left-x.width-t),u({top:w,left:C});})();},[i,t,c]);let h=v=>{n?.(v),l(true);},b=v=>{r?.(v),l(false);};return !f||!i?null:Da.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:m("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)});Qd.displayName="ContextMenuSubContent";var Jd=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Ha(),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:m("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})});Jd.displayName="ContextMenuItem";var eu=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Ha(),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:m("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]})});eu.displayName="ContextMenuCheckboxItem";var tu=q.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));tu.displayName="ContextMenuSection";var nu=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));nu.displayName="ContextMenuSeparator";var ru=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ru.displayName="ContextMenuShortcut";var au=q.createContext(null),qy=()=>{let e=q.useContext(au);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},su=q.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",children:l,...c},d)=>{let[u,f]=q.useState(n),p=t!==void 0,g=p?t:u,h=q.useId(),b=v=>{p||f(v),r?.(v);};return jsx("div",{ref:d,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"grid gap-2":"flex gap-4",e),...c,children:jsx(au.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});su.displayName="RadioGroup";var iu=q.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=qy(),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:m("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}})]})});iu.displayName="RadioGroupItem";var Va=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"}}),lu=q.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,u]=q.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let b=!p;f||u(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:m(Va({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});lu.displayName="Toggle";var cu=q.createContext(null),e0=()=>{let e=q.useContext(cu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},du=q.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[u,f]=q.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:u,h=b=>{if(r==="single"){let v=g.includes(b)?[]:[b];p||f(v),s?.(v[0]||"");}else {let v=g.includes(b)?g.filter(y=>y!==b):[...g,b];p||f(v),s?.(v);}};return jsx("div",{ref:d,role:"group",className:m("flex items-center justify-center gap-1",e),...c,children:jsx(cu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});du.displayName="ToggleGroup";var uu=q.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=e0(),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:m(Va({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});uu.displayName="ToggleGroupItem";var za=q.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,...u},f)=>{let[p,g]=q.useState(n),h=t!==void 0,b=h?t:p,v=q.useRef(null),[y,x]=q.useState(false),[w,C]=q.useState(null),R=(H,D)=>{if(!v.current)return b[0];let E=v.current.getBoundingClientRect(),I;c==="horizontal"?I=(H-E.left)/E.width:I=1-(D-E.top)/E.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=(H,D)=>{let E=[...b];E[D]=H,D>0&&H<b[D-1]&&(E[D]=b[D-1]),D<b.length-1&&H>b[D+1]&&(E[D]=b[D+1]),h||g(E),r?.(E);},k=(H,D)=>{l||(H.preventDefault(),x(true),C(D),H.target.setPointerCapture(H.pointerId));},L=H=>{if(!y||w===null||l)return;let D=R(H.clientX,H.clientY);T(D,w);},N=()=>{y&&(x(false),C(null),o?.(b));},P=H=>{if(l)return;let D=R(H.clientX,H.clientY),E=0,I=Math.abs(b[0]-D);for(let A=1;A<b.length;A++){let O=Math.abs(b[A]-D);O<I&&(I=O,E=A);}T(D,E),o?.([...b.slice(0,E),D,...b.slice(E+1)]);},M=(H,D)=>{if(l)return;let E=b[D];switch(H.key){case "ArrowRight":case "ArrowUp":H.preventDefault(),E=Math.min(s,b[D]+i);break;case "ArrowLeft":case "ArrowDown":H.preventDefault(),E=Math.max(a,b[D]-i);break;case "Home":H.preventDefault(),E=a;break;case "End":H.preventDefault(),E=s;break;default:return}T(E,D),o?.([...b.slice(0,D),E,...b.slice(D+1)]);},S=H=>(H-a)/(s-a)*100;return jsxs("div",{ref:f,className:m("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...u,children:[jsx("div",{ref:v,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:P,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${S(b[0])}%`:0,right:`${100-S(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${S(b[0])}%`:0,top:`${100-S(b[b.length-1])}%`,left:0,right:0}})}),b.map((H,D)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":H,"aria-orientation":c,"aria-disabled":l,className:m("absolute block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",y&&w===D&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${S(H)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${S(H)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:E=>k(E,D),onPointerMove:L,onPointerUp:N,onPointerCancel:N,onKeyDown:E=>M(E,D)},D)),d&&b.map((H,D)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${D}]`:d,value:H},D))]})});za.displayName="Slider";var mu=q.createContext(null),pu=()=>{let e=q.useContext(mu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},Ri=q.createContext(null),fu=()=>{let e=q.useContext(Ri);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},gu=q.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,u]=q.useState(()=>t==="single"?r?[r]:[]:r||[]),f=q.useRef(new Map),p=q.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=w=>{if(t==="single"){let R=h.includes(w)&&a?[]:[w];g||u(R),o?.(R[0]||"");}else {let C=h.includes(w)?h.filter(R=>R!==w):[...h,w];g||u(C),o?.(C);}},v=q.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),y=q.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=q.useCallback(w=>{let C=p.current;if(C.length===0)return;let R=document.activeElement,T;f.current.forEach((M,S)=>{M===R&&(T=S);});let k=T?C.indexOf(T):-1,L;switch(w){case "first":L=0;break;case "last":L=C.length-1;break;case "next":L=k===-1?0:(k+1)%C.length;break;case "prev":L=k===-1?C.length-1:(k-1+C.length)%C.length;break}let N=C[L];f.current.get(N)?.focus();},[]);return jsx(mu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:m("w-full",e),...l,children:i})})});gu.displayName="Accordion";var bu=q.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=pu(),d=c.value.includes(t),u=n||c.disabled||false,f=q.useId(),p=q.useId();return r!==void 0?jsx(Ri.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:m("border-b",u&&"opacity-50",e),...i,children:[jsx(vu,{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(hu,{children:s})]})}):jsx(Ri.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:m("border-b",u&&"opacity-50",e),...i,children:s})})});bu.displayName="AccordionItem";var vu=q.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=pu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=fu(),f=q.useRef(null);q.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:u,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:m("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"})]})})});vu.displayName="AccordionTrigger";var hu=q.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=fu();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("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})})})});hu.displayName="AccordionContent";var yu=q.createContext(null),Ru=()=>{let e=q.useContext(yu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},wu=q.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=q.useState(n),u=t!==void 0,f=u?t:c,p=q.useId(),g=q.useId(),h=b=>{o||(u||d(b),r?.(b));};return jsx(yu.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:m("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(wi,{})]}),s]})})});wu.displayName="Collapsible";var wi=q.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=Ru();return jsx(se,{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:m("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});wi.displayName="CollapsibleTrigger";var Cu=q.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=Ru(),c=q.useRef(null),[d,u]=q.useState(0),[f,p]=q.useState(false),[g,h]=q.useState(a);q.useEffect(()=>{a?(h(true),u(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(p(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(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:m("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});Cu.displayName="CollapsibleContent";var a0=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"}}),Tu={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},Fa=q.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),u=r||o,f=Tu[i]||"",p=!Tu[i];return jsxs("div",{ref:c,className:"w-full",children:[u&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:m("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:m(a0({size:s}),e),...l,children:jsx("div",{className:m("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});Fa.displayName="Progress";var Pu=q.createContext(null),Eu=()=>{let e=q.useContext(Pu);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Su=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=q.useState(n),c=t!==void 0,d=c?t:i,u=q.useRef(null),f=q.useId(),p=q.useRef(null),g=q.useRef(null),h=q.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 q.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]),q.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(Pu.Provider,{value:{open:d,onOpenChange:h,triggerRef:u,contentId:f},children:e})};Su.displayName="HoverCard";var Lu=q.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=Eu();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})});Lu.displayName="HoverCardTrigger";var Du=q.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:u,triggerRef:f,contentId:p}=Eu(),[g,h]=q.useState({top:0,left:0}),[b,v]=q.useState(false),y=q.useRef(null);q.useEffect(()=>{v(true);},[]),q.useEffect(()=>{if(!d||!f.current||!y.current)return;(()=>{if(!f.current||!y.current)return;let T=f.current.getBoundingClientRect(),k=y.current.getBoundingClientRect(),L=0,N=0;switch(t){case "top":L=T.top-k.height-n;break;case "bottom":L=T.bottom+n;break;case "left":N=T.left-k.width-n;break;case "right":N=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":N=T.left+o;break;case "center":N=T.left+T.width/2-k.width/2;break;case "end":N=T.right-k.width-o;break}else switch(r){case "start":L=T.top+o;break;case "center":L=T.top+T.height/2-k.height/2;break;case "end":L=T.bottom-k.height-o;break}h({top:L,left:N});})();},[d,t,n,r,o,f]);let x=R=>{a?.(R),u(true);},w=R=>{s?.(R),u(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 Da.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:p,"data-state":d?"open":"closed","data-side":t,className:m("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)});Du.displayName="HoverCardContent";var Hu=q.createContext({size:"md",variant:"default",radius:"md"}),$a=()=>q.useContext(Hu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var l0=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"}}),c0=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"}}),Iu=q.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(Hu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));Iu.displayName="Breadcrumb";var Vu=q.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=$a();return jsx("ol",{ref:n,className:m(l0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});Vu.displayName="BreadcrumbList";var Au=q.forwardRef(({className:e,...t},n)=>{let{size:r}=$a();return jsx("li",{ref:n,className:m("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});Au.displayName="BreadcrumbItem";var zu=q.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));zu.displayName="BreadcrumbLink";var Ou=q.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:m("font-medium text-foreground",e),...t}));Ou.displayName="BreadcrumbPage";var Bu=({children:e,className:t,...n})=>{let{size:r}=$a();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(c0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};Bu.displayName="BreadcrumbSeparator";var Fu=({className:e,...t})=>{let{size:n}=$a();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(d0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Fu.displayName="BreadcrumbEllipsis";var Gu=q.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:m("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));Gu.displayName="AspectRatio";var _u=q.createContext(null),Ti=()=>{let e=q.useContext(_u);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Wu=q.createContext(null),Yu=()=>{let e=q.useContext(Wu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},qu=q.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=q.useState(null);return jsx(_u.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:m("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(Mi,{})]})})});qu.displayName="NavigationMenu";var Xu=q.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Ti();return jsx("ul",{ref:n,className:m("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Xu.displayName="NavigationMenuList";var Zu=q.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=Ti(),s=q.useId(),i=q.useRef(null),l=o===s,c=q.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Wu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:m("relative",e),...n,children:t})})});Zu.displayName="NavigationMenuItem";var Qu=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"),Ju=q.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Yu(),c=u=>{n?.(u),l(true);},d=u=>{r?.(u),l(!i);};return jsxs("button",{ref:u=>{s.current=u,typeof a=="function"?a(u):a&&(a.current=u);},type:"button","data-state":i?"open":"closed",className:m(Qu(),"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"})]})});Ju.displayName="NavigationMenuTrigger";var em=q.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Yu(),l=q.useRef(null),[c,d]=q.useState({top:0,left:0});q.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 u=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Da.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:m("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:u,onMouseLeave:f,...r}),document.body):null});em.displayName="NavigationMenuContent";var tm=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"),nm=q.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:m(tm(),t&&"bg-accent text-accent-foreground",e),...n}));nm.displayName="NavigationMenuLink";var Mi=q.forwardRef((e,t)=>null);Mi.displayName="NavigationMenuViewport";var rm=q.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=Ti();return r?jsx("div",{ref:n,className:m("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});rm.displayName="NavigationMenuIndicator";var im=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"}}),Mt=q.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:m(im({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Mt.displayName="CloseButton";var Ga=q.createContext(null);function R0(){let e=q.useContext(Ga);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Tn(){return q.useContext(Ga)}var w0="16rem",C0="18rem",T0="3rem",M0="b",N0={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},k0={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Ni=q.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:u,children:f,...p},g)=>{let h=c??"overlay",b=h==="overlay",[v,y]=q.useState(false),[x,w]=q.useState(false),[C,R]=q.useState(e),T=t??C,k=q.useCallback(M=>{let S=typeof M=="function"?M(T):M;n?n(S):R(S);},[n,T]);q.useEffect(()=>{let M=()=>{y(window.innerWidth<768);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);let L=q.useCallback(()=>b?k(M=>!M):v?w(M=>!M):k(M=>!M),[v,k,w,b]);q.useEffect(()=>{if(b)return;let M=S=>{S.key===M0&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),L());};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[L,b]);let N=T?"expanded":"collapsed",P=q.useMemo(()=>({placement:r,state:N,open:T,setOpen:k,isMobile:v,openMobile:x,setOpenMobile:w,toggleDrawer:L,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,N,T,k,v,x,w,L,l,h,o,a,s,i]);return b?jsx(Ga.Provider,{value:P,children:jsx(Drawer.Root,{open:T,onOpenChange:k,direction:r,dismissible:s,children:f})}):jsx(Ga.Provider,{value:P,children:jsx(Bn,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":w0,"--drawer-width-icon":T0,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Ni.displayName="Drawer";var cm=q.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Tn();if(!s)return jsx("div",{ref:a,className:m("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:u,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:m("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(P0,{open:u,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:m("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:m("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:m("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:m("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:m("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:m("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})})]})});cm.displayName="DrawerSidebar";var P0=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=q.useState(false);return q.useEffect(()=>{a(true);},[]),q.useEffect(()=>{if(t)return Kt(),()=>$t()},[t]),!o||!t?null:Da.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:m("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":C0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},dm=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Tn();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:m("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"})]})});dm.displayName="DrawerTrigger";var um=q.forwardRef(({className:e,children:t,...n},r)=>{let o=Tn(),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",u=d?N0[i]:k0[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:m("fixed inset-0 z-50",f[l])}),jsxs(Drawer.Content,{ref:r,className:m("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:u,height:"100%"}:{},...c?{maxHeight:u}:{},...n.style},...n,children:[c&&jsx("div",{className:m("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:m("flex flex-col h-full",e),...n,children:t})});um.displayName="DrawerContent";var mm=q.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Tn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:m("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Mt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});mm.displayName="DrawerHeader";var pm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));pm.displayName="DrawerBody";var fm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:m("flex flex-col gap-2 p-4 mt-auto",e),...t}));fm.displayName="DrawerFooter";var gm=q.forwardRef(({className:e,...t},n)=>Tn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));gm.displayName="DrawerTitle";var bm=q.forwardRef(({className:e,...t},n)=>Tn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:m("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));bm.displayName="DrawerDescription";var vm=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Tn();return jsx(Mt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});vm.displayName="DrawerClose";var hm=q.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Tn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:m("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(u,{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"})]})});hm.displayName="DrawerToggle";var xm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));xm.displayName="DrawerSeparator";var ym=q.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));ym.displayName="DrawerMenu";var Rm=q.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:m("group/menu-item relative",e),...t}));Rm.displayName="DrawerMenuItem";var wm=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"}}),Cm=q.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Tn(),c=l?.isMobile??false,d=l?.state??"expanded",u=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:m(wm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Fn,{children:[jsx(Kn,{children:u}),jsx($n,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):u});Cm.displayName="DrawerMenuButton";var Tm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));Tm.displayName="DrawerGroup";var Mm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:m("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}));Mm.displayName="DrawerGroupLabel";var Nm=q.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:m("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}));Nm.displayName="DrawerInset";var E0=Ni;var Pm=q.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:m("w-full caption-bottom text-sm",e),...t})}));Pm.displayName="Table";var Em=q.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:m("[&_tr]:border-b",e),...t}));Em.displayName="TableHeader";var Sm=q.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:m("[&_tr:last-child]:border-0",e),...t}));Sm.displayName="TableBody";var Lm=q.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:m("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Lm.displayName="TableFooter";var Dm=q.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:m("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Dm.displayName="TableRow";var Hm=q.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Hm.displayName="TableHead";var Im=q.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Im.displayName="TableCell";var Vm=q.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:m("mt-4 text-sm text-muted-foreground",e),...t}));Vm.displayName="TableCaption";function V0({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:u=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:b=false,hoverable:v=true,...y},x){let[w,C]=q.useState(new Set),[R,T]=q.useState({columnId:null,direction:null}),[k,L]=q.useState({pageIndex:0,pageSize:u[0]||10}),N=o??w,P=l??R,M=f??k,S=B=>{a?a(B):C(B);},H=B=>{c?c(B):T(B);},D=B=>{p?p(B):L(B);},E=q.useMemo(()=>{if(!P.columnId||!P.direction)return t;let B=n.find(z=>z.id===P.columnId);return B?[...t].sort((z,_)=>{let U=B.accessor(z),F=B.accessor(_);if(U===F)return 0;if(U==null)return 1;if(F==null)return -1;let X=String(U).localeCompare(String(F),void 0,{numeric:true});return P.direction==="asc"?X:-X}):t},[t,P,n]),I=q.useMemo(()=>{if(!d)return E;let B=M.pageIndex*M.pageSize;return E.slice(B,B+M.pageSize)},[E,d,M]),A=Math.ceil(E.length/M.pageSize),O=B=>{if(B===true){let z=new Set(I.map((_,U)=>s(_,U)));S(z);}else S(new Set);},V=(B,z)=>{let _=new Set(N);z?_.add(B):_.delete(B),S(_);},K=I.length>0&&I.every((B,z)=>N.has(s(B,z))),$=I.some((B,z)=>N.has(s(B,z))),G=B=>{if(!n.find(U=>U.id===B)?.sortable&&!i)return;let _="asc";P.columnId===B&&(P.direction==="asc"?_="desc":P.direction==="desc"&&(_=null)),H({columnId:_?B:null,direction:_});},Y=B=>P.columnId!==B?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):P.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className:m("w-full",e),...y,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(So,{checked:K?true:$?"indeterminate":false,onCheckedChange:O,"aria-label":"Select all"})}),n.map(B=>{let z=B.sortable??i;return jsx("th",{className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground",z&&"cursor-pointer select-none hover:text-foreground"),style:{width:B.width},onClick:()=>z&&G(B.id),children:jsxs("div",{className:"flex items-center gap-2",children:[B.header,z&&Y(B.id)]})},B.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((B,z)=>{let _=s(B,z),U=N.has(_);return jsxs("tr",{className:m("border-b transition-colors",v&&"hover:bg-muted/50",b&&z%2===1&&"bg-muted/30",U&&"bg-muted"),"data-state":U?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(So,{checked:U,onCheckedChange:F=>V(_,!!F),"aria-label":`Select row ${z+1}`})}),n.map(F=>jsx("td",{className:"p-4 align-middle",children:F.cell?F.cell(B,z):F.accessor(B)},F.id))]},_)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:M.pageSize,onChange:B=>D({pageIndex:0,pageSize:Number(B.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(B=>jsx("option",{value:B,children:B},B))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",M.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(se,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex-1}),disabled:M.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(se,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex+1}),disabled:M.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var A0=q.forwardRef(V0);var ki=["January","February","March","April","May","June","July","August","September","October","November","December"];function G0({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=q.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(yn,{children:[jsx(Rn,{children:jsxs("div",{className:m("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:ki[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(wn,{className:"min-w-[120px] p-0",children:jsx(Ne,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:ki.map((c,d)=>jsx(Ft,{onSelect:()=>s(d),className:m("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(yn,{children:[jsx(Rn,{children:jsxs("div",{className:m("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(wn,{className:"min-w-[80px] p-0",children:jsx(Ne,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Ft,{onSelect:()=>i(c),className:m("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function U0(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(G0,{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:m("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:m("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=ki[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:m("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:m("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 Yr({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=q.useMemo(()=>U0(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:m("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:m("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:m("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:m("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})}Yr.displayName="Calendar";var Bm=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});Bm.displayName="Pagination";var Fm=q.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:m("flex flex-row items-center gap-1",e),...t}));Fm.displayName="PaginationContent";var Km=q.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:m("",e),...t}));Km.displayName="PaginationItem";var Ua=({className:e,isActive:t,size:n="sm",isIconOnly:r=true,...o})=>jsx("a",{"aria-current":t?"page":void 0,className:m(Gr({variant:t?"solid":"light",size:n}),r&&"!px-0 !w-9",e),...o});Ua.displayName="PaginationLink";var $m=({className:e,...t})=>jsxs(Ua,{"aria-label":"Go to previous page",size:"md",className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});$m.displayName="PaginationPrevious";var Gm=({className:e,...t})=>jsxs(Ua,{"aria-label":"Go to next page",size:"md",className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Gm.displayName="PaginationNext";var Um=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:m("flex h-9 w-9 items-center justify-center",e),...t,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});Um.displayName="PaginationEllipsis";var Io=q.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:m("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Io.displayName="VisuallyHidden";var _m={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},q0={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"},Wm=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"),Li=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"}}),_a=q.createContext(null),Rr=()=>{let e=q.useContext(_a);if(!e)throw new Error("Modal components must be used within a Modal");return e},qm=q.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:u,className:f},p)=>{let[g,h]=q.useState(false),b=e!==void 0,v=b?e:g,[y,x]=q.useState(false),w=q.useRef(null),C=q.useId(),R=q.useId();q.useEffect(()=>{x(true);},[]);let T=q.useCallback(P=>{b||h(P),t?.(P);},[b,t]);q.useEffect(()=>{if(v)return Kt(),()=>$t()},[v]),q.useEffect(()=>{if(!v||i)return;let P=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,T]);let k=P=>{s&&P.target===P.currentTarget&&T(false);},L=n?q.isValidElement(n)?q.cloneElement(n,{onClick:P=>{n.props.onClick?.(P),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,N=()=>!y||!v?null:d==="outside"?Da.createPortal(jsx("div",{"data-state":v?"open":"closed",className:m(Wm(),_m[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:k,children:jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":v?"open":"closed",className:m("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",u==="xs"&&"w-full max-w-xs",u==="sm"&&"w-full max-w-sm",u==="md"&&"w-full max-w-md",u==="lg"&&"w-full max-w-lg",u==="xl"&&"w-full max-w-xl",u==="2xl"&&"w-full max-w-2xl",u==="3xl"&&"w-full max-w-3xl",u==="4xl"&&"w-full max-w-4xl",u==="5xl"&&"w-full max-w-5xl",u==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!u&&"w-full max-w-md",f),children:[jsx(Io,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):Da.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:m(Wm(),_m[l]),onClick:k,"aria-hidden":"true"}),jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":v?"open":"closed",className:m(Li({size:u}),q0[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Io,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(_a.Provider,{value:{open:v,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:R},children:[L,N()]})});qm.displayName="Modal";var Wa=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=q.useState(n),i=t!==void 0,l=i?t:a,c=q.useId(),d=q.useId(),u=q.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(_a.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Wa.displayName="ModalRoot";var Xm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Rr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Xm.displayName="ModalTrigger";var Di=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Da.createPortal(e,t||document.body):null};Di.displayName="ModalPortal";var Hi=q.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Rr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:m("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});Hi.displayName="ModalOverlay";var Zm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Rr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Zm.displayName="ModalClose";var Ya=q.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:u}=Rr(),[f,p]=q.useState(false);return q.useEffect(()=>{p(true);},[]),q.useEffect(()=>{if(l)return Kt(),()=>$t()},[l]),q.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(Di,{children:[jsx(Hi,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Li({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});Ya.displayName="ModalContent";var Qm=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qm.displayName="ModalHeader";var Jm=({className:e,children:t})=>(q.useContext(_a)?.scrollBehavior??"inside")==="inside"?jsx(Ne,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Jm.displayName="ModalBody";var ep=({className:e,children:t,...n})=>{let{onOpenChange:r}=Rr();return jsx("div",{className:m("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:q.Children.map(t,o=>q.isValidElement(o)?q.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};ep.displayName="ModalFooter";var tp=q.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Rr();return jsx("h2",{ref:n,id:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});tp.displayName="ModalTitle";var np=q.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Rr();return jsx("p",{ref:n,id:r,className:m("text-sm text-muted-foreground",e),...t})});np.displayName="ModalDescription";var Ii=q.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:m("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ii.displayName=Command.displayName;var Q0=({children:e,...t})=>jsx(Wa,{...t,children:jsx(Ya,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Ii,{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})})}),rp=q.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:m("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})]}));rp.displayName=Command.Input.displayName;var op=q.forwardRef(({className:e,children:t,...n},r)=>jsx(Ne,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:m("overflow-hidden",e),...n,children:t})}));op.displayName=Command.List.displayName;var ap=q.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ap.displayName=Command.Empty.displayName;var sp=q.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:m("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));sp.displayName=Command.Group.displayName;var ip=q.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:m("-mx-1 h-px bg-border",e),...t}));ip.displayName=Command.Separator.displayName;var lp=q.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:m("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]}));lp.displayName=Command.Item.displayName;var cp=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});cp.displayName="CommandShortcut";var tR={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"},up=q.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,u]=q.useState(false),[f,p]=q.useState(false),g=tR[s],h=nR[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:m("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:m("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:()=>u(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});up.displayName="PasswordInput";var sR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},iR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},mp=q.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",...u},f)=>{let[p,g]=q.useState(s),[h,b]=q.useState(false),v=a!==void 0,y=v?a:p,x=sR[c],w=iR[d],C=M=>{M!==void 0&&(r!==void 0&&M<r&&(M=r),o!==void 0&&M>o&&(M=o)),v||g(M),i?.(M);},R=()=>{C((y??0)+n);},T=()=>{C((y??0)-n);},k=M=>{let S=M.target.value;if(S==="")C(void 0);else {let H=parseFloat(S);isNaN(H)||C(H);}},L=M=>{M.key==="ArrowUp"?(M.preventDefault(),R()):M.key==="ArrowDown"&&(M.preventDefault(),T());},N=r===void 0||(y??0)>r,P=o===void 0||(y??0)<o;return t?jsxs("div",{className:m("relative flex items-center border transition-colors",x.wrapper,w,h?"border-foreground":"border-input",l&&"opacity-50",e),children:[jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",x.button),onClick:T,disabled:l||!N,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("min-w-0 flex-1 bg-background text-center focus:outline-none disabled:cursor-not-allowed",x.input),ref:f,value:y??"",onChange:k,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u}),jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",x.button),onClick:R,disabled:l||!P,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",x.input,w,h?"border-foreground":"border-input",e),ref:f,value:y??"",onChange:k,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u})});mp.displayName="NumberInput";var bp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),pp=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"}}),vp=q.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=(u,f)=>{let p=jsxs(vr,{className:m(pp({size:r})),children:[u.src&&jsx(_r,{src:u.src,alt:u.alt||""}),jsx(hr,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&u.alt?jsxs(Fn,{children:[jsx(Kn,{children:p}),jsx($n,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:u.alt})]},f):p},d=jsxs("div",{ref:s,className:m(bp({size:r,className:e})),...a,children:[i.map((u,f)=>c(u,f)),l>0&&jsx(vr,{className:m(pp({size:r})),children:jsxs(hr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(Bn,{delayDuration:300,children:d}):d});vp.displayName="AvatarGroup";var hp=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"}}),xp=q.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:u,...f},p)=>{let[g,h]=q.useState(n),[b,v]=q.useState(null),y=t!==void 0,x=y?t:g,w=b!==null?b:x,C=S=>{l||c||(y||h(S),r?.(S));},R=(S,H=false)=>{let D=i&&H?S+.5:S+1;C(D);},T=(S,H)=>{if(l||c)return;let D=S.currentTarget.getBoundingClientRect(),E=i&&S.clientX<D.left+D.width/2;v(E?H+.5:H+1);},k=()=>{v(null);},L=s==="heart"?Heart:Star,N=S=>w>=S+1?"full":w>=S+.5?"half":"empty",P=d?{color:d,fill:d}:{},M=u?{color:u}:{};return jsx("div",{ref:p,className:m(hp({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:k,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(S,H)=>{let D=N(H);return jsxs("button",{type:"button",className:m("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:E=>{let I=E.currentTarget.getBoundingClientRect(),A=i&&E.clientX<I.left+I.width/2;R(H,A);},onMouseMove:E=>T(E,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(L,{className:m("text-muted-foreground/30",D!=="empty"&&"absolute inset-0"),style:D==="empty"?M:void 0}),D!=="empty"&&jsx(L,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",D==="half"&&"clip-path-half"),style:{...P,clipPath:D==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});xp.displayName="Rating";var Rp=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}}),fR={sm:"sm",md:"sm",lg:"sm"},wp=q.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:u,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:m(Rp({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:u}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Mt,{size:fR[r??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});wp.displayName="Chip";var Cp=createContext({direction:"horizontal"}),wR=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Cp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:m("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),CR=Panel,TR=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Cp),o=r==="vertical";return jsx(Separator,{className:m("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:m("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 kp=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"}}),NR={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"}},Tp={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)"},Pp=q.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)),u=NR[t],f=(u.size-u.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:m(kp({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:u.size,height:u.size,viewBox:`0 0 ${u.size} ${u.size}`,fill:"none",children:[jsx("circle",{className:m("stroke-muted",i),cx:u.size/2,cy:u.size/2,r:f,strokeWidth:u.strokeWidth,fill:"none"}),jsx("circle",{cx:u.size/2,cy:u.size/2,r:f,strokeWidth:u.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Tp[n]||Tp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:m("absolute font-medium text-foreground",u.fontSize),children:s(d)})]})});Pp.displayName="CircularProgress";var Ep=q.createContext(null),ER=()=>{let e=q.useContext(Ep);if(!e)throw new Error("OTP components must be used within InputOTP");return e},Sp=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"}}),Lp=q.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:u,...f},p)=>{let[g,h]=q.useState(o),[b,v]=q.useState(0),[y,x]=q.useState(false),w=q.useRef(null),C=r!==void 0?r:g;q.useImperativeHandle(p,()=>w.current),q.useEffect(()=>{v(Math.min(C.length,n-1));},[C,n]),q.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=M=>{let S=M.target.value;if(i&&S){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));S=S.split("").filter(D=>H.test(D)).join("");}S=S.slice(0,n),r===void 0&&h(S),a?.(S);},T=M=>{M.key==="ArrowLeft"?v(S=>Math.max(0,S-1)):M.key==="ArrowRight"&&v(S=>Math.min(C.length,n-1,S+1));},k=()=>{w.current?.focus();},L=()=>{x(true),v(Math.min(C.length,n-1));},N=()=>{x(false);},P={value:C,activeIndex:y?b:-1,maxLength:n,disabled:l,radius:d};return jsx(Ep.Provider,{value:P,children:jsxs("div",{className:m(Sp({size:c}),t),onClick:k,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:R,onKeyDown:T,onFocus:L,onBlur:N,disabled:l,maxLength:n,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),u]})})});Lp.displayName="InputOTP";var Dp=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center",e),...t}));Dp.displayName="InputOTPGroup";var SR={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"},LR={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"},Hp=q.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=ER(),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:m("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",SR[i],LR[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"})})]})});Hp.displayName="InputOTPSlot";var Ip=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));Ip.displayName="InputOTPSeparator";var zp=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"}}),Op=q.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:u,readOnly:f,renderTag:p,...g},h)=>{let[b,v]=q.useState(""),y=q.useRef(null);q.useImperativeHandle(h,()=>y.current);let x=N=>{let P=N.trim();if(P.length<i||P.length>l||s&&r.length>=s||!d&&r.some(S=>S.text.toLowerCase()===P.toLowerCase()))return;let M={id:crypto.randomUUID(),text:P};o?.([...r,M]),v("");},w=N=>{u||f||o?.(r.filter(P=>P.id!==N));},C=N=>{if(c.includes(N.key)){if(N.key==="Tab"&&!b)return;N.preventDefault(),x(b);}N.key==="Backspace"&&!b&&r.length>0&&w(r[r.length-1].id);},R=N=>{let P=N.target.value;if(P.includes(",")){P.split(",").forEach(S=>{S.trim()&&x(S);});return}v(P);},T=N=>{N.preventDefault(),N.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(S=>{x(S);});},k=()=>{y.current?.focus();},L=s?r.length>=s:false;return jsxs("div",{className:m("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",u&&"cursor-not-allowed opacity-50",e),onClick:k,children:[r.map(N=>p?p(N,()=>w(N.id)):jsxs("span",{className:m(zp({variant:t,size:n})),children:[N.text,!u&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),w(N.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${N.text}`,children:jsx(X,{className:"h-3 w-3"})})]},N.id)),!L&&!f&&jsx("input",{ref:y,type:"text",value:b,onChange:R,onKeyDown:C,onPaste:T,placeholder:r.length===0?a:"",disabled:u,className:m("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});Op.displayName="TagInput";var Fp=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"}}),Kp=q.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m(Fp({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]}));Kp.displayName="EmptyState";var Gp=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"}}),Up=q.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let u=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:m(Gp({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:m("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:m("[&>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:m("flex items-center gap-0.5 text-sm",f),children:[jsx(u,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:m("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});Up.displayName="StatCard";var Fo=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"}}),Bi=({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:m("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 QR({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:u}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:b,isDragging:v}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:b};return jsxs("div",{ref:g,...f,style:y,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:m("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(Bi,{checked:l,onClick:x=>u?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function JR({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:u,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:b=[],onCheck:v,emptyContent:y,children:x,...w},C){let[R,T]=q.useState(false),[k,L]=q.useState(null);q.useEffect(()=>{T(true);},[]);let[N,P]=q.useState(new Set(f)),M=u!==void 0,S=M?new Set(u):N,[H,D]=q.useState(new Set(b)),E=h!==void 0,I=E?new Set(h):H,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),O=q.useCallback((z,_)=>{if(!r)return;let U=new Set(S),F=!U.has(z.id);d?F?U.add(z.id):U.delete(z.id):(U.clear(),F&&U.add(z.id)),M||P(U);let X=r.filter(ae=>U.has(ae.id));p?.(Array.from(U),{selected:F,selectedItems:X,item:z,event:_});},[r,S,d,M,p]),V=q.useCallback((z,_)=>{if(!r)return;let U=new Set(I),F=!U.has(z.id);F?U.add(z.id):U.delete(z.id),E||D(U);let X=r.filter(ae=>U.has(ae.id));v?.(Array.from(U),{checked:F,checkedItems:X,item:z,event:_});},[r,I,E,v]),K=z=>{if(!r)return;let _=r.find(U=>U.id===z.active.id);_&&L(_);},$=z=>{let{active:_,over:U}=z;if(L(null),!r||!U||_.id===U.id)return;let F=r.findIndex(ae=>ae.id===_.id),X=r.findIndex(ae=>ae.id===U.id);if(F!==-1&&X!==-1){let ae=[...r],[j]=ae.splice(F,1);ae.splice(X,0,j),s?.(ae);}},Y=(a||c||g)&&r&&o,B=t==="cards";return r&&r.length===0&&y?jsx("div",{ref:C,className:m("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:y}):Y?a?R?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:K,onDragEnd:$,children:[jsx("div",{ref:C,role:"list",className:m(Fo({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(z=>z.id),strategy:verticalListSortingStrategy,children:r.map((z,_)=>jsx(QR,{item:z,index:_,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:S.has(z.id),isChecked:I.has(z.id),isCards:B,onSelect:O,onCheck:V},z.id))})}),jsx(DragOverlay,{children:k&&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(k,r?.indexOf(k)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:m(Fo({variant:t,size:n,className:e})),...w,children:r.map((z,_)=>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(Bi,{checked:I.has(z.id),onClick:U=>V(z,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(z,_)})]},z.id))}):jsx("div",{ref:C,role:"list",className:m(Fo({variant:t,size:n,className:e})),...w,children:r.map((z,_)=>{let U=S.has(z.id),F=I.has(z.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?X=>O(z,X):void 0,className:m("flex items-center gap-3 transition-all",B&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",B&&U&&"border-primary bg-accent",!B&&c&&!g&&"cursor-pointer hover:bg-muted/50",!B&&g&&"cursor-pointer hover:bg-muted/50",!B&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Bi,{checked:F,onClick:X=>V(z,X)}),jsx("div",{className:"flex-1 min-w-0",children:o(z,_)})]},z.id)})}):jsx("div",{ref:C,role:"list",className:m(Fo({variant:t,size:n,className:e})),...w,children:x})}var ew=q.forwardRef(JR),Wp=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Yp=q.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(Wp({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})]}));Yp.displayName="ListItem";var qp=q.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:m("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]}));qp.displayName="ListItemText";var Qp=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Jp=q.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:m(Qp({position:t,className:e})),...n}));Jp.displayName="Timeline";var ef=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"}}),tf=q.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(ef({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]}));tf.displayName="TimelineItem";var nf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 pt-0.5",e),...t}));nf.displayName="TimelineContent";var rf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));rf.displayName="TimelineOpposite";var af=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}}),sf=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}}),lf=q.createContext({}),cf=q.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,u]=q.useState(a),f=o!==void 0?o:d,p=q.useCallback(g=>{o===void 0&&u(g),s?.(g);},[o,s]);return jsx(lf.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:m(af({size:t,fullWidth:n,className:e})),...l,children:r})})});cf.displayName="SegmentedControl";var df=q.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=q.useContext(lf),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:m(sf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});df.displayName="SegmentedControlItem";var uf=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"}}),mf=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},es=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]},pf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${es(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},ff=q.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:u=true,disabled:f,...p},g)=>{let[h,b]=q.useState(false),[v,y]=q.useState(false),[x,w]=q.useState([]),C=q.useRef(null),R=q.useCallback(E=>{if(!E||E.length===0)return;let I=Array.from(E),A=[],O=[];(u?I:[I[0]]).forEach(K=>{let $=pf(K,c,d);$.length>0?O.push({file:K,errors:$}):A.push(K);}),w(O),A.length>0&&r?.(A),O.length>0&&o?.(O);},[c,d,u,r,o]),T=q.useCallback(E=>{if(E.preventDefault(),E.stopPropagation(),!f&&(b(true),E.dataTransfer.items)){let A=Array.from(E.dataTransfer.items).some(O=>{if(O.kind!=="file")return true;if(d&&d.length>0){let V=O.type;return !d.some(K=>K.endsWith("/*")?V.startsWith(K.slice(0,-2)):V===K)}return false});y(A);}},[f,d]),k=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),!f&&(E.dataTransfer.dropEffect="copy");},[f]),L=q.useCallback(E=>{E.preventDefault(),E.stopPropagation();let I=E.currentTarget.getBoundingClientRect(),A=E.clientX,O=E.clientY;(A<I.left||A>I.right||O<I.top||O>I.bottom)&&(b(false),y(false));},[]),N=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),b(false),y(false),!f&&R(E.dataTransfer.files);},[f,R]),P=q.useCallback(()=>{f||C.current?.click();},[f]),M=q.useCallback(E=>{R(E.target.files),E.target.value="";},[R]),S=q.useCallback(E=>{f||(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.current?.click());},[f]),H=v?"error":h?"active":t,D=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:k,onDragLeave:L,onDrop:N,onClick:P,onKeyDown:S,className:m(uf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:D,multiple:u,disabled:f,onChange:M,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 ${es(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:E,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:E.name}),":"," ",I.map(A=>A.message).join(", ")]},E.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(E=>{let I=mf(E.file);return jsxs("div",{className:m("flex items-center gap-3 rounded-lg border p-3",E.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:E.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[es(E.file.size),E.error&&jsx("span",{className:"ml-2 text-danger",children:E.error})]}),E.progress!==void 0&&E.progress<100&&jsx(Fa,{value:E.progress,className:"mt-2 h-1"})]}),jsxs(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(E.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},E.id)})})]})});ff.displayName="FileUpload";var dw=`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")`,bf=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}}),Go=q.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...u},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:m(bf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?dw:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...u,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));Go.displayName="ColorSwatch";var vf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),hf=q.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:u,...f},p)=>{let[g,h]=q.useState(t),b=e??g,v=q.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:m(vf({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...f,children:a.map(x=>{let w=b?y(b)===y(x):false;return jsx(Go,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:v,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});hf.displayName="ColorSwatchPicker";var pw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],xf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},yf=q.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=pw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=q.useState(e??t),f=q.useId();q.useEffect(()=>{e!==void 0&&u(e);},[e]);let p=b=>{u(b),n?.(b);},g=b=>{u(b),n?.(b);},h=b=>{let v=b.target.value.toUpperCase();u(v),n?.(v);};return l==="simple"?jsxs("label",{className:m("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",xf[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(rt,{children:[jsx(Gn,{ref:c,disabled:r,className:m("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",xf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(ot,{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(br,{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(br,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(Go,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});yf.displayName="ColorPicker";var Rf=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"}}),Ki=e=>String(e).padStart(2,"0"),hw=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},xw=(e,t)=>`${Ki(e)}:${Ki(t)}`,wf=q.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},u)=>{let[f,p]=q.useState(n??""),[g,h]=q.useState(false);q.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=hw(f||"00:00"),y=L=>{let N=L.target.value;p(N),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(N)&&r?.(N);},x=(L,N)=>{let P=Math.max(0,Math.min(23,L)),M=Math.max(0,Math.min(59,N)),S=xw(P,M);p(S),r?.(S);},w=()=>x(b+1,v),C=()=>x(b-1,v),R=()=>x(b,v+a),T=()=>x(b,v-a),k=({value:L,onIncrement:N,onDecrement:P})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:N,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:Ki(L)}),jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:P,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:u,type:"time",value:f,onChange:y,disabled:c,className:m(Rf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(rt,{open:g,onOpenChange:h,children:[jsxs(Gn,{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(ot,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(k,{value:b,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(k,{value:v,onIncrement:R,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(se,{variant:"bordered",size:"sm",onClick:()=>{let L=new Date;x(L.getHours(),L.getMinutes());},children:"Now"}),jsx(se,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});wf.displayName="TimeInput";var Cf=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"}}),Rw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},ww=(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}},$i=(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},Tf=(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},Mf=q.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:u="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",radius:h="md",disabled:b,placeholder:v,...y},x)=>{let[w,C]=q.useState(r),[R,T]=q.useState(""),[k,L]=q.useState(false),N=n!==void 0?n:w,P=f??ww(a,s);q.useEffect(()=>{!k&&N!==void 0&&T($i(N,i,p,g));},[N,i,p,g,k]);let M=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=Tf(A,p,g);if(V!==void 0){let K=V;l!==void 0&&V<l&&(K=l),c!==void 0&&V>c&&(K=c),n===void 0&&C(K),o?.(K);}},S=()=>{L(true),N!==void 0&&T(N.toString().replace(".",g));},H=()=>{L(false),T(N!==void 0?$i(N,i,p,g):"");},D=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:P}),E=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:P});return jsxs("div",{className:"relative flex items-center",children:[D&&jsx("div",{className:"absolute left-3 pointer-events-none",children:D}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:M,onFocus:S,onBlur:H,disabled:b,placeholder:v??`0${g}${"0".repeat(i)}`,className:m(Cf({size:t}),Rw[h],D&&"pl-8",E&&"pr-8","text-right",e),style:{borderColor:k?"var(--color-foreground)":void 0},...y}),E&&jsx("div",{className:"absolute right-3 pointer-events-none",children:E})]})});Mf.displayName="CurrencyInput";var Nf=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"}}),Gi={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:"#####-####"}},Mw=(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}},Xn=e=>["#","A","*"].includes(e),ns=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(Xn(s)){if(o<e.length){let i=e[o];Mw(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},Ui=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];Xn(o)&&(n+=e[r]);}return n},kf=(e,t)=>e.split("").map(n=>Xn(n)?t:n).join(""),Nw=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)Xn(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,Xn(t[i])&&s++;for(;a<t.length&&!Xn(t[a]);)a++;return Math.min(a,e.length)},Pf=q.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,...u},f)=>{let p=typeof a=="string"&&a in Gi?Gi[a].mask:a,[g,h]=q.useState(r),[b,v]=q.useState(""),[y,x]=q.useState(false),w=q.useRef(null),C=n!==void 0?n:g;q.useImperativeHandle(f,()=>w.current),q.useEffect(()=>{let L=ns(C,p,true);v(L);},[C,p]);let R=L=>{let N=L.target.value,P=L.target.selectionStart??0,M=N.replace(/[^\w]/g,""),S=ns(M,p,true),H=Ui(S,p);v(S),n===void 0&&h(l?S:H),o?.(H,S),requestAnimationFrame(()=>{if(w.current){let D=Nw(S,p,P);w.current.setSelectionRange(D,D);}});},T=L=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(L.key)||L.ctrlKey||L.metaKey)return;let N=w.current;if(!N)return;let P=N.selectionStart??0;if(L.key==="Backspace"&&P>0){let M=P-1;for(;M>0&&!Xn(p[M]);)M--;let S=Ui(b,p),H=0;for(let I=0;I<M&&I<p.length;I++)Xn(p[I])&&H++;let D=S.slice(0,Math.max(0,H-1))+S.slice(H),E=ns(D,p,true);v(E),n===void 0&&h(l?E:D),o?.(D,E),L.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(M,M);});}},k=i?kf(p,s):d;return jsx("input",{ref:w,type:"text",value:b,onChange:R,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:k,className:m(Nf({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...u})});Pf.displayName="MaskedInput";var Lw=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"}}),Sf=[{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:"(###) ###-####"}],rs=(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},Dw=e=>e.replace(/#/g,"_"),Lf=q.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Sf,showCountrySelect:c=true,showDialCode:d=false,disabled:u,placeholder:f,radius:p="md",...g},h)=>{let[b,v]=q.useState(r),[y,x]=q.useState(a??s),[w,C]=q.useState(false),[R,T]=q.useState(false),[k,L]=q.useState(false),[N,P]=q.useState({top:0,left:0,width:0}),M=q.useRef(null),S=q.useRef(null),H=n!==void 0?n:b,D=a??y,E=l.find(G=>G.code===D)??l[0],I=rs(H,E.format);q.useEffect(()=>{L(true);},[]),q.useEffect(()=>{if(R&&M.current){let G=M.current.getBoundingClientRect();P({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[R]),q.useEffect(()=>{if(!R)return;let G=Y=>{M.current&&!M.current.contains(Y.target)&&S.current&&!S.current.contains(Y.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[R]),q.useEffect(()=>{if(!R)return;let G=Y=>{Y.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[R]);let A=G=>{let B=G.target.value.replace(/\D/g,"");n===void 0&&v(B);let z=rs(B,E.format),_=`${E.dialCode} ${z}`;o?.(B,_,E);},O=G=>{let Y=l.find(_=>_.code===G);if(!Y)return;a===void 0&&x(G),i?.(Y);let B=rs(H,Y.format),z=`${Y.dialCode} ${B}`;o?.(H,z,Y),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",K=w||R;return jsxs("div",{className:m("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],u&&"cursor-not-allowed opacity-50"),style:{borderColor:K?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:M,type:"button",disabled:u,onClick:()=>T(!R),className:m("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:K?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:E.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:E.dialCode})]}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",R&&"rotate-180")})]}),k&&R&&Da.createPortal(jsx("div",{ref:S,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:N.top,left:N.left,minWidth:N.width},children:jsx(Ne,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===D,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===D&&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:E.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:u,placeholder:f??Dw(E.format),className:m("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})]})]})});Lf.displayName="PhoneInput";var Hf=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}}),If=q.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=q.useState(false),u={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:m(Hf({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:m("items-center gap-4 flex-1 justify-end",u),children:a}),jsx("button",{type:"button",className:m("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:m("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})]})});If.displayName="Navbar";var Vf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));Vf.displayName="NavbarBrand";var Af=q.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:m("flex items-center gap-4",o,e),...n})});Af.displayName="NavbarContent";var zf=q.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:m("flex items-center",t&&"text-primary font-medium",e),...n}));zf.displayName="NavbarItem";var Of=q.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:m("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));Of.displayName="NavbarLink";var Ow={none:"",hover:"hover:underline",always:"underline"},Bf={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},Kf=q.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"}:{},u=t in Bf,f=u?i:{color:t,...i};return jsxs("a",{ref:c,className:m("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",u&&Bf[t],Ow[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"})]})});Kf.displayName="Link";var $f=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"}}),Gf=q.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:u,...f},p)=>{let[g,h]=q.useState(false);q.useEffect(()=>{let y=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return y.addEventListener("scroll",x,{passive:true}),x(),()=>{y.removeEventListener("scroll",x);}},[n,c,g,d]);let b=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(y);},v=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m($f({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(se,{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})})})});Gf.displayName="BackTop";var _w=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),Ww=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),Uf=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),ss=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),jf=q.createContext(null),Qn=()=>{let e=q.useContext(jf);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},_f=q.createContext(null),jo=()=>{let e=q.useContext(_f);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},_i=q.createContext(null),Wf=q.createContext(null),Yf=q.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=q.useState(null);return jsx(jf.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:m("flex h-10 items-center space-x-1 border bg-background p-1",_w({radius:n}),e),...r,children:t})})});Yf.displayName="Menubar";var qf=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=Qn(),r=q.useId(),o=q.useRef(null),a=t===r,s=q.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(_f.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};qf.displayName="MenubarMenu";var Xf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Xf.displayName="MenubarGroup";var Zf=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Da.createPortal(e,t||document.body):null};Zf.displayName="MenubarPortal";var Qf=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),s=t!==void 0,i=s?t:o,l=q.useRef(null),c=q.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(_i.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Qf.displayName="MenubarSub";var Jf=q.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Wf.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Jf.displayName="MenubarRadioGroup";var eg=q.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=Qn(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=jo(),f=g=>{t?.(g),u(!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:m("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",Ww({radius:i}),e),onClick:f,onMouseEnter:p,...r})});eg.displayName="MenubarTrigger";var tg=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=Qn(),l=q.useContext(_i);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{u.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:m("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",ss({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});tg.displayName="MenubarSubTrigger";var ng=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=Qn(),i=q.useContext(_i);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,f]=q.useState({top:0,left:0}),[p,g]=q.useState(false),h=q.useRef(null);q.useEffect(()=>{g(true);},[]),q.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,R=x.right+t;R+w.width>window.innerWidth&&(R=x.left-w.width-t),f({top:C,left:R});})();},[l,t,d]);let b=y=>{n?.(y),c(true);},v=y=>{r?.(y),c(false);};return !p||!l?null:Da.createPortal(jsx("div",{ref:y=>{h.current=y,typeof a=="function"?a(y):a&&(a.current=y);},role:"menu","data-state":l?"open":"closed",className:m("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",Uf({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});ng.displayName="MenubarSubContent";var rg=q.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=Qn(),{triggerRef:l,open:c,onOpenChange:d}=jo(),[u,f]=q.useState({top:0,left:0}),[p,g]=q.useState(false),h=q.useRef(null);return q.useEffect(()=>{g(true);},[]),q.useEffect(()=>{if(!c||!l.current||!h.current)return;let b=()=>{if(!l.current||!h.current)return;let v=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=v.bottom+r,w=v.left+n;t==="center"?w=v.left+v.width/2-y.width/2:t==="end"&&(w=v.right-y.width-n),f({top: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]),q.useEffect(()=>{if(!c)return;let b=v=>{let y=v.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),q.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:Da.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:m("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",Uf({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});rg.displayName="MenubarContent";var og=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=Qn(),{onOpenChange:l}=jo(),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:m("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",ss({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});og.displayName="MenubarItem";var ag=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=Qn(),{onOpenChange:c}=jo(),d=u=>{if(o){u.preventDefault();return}a?.(u),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:m("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",ss({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]})});ag.displayName="MenubarCheckboxItem";var sg=q.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=Qn(),{onOpenChange:l}=jo(),c=q.useContext(Wf),d=c?.value===n,u=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:m("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",ss({radius:i}),!r&&"cursor-pointer",e),onClick:u,...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]})});sg.displayName="MenubarRadioItem";var Wi=q.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Wi.displayName="MenubarSection";var Yw=Wi,ig=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));ig.displayName="MenubarSeparator";var lg=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});lg.displayName="MenubarShortcut";var cg=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"}}),dg=q.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=q.Children.toArray(o);return jsx("div",{ref:s,className:m(cg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>q.isValidElement(l)?q.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)})});dg.displayName="Steps";var ug=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"}}),Xw=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"}}),Zw=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"}}),mg=q.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:m(ug({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:m("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:m(Xw({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:m("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:m("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:m(Zw({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));mg.displayName="Step";var fg=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"}}),gg=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}}),bg=q.createContext(null),aC=()=>{let e=q.useContext(bg);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:m("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"})})}),vg=({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:u,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:b,dragOverPosition:v,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:T,onDragLeave:k,onDragEnd:L,showLine:N,showIcon:P,showHandle:M,dragIcon:S,icon:H,leafIcon:D,folderIcon:E,folderOpenIcon:I,blockNode:A,disabled:O,size:V,getAllKeys:K}=aC(),$=e.children&&e.children.length>0,G=e.isLeaf??!$,Y=o.has(e.key),B=s.has(e.key),z=c.has(e.key),_=d.has(e.key),U=g?.key===e.key,F=b===e.key,X=!!(O||e.disabled),ae=l&&e.selectable!==false,j=f&&e.checkable!==false,we=q.useMemo(()=>X?false:typeof p=="boolean"?p:typeof p=="function"?p(e):p&&typeof p=="object"?p.nodeDraggable?p.nodeDraggable(e):true:false,[p,e,X]),Q=q.useMemo(()=>S!==void 0?S:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[S,p]),ce=q.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:Y,isLeaf:G}):H:G?D:Y?I:E,[e.icon,H,Y,G,D,E,I]),Be=Z=>{if(!we)return;Z.stopPropagation(),Z.dataTransfer.effectAllowed="move";let Le=Z.currentTarget,ue=Le.cloneNode(true),Ue=document.documentElement.classList.contains("dark"),je=Ue?"#0a0a0a":"#ffffff",An=Ue?"#27272a":"#e4e4e7";ue.style.cssText=`
|
|
43
|
+
`;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:x}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),style:{...s,...(()=>{if(!r)return {};let C=vy[o],R=t==="vertical"||t==="both",T=t==="horizontal"||t==="both",k=[R&&f.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&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 k.length===0?{}:{maskImage:k.join(", "),WebkitMaskImage:k.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:m(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})]})});Ne.displayName="ScrollArea";var cd=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"}}),Na=X.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:u=3,maxDropdownHeight:f=240,size:p,radius:g,className:h,...b},v)=>{let[y,x]=X.useState(false),[w,C]=X.useState(""),[R,T]=X.useState(r||""),[k,S]=X.useState(r||[]),[N,P]=X.useState({top:0,left:0,width:0}),M=X.useRef(null),E=X.useRef(null),H=X.useRef(null),D=X.useRef(null),L=n!==void 0?n:R,I=n!==void 0?n:k,A=n!==void 0,z=B=>{d&&L===B?(A||T(""),o?.("")):(A||T(B),o?.(B)),x(false),C("");},V=B=>{let q=I.includes(B)?I.filter(ae=>ae!==B):[...I,B];A||S(q),o?.(q);},K=(B,q)=>{q.stopPropagation();let ae=I.filter(j=>j!==B);A||S(ae),o?.(ae);},$=B=>{B.stopPropagation(),t?(A||S([]),o?.([])):(A||T(""),o?.(""));},G=e.find(B=>B.value===L),Y=e.filter(B=>I.includes(B.value)),O=Y.slice(0,u),F=Y.length-u,W=s?e.filter(B=>B.label.toLowerCase().includes(w.toLowerCase())):e;X.useEffect(()=>{if(y&&E.current){let B=E.current.getBoundingClientRect();P({top:B.bottom+4,left:B.left,width:B.width}),s&&setTimeout(()=>D.current?.focus(),0);}y||C("");},[y,s]),X.useEffect(()=>{let B=q=>{let ae=q.target,j=M.current&&!M.current.contains(ae),we=H.current&&!H.current.contains(ae);j&&we&&(x(false),C(""));};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]),X.useEffect(()=>{if(!y)return;let B=q=>{H.current?.contains(q.target)||(x(false),C(""));};return window.addEventListener("scroll",B,true),()=>window.removeEventListener("scroll",B,true)},[y]);let U=t?I.length>0:!!L;return jsxs("div",{ref:M,className:m("relative",h),...b,children:[jsxs("div",{ref:B=>{E.current=B,typeof v=="function"?v(B):v&&(v.current=B);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:m(cd({size:p,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:m(!G&&"text-muted-foreground"),children:G?G.label:a}),t&&jsx(Fragment,{children:Y.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[O.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=>K(B.value,q),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&K(B.value,q);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X$1,{className:"h-3 w-3"})})]},B.value)),F>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",F," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&U&&jsx("span",{role:"button",tabIndex:0,onClick:$,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&$(B);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X$1,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]})]}),y&&!c&&typeof document<"u"&&Ea.createPortal(jsxs("div",{ref:H,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:N.top,left:N.left,minWidth:N.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:D,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(Ne,{style:{maxHeight:f},onWheel:B=>B.stopPropagation(),children:jsx("div",{className:"p-1",children:W.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):W.map(B=>{let q=t?I.includes(B.value):L===B.value;return jsxs("div",{role:"option","aria-selected":q,onClick:()=>{B.disabled||(t?V(B.value):z(B.value));},className:m("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)]})});Na.displayName="Select";var dd=X.createContext(null),Eo=()=>{let e=X.useContext(dd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},ii=X.createContext({radius:"md"}),li=X.createContext(null),xn=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=X.useState(n),[s,i]=X.useState(-1),l=t!==void 0,c=l?t:o,d=X.useRef(null),u=X.useRef(null),f=X.useId(),p=X.useRef(new Map),g=X.useCallback(v=>{l||a(v),r?.(v),v||i(-1);},[l,r]),h=X.useCallback((v,y)=>{p.current.set(v,y);},[]),b=X.useCallback(v=>{p.current.delete(v);},[]);return jsx(dd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:f,activeIndex:s,setActiveIndex:i,items:p,registerItem:h,unregisterItem:b},children:e})};xn.displayName="Dropdown";var yn=X.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Eo();return jsx("div",{ref:u=>{i.current=u,typeof o=="function"?o(u):o&&(o.current=u);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:u=>{t?.(u),s(!a);},onKeyDown:u=>{n?.(u),(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),s(true)),(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});yn.displayName="DropdownTrigger";var My={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Rn=X.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,...u},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentRef:b,contentId:v,activeIndex:y,setActiveIndex:x,items:w}=Eo(),[C,R]=X.useState({top:0,left:0}),[T,k]=X.useState(t),[S,N]=X.useState(false),P=X.useRef(0);if(X.useEffect(()=>{N(true);},[]),X.useEffect(()=>{p&&(P.current=w.current.size);},[p,w]),X.useEffect(()=>{if(!p||!h.current||!b.current)return;let E=()=>{if(!h.current||!b.current)return;let H=h.current.getBoundingClientRect(),D=b.current.getBoundingClientRect(),L=window.innerWidth,I=window.innerHeight,A=0,z=0,V=t;switch(t){case "top":A=H.top-D.height-n,A<a&&(A=H.bottom+n,V="bottom");break;case "bottom":A=H.bottom+n,A+D.height>I-a&&(A=H.top-D.height-n,V="top");break;case "left":z=H.left-D.width-n,z<a&&(z=H.right+n,V="right");break;case "right":z=H.right+n,z+D.width>L-a&&(z=H.left-D.width-n,V="left");break}if(V==="top"||V==="bottom"){switch(r){case "start":z=H.left+o;break;case "center":z=H.left+H.width/2-D.width/2;break;case "end":z=H.right-D.width-o;break}z<a?z=a:z+D.width>L-a&&(z=L-D.width-a);}else {switch(r){case "start":A=H.top+o;break;case "center":A=H.top+H.height/2-D.height/2;break;case "end":A=H.bottom-D.height-o;break}A<a?A=a:A+D.height>I-a&&(A=I-D.height-a);}R({top:A,left:z}),k(V);};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true);}},[p,t,n,r,o,a,h]),X.useEffect(()=>{if(!p)return;let E=H=>{let D=H.target;b.current&&!b.current.contains(D)&&h.current&&!h.current.contains(D)&&(s?.(),g(false));};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[p,g,s,h,b]),X.useEffect(()=>{if(!p)return;let E=H=>{let D=Array.from(w.current.entries()).sort(([I],[A])=>I-A).map(([,I])=>I),L=D.length;if(L!==0)switch(H.key){case "Escape":H.preventDefault(),i?.(),g(false),h.current?.focus();break;case "ArrowDown":H.preventDefault(),y===-1||y>=L-1?x(l?0:Math.min(y+1,L-1)):x(y+1);break;case "ArrowUp":H.preventDefault(),y<=0?x(l?L-1:0):x(y-1);break;case "Home":H.preventDefault(),x(0);break;case "End":H.preventDefault(),x(L-1);break;case "Enter":case " ":H.preventDefault(),y>=0&&y<L&&D[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[p,g,i,y,x,w,l,h]),X.useEffect(()=>{p&&y>=0&&Array.from(w.current.entries()).sort(([H],[D])=>H-D).map(([,H])=>H)[y]?.focus();},[p,y,w]),!S||!p)return null;let M={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 Ea.createPortal(jsx("div",{ref:E=>{b.current=E,typeof f=="function"?f(E):f&&(f.current=E);},id:v,role:"menu","aria-orientation":"vertical","data-state":p?"open":"closed","data-side":T,"data-dropdown-content":"",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",My[c],M,e),style:{top:C.top,left:C.left},...u,children:jsx(ii.Provider,{value:{radius:c},children:d})}),document.body)});Rn.displayName="DropdownContent";var ud=0,md={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Ft=X.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:u,activeIndex:f,setActiveIndex:p,registerItem:g,unregisterItem:h}=Eo(),{radius:b}=X.useContext(ii),[v]=X.useState(()=>ud++),y=X.useRef(null);X.useEffect(()=>(!n&&y.current&&g(v,y.current),()=>{h(v);}),[n,v,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),u(false);},w=R=>{a?.(R),n||p(v);};return jsxs("div",{ref:R=>{y.current=R,typeof d=="function"?d(R):d&&(d.current=R);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":f===v?"":void 0,className:m("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",md[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Ft.displayName="DropdownItem";var ci=X.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));ci.displayName="DropdownSection";var pd=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));pd.displayName="DropdownSeparator";var fd=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});fd.displayName="DropdownShortcut";var gd=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));gd.displayName="DropdownGroup";var bd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=X.useState(n),{contentRef:s}=Eo(),i=t!==void 0,l=i?t:o,c=X.useRef(null),d=X.useCallback(u=>{i||a(u),r?.(u);},[i,r]);return jsx(li.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};bd.displayName="DropdownSub";var vd=X.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=X.useContext(li),{setActiveIndex:d,registerItem:u,unregisterItem:f}=Eo(),{radius:p}=X.useContext(ii),[g]=X.useState(()=>ud++),h=X.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:v,triggerRef:y}=c;X.useEffect(()=>(!n&&h.current&&u(g,h.current),()=>{f(g);}),[n,g,u,f]);let x=R=>{o?.(R),n||(d(g),v(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(true));};return jsxs("div",{ref:R=>{h.current=R,y.current=R,typeof l=="function"?l(R):l&&(l.current=R);},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:m("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",md[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"})]})});vd.displayName="DropdownSubTrigger";var hd=X.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=X.useContext(li);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:f}=l,[p,g]=X.useState({top:0,left:0}),[h,b]=X.useState(false),v=X.useRef(null),y=X.useRef(null);X.useEffect(()=>{b(true);},[]),X.useEffect(()=>{if(!c||!u.current||!v.current)return;(()=>{if(!u.current||!v.current)return;let R=u.current.getBoundingClientRect(),T=v.current.getBoundingClientRect(),k=window.innerWidth,S=window.innerHeight,N=R.top+n,P=R.right+t;P+T.width>k-r&&(P=R.left-T.width-t),N+T.height>S-r&&(N=S-T.height-r),N<r&&(N=r),g({top:N,left:P});})();},[c,t,n,r,u]);let x=C=>{o?.(C),y.current&&(clearTimeout(y.current),y.current=null),d(true);},w=C=>{a?.(C);let R=C.relatedTarget;u.current?.contains(R)||f?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return X.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Ea.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:m("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)});hd.displayName="DropdownSubContent";var Ny=ci;var Rd=X.createContext(null),di=()=>{let e=X.useContext(Rd);if(!e)throw new Error("Popover components must be used within a Popover");return e},rt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=X.useState(n),s=t!==void 0,i=s?t:o,l=X.useRef(null),c=X.useId(),d=X.useCallback(u=>{s||a(u),r?.(u);},[s,r]);return jsx(Rd.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};rt.displayName="Popover";var $n=X.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=di(),c=f=>{t?.(f),s(!a);},d=f=>{i.current=f,typeof o=="function"?o(f):o&&(o.current=f);},u={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&X.isValidElement(e)?X.cloneElement(e,{...u,ref:d,onClick:f=>{e.props.onClick?.(f),c(f);}}):jsx("button",{ref:d,type:"button",...u,children:e})});$n.displayName="PopoverTrigger";var tn=X.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=di();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});tn.displayName="PopoverAnchor";var ot=X.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,...u},f)=>{let{open:p,onOpenChange:g,triggerRef:h,contentId:b}=di(),[v,y]=X.useState({top:0,left:0}),[x,w]=X.useState(false),[C,R]=X.useState(null);if(X.useEffect(()=>{w(true);},[]),X.useEffect(()=>{if(!p||!h.current||!C)return;let k=()=>{if(!h.current||!C)return;let S=h.current.getBoundingClientRect(),N=C.getBoundingClientRect(),P=0,M=0;switch(n){case "top":P=S.top-N.height-r;break;case "bottom":P=S.bottom+r;break;case "left":M=S.left-N.width-r;break;case "right":M=S.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":M=S.left+a;break;case "center":M=S.left+S.width/2-N.width/2;break;case "end":M=S.right-N.width-a;break}else switch(o){case "start":P=S.top+a;break;case "center":P=S.top+S.height/2-N.height/2;break;case "end":P=S.bottom-N.height-a;break}y({top:P,left:M});};return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,true),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true);}},[p,n,r,o,a,h,C]),X.useEffect(()=>{if(!p)return;let k=S=>{let N=S.target;C&&C.contains(N)||h.current&&h.current.contains(N)||N.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",k),()=>document.removeEventListener("mouseup",k)},[p,g,s,h,C]),X.useEffect(()=>{if(!p)return;let k=S=>{S.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[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 Ea.createPortal(jsx("div",{ref:k=>{R(S=>S!==k?k:S),typeof f=="function"?f(k):f&&(f.current=k);},id:b,role:"dialog","data-state":p?"open":"closed","data-side":n,className:m("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},...u,children:d}),document.body)});ot.displayName="PopoverContent";var wd=X.createContext(null),mi=()=>{let e=X.useContext(wd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Cd=X.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,u]=X.useState(n),f=t!==void 0,p=f?t:d,g=h=>{f||u(h),r?.(h);};return jsx(wd.Provider,{value:{value:p,onValueChange:g,variant:o,radius:a,orientation:s},children:jsx("div",{ref:c,"data-orientation":s,className:m(s==="vertical"&&"flex gap-4",e),...l,children:i})})});Cd.displayName="Tabs";var ui={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"}},Td=X.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=mi(),l=X.useRef(null),[c,d]=X.useState({opacity:0});X.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let v=g.querySelector('[data-state="active"]');if(v){let y=g.getBoundingClientRect(),x=v.getBoundingClientRect(),w=s==="vertical";o==="underline"?d(w?{width:2,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:2,transform:`translateX(${x.left-y.left}px)`,opacity:1}):o==="solid"&&d(w?{width:x.width,height:x.height,transform:`translateY(${x.top-y.top}px)`,opacity:1}:{width:x.width,height:x.height,transform:`translateX(${x.left-y.left}px)`,opacity:1});}};h();let b=new ResizeObserver(h);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let u={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:m("relative inline-flex h-9 items-center justify-center text-muted-foreground",f&&"flex-col h-auto w-auto",ui[a].list,u[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",ui[a].indicator,p()),style:c,"aria-hidden":"true"}),t]})});Td.displayName="TabsList";var Md=X.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=mi(),d=s===t,u={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:m("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",ui[c].trigger,u[l],e),onClick:f=>{r?.(f),i(t);},...o})});Md.displayName="TabsTrigger";var Nd=X.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=mi(),s=a===t;return s?jsx("div",{ref:o,role:"tabpanel","data-state":s?"active":"inactive",className:m("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});Nd.displayName="TabsContent";var kd=[{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 Py(e,t=kd){return e?t.filter(r=>r.test(e)).length/t.length:0}function Ey(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function Sy(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}var Lo=0,pi=null;function Kt(){Lo===0&&(pi=document.body.style.overflow,document.body.style.overflow="hidden"),Lo++;}function $t(){Lo--,Lo<=0&&(Lo=0,document.body.style.overflow=pi??"",pi=null);}var Ed=X.createContext(null),Pa=()=>{let e=X.useContext(Ed);if(!e)throw new Error("Sheet components must be used within a Sheet");return e},Sd=({open:e,defaultOpen:t=false,onOpenChange:n,children:r})=>{let[o,a]=X.useState(t),s=e!==void 0,i=s?e:o,l=X.useCallback(c=>{s||a(c),n?.(c);},[s,n]);return jsx(Ed.Provider,{value:{open:i,onOpenChange:l},children:r})};Sd.displayName="Sheet";var Ld=X.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Pa();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(true);},...n,children:t})});Ld.displayName="SheetTrigger";var Dd=X.forwardRef(({onClick:e,children:t,...n},r)=>{let{onOpenChange:o}=Pa();return jsx("button",{ref:r,type:"button",onClick:s=>{e?.(s),o(false);},...n,children:t})});Dd.displayName="SheetClose";var gi=({children:e,container:t})=>{let[n,r]=X.useState(false);return X.useEffect(()=>{r(true);},[]),n?Ea.createPortal(e,t||document.body):null};gi.displayName="SheetPortal";var Hd=X.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Pa();return r?jsx("div",{ref:n,className:m("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});Hd.displayName="SheetOverlay";var Id=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"}}),Hy=(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],Vd=X.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c}=Pa(),[d,u]=X.useState(false),[,f]=X.useState(false);return X.useEffect(()=>{if(l)u(true),f(true),Kt();else {f(true);let p=setTimeout(()=>{u(false),f(false);},300);return ()=>clearTimeout(p)}return ()=>{$t();}},[l]),X.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(gi,{children:[jsx("div",{className:m("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:m(Id({side:e}),Hy(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$1,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),n]})]})});Vd.displayName="SheetContent";var Ad=({className:e,...t})=>jsx("div",{className:m("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ad.displayName="SheetHeader";var zd=({className:e,...t})=>jsx("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zd.displayName="SheetFooter";var Od=X.forwardRef(({className:e,...t},n)=>jsx("h2",{ref:n,className:m("text-lg font-semibold text-foreground",e),...t}));Od.displayName="SheetTitle";var Bd=X.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));Bd.displayName="SheetDescription";var Ay=({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 Fd=X.createContext(null),Sa=()=>{let e=X.useContext(Fd);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},bi=X.createContext(null),Kd=({children:e,onOpenChange:t})=>{let[n,r]=X.useState(false),[o,a]=X.useState({x:0,y:0}),s=X.useId(),i=X.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(Fd.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};Kd.displayName="ContextMenu";var $d=X.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Sa(),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})});$d.displayName="ContextMenuTrigger";var Gd=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Gd.displayName="ContextMenuGroup";var Ud=({children:e,container:t})=>{let[n,r]=X.useState(false);return X.useEffect(()=>{r(true);},[]),n?Ea.createPortal(e,t||document.body):null};Ud.displayName="ContextMenuPortal";var jd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=X.useState(n),s=t!==void 0,i=s?t:o,l=X.useRef(null),c=X.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(bi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};jd.displayName="ContextMenuSub";var _d=X.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Sa(),[d,u]=X.useState(false),[f,p]=X.useState(l),g=X.useRef(null);return X.useEffect(()=>{u(true);},[]),X.useEffect(()=>{if(!s||!g.current){p(l);return}let b=g.current.getBoundingClientRect(),{x:v,y}=l;v+b.width>window.innerWidth&&(v=window.innerWidth-b.width-8),y+b.height>window.innerHeight&&(y=window.innerHeight-b.height-8),p({x:v,y});},[s,l]),X.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]),X.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:Ea.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:m("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)});_d.displayName="ContextMenuContent";var Wd=X.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=X.useContext(bi);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=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:m("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:u,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Wd.displayName="ContextMenuSubTrigger";var Yd=X.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=X.useContext(bi);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,u]=X.useState({top:0,left:0}),[f,p]=X.useState(false),g=X.useRef(null);X.useEffect(()=>{p(true);},[]),X.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let y=c.current.getBoundingClientRect(),x=g.current.getBoundingClientRect(),w=y.top,C=y.right+t;C+x.width>window.innerWidth&&(C=y.left-x.width-t),u({top:w,left:C});})();},[i,t,c]);let h=v=>{n?.(v),l(true);},b=v=>{r?.(v),l(false);};return !f||!i?null:Ea.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:m("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)});Yd.displayName="ContextMenuSubContent";var Xd=X.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Sa(),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:m("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})});Xd.displayName="ContextMenuItem";var qd=X.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Sa(),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:m("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]})});qd.displayName="ContextMenuCheckboxItem";var Zd=X.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Zd.displayName="ContextMenuSection";var Qd=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));Qd.displayName="ContextMenuSeparator";var Jd=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Jd.displayName="ContextMenuShortcut";var tu=X.createContext(null),Ky=()=>{let e=X.useContext(tu);if(!e)throw new Error("RadioGroupItem must be used within a RadioGroup");return e},nu=X.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",children:l,...c},d)=>{let[u,f]=X.useState(n),p=t!==void 0,g=p?t:u,h=X.useId(),b=v=>{p||f(v),r?.(v);};return jsx("div",{ref:d,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"grid gap-2":"flex gap-4",e),...c,children:jsx(tu.Provider,{value:{name:o||h,value:g,onValueChange:b,disabled:a,required:s},children:l})})});nu.displayName="RadioGroup";var ru=X.forwardRef(({className:e,value:t,disabled:n,...r},o)=>{let a=Ky(),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:m("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}})]})});ru.displayName="RadioGroupItem";var Da=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"}}),ou=X.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,disabled:s,onKeyDown:i,...l},c)=>{let[d,u]=X.useState(o),f=r!==void 0,p=f?r:d,g=()=>{if(s)return;let b=!p;f||u(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:m(Da({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});ou.displayName="Toggle";var au=X.createContext(null),_y=()=>{let e=X.useContext(au);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},su=X.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[u,f]=X.useState(()=>r==="single"?a?[a]:[]:a||[]),p=o!==void 0,g=p?r==="single"?o?[o]:[]:o:u,h=b=>{if(r==="single"){let v=g.includes(b)?[]:[b];p||f(v),s?.(v[0]||"");}else {let v=g.includes(b)?g.filter(y=>y!==b):[...g,b];p||f(v),s?.(v);}};return jsx("div",{ref:d,role:"group",className:m("flex items-center justify-center gap-1",e),...c,children:jsx(au.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});su.displayName="ToggleGroup";var iu=X.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=_y(),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:m(Da({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});iu.displayName="ToggleGroupItem";var Ia=X.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,...u},f)=>{let[p,g]=X.useState(n),h=t!==void 0,b=h?t:p,v=X.useRef(null),[y,x]=X.useState(false),[w,C]=X.useState(null),R=(H,D)=>{if(!v.current)return b[0];let L=v.current.getBoundingClientRect(),I;c==="horizontal"?I=(H-L.left)/L.width:I=1-(D-L.top)/L.height,I=Math.max(0,Math.min(1,I));let A=a+I*(s-a),z=Math.round(A/i)*i;return Math.max(a,Math.min(s,z))},T=(H,D)=>{let L=[...b];L[D]=H,D>0&&H<b[D-1]&&(L[D]=b[D-1]),D<b.length-1&&H>b[D+1]&&(L[D]=b[D+1]),h||g(L),r?.(L);},k=(H,D)=>{l||(H.preventDefault(),x(true),C(D),H.target.setPointerCapture(H.pointerId));},S=H=>{if(!y||w===null||l)return;let D=R(H.clientX,H.clientY);T(D,w);},N=()=>{y&&(x(false),C(null),o?.(b));},P=H=>{if(l)return;let D=R(H.clientX,H.clientY),L=0,I=Math.abs(b[0]-D);for(let A=1;A<b.length;A++){let z=Math.abs(b[A]-D);z<I&&(I=z,L=A);}T(D,L),o?.([...b.slice(0,L),D,...b.slice(L+1)]);},M=(H,D)=>{if(l)return;let L=b[D];switch(H.key){case "ArrowRight":case "ArrowUp":H.preventDefault(),L=Math.min(s,b[D]+i);break;case "ArrowLeft":case "ArrowDown":H.preventDefault(),L=Math.max(a,b[D]-i);break;case "Home":H.preventDefault(),L=a;break;case "End":H.preventDefault(),L=s;break;default:return}T(L,D),o?.([...b.slice(0,D),L,...b.slice(D+1)]);},E=H=>(H-a)/(s-a)*100;return jsxs("div",{ref:f,className:m("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none",e),...u,children:[jsx("div",{ref:v,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:P,children:jsx("div",{className:"absolute bg-primary",style:c==="horizontal"?{left:b.length>1?`${E(b[0])}%`:0,right:`${100-E(b[b.length-1])}%`,top:0,bottom:0}:{bottom:b.length>1?`${E(b[0])}%`:0,top:`${100-E(b[b.length-1])}%`,left:0,right:0}})}),b.map((H,D)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":H,"aria-orientation":c,"aria-disabled":l,className:m("absolute block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",y&&w===D&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${E(H)}% - 10px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${E(H)}% - 10px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:L=>k(L,D),onPointerMove:S,onPointerUp:N,onPointerCancel:N,onKeyDown:L=>M(L,D)},D)),d&&b.map((H,D)=>jsx("input",{type:"hidden",name:b.length>1?`${d}[${D}]`:d,value:H},D))]})});Ia.displayName="Slider";var lu=X.createContext(null),cu=()=>{let e=X.useContext(lu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},hi=X.createContext(null),du=()=>{let e=X.useContext(hi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},uu=X.forwardRef(({className:e,type:t="multiple",value:n,defaultValue:r,onValueChange:o,collapsible:a=true,disabled:s,children:i,...l},c)=>{let[d,u]=X.useState(()=>t==="single"?r?[r]:[]:r||[]),f=X.useRef(new Map),p=X.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,b=w=>{if(t==="single"){let R=h.includes(w)&&a?[]:[w];g||u(R),o?.(R[0]||"");}else {let C=h.includes(w)?h.filter(R=>R!==w):[...h,w];g||u(C),o?.(C);}},v=X.useCallback((w,C)=>{f.current.set(w,C),p.current.includes(w)||p.current.push(w);},[]),y=X.useCallback(w=>{f.current.delete(w),p.current=p.current.filter(C=>C!==w);},[]),x=X.useCallback(w=>{let C=p.current;if(C.length===0)return;let R=document.activeElement,T;f.current.forEach((M,E)=>{M===R&&(T=E);});let k=T?C.indexOf(T):-1,S;switch(w){case "first":S=0;break;case "last":S=C.length-1;break;case "next":S=k===-1?0:(k+1)%C.length;break;case "prev":S=k===-1?C.length-1:(k-1+C.length)%C.length;break}let N=C[S];f.current.get(N)?.focus();},[]);return jsx(lu.Provider,{value:{type:t,value:h,onValueChange:b,collapsible:a,disabled:s,registerTrigger:v,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:m("w-full",e),...l,children:i})})});uu.displayName="Accordion";var mu=X.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=cu(),d=c.value.includes(t),u=n||c.disabled||false,f=X.useId(),p=X.useId();return r!==void 0?jsx(hi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:p},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:m("border-b",u&&"opacity-50",e),...i,children:[jsx(pu,{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(fu,{children:s})]})}):jsx(hi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:p},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:m("border-b",u&&"opacity-50",e),...i,children:s})})});mu.displayName="AccordionItem";var pu=X.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=cu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=du(),f=X.useRef(null);X.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:u,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:m("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"})]})})});pu.displayName="AccordionTrigger";var fu=X.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=du();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("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})})})});fu.displayName="AccordionContent";var bu=X.createContext(null),vu=()=>{let e=X.useContext(bu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},hu=X.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,disabled:o,title:a,children:s,...i},l)=>{let[c,d]=X.useState(n),u=t!==void 0,f=u?t:c,p=X.useId(),g=X.useId(),h=b=>{o||(u||d(b),r?.(b));};return jsx(bu.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:m("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(xi,{})]}),s]})})});hu.displayName="Collapsible";var xi=X.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=vu();return jsx(se,{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:m("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});xi.displayName="CollapsibleTrigger";var xu=X.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,disabled:l}=vu(),c=X.useRef(null),[d,u]=X.useState(0),[f,p]=X.useState(false),[g,h]=X.useState(a);X.useEffect(()=>{a?(h(true),u(0),p(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(p(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(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:m("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});xu.displayName="CollapsibleContent";var Zy=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"}}),yu={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},za=X.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),u=r||o,f=yu[i]||"",p=!yu[i];return jsxs("div",{ref:c,className:"w-full",children:[u&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&jsx("span",{className:m("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:m(Zy({size:s}),e),...l,children:jsx("div",{className:m("h-full w-full flex-1 transition-all rounded-full",f),style:{transform:`translateX(-${100-d}%)`,...p?{backgroundColor:i}:{}}})})]})});za.displayName="Progress";var Tu=X.createContext(null),Mu=()=>{let e=X.useContext(Tu);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Nu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=X.useState(n),c=t!==void 0,d=c?t:i,u=X.useRef(null),f=X.useId(),p=X.useRef(null),g=X.useRef(null),h=X.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 X.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]),X.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g.current&&clearTimeout(g.current);},[]),jsx(Tu.Provider,{value:{open:d,onOpenChange:h,triggerRef:u,contentId:f},children:e})};Nu.displayName="HoverCard";var ku=X.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=Mu();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})});ku.displayName="HoverCardTrigger";var Pu=X.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:u,triggerRef:f,contentId:p}=Mu(),[g,h]=X.useState({top:0,left:0}),[b,v]=X.useState(false),y=X.useRef(null);X.useEffect(()=>{v(true);},[]),X.useEffect(()=>{if(!d||!f.current||!y.current)return;(()=>{if(!f.current||!y.current)return;let T=f.current.getBoundingClientRect(),k=y.current.getBoundingClientRect(),S=0,N=0;switch(t){case "top":S=T.top-k.height-n;break;case "bottom":S=T.bottom+n;break;case "left":N=T.left-k.width-n;break;case "right":N=T.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":N=T.left+o;break;case "center":N=T.left+T.width/2-k.width/2;break;case "end":N=T.right-k.width-o;break}else switch(r){case "start":S=T.top+o;break;case "center":S=T.top+T.height/2-k.height/2;break;case "end":S=T.bottom-k.height-o;break}h({top:S,left:N});})();},[d,t,n,r,o,f]);let x=R=>{a?.(R),u(true);},w=R=>{s?.(R),u(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 Ea.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:p,"data-state":d?"open":"closed","data-side":t,className:m("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)});Pu.displayName="HoverCardContent";var Eu=X.createContext({size:"md",variant:"default",radius:"md"}),Ba=()=>X.useContext(Eu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var e0=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"}}),t0=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"}}),n0=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"}}),Su=X.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(Eu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));Su.displayName="Breadcrumb";var Lu=X.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=Ba();return jsx("ol",{ref:n,className:m(e0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});Lu.displayName="BreadcrumbList";var Du=X.forwardRef(({className:e,...t},n)=>{let{size:r}=Ba();return jsx("li",{ref:n,className:m("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});Du.displayName="BreadcrumbItem";var Hu=X.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));Hu.displayName="BreadcrumbLink";var Iu=X.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:m("font-medium text-foreground",e),...t}));Iu.displayName="BreadcrumbPage";var Vu=({children:e,className:t,...n})=>{let{size:r}=Ba();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(t0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};Vu.displayName="BreadcrumbSeparator";var Au=({className:e,...t})=>{let{size:n}=Ba();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(n0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Au.displayName="BreadcrumbEllipsis";var Bu=X.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:m("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));Bu.displayName="AspectRatio";var $u=X.createContext(null),Ri=()=>{let e=X.useContext($u);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Gu=X.createContext(null),Uu=()=>{let e=X.useContext(Gu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},ju=X.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=X.useState(null);return jsx($u.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:m("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx(wi,{})]})})});ju.displayName="NavigationMenu";var _u=X.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Ri();return jsx("ul",{ref:n,className:m("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});_u.displayName="NavigationMenuList";var Wu=X.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=Ri(),s=X.useId(),i=X.useRef(null),l=o===s,c=X.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Gu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:m("relative",e),...n,children:t})})});Wu.displayName="NavigationMenuItem";var Yu=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"),Xu=X.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Uu(),c=u=>{n?.(u),l(true);},d=u=>{r?.(u),l(!i);};return jsxs("button",{ref:u=>{s.current=u,typeof a=="function"?a(u):a&&(a.current=u);},type:"button","data-state":i?"open":"closed",className:m(Yu(),"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"})]})});Xu.displayName="NavigationMenuTrigger";var qu=X.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Uu(),l=X.useRef(null),[c,d]=X.useState({top:0,left:0});X.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 u=p=>{t?.(p),s(true);},f=p=>{n?.(p),s(false);};return a?Ea.createPortal(jsx("div",{ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p);},"data-state":a?"open":"closed",className:m("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:u,onMouseLeave:f,...r}),document.body):null});qu.displayName="NavigationMenuContent";var Zu=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"),Qu=X.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:m(Zu(),t&&"bg-accent text-accent-foreground",e),...n}));Qu.displayName="NavigationMenuLink";var wi=X.forwardRef((e,t)=>null);wi.displayName="NavigationMenuViewport";var Ju=X.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=Ri();return r?jsx("div",{ref:n,className:m("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});Ju.displayName="NavigationMenuIndicator";var rm=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"}}),Mt=X.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:m(rm({size:t}),e),"aria-label":"Close",...n,children:jsx(X$1,{style:{width:a,height:a}})})});Mt.displayName="CloseButton";var Fa=X.createContext(null);function p0(){let e=X.useContext(Fa);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Cn(){return X.useContext(Fa)}var f0="16rem",g0="18rem",b0="3rem",v0="b",h0={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"},Ci=X.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:u,children:f,...p},g)=>{let h=c??"overlay",b=h==="overlay",[v,y]=X.useState(false),[x,w]=X.useState(false),[C,R]=X.useState(e),T=t??C,k=X.useCallback(M=>{let E=typeof M=="function"?M(T):M;n?n(E):R(E);},[n,T]);X.useEffect(()=>{let M=()=>{y(window.innerWidth<768);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);let S=X.useCallback(()=>b?k(M=>!M):v?w(M=>!M):k(M=>!M),[v,k,w,b]);X.useEffect(()=>{if(b)return;let M=E=>{E.key===v0&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),S());};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[S,b]);let N=T?"expanded":"collapsed",P=X.useMemo(()=>({placement:r,state:N,open:T,setOpen:k,isMobile:v,openMobile:x,setOpenMobile:w,toggleDrawer:S,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,N,T,k,v,x,w,S,l,h,o,a,s,i]);return b?jsx(Fa.Provider,{value:P,children:jsx(Drawer.Root,{open:T,onOpenChange:k,direction:r,dismissible:s,children:f})}):jsx(Fa.Provider,{value:P,children:jsx(On,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":f0,"--drawer-width-icon":b0,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...p,children:f})})})});Ci.displayName="Drawer";var am=X.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Cn();if(!s)return jsx("div",{ref:a,className:m("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:u,setOpenMobile:f}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:m("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(y0,{open:u,onOpenChange:f,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:m("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:m("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:m("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:m("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:m("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:m("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})})]})});am.displayName="DrawerSidebar";var y0=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=X.useState(false);return X.useEffect(()=>{a(true);},[]),X.useEffect(()=>{if(t)return Kt(),()=>$t()},[t]),!o||!t?null:Ea.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:m("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":g0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},sm=X.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Cn();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:m("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"})]})});sm.displayName="DrawerTrigger";var im=X.forwardRef(({className:e,children:t,...n},r)=>{let o=Cn(),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",u=d?h0[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:m("fixed inset-0 z-50",f[l])}),jsxs(Drawer.Content,{ref:r,className:m("fixed z-50 flex flex-col border bg-background",p[s],e),style:{...d?{width:u,height:"100%"}:{},...c?{maxHeight:u}:{},...n.style},...n,children:[c&&jsx("div",{className:m("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:m("flex flex-col h-full",e),...n,children:t})});im.displayName="DrawerContent";var lm=X.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Cn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:m("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Mt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});lm.displayName="DrawerHeader";var cm=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));cm.displayName="DrawerBody";var dm=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:m("flex flex-col gap-2 p-4 mt-auto",e),...t}));dm.displayName="DrawerFooter";var um=X.forwardRef(({className:e,...t},n)=>Cn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));um.displayName="DrawerTitle";var mm=X.forwardRef(({className:e,...t},n)=>Cn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:m("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));mm.displayName="DrawerDescription";var pm=X.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Cn();return jsx(Mt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});pm.displayName="DrawerClose";var fm=X.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Cn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,f=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:m("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(u,{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"})]})});fm.displayName="DrawerToggle";var gm=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));gm.displayName="DrawerSeparator";var bm=X.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));bm.displayName="DrawerMenu";var vm=X.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:m("group/menu-item relative",e),...t}));vm.displayName="DrawerMenuItem";var hm=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"}}),xm=X.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Cn(),c=l?.isMobile??false,d=l?.state??"expanded",u=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:m(hm({variant:t,size:n}),o),...s,children:a});return r?jsxs(Bn,{children:[jsx(Fn,{children:u}),jsx(Kn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):u});xm.displayName="DrawerMenuButton";var ym=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));ym.displayName="DrawerGroup";var Rm=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:m("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}));Rm.displayName="DrawerGroupLabel";var wm=X.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:m("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}));wm.displayName="DrawerInset";var R0=Ci;var Tm=X.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:m("w-full caption-bottom text-sm",e),...t})}));Tm.displayName="Table";var Mm=X.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:m("[&_tr]:border-b",e),...t}));Mm.displayName="TableHeader";var Nm=X.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:m("[&_tr:last-child]:border-0",e),...t}));Nm.displayName="TableBody";var km=X.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:m("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));km.displayName="TableFooter";var Pm=X.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:m("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Pm.displayName="TableRow";var Em=X.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Em.displayName="TableHead";var Sm=X.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Sm.displayName="TableCell";var Lm=X.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:m("mt-4 text-sm text-muted-foreground",e),...t}));Lm.displayName="TableCaption";function k0({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:u=[10,20,50],paginationState:f,onPaginationChange:p,emptyContent:g="No data",loading:h=false,striped:b=false,hoverable:v=true,...y},x){let[w,C]=X.useState(new Set),[R,T]=X.useState({columnId:null,direction:null}),[k,S]=X.useState({pageIndex:0,pageSize:u[0]||10}),N=o??w,P=l??R,M=f??k,E=O=>{a?a(O):C(O);},H=O=>{c?c(O):T(O);},D=O=>{p?p(O):S(O);},L=X.useMemo(()=>{if(!P.columnId||!P.direction)return t;let O=n.find(F=>F.id===P.columnId);return O?[...t].sort((F,W)=>{let U=O.accessor(F),B=O.accessor(W);if(U===B)return 0;if(U==null)return 1;if(B==null)return -1;let q=String(U).localeCompare(String(B),void 0,{numeric:true});return P.direction==="asc"?q:-q}):t},[t,P,n]),I=X.useMemo(()=>{if(!d)return L;let O=M.pageIndex*M.pageSize;return L.slice(O,O+M.pageSize)},[L,d,M]),A=Math.ceil(L.length/M.pageSize),z=O=>{if(O===true){let F=new Set(I.map((W,U)=>s(W,U)));E(F);}else E(new Set);},V=(O,F)=>{let W=new Set(N);F?W.add(O):W.delete(O),E(W);},K=I.length>0&&I.every((O,F)=>N.has(s(O,F))),$=I.some((O,F)=>N.has(s(O,F))),G=O=>{if(!n.find(U=>U.id===O)?.sortable&&!i)return;let W="asc";P.columnId===O&&(P.direction==="asc"?W="desc":P.direction==="desc"&&(W=null)),H({columnId:W?O:null,direction:W});},Y=O=>P.columnId!==O?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):P.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className:m("w-full",e),...y,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(Po,{checked:K?true:$?"indeterminate":false,onCheckedChange:z,"aria-label":"Select all"})}),n.map(O=>{let F=O.sortable??i;return jsx("th",{className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground",F&&"cursor-pointer select-none hover:text-foreground"),style:{width:O.width},onClick:()=>F&&G(O.id),children:jsxs("div",{className:"flex items-center gap-2",children:[O.header,F&&Y(O.id)]})},O.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((O,F)=>{let W=s(O,F),U=N.has(W);return jsxs("tr",{className:m("border-b transition-colors",v&&"hover:bg-muted/50",b&&F%2===1&&"bg-muted/30",U&&"bg-muted"),"data-state":U?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Po,{checked:U,onCheckedChange:B=>V(W,!!B),"aria-label":`Select row ${F+1}`})}),n.map(B=>jsx("td",{className:"p-4 align-middle",children:B.cell?B.cell(O,F):B.accessor(O)},B.id))]},W)})})]})}),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:M.pageSize,onChange:O=>D({pageIndex:0,pageSize:Number(O.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(O=>jsx("option",{value:O,children:O},O))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",M.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(se,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex-1}),disabled:M.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(se,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>D({...M,pageIndex:M.pageIndex+1}),disabled:M.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var P0=X.forwardRef(k0);var Ti=["January","February","March","April","May","June","July","August","September","October","November","December"];function V0({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=X.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(xn,{children:[jsx(yn,{children:jsxs("div",{className:m("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:Ti[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Rn,{className:"min-w-[120px] p-0",children:jsx(Ne,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:Ti.map((c,d)=>jsx(Ft,{onSelect:()=>s(d),className:m("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(xn,{children:[jsx(yn,{children:jsxs("div",{className:m("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(Rn,{className:"min-w-[80px] p-0",children:jsx(Ne,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Ft,{onSelect:()=>i(c),className:m("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function A0(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(V0,{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:m("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:m("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=Ti[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:m("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:m("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 _r({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,components:s,...i}){let l=X.useMemo(()=>A0(r,o,a),[r,o,a]);return jsx(DayPicker,{showOutsideDays:n,className:m("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:m("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:m("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:m("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})}_r.displayName="Calendar";var Vm=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});Vm.displayName="Pagination";var Am=X.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:m("flex flex-row items-center gap-1",e),...t}));Am.displayName="PaginationContent";var zm=X.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:m("",e),...t}));zm.displayName="PaginationItem";var Ka=({className:e,isActive:t,size:n="sm",isIconOnly:r=true,...o})=>jsx("a",{"aria-current":t?"page":void 0,className:m(Kr({variant:t?"solid":"light",size:n}),r&&"!px-0 !w-9",e),...o});Ka.displayName="PaginationLink";var Om=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to previous page",size:"md",className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});Om.displayName="PaginationPrevious";var Bm=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to next page",size:"md",className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Bm.displayName="PaginationNext";var Fm=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:m("flex h-9 w-9 items-center justify-center",e),...t,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});Fm.displayName="PaginationEllipsis";var Do=X.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:m("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Do.displayName="VisuallyHidden";var $m={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},K0={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"},Gm=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"),Pi=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"}}),Ga=X.createContext(null),xr=()=>{let e=X.useContext(Ga);if(!e)throw new Error("Modal components must be used within a Modal");return e},jm=X.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:u,className:f},p)=>{let[g,h]=X.useState(false),b=e!==void 0,v=b?e:g,[y,x]=X.useState(false),w=X.useRef(null),C=X.useId(),R=X.useId();X.useEffect(()=>{x(true);},[]);let T=X.useCallback(P=>{b||h(P),t?.(P);},[b,t]);X.useEffect(()=>{if(v)return Kt(),()=>$t()},[v]),X.useEffect(()=>{if(!v||i)return;let P=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,T]);let k=P=>{s&&P.target===P.currentTarget&&T(false);},S=n?X.isValidElement(n)?X.cloneElement(n,{onClick:P=>{n.props.onClick?.(P),T(true);}}):jsx("button",{type:"button",onClick:()=>T(true),children:n}):null,N=()=>!y||!v?null:d==="outside"?Ea.createPortal(jsx("div",{"data-state":v?"open":"closed",className:m(Gm(),$m[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:k,children:jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":v?"open":"closed",className:m("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",u==="xs"&&"w-full max-w-xs",u==="sm"&&"w-full max-w-sm",u==="md"&&"w-full max-w-md",u==="lg"&&"w-full max-w-lg",u==="xl"&&"w-full max-w-xl",u==="2xl"&&"w-full max-w-2xl",u==="3xl"&&"w-full max-w-3xl",u==="4xl"&&"w-full max-w-4xl",u==="5xl"&&"w-full max-w-5xl",u==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!u&&"w-full max-w-md",f),children:[jsx(Do,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})}),document.body):Ea.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:m(Gm(),$m[l]),onClick:k,"aria-hidden":"true"}),jsxs("div",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":v?"open":"closed",className:m(Pi({size:u}),K0[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(Do,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>T(false)})]})]}),document.body);return jsxs(Ga.Provider,{value:{open:v,onOpenChange:T,scrollBehavior:d,titleId:C,descriptionId:R},children:[S,N()]})});jm.displayName="Modal";var Ua=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=X.useState(n),i=t!==void 0,l=i?t:a,c=X.useId(),d=X.useId(),u=X.useCallback(f=>{i||s(f),r?.(f);},[i,r]);return jsx(Ga.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Ua.displayName="ModalRoot";var _m=X.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=xr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});_m.displayName="ModalTrigger";var Ei=({children:e,container:t})=>{let[n,r]=X.useState(false);return X.useEffect(()=>{r(true);},[]),n?Ea.createPortal(e,t||document.body):null};Ei.displayName="ModalPortal";var Si=X.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=xr();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:m("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});Si.displayName="ModalOverlay";var Wm=X.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=xr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Wm.displayName="ModalClose";var ja=X.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:u}=xr(),[f,p]=X.useState(false);return X.useEffect(()=>{p(true);},[]),X.useEffect(()=>{if(l)return Kt(),()=>$t()},[l]),X.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(Ei,{children:[jsx(Si,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Pi({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Mt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ja.displayName="ModalContent";var Ym=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ym.displayName="ModalHeader";var Xm=({className:e,children:t})=>(X.useContext(Ga)?.scrollBehavior??"inside")==="inside"?jsx(Ne,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Xm.displayName="ModalBody";var qm=({className:e,children:t,...n})=>{let{onOpenChange:r}=xr();return jsx("div",{className:m("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:X.Children.map(t,o=>X.isValidElement(o)?X.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};qm.displayName="ModalFooter";var Zm=X.forwardRef(({className:e,...t},n)=>{let{titleId:r}=xr();return jsx("h2",{ref:n,id:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});Zm.displayName="ModalTitle";var Qm=X.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=xr();return jsx("p",{ref:n,id:r,className:m("text-sm text-muted-foreground",e),...t})});Qm.displayName="ModalDescription";var Li=X.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:m("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Li.displayName=Command.displayName;var U0=({children:e,...t})=>jsx(Ua,{...t,children:jsx(ja,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Li,{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})})}),Jm=X.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:m("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})]}));Jm.displayName=Command.Input.displayName;var ep=X.forwardRef(({className:e,children:t,...n},r)=>jsx(Ne,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:m("overflow-hidden",e),...n,children:t})}));ep.displayName=Command.List.displayName;var tp=X.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));tp.displayName=Command.Empty.displayName;var np=X.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:m("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}));np.displayName=Command.Group.displayName;var rp=X.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:m("-mx-1 h-px bg-border",e),...t}));rp.displayName=Command.Separator.displayName;var op=X.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:m("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]}));op.displayName=Command.Item.displayName;var ap=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ap.displayName="CommandShortcut";var W0={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"}},Y0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},ip=X.forwardRef(({className:e,showToggle:t=true,disabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",...l},c)=>{let[d,u]=X.useState(false),[f,p]=X.useState(false),g=W0[s],h=Y0[i];return jsxs("div",{className:"relative",children:[jsx("input",{type:d?"text":"password",className:m("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:m("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:()=>u(!d),disabled:n,tabIndex:-1,"aria-label":d?"Hide password":"Show password",children:d?jsx(EyeOff,{className:g.icon}):jsx(Eye,{className:g.icon})})]})});ip.displayName="PasswordInput";var Q0={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-10 w-10",icon:"h-4 w-4"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-11 w-11",icon:"h-5 w-5"}},J0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},lp=X.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",...u},f)=>{let[p,g]=X.useState(s),[h,b]=X.useState(false),v=a!==void 0,y=v?a:p,x=Q0[c],w=J0[d],C=M=>{M!==void 0&&(r!==void 0&&M<r&&(M=r),o!==void 0&&M>o&&(M=o)),v||g(M),i?.(M);},R=()=>{C((y??0)+n);},T=()=>{C((y??0)-n);},k=M=>{let E=M.target.value;if(E==="")C(void 0);else {let H=parseFloat(E);isNaN(H)||C(H);}},S=M=>{M.key==="ArrowUp"?(M.preventDefault(),R()):M.key==="ArrowDown"&&(M.preventDefault(),T());},N=r===void 0||(y??0)>r,P=o===void 0||(y??0)<o;return t?jsxs("div",{className:m("relative flex items-center border transition-colors",x.wrapper,w,h?"border-foreground":"border-input",l&&"opacity-50",e),children:[jsx("button",{type:"button",className:m("shrink-0 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",x.button),onClick:T,disabled:l||!N,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:x.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("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:y??"",onChange:k,onKeyDown:S,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u}),jsx("button",{type:"button",className:m("shrink-0 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",x.button),onClick:R,disabled:l||!P,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",x.input,w,h?"border-foreground":"border-input",e),ref:f,value:y??"",onChange:k,onKeyDown:S,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u})});lp.displayName="NumberInput";var mp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),cp=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"}}),pp=X.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=(u,f)=>{let p=jsxs(gr,{className:m(cp({size:r})),children:[u.src&&jsx(Ur,{src:u.src,alt:u.alt||""}),jsx(br,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]},f);return o&&u.alt?jsxs(Bn,{children:[jsx(Fn,{children:p}),jsx(Kn,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:u.alt})]},f):p},d=jsxs("div",{ref:s,className:m(mp({size:r,className:e})),...a,children:[i.map((u,f)=>c(u,f)),l>0&&jsx(gr,{className:m(cp({size:r})),children:jsxs(br,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(On,{delayDuration:300,children:d}):d});pp.displayName="AvatarGroup";var fp=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"}}),gp=X.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:u,...f},p)=>{let[g,h]=X.useState(n),[b,v]=X.useState(null),y=t!==void 0,x=y?t:g,w=b!==null?b:x,C=E=>{l||c||(y||h(E),r?.(E));},R=(E,H=false)=>{let D=i&&H?E+.5:E+1;C(D);},T=(E,H)=>{if(l||c)return;let D=E.currentTarget.getBoundingClientRect(),L=i&&E.clientX<D.left+D.width/2;v(L?H+.5:H+1);},k=()=>{v(null);},S=s==="heart"?Heart:Star,N=E=>w>=E+1?"full":w>=E+.5?"half":"empty",P=d?{color:d,fill:d}:{},M=u?{color:u}:{};return jsx("div",{ref:p,className:m(fp({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:k,role:"radiogroup","aria-label":"Rating",...f,children:Array.from({length:o},(E,H)=>{let D=N(H);return jsxs("button",{type:"button",className:m("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:L=>{let I=L.currentTarget.getBoundingClientRect(),A=i&&L.clientX<I.left+I.width/2;R(H,A);},onMouseMove:L=>T(L,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(S,{className:m("text-muted-foreground/30",D!=="empty"&&"absolute inset-0"),style:D==="empty"?M:void 0}),D!=="empty"&&jsx(S,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",D==="half"&&"clip-path-half"),style:{...P,clipPath:D==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});gp.displayName="Rating";var vp=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}}),sR={sm:"sm",md:"sm",lg:"sm"},hp=X.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,disabled:d,children:u,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:m(vp({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:u}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Mt,{size:sR[r??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});hp.displayName="Chip";var xp=createContext({direction:"horizontal"}),fR=({className:e,direction:t="horizontal",children:n,...r})=>jsx(xp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:m("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),gR=Panel,bR=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(xp),o=r==="vertical";return jsx(Separator,{className:m("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:m("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 Cp=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"}}),hR={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"}},yp={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)"},Tp=X.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)),u=hR[t],f=(u.size-u.strokeWidth)/2,p=2*Math.PI*f,g=p-d/100*p;return jsxs("div",{ref:c,className:m(Cp({size:t,color:n}),e),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":o,...l,children:[jsxs("svg",{width:u.size,height:u.size,viewBox:`0 0 ${u.size} ${u.size}`,fill:"none",children:[jsx("circle",{className:m("stroke-muted",i),cx:u.size/2,cy:u.size/2,r:f,strokeWidth:u.strokeWidth,fill:"none"}),jsx("circle",{cx:u.size/2,cy:u.size/2,r:f,strokeWidth:u.strokeWidth,fill:"none",strokeLinecap:"round",stroke:yp[n]||yp.default,strokeDasharray:`${p} ${p}`,strokeDashoffset:g,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&jsx("span",{className:m("absolute font-medium text-foreground",u.fontSize),children:s(d)})]})});Tp.displayName="CircularProgress";var Mp=X.createContext(null),RR=()=>{let e=X.useContext(Mp);if(!e)throw new Error("OTP components must be used within InputOTP");return e},Np=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"}}),kp=X.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:u,...f},p)=>{let[g,h]=X.useState(o),[b,v]=X.useState(0),[y,x]=X.useState(false),w=X.useRef(null),C=r!==void 0?r:g;X.useImperativeHandle(p,()=>w.current),X.useEffect(()=>{v(Math.min(C.length,n-1));},[C,n]),X.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=M=>{let E=M.target.value;if(i&&E){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));E=E.split("").filter(D=>H.test(D)).join("");}E=E.slice(0,n),r===void 0&&h(E),a?.(E);},T=M=>{M.key==="ArrowLeft"?v(E=>Math.max(0,E-1)):M.key==="ArrowRight"&&v(E=>Math.min(C.length,n-1,E+1));},k=()=>{w.current?.focus();},S=()=>{x(true),v(Math.min(C.length,n-1));},N=()=>{x(false);},P={value:C,activeIndex:y?b:-1,maxLength:n,disabled:l,radius:d};return jsx(Mp.Provider,{value:P,children:jsxs("div",{className:m(Np({size:c}),t),onClick:k,"data-otp-container":true,children:[jsx("input",{ref:w,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:C,onChange:R,onKeyDown:T,onFocus:S,onBlur:N,disabled:l,maxLength:n,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...f}),u]})})});kp.displayName="InputOTP";var Pp=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center",e),...t}));Pp.displayName="InputOTPGroup";var wR={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"},CR={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"},Ep=X.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=RR(),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:m("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",wR[i],CR[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"})})]})});Ep.displayName="InputOTPSlot";var Sp=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));Sp.displayName="InputOTPSeparator";var Hp=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"}}),Ip=X.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:u,readOnly:f,renderTag:p,...g},h)=>{let[b,v]=X.useState(""),y=X.useRef(null);X.useImperativeHandle(h,()=>y.current);let x=N=>{let P=N.trim();if(P.length<i||P.length>l||s&&r.length>=s||!d&&r.some(E=>E.text.toLowerCase()===P.toLowerCase()))return;let M={id:crypto.randomUUID(),text:P};o?.([...r,M]),v("");},w=N=>{u||f||o?.(r.filter(P=>P.id!==N));},C=N=>{if(c.includes(N.key)){if(N.key==="Tab"&&!b)return;N.preventDefault(),x(b);}N.key==="Backspace"&&!b&&r.length>0&&w(r[r.length-1].id);},R=N=>{let P=N.target.value;if(P.includes(",")){P.split(",").forEach(E=>{E.trim()&&x(E);});return}v(P);},T=N=>{N.preventDefault(),N.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(E=>{x(E);});},k=()=>{y.current?.focus();},S=s?r.length>=s:false;return jsxs("div",{className:m("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",u&&"cursor-not-allowed opacity-50",e),onClick:k,children:[r.map(N=>p?p(N,()=>w(N.id)):jsxs("span",{className:m(Hp({variant:t,size:n})),children:[N.text,!u&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),w(N.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${N.text}`,children:jsx(X$1,{className:"h-3 w-3"})})]},N.id)),!S&&!f&&jsx("input",{ref:y,type:"text",value:b,onChange:R,onKeyDown:C,onPaste:T,placeholder:r.length===0?a:"",disabled:u,className:m("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});Ip.displayName="TagInput";var Ap=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"}}),zp=X.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m(Ap({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]}));zp.displayName="EmptyState";var Bp=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"}}),Fp=X.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let u=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:m(Bp({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:m("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:m("[&>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:m("flex items-center gap-0.5 text-sm",f),children:[jsx(u,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:m("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});Fp.displayName="StatCard";var Oo=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"}}),Ai=({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:m("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 UR({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:u}){let{attributes:f,listeners:p,setNodeRef:g,transform:h,transition:b,isDragging:v}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:b};return jsxs("div",{ref:g,...f,style:y,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?x=>d?.(e,x):void 0,className:m("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(Ai,{checked:l,onClick:x=>u?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function jR({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:u,defaultSelectedKeys:f=[],onSelect:p,checkable:g=false,checkedKeys:h,defaultCheckedKeys:b=[],onCheck:v,emptyContent:y,children:x,...w},C){let[R,T]=X.useState(false),[k,S]=X.useState(null);X.useEffect(()=>{T(true);},[]);let[N,P]=X.useState(new Set(f)),M=u!==void 0,E=M?new Set(u):N,[H,D]=X.useState(new Set(b)),L=h!==void 0,I=L?new Set(h):H,A=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),z=X.useCallback((F,W)=>{if(!r)return;let U=new Set(E),B=!U.has(F.id);d?B?U.add(F.id):U.delete(F.id):(U.clear(),B&&U.add(F.id)),M||P(U);let q=r.filter(ae=>U.has(ae.id));p?.(Array.from(U),{selected:B,selectedItems:q,item:F,event:W});},[r,E,d,M,p]),V=X.useCallback((F,W)=>{if(!r)return;let U=new Set(I),B=!U.has(F.id);B?U.add(F.id):U.delete(F.id),L||D(U);let q=r.filter(ae=>U.has(ae.id));v?.(Array.from(U),{checked:B,checkedItems:q,item:F,event:W});},[r,I,L,v]),K=F=>{if(!r)return;let W=r.find(U=>U.id===F.active.id);W&&S(W);},$=F=>{let{active:W,over:U}=F;if(S(null),!r||!U||W.id===U.id)return;let B=r.findIndex(ae=>ae.id===W.id),q=r.findIndex(ae=>ae.id===U.id);if(B!==-1&&q!==-1){let ae=[...r],[j]=ae.splice(B,1);ae.splice(q,0,j),s?.(ae);}},Y=(a||c||g)&&r&&o,O=t==="cards";return r&&r.length===0&&y?jsx("div",{ref:C,className:m("flex items-center justify-center p-8 text-muted-foreground",e),...w,children:y}):Y?a?R?jsxs(DndContext,{sensors:A,collisionDetection:closestCenter,onDragStart:K,onDragEnd:$,children:[jsx("div",{ref:C,role:"list",className:m(Oo({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(F=>F.id),strategy:verticalListSortingStrategy,children:r.map((F,W)=>jsx(UR,{item:F,index:W,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:E.has(F.id),isChecked:I.has(F.id),isCards:O,onSelect:z,onCheck:V},F.id))})}),jsx(DragOverlay,{children:k&&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(k,r?.indexOf(k)??0)})]})})]}):jsx("div",{ref:C,role:"list",className:m(Oo({variant:t,size:n,className:e})),...w,children:r.map((F,W)=>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(Ai,{checked:I.has(F.id),onClick:U=>V(F,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,W)})]},F.id))}):jsx("div",{ref:C,role:"list",className:m(Oo({variant:t,size:n,className:e})),...w,children:r.map((F,W)=>{let U=E.has(F.id),B=I.has(F.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?q=>z(F,q):void 0,className:m("flex items-center gap-3 transition-all",O&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",O&&U&&"border-primary bg-accent",!O&&c&&!g&&"cursor-pointer hover:bg-muted/50",!O&&g&&"cursor-pointer hover:bg-muted/50",!O&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Ai,{checked:B,onClick:q=>V(F,q)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,W)})]},F.id)})}):jsx("div",{ref:C,role:"list",className:m(Oo({variant:t,size:n,className:e})),...w,children:x})}var _R=X.forwardRef(jR),Gp=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Up=X.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(Gp({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})]}));Up.displayName="ListItem";var jp=X.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:m("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]}));jp.displayName="ListItemText";var Yp=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Xp=X.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:m(Yp({position:t,className:e})),...n}));Xp.displayName="Timeline";var qp=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"}}),Zp=X.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(qp({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]}));Zp.displayName="TimelineItem";var Qp=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 pt-0.5",e),...t}));Qp.displayName="TimelineContent";var Jp=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Jp.displayName="TimelineOpposite";var tf=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}}),nf=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}}),rf=X.createContext({}),of=X.forwardRef(({className:e,size:t="md",fullWidth:n,children:r,value:o,defaultValue:a,onValueChange:s,disabled:i,...l},c)=>{let[d,u]=X.useState(a),f=o!==void 0?o:d,p=X.useCallback(g=>{o===void 0&&u(g),s?.(g);},[o,s]);return jsx(rf.Provider,{value:{size:t??"md",value:f,onValueChange:p,disabled:i},children:jsx("div",{ref:c,role:"group",className:m(tf({size:t,fullWidth:n,className:e})),...l,children:r})})});of.displayName="SegmentedControl";var af=X.forwardRef(({className:e,children:t,value:n,disabled:r,...o},a)=>{let s=X.useContext(rf),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:m(nf({size:s.size,selected:i}),"flex-1",e),...o,children:t})});af.displayName="SegmentedControlItem";var sf=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"}}),lf=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},Za=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]},cf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${Za(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},df=X.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:u=true,disabled:f,...p},g)=>{let[h,b]=X.useState(false),[v,y]=X.useState(false),[x,w]=X.useState([]),C=X.useRef(null),R=X.useCallback(L=>{if(!L||L.length===0)return;let I=Array.from(L),A=[],z=[];(u?I:[I[0]]).forEach(K=>{let $=cf(K,c,d);$.length>0?z.push({file:K,errors:$}):A.push(K);}),w(z),A.length>0&&r?.(A),z.length>0&&o?.(z);},[c,d,u,r,o]),T=X.useCallback(L=>{if(L.preventDefault(),L.stopPropagation(),!f&&(b(true),L.dataTransfer.items)){let A=Array.from(L.dataTransfer.items).some(z=>{if(z.kind!=="file")return true;if(d&&d.length>0){let V=z.type;return !d.some(K=>K.endsWith("/*")?V.startsWith(K.slice(0,-2)):V===K)}return false});y(A);}},[f,d]),k=X.useCallback(L=>{L.preventDefault(),L.stopPropagation(),!f&&(L.dataTransfer.dropEffect="copy");},[f]),S=X.useCallback(L=>{L.preventDefault(),L.stopPropagation();let I=L.currentTarget.getBoundingClientRect(),A=L.clientX,z=L.clientY;(A<I.left||A>I.right||z<I.top||z>I.bottom)&&(b(false),y(false));},[]),N=X.useCallback(L=>{L.preventDefault(),L.stopPropagation(),b(false),y(false),!f&&R(L.dataTransfer.files);},[f,R]),P=X.useCallback(()=>{f||C.current?.click();},[f]),M=X.useCallback(L=>{R(L.target.files),L.target.value="";},[R]),E=X.useCallback(L=>{f||(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),C.current?.click());},[f]),H=v?"error":h?"active":t,D=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...p,children:[jsxs("div",{role:"button",tabIndex:f?-1:0,onDragEnter:T,onDragOver:k,onDragLeave:S,onDrop:N,onClick:P,onKeyDown:E,className:m(sf({variant:H,size:n}),f&&"opacity-50 cursor-not-allowed",!f&&"cursor-pointer focus:outline-none"),"aria-disabled":f,children:[jsx("input",{ref:C,type:"file",accept:D,multiple:u,disabled:f,onChange:M,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 ${Za(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:L,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:L.name}),":"," ",I.map(A=>A.message).join(", ")]},L.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(L=>{let I=lf(L.file);return jsxs("div",{className:m("flex items-center gap-3 rounded-lg border p-3",L.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:L.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[Za(L.file.size),L.error&&jsx("span",{className:"ml-2 text-danger",children:L.error})]}),L.progress!==void 0&&L.progress<100&&jsx(za,{value:L.progress,className:"mt-2 h-1"})]}),jsxs(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:A=>{A.stopPropagation(),a?.(L.file);},children:[jsx(X$1,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},L.id)})})]})});df.displayName="FileUpload";var nw=`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")`,mf=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}}),Ko=X.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...u},f)=>jsx("button",{ref:f,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:m(mf({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?nw:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...u,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));Ko.displayName="ColorSwatch";var pf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),ff=X.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:u,...f},p)=>{let[g,h]=X.useState(t),b=e??g,v=X.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:p,role:"listbox","aria-label":"Color options",className:m(pf({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...f,children:a.map(x=>{let w=b?y(b)===y(x):false;return jsx(Ko,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:v,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});ff.displayName="ColorSwatchPicker";var aw=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],gf={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},bf=X.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=aw,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=X.useState(e??t),f=X.useId();X.useEffect(()=>{e!==void 0&&u(e);},[e]);let p=b=>{u(b),n?.(b);},g=b=>{u(b),n?.(b);},h=b=>{let v=b.target.value.toUpperCase();u(v),n?.(v);};return l==="simple"?jsxs("label",{className:m("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",gf[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(rt,{children:[jsx($n,{ref:c,disabled:r,className:m("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",gf[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(ot,{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(fr,{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(fr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(Ko,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});bf.displayName="ColorPicker";var vf=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"}}),Oi=e=>String(e).padStart(2,"0"),dw=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},uw=(e,t)=>`${Oi(e)}:${Oi(t)}`,hf=X.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},u)=>{let[f,p]=X.useState(n??""),[g,h]=X.useState(false);X.useEffect(()=>{n!==void 0&&p(n);},[n]);let{hours:b,minutes:v}=dw(f||"00:00"),y=S=>{let N=S.target.value;p(N),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(N)&&r?.(N);},x=(S,N)=>{let P=Math.max(0,Math.min(23,S)),M=Math.max(0,Math.min(59,N)),E=uw(P,M);p(E),r?.(E);},w=()=>x(b+1,v),C=()=>x(b-1,v),R=()=>x(b,v+a),T=()=>x(b,v-a),k=({value:S,onIncrement:N,onDecrement:P})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:N,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:Oi(S)}),jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:P,disabled:c,children:jsx(ChevronDown,{className:"h-4 w-4"})})]});return jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:u,type:"time",value:f,onChange:y,disabled:c,className:m(vf({size:t}),s&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",e),...d}),s&&jsxs(rt,{open:g,onOpenChange:h,children:[jsxs($n,{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(ot,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(k,{value:b,onIncrement:w,onDecrement:C,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(k,{value:v,onIncrement:R,onDecrement:T,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(se,{variant:"bordered",size:"sm",onClick:()=>{let S=new Date;x(S.getHours(),S.getMinutes());},children:"Now"}),jsx(se,{size:"sm",onClick:()=>h(false),children:"Done"})]})]})]})]})});hf.displayName="TimeInput";var xf=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"}}),pw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},fw=(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}},Bi=(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},yf=(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},Rf=X.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:u="prefix",currencySymbol:f,thousandSeparator:p=",",decimalSeparator:g=".",radius:h="md",disabled:b,placeholder:v,...y},x)=>{let[w,C]=X.useState(r),[R,T]=X.useState(""),[k,S]=X.useState(false),N=n!==void 0?n:w,P=f??fw(a,s);X.useEffect(()=>{!k&&N!==void 0&&T(Bi(N,i,p,g));},[N,i,p,g,k]);let M=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=yf(A,p,g);if(V!==void 0){let K=V;l!==void 0&&V<l&&(K=l),c!==void 0&&V>c&&(K=c),n===void 0&&C(K),o?.(K);}},E=()=>{S(true),N!==void 0&&T(N.toString().replace(".",g));},H=()=>{S(false),T(N!==void 0?Bi(N,i,p,g):"");},D=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:P}),L=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:P});return jsxs("div",{className:"relative flex items-center",children:[D&&jsx("div",{className:"absolute left-3 pointer-events-none",children:D}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:M,onFocus:E,onBlur:H,disabled:b,placeholder:v??`0${g}${"0".repeat(i)}`,className:m(xf({size:t}),pw[h],D&&"pl-8",L&&"pr-8","text-right",e),style:{borderColor:k?"var(--color-foreground)":void 0},...y}),L&&jsx("div",{className:"absolute right-3 pointer-events-none",children:L})]})});Rf.displayName="CurrencyInput";var wf=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"}}),Fi={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:"#####-####"}},vw=(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}},Xn=e=>["#","A","*"].includes(e),Ja=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(Xn(s)){if(o<e.length){let i=e[o];vw(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},Ki=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];Xn(o)&&(n+=e[r]);}return n},Cf=(e,t)=>e.split("").map(n=>Xn(n)?t:n).join(""),hw=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)Xn(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,Xn(t[i])&&s++;for(;a<t.length&&!Xn(t[a]);)a++;return Math.min(a,e.length)},Tf=X.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,...u},f)=>{let p=typeof a=="string"&&a in Fi?Fi[a].mask:a,[g,h]=X.useState(r),[b,v]=X.useState(""),[y,x]=X.useState(false),w=X.useRef(null),C=n!==void 0?n:g;X.useImperativeHandle(f,()=>w.current),X.useEffect(()=>{let S=Ja(C,p,true);v(S);},[C,p]);let R=S=>{let N=S.target.value,P=S.target.selectionStart??0,M=N.replace(/[^\w]/g,""),E=Ja(M,p,true),H=Ki(E,p);v(E),n===void 0&&h(l?E:H),o?.(H,E),requestAnimationFrame(()=>{if(w.current){let D=hw(E,p,P);w.current.setSelectionRange(D,D);}});},T=S=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(S.key)||S.ctrlKey||S.metaKey)return;let N=w.current;if(!N)return;let P=N.selectionStart??0;if(S.key==="Backspace"&&P>0){let M=P-1;for(;M>0&&!Xn(p[M]);)M--;let E=Ki(b,p),H=0;for(let I=0;I<M&&I<p.length;I++)Xn(p[I])&&H++;let D=E.slice(0,Math.max(0,H-1))+E.slice(H),L=Ja(D,p,true);v(L),n===void 0&&h(l?L:D),o?.(D,L),S.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(M,M);});}},k=i?Cf(p,s):d;return jsx("input",{ref:w,type:"text",value:b,onChange:R,onKeyDown:T,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:k,className:m(wf({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...u})});Tf.displayName="MaskedInput";var Cw=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"}}),Nf=[{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:"(###) ###-####"}],es=(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},Tw=e=>e.replace(/#/g,"_"),kf=X.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Nf,showCountrySelect:c=true,showDialCode:d=false,disabled:u,placeholder:f,radius:p="md",...g},h)=>{let[b,v]=X.useState(r),[y,x]=X.useState(a??s),[w,C]=X.useState(false),[R,T]=X.useState(false),[k,S]=X.useState(false),[N,P]=X.useState({top:0,left:0,width:0}),M=X.useRef(null),E=X.useRef(null),H=n!==void 0?n:b,D=a??y,L=l.find(G=>G.code===D)??l[0],I=es(H,L.format);X.useEffect(()=>{S(true);},[]),X.useEffect(()=>{if(R&&M.current){let G=M.current.getBoundingClientRect();P({top:G.bottom+4,left:G.left,width:Math.max(G.width,280)});}},[R]),X.useEffect(()=>{if(!R)return;let G=Y=>{M.current&&!M.current.contains(Y.target)&&E.current&&!E.current.contains(Y.target)&&T(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[R]),X.useEffect(()=>{if(!R)return;let G=Y=>{Y.key==="Escape"&&T(false);};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[R]);let A=G=>{let O=G.target.value.replace(/\D/g,"");n===void 0&&v(O);let F=es(O,L.format),W=`${L.dialCode} ${F}`;o?.(O,W,L);},z=G=>{let Y=l.find(W=>W.code===G);if(!Y)return;a===void 0&&x(G),i?.(Y);let O=es(H,Y.format),F=`${Y.dialCode} ${O}`;o?.(H,F,Y),T(false);},V=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",K=w||R;return jsxs("div",{className:m("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[p],u&&"cursor-not-allowed opacity-50"),style:{borderColor:K?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:M,type:"button",disabled:u,onClick:()=>T(!R),className:m("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:K?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:L.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:L.dialCode})]}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",R&&"rotate-180")})]}),k&&R&&Ea.createPortal(jsx("div",{ref:E,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:N.top,left:N.left,minWidth:N.width},children:jsx(Ne,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(G=>jsxs("div",{role:"option","aria-selected":G.code===D,onClick:()=>z(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===D&&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:L.dialCode}),jsx("input",{ref:h,type:"tel",inputMode:"tel",value:I,onChange:A,onFocus:()=>C(true),onBlur:()=>C(false),disabled:u,placeholder:f??Tw(L.format),className:m("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})]})]})});kf.displayName="PhoneInput";var Ef=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}}),Sf=X.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=X.useState(false),u={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:m(Ef({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:m("items-center gap-4 flex-1 justify-end",u),children:a}),jsx("button",{type:"button",className:m("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$1,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:m("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})]})});Sf.displayName="Navbar";var Lf=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));Lf.displayName="NavbarBrand";var Df=X.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:m("flex items-center gap-4",o,e),...n})});Df.displayName="NavbarContent";var Hf=X.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:m("flex items-center",t&&"text-primary font-medium",e),...n}));Hf.displayName="NavbarItem";var If=X.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:m("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));If.displayName="NavbarLink";var Sw={none:"",hover:"hover:underline",always:"underline"},Vf={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},zf=X.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"}:{},u=t in Vf,f=u?i:{color:t,...i};return jsxs("a",{ref:c,className:m("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",u&&Vf[t],Sw[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"})]})});zf.displayName="Link";var Of=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"}}),Bf=X.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:u,...f},p)=>{let[g,h]=X.useState(false);X.useEffect(()=>{let y=c?.current||window,x=()=>{let C=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;C!==g&&(h(C),d?.(C));};return y.addEventListener("scroll",x,{passive:true}),x(),()=>{y.removeEventListener("scroll",x);}},[n,c,g,d]);let b=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(y);},v=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m(Of({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(se,{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})})})});Bf.displayName="BackTop";var Ow=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),Bw=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),Ff=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),rs=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),Kf=X.createContext(null),Zn=()=>{let e=X.useContext(Kf);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},$f=X.createContext(null),Go=()=>{let e=X.useContext($f);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},Gi=X.createContext(null),Gf=X.createContext(null),Uf=X.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=X.useState(null);return jsx(Kf.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:m("flex h-10 items-center space-x-1 border bg-background p-1",Ow({radius:n}),e),...r,children:t})})});Uf.displayName="Menubar";var jf=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=Zn(),r=X.useId(),o=X.useRef(null),a=t===r,s=X.useCallback(i=>{n(i?r:null);},[r,n]);return jsx($f.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};jf.displayName="MenubarMenu";var _f=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));_f.displayName="MenubarGroup";var Wf=({children:e,container:t})=>{let[n,r]=X.useState(false);return X.useEffect(()=>{r(true);},[]),n?Ea.createPortal(e,t||document.body):null};Wf.displayName="MenubarPortal";var Yf=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=X.useState(n),s=t!==void 0,i=s?t:o,l=X.useRef(null),c=X.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Gi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Yf.displayName="MenubarSub";var Xf=X.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Gf.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Xf.displayName="MenubarRadioGroup";var qf=X.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=Zn(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=Go(),f=g=>{t?.(g),u(!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:m("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",Bw({radius:i}),e),onClick:f,onMouseEnter:p,...r})});qf.displayName="MenubarTrigger";var Zf=X.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=Zn(),l=X.useContext(Gi);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,f=g=>{r?.(g),d(true);},p=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{u.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:m("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",rs({radius:i}),t&&"pl-8",e),onMouseEnter:f,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Zf.displayName="MenubarSubTrigger";var Qf=X.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=Zn(),i=X.useContext(Gi);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,f]=X.useState({top:0,left:0}),[p,g]=X.useState(false),h=X.useRef(null);X.useEffect(()=>{g(true);},[]),X.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,R=x.right+t;R+w.width>window.innerWidth&&(R=x.left-w.width-t),f({top:C,left:R});})();},[l,t,d]);let b=y=>{n?.(y),c(true);},v=y=>{r?.(y),c(false);};return !p||!l?null:Ea.createPortal(jsx("div",{ref:y=>{h.current=y,typeof a=="function"?a(y):a&&(a.current=y);},role:"menu","data-state":l?"open":"closed",className:m("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",Ff({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:b,onMouseLeave:v,...o}),document.body)});Qf.displayName="MenubarSubContent";var Jf=X.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=Zn(),{triggerRef:l,open:c,onOpenChange:d}=Go(),[u,f]=X.useState({top:0,left:0}),[p,g]=X.useState(false),h=X.useRef(null);return X.useEffect(()=>{g(true);},[]),X.useEffect(()=>{if(!c||!l.current||!h.current)return;let b=()=>{if(!l.current||!h.current)return;let v=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=v.bottom+r,w=v.left+n;t==="center"?w=v.left+v.width/2-y.width/2:t==="end"&&(w=v.right-y.width-n),f({top: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]),X.useEffect(()=>{if(!c)return;let b=v=>{let y=v.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),X.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:Ea.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:m("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",Ff({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});Jf.displayName="MenubarContent";var eg=X.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=Zn(),{onOpenChange:l}=Go(),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:m("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",rs({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});eg.displayName="MenubarItem";var tg=X.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=Zn(),{onOpenChange:c}=Go(),d=u=>{if(o){u.preventDefault();return}a?.(u),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:m("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",rs({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]})});tg.displayName="MenubarCheckboxItem";var ng=X.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=Zn(),{onOpenChange:l}=Go(),c=X.useContext(Gf),d=c?.value===n,u=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:m("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",rs({radius:i}),!r&&"cursor-pointer",e),onClick:u,...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]})});ng.displayName="MenubarRadioItem";var Ui=X.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Ui.displayName="MenubarSection";var Fw=Ui,rg=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));rg.displayName="MenubarSeparator";var og=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});og.displayName="MenubarShortcut";var ag=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"}}),sg=X.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=X.Children.toArray(o);return jsx("div",{ref:s,className:m(ag({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>X.isValidElement(l)?X.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)})});sg.displayName="Steps";var ig=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"}}),$w=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"}}),Gw=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"}}),lg=X.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:m(ig({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:m("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:m($w({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:m("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:m("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:m(Gw({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));lg.displayName="Step";var dg=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"}}),ug=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}}),mg=X.createContext(null),Zw=()=>{let e=X.useContext(mg);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},Qw=({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:m("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"})})}),pg=({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:u,checkable:f,draggable:p,draggedNode:g,setDraggedNode:h,dragOverKey:b,dragOverPosition:v,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:T,onDragLeave:k,onDragEnd:S,showLine:N,showIcon:P,showHandle:M,dragIcon:E,icon:H,leafIcon:D,folderIcon:L,folderOpenIcon:I,blockNode:A,disabled:z,size:V,getAllKeys:K}=Zw(),$=e.children&&e.children.length>0,G=e.isLeaf??!$,Y=o.has(e.key),O=s.has(e.key),F=c.has(e.key),W=d.has(e.key),U=g?.key===e.key,B=b===e.key,q=!!(z||e.disabled),ae=l&&e.selectable!==false,j=f&&e.checkable!==false,we=X.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=X.useMemo(()=>E!==void 0?E:typeof p=="object"&&p.icon!==void 0?p.icon:jsx(GripVertical,{className:"h-4 w-4"}),[E,p]),ce=X.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:Y,isLeaf:G}):H:G?D:Y?I:L,[e.icon,H,Y,G,D,L,I]),Be=Z=>{if(!we)return;Z.stopPropagation(),Z.dataTransfer.effectAllowed="move";let Le=Z.currentTarget,ue=Le.cloneNode(true),Ue=document.documentElement.classList.contains("dark"),je=Ue?"#0a0a0a":"#ffffff",Vn=Ue?"#27272a":"#e4e4e7";ue.style.cssText=`
|
|
44
44
|
position: fixed;
|
|
45
45
|
top: -9999px;
|
|
46
46
|
left: -9999px;
|
|
47
47
|
background-color: ${je};
|
|
48
|
-
border: 1px solid ${
|
|
48
|
+
border: 1px solid ${Vn};
|
|
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: ${Le.offsetWidth}px;
|
|
53
53
|
opacity: 1;
|
|
54
54
|
z-index: 9999;
|
|
55
|
-
`,document.body.appendChild(ue),Z.dataTransfer.setDragImage(ue,20,15),setTimeout(()=>{document.body.removeChild(ue);},0),h(e),C?.({event:Z,node:e});},pe=Z=>{if(Z.preventDefault(),Z.stopPropagation(),!g||g.key===e.key||X)return;let Le=Z.currentTarget.getBoundingClientRect(),ue=Z.clientY-Le.top,Ue=Le.height,je;ue<Ue*.25?je=-1:ue>Ue*.75?je=1:je=0,!(w&&!w({dropNode:e,dropPosition:je,dragNode:g}))&&(y(e.key,je),R?.({event:Z,node:e}));},wt=Z=>{Z.preventDefault(),Z.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:Z,node:e,expandedKeys:K()});},gt=Z=>{Z.stopPropagation(),k?.({event:Z,node:e});},vn=Z=>{Z.preventDefault(),Z.stopPropagation(),!(!g||g.key===e.key||X)&&(v!==null&&x(e,v),h(null),y(null,null));},Fe=Z=>{h(null),y(null,null),L?.({event:Z,node:e});},tn=Z=>{X||ae&&i(e.key,e,Z);},Ct=Z=>{Z.stopPropagation(),!X&&!G&&a(e.key,e);},W=q.useMemo(()=>{if(!F||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 ""}},[F,v]),oe=[...r,n];return jsxs("div",{className:"relative",children:[N&&t>0&&jsxs(Fragment,{children:[r.map((Z,Le)=>!Z&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Le} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Le)),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:Y,"aria-selected":ae?B:void 0,"aria-disabled":X,draggable:we,onDragStart:Be,onDragOver:pe,onDragEnter:wt,onDragLeave:gt,onDrop:vn,onDragEnd:Fe,onClick:tn,className:m("relative",gg({size:V,isSelected:B,isDragging:U,isDisabled:X,isHoverable:ae&&!X}),W,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[we&&M&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:Ct,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",Y&&"rotate-90")})}),j&&jsx(sC,{checked:z,indeterminate:_,disabled:X,onClick:Z=>u(e.key,e,Z)}),P&&ce&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:ce}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),$&&Y&&jsx("div",{role:"group",children:e.children.map((Z,Le)=>jsx(vg,{node:Z,level:t+1,isLast:Le===e.children.length-1,parentIsLastPath:oe},Z.key))})]})},iC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},lC=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},hg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||hg(n,t))return true;return false},xg=q.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:u=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:y=[],onCheck:x,showLine:w=false,showIcon:C=false,showHandle:R=true,dragIcon:T,icon:k,leafIcon:L=jsx(File,{className:"h-4 w-4"}),folderIcon:N=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:M,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:E,onDrop:I,blockNode:A=false,disabled:O=false,...V},K)=>{let $=q.useCallback(()=>l?new Set(iC(r)):new Set(i),[l,i,r]),[G,Y]=q.useState($),B=s!==void 0,z=B?new Set(s):G,_=q.useCallback((he,We)=>{let Bt=new Set(z),Ae=!Bt.has(he);Ae?Bt.add(he):Bt.delete(he),B||Y(Bt),c?.(Array.from(Bt),{expanded:Ae,node:We});},[z,B,c]),[U,F]=q.useState(new Set(p)),X=f!==void 0,ae=X?new Set(f):U,j=q.useCallback((he,We,Bt)=>{let Ae=new Set(ae),hn=!Ae.has(he);u?hn?Ae.add(he):Ae.delete(he):(Ae.clear(),hn&&Ae.add(he)),X||F(Ae);let Br=[],Eo=ba=>{for(let Fr of ba)Ae.has(Fr.key)&&Br.push(Fr),Fr.children&&Eo(Fr.children);};Eo(r),g?.(Array.from(Ae),{selected:hn,selectedNodes:Br,node:We,event:Bt});},[ae,u,X,g,r]),[we,Q]=q.useState(new Set(y)),[ce,Be]=q.useState(new Set),pe=v!==void 0,wt=pe?new Set(Array.isArray(v)?v:v.checked):we,gt=pe&&!Array.isArray(v)?new Set(v.halfChecked):ce,vn=q.useCallback((he,We,Bt)=>{let Ae=new Set(wt),hn=new Set(gt),Br=!Ae.has(he);if(Br?(Ae.add(he),hn.delete(he)):Ae.delete(he),!b&&We.children){let ri=lC(We);for(let zn of ri)Br?(Ae.add(zn),hn.delete(zn)):Ae.delete(zn);}pe||(Q(Ae),Be(hn));let Eo=[],ba=ri=>{for(let zn of ri)Ae.has(zn.key)&&Eo.push(zn),zn.children&&ba(zn.children);};ba(r);let Fr=b?{checked:Array.from(Ae),halfChecked:Array.from(hn)}:Array.from(Ae);x?.(Fr,{checked:Br,checkedNodes:Eo,node:We,event:Bt,halfCheckedKeys:Array.from(hn)});},[wt,gt,b,pe,x,r]),[Fe,tn]=q.useState(null),[Ct,W]=q.useState(null),[oe,Z]=q.useState(null),Le=q.useCallback((he,We)=>{W(he),Z(We);},[]),ue=q.useCallback((he,We)=>{!Fe||!I||We===0&&hg(Fe,he.key)||I({event:{},node:he,dragNode:Fe,dropPosition:We,dropToGap:We!==0});},[Fe,I]),Ue=q.useCallback(()=>Array.from(z),[z]),je={expandedKeys:z,toggleExpand:_,selectedKeys:ae,handleSelect:j,selectable:d,multiple:u,checkedKeys:wt,halfCheckedKeys:gt,handleCheck:vn,checkable:h,checkStrictly:b,draggable:o,draggedNode:Fe,setDraggedNode:tn,dragOverKey:Ct,dragOverPosition:oe,setDragOver:Le,handleDrop:ue,allowDrop:a,onDragStart:M,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:E,showLine:w,showIcon:C,showHandle:R,dragIcon:T,icon:k,leafIcon:L,folderIcon:N,folderOpenIcon:P,blockNode:A,disabled:O,size:n,data:r,getAllKeys:Ue},An=he=>{let We=he.relatedTarget,Bt=he.currentTarget;(!We||!Bt.contains(We))&&Le(null,null);};return jsx(bg.Provider,{value:je,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":u||h,className:m(fg({variant:t,size:n,className:e})),onDragLeave:An,...V,children:r.map((he,We)=>jsx(vg,{node:he,level:0,isLast:We===r.length-1},he.key))})})});xg.displayName="Tree";var Rg=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}}),fC=({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))})},gC=(e,t)=>{let[n,r]=q.useState(e);return q.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},wg=q.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:u="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:y,...x},w)=>{let[C,R]=q.useState(false),[T,k]=q.useState(r),[L,N]=q.useState([]),[P,M]=q.useState(false),[S,H]=q.useState(false),[D,E]=q.useState(0),I=q.useRef(null),A=q.useRef(null),O=n!==void 0?n:T,V=gC(O,l);q.useEffect(()=>{let j=A.current;if(!j)return;let we=()=>{E(j.offsetWidth);};we();let Q=new ResizeObserver(we);return Q.observe(j),()=>{Q.disconnect();}},[]),q.useImperativeHandle(w,()=>I.current);let K=i?L:s,$=q.useMemo(()=>i?K:K.filter(j=>j.label.toLowerCase().includes(O.toLowerCase())),[K,O,i]);q.useEffect(()=>{if(!i)return;if(V.length<c){N([]);return}let j=false;return (async()=>{M(true);try{let Q=await i(V);j||N(Q);}catch{j||N([]);}finally{j||M(false);}})(),()=>{j=true;}},[V,i,c]);let G=j=>{n===void 0&&k(j),o?.(j);},Y=j=>{let we=j.target.value;G(we),we.length>=c&&R(true);},B=j=>{G(j.label),a?.(j),R(false);},z=()=>{G(""),I.current?.focus();},_=()=>{H(true),R(true);},U=()=>{H(false);},F=j=>{j.key==="Escape"&&R(false),j.key==="ArrowDown"&&!C&&$.length>0&&R(true);},X$1=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ae=p&&O?"pr-8":"pr-3";return jsxs(rt,{open:C,onOpenChange:R,children:[jsxs(nn,{ref:A,className:m("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:O,onChange:Y,onFocus:_,onBlur:U,onKeyDown:F,disabled:y,placeholder:d,className:m(Rg({size:t,fullWidth:v}),ae,e),style:{borderColor:S?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&O&&!y&&jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:X$1})})]}),jsx(ot,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:j=>j.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ne,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:m(X$1,"animate-spin")}),f]}):$.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):$.map(j=>jsxs(Command.Item,{value:j.value,disabled:j.disabled,onSelect:()=>B(j),className:m("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:m("mr-2 h-4 w-4 shrink-0",O===j.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(fC,{text:j.label,query:O}):j.label})]},j.value))})})})})]})});wg.displayName="Autocomplete";var Qi=q.createContext(null),Ji=q.createContext(null),el=()=>{let e=q.useContext(Qi);if(!e)throw new Error("useFormContext must be used within a Form");return e},cs=()=>{let e=q.useContext(Ji);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},bC={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})},Cg=q.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=q.useState(e),[u,f]=q.useState({}),[p,g]=q.useState({}),[h,b]=q.useState({}),[v,y]=q.useState(false),x=q.useRef(new Map),w=q.useCallback((D,E)=>{x.current.set(D,E);},[]),C=q.useCallback(D=>{x.current.delete(D);},[]),R=q.useCallback(D=>{let E=x.current.get(D)||[],I=c[D];for(let A of E)if(!A.validate(I))return f(O=>({...O,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),T=q.useCallback(()=>{let D=true,E={};return x.current.forEach((I,A)=>{let O=c[A];for(let V of I)if(!V.validate(O)){E[A]=V.message,D=false;break}E[A]||(E[A]=null);}),f(E),D},[c]),k=q.useCallback((D,E)=>{d(I=>({...I,[D]:E})),b(I=>({...I,[D]:true})),o&&setTimeout(()=>{R(D);},0);},[o,R]),L=q.useCallback((D,E)=>{f(I=>({...I,[D]:E}));},[]),N=q.useCallback((D,E)=>{g(I=>({...I,[D]:E})),E&&r&&R(D);},[r,R]),P=q.useCallback(D=>({value:c[D],error:u[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,u,p,h]),M=q.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),S=async D=>{D.preventDefault();let E={};if(x.current.forEach((A,O)=>{E[O]=true;}),g(E),!T()){n?.(u);return}if(t){y(true);try{await t(c);}finally{y(false);}}},H={values:c,errors:u,touched:p,dirty:h,isSubmitting:v,setValue:k,setError:L,setTouched:N,validateField:R,validateAll:T,registerField:w,unregisterField:C,getFieldState:P,reset:M};return jsx(Qi.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:S,className:m("space-y-4",s),...i,children:a})})});Cg.displayName="Form";var Tg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=el(),a=q.useId();q.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(Ji.Provider,{value:i,children:r})};Tg.displayName="FormField";var Mg=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("space-y-1.5",e),...t}));Mg.displayName="FormItem";var Ng=q.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=cs();return jsxs(br,{ref:o,htmlFor:a,className:m(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});Ng.displayName="FormLabel";var kg=({children:e})=>{let{name:t,id:n,error:r,touched:o}=cs(),a=el(),s=a.getFieldState(t),i=c=>{let d=c.target,u=d.type==="checkbox"?d.checked:d.value;a.setValue(t,u);},l=()=>{a.setTouched(t,true);};return q.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})};kg.displayName="FormControl";var Pg=q.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-xs text-muted-foreground",e),...t}));Pg.displayName="FormDescription";var Eg=q.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=cs(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:m("text-xs text-danger",e),role:"alert",...n,children:i}):null});Eg.displayName="FormMessage";var Lg=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"}}),Dg=q.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:m(Lg({size:t,className:e})),...i,children:[jsxs(vr,{"data-user-avatar":true,children:[o&&jsx(_r,{src:o,alt:n}),jsx(hr,{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})]})});Dg.displayName="User";var Ig=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"}}),Vg=q.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:m(Ig({variant:t,size:n,radius:r,className:e})),...o}));Vg.displayName="Code";function Bg(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 Fg=q.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=Bg(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:m("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,y)=>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:y+1}),v.map((x,w)=>jsx("span",{...b({token:x})},w))]},y))})}),!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"})})]})]})});Fg.displayName="CodeBlock";var Kg=q.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=Bg(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],f=u.language||"bash";return jsxs("div",{ref:r,className:m("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:m("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:u.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((y,x)=>jsx("span",{...h({token:y})},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"})})]})]})});Kg.displayName="TabbedCodeBlock";var $g=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"}}),Gg=q.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[u,f]=q.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:m($g({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:m("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":u?"Copied":a,children:u?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});Gg.displayName="Snippet";var ol=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),Ug=q.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,...u},f)=>{let[p,g]=q.useState("loading");q.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:m(ol({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(ol({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Na,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:b,className:m("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...u})]})});Ug.displayName="Image";var _g=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"}}),Wg=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 EC({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,u]=q.useState(null),[f,p]=q.useState(null),g=(x,w)=>{i||(u(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){u(null),p(null);return}let C=[...r],[R]=C.splice(d,1);C.splice(w,0,R),o?.(C),u(null),p(null);},y=()=>{u(null),p(null);};return jsx("div",{ref:c,className:m(_g({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:y,className:m(Wg({variant:t,size:n,isDragging:d===w,isDragOver:f===w}),!i&&"cursor-move"),children:[s&&jsx("div",{className:m("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 SC=q.forwardRef(EC);var Zg=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"}}),Yg={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},IC={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},qg={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},Qg=q.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in qg,l=i?qg[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(u=>jsx("div",{className:m(IC[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${u*.15}s`}},u))});case "pulse":return jsx("div",{className:m(Yg[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:m(Yg[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:m(Zg({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:m("text-sm",l),style:c,children:r})]})})});Qg.displayName="Loading";var zC=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),OC=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}}),BC=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"}}),FC=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"}}),vs={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},sl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},al=(e,t)=>String(e).padStart(t,"0"),Jg=(e,t)=>{if(!e)return "";let n=al(e.getDate(),2),r=al(e.getMonth()+1,2),o=al(e.getFullYear(),4),a=vs[t],s=sl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},fs=(e,t)=>{let n=vs[t],r=e.split(n);if(r.length!==3)return null;let o=sl[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},KC=e=>{let t=vs[e];return sl[e].map(r=>r==="year"?"####":"##").join(t)},qo=(e,t)=>{if(!e?.from)return "";let n=Jg(e.from,t),r=e.to?Jg(e.to,t):"";return n&&r?`${n} - ${r}`:n},eb=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="dd.MM.yyyy",showPickerIcon:v=true,mode:y="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:R,placeholder:T,id:k,...L},N)=>{let P=q.useId(),M=k||P,S=`${M}-description`,H=`${M}-error`,[D,E]=q.useState(f),[I,A]=q.useState(""),[O,V]=q.useState(false),[K,$]=q.useState(false),G=u!==void 0?u:D,Y=a&&r,B=KC(b),z=vs[b],_=" - ";q.useEffect(()=>{K||A(qo(G,b));},[G,b,K]);let U=ce=>{u===void 0&&E(ce),p?.(ce);},F=ce=>{U(ce),A(qo(ce,b)),ce?.from&&ce?.to&&V(false);},X=ce=>{let Be=ce.target.value;Be=Be.replace(new RegExp(`[^0-9\\${z}\\s-]`,"g"),"");let pe=`${B}${_}${B}`,wt=Be.replace(new RegExp(`[\\${z}\\s-]`,"g"),""),gt="",vn=0;for(let Fe=0;Fe<pe.length&&vn<wt.length;Fe++)pe[Fe]==="#"?(gt+=wt[vn],vn++):gt+=pe[Fe];if(A(gt),gt.length===pe.length){let Fe=gt.split(_);if(Fe.length===2){let tn=fs(Fe[0].trim(),b),Ct=fs(Fe[1].trim(),b);if(tn&&Ct){if(g&&(tn<g||Ct<g)||h&&(tn>h||Ct>h))return;tn<=Ct&&U({from:tn,to:Ct});}}}},ae=()=>{$(true);},j=()=>{$(false);let ce=`${B}${_}${B}`;if(I.length!==ce.length)A(qo(G,b));else {let Be=I.split(_);if(Be.length!==2)A(qo(G,b));else {let pe=fs(Be[0].trim(),b),wt=fs(Be[1].trim(),b);(!pe||!wt||pe>wt)&&A(qo(G,b));}}},we=()=>{R||V(true);},Q=()=>{!R&&y==="picker"&&v&&V(true);};return jsxs("div",{className:m(zC({size:s}),e),children:[t&&jsxs("label",{htmlFor:M,className:m(FC({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(rt,{open:v&&O,onOpenChange:V,children:[jsxs(nn,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:N,id:M,type:"text",inputMode:y==="text"?"numeric":void 0,value:I,onChange:y==="text"?X:void 0,onClick:Q,onFocus:ae,onBlur:j,readOnly:y==="picker","aria-invalid":a,"aria-describedby":Y?H:n?S:void 0,"aria-required":o,disabled:R,placeholder:T||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:m(OC({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),y==="picker"&&v&&"cursor-pointer",l),style:{borderColor:K||v&&O?"var(--color-foreground)":void 0},...L}),v&&jsx("button",{type:"button",onClick:we,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(BC({size:s}))})})]}),v&&jsx(ot,{className:"w-auto p-0",align:C,children:jsx(Yr,{mode:"range",selected:G,onSelect:F,numberOfMonths:w,disabled:ce=>!!(g&&ce<g||h&&ce>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!Y&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),Y&&jsx("p",{id:H,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});eb.displayName="DateRangePicker";var ro=e=>String(e).padStart(2,"0"),tb=q.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]=q.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),u=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${ro(x.hours)}:${ro(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${ro(w)}:${ro(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let R=e.hours>=12;R&&x!==12?C=x+12:!R&&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,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(rt,{open:l,onOpenChange:c,children:[jsxs(Gn,{ref:i,disabled:a,className:m("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(ot,{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(Ne,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(se,{variant:y===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:ro(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(Ne,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:u.map(x=>jsx(se,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:ro(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(se,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(se,{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(se,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(se,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});tb.displayName="TimePicker";var nb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function UC({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},u){let f=q.useRef(null),[p,g]=q.useState(0);q.useImperativeHandle(u,()=>f.current);let h=n.length*(r+l)-l,b=r+l,v=Math.max(0,Math.floor(p/b)-a),y=Math.ceil(o/b)+2*a,x=Math.min(n.length-1,v+y),w=R=>{let T=R.currentTarget.scrollTop;g(T),c?.(T);},C=q.useMemo(()=>{let R=[];for(let T=v;T<=x;T++)n[T]!==void 0&&R.push({item:n[T],index:T,style:{position:"absolute",top:T*b,left:0,right:0,height:r}});return R},[n,v,x,b,r]);return jsx("div",{ref:f,className:m(nb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:R,index:T,style:k})=>jsx("div",{style:k,children:s(R,T)},i?i(R,T):T))})})}var jC=q.forwardRef(UC);var ll=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),cl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),ob=q.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:u,scrollbarVisibility:f="visible",...p},g)=>{let h=q.useRef(null),b=q.useRef(null),v=q.useRef(false);q.useImperativeHandle(g,()=>h.current),q.useEffect(()=>{let w=b.current;if(!w)return;let C=new IntersectionObserver(R=>{let[T]=R;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 y=jsx("div",{className:m(cl({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||y),!a&&!s&&u&&jsx("div",{className:m(cl({size:n}),"text-muted-foreground text-sm"),children:u})]});return d?jsx("div",{ref:h,className:m(ll({variant:t,className:e})),...p,children:x}):jsx(Ne,{ref:h,visibility:f,className:m(ll({variant:t,className:e})),...p,children:x})});ob.displayName="InfiniteScroll";var oT=e=>e.map(t=>typeof t=="string"?{src:t}:t),dl=q.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:u=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=q.useMemo(()=>oT(e),[e]),[v,y]=q.useState(r),[x,w]=q.useState(1),[C,R]=q.useState(0),[T,k]=q.useState(false),[L,N]=q.useState(false),[P,M]=q.useState({x:0,y:0}),[S,H]=q.useState({x:0,y:0}),[D,E]=q.useState(false),I=q.useRef(null),A=b[v];q.useEffect(()=>{E(true);},[]),q.useEffect(()=>{y(r);},[r]),q.useEffect(()=>{o?.(v);},[v,o]),q.useEffect(()=>{w(1),R(0),M({x:0,y:0});},[v]),q.useEffect(()=>{if(t)return Kt(),()=>$t()},[t]);let O=q.useCallback(()=>{y(Q=>Q>0?Q-1:b.length-1);},[b.length]),V=q.useCallback(()=>{y(Q=>Q<b.length-1?Q+1:0);},[b.length]),K=()=>{w(Q=>Math.min(Q+.5,4));},$=()=>{w(Q=>{let ce=Math.max(Q-.5,.5);return ce===1&&M({x:0,y:0}),ce});},G=()=>{R(Q=>(Q+90)%360);},Y=async()=>{if(A)try{let ce=await(await fetch(A.src)).blob(),Be=URL.createObjectURL(ce),pe=document.createElement("a");pe.href=Be,pe.download=A.alt||`image-${v+1}`,document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(Be);}catch{window.open(A.src,"_blank");}},B=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),k(!1);}catch{}else try{await I.current.requestFullscreen(),k(!0);}catch{}},z=Q=>{x>1&&(N(true),H({x:Q.clientX-P.x,y:Q.clientY-P.y}));},_=Q=>{L&&x>1&&M({x:Q.clientX-S.x,y:Q.clientY-S.y});},U=()=>{N(false);},F=()=>{n?.(false);},X$1=Q=>{p&&Q.target===Q.currentTarget&&F();},ae=q.useCallback(Q=>{switch(Q.key){case "ArrowLeft":O();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":K();break;case "-":$();break}},[O,V,n]);if(q.useEffect(()=>{if(t)return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[t,ae]),q.useEffect(()=>{let Q=()=>{k(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),b.length===0)return null;let j=a?q.isValidElement(a)?q.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[j,!D||!t?null:Da.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:X$1}),jsxs("div",{ref:h,className:m("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:$,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:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick: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:Y,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:B,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:F,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:z,onMouseMove:_,onMouseUp:U,onMouseLeave:U,children:[u&&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:m("max-h-full max-w-full object-contain transition-transform duration-200",L?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.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,ce)=>jsx("button",{onClick:()=>y(ce),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===ce?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${ce+1}`,className:"h-full w-full object-cover"})},ce))})]})]}),document.body)]})});dl.displayName="ImageViewer";var sb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=q.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:m("cursor-zoom-in",r),children:e}),jsx(dl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};sb.displayName="ImageViewerTrigger";var ib=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"},iT={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"},lT=e=>{let t=e.toLowerCase();return sT[t]||e.toUpperCase()},Zo=e=>{let t=e.toLowerCase();return iT[t]||t},xs=e=>{let t=Zo(e);return ["meta","control","alt","shift"].includes(t)},lb=q.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{q.useEffect(()=>{if(!a||!r||s)return;let u=Array.isArray(r)?r:[r],f=u.filter(xs).map(Zo),p=u.filter(h=>!xs(h)).map(Zo),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,y=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());b&&v&&y&&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(q.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:lT(f)})]},p)):o;return jsx("kbd",{ref:c,className:m(ib({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});lb.displayName="Kbd";function cT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;q.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(xs).map(Zo),i=a.filter(c=>!xs(c)).map(Zo),l=c=>{let d=s.includes("meta")===c.metaKey,u=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&&u&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var cb=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"}}),db=q.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=q.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),u(!0),o?.(),setTimeout(()=>{u(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:m(cb({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}})})});db.displayName="CopyButton";var mb=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"}}),vT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],hT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function yT(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 RT(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 so(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ao(e){return so(e,new Date)}function ub(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return so(r,t)||so(o,t)||r<t&&o>t})}var pb=q.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=vT,date:l,onDateChange:c,onEventClick:d,onSlotClick:u,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[b,v]=q.useState(new Date),y=l??b,x=M=>{c?c(M):v(M);},w=f===1?xT:hT,C=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()-1):a==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),x(M);},R=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()+1):a==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),x(M);},T=()=>{x(new Date);},k=()=>a==="day"?y.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):y.toLocaleDateString(p,{year:"numeric",month:"long"}),L=()=>{let M=yT(y.getFullYear(),y.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(S=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:S},S))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((S,H)=>{let D=ub(o,S),E=S.getMonth()===y.getMonth(),I=so(S,y);return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!E&&"bg-muted/30",I&&"bg-accent"),onClick:()=>u?.(S),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",ao(S)&&"bg-primary text-primary-foreground",!E&&"text-muted-foreground"),children:S.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.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)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},H)})})]})},N=()=>{let M=RT(y,f),S=Array.from({length:24},(H,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((H,D)=>{let E=so(H,y);return jsxs("div",{className:m("p-2 text-center border-l cursor-pointer hover:bg-accent/50",ao(H)&&"bg-primary/10",E&&!ao(H)&&"bg-accent"),onClick:()=>u?.(H),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[D]}),jsx("div",{className:m("text-lg font-semibold",ao(H)&&"text-primary",E&&!ao(H)&&"text-primary"),children:H.getDate()})]},D)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:S.map(H=>jsxs(q.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),M.map((D,E)=>{let I=new Date(D);I.setHours(H,0,0,0);let A=o.filter(O=>{let V=new Date(O.start);return so(V,D)&&V.getHours()===H});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(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))},E)})]},H))})})]})},P=()=>{let M=Array.from({length:24},(H,D)=>D),S=ub(o,y);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:m("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",ao(y)&&"bg-primary text-primary-foreground"),children:y.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(H=>{let D=new Date(y);D.setHours(H,0,0,0);let E=S.filter(I=>new Date(I.start).getHours()===H);return jsxs(q.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(D),children:E.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))})]},H)})})})]})};return jsxs("div",{ref:h,className:m(mb({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:k()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(se,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx(Ea,{options:i,value:a,onValueChange:M=>s?.(M),size:"sm",radius:"md",className:"w-[120px]"}),jsx(se,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(se,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&L(),a==="week"&&N(),a==="day"&&P()]})});pb.displayName="FullCalendar";var Ts=({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))})]}),Jo=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),ea=["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%))"],fb=q.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ea,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(Jo({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(Ts,{})}),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))]})})}));fb.displayName="LineChart";var gb=q.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ea,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},f)=>jsx("div",{ref:f,className:m(Jo({size:t,className:e})),...u,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(Ts,{})}),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))]})})}));gb.displayName="BarChart";var bb=q.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=ea,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},f)=>jsx("div",{ref:f,className:m(Jo({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Ts,{})}),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}`))})]})})}));bb.displayName="PieChart";var vb=q.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ea,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},f)=>jsx("div",{ref:f,className:m(Jo({size:t,className:e})),...u,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(Ts,{})}),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))]})})}));vb.displayName="AreaChart";var bl={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function UT({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}}),u={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:u,className:m("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",bl[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 xb({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:m("flex flex-col min-w-[280px] w-[280px]",bl[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(Ne,{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(UT,{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(se,{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 Rb=q.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},u)=>{let[f,p]=q.useState(false),[g,h]=q.useState(null),[b,v]=q.useState(null);q.useEffect(()=>{p(true);},[]);let y=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(xb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(k=>k.cards.some(L=>L.id===T));return jsxs(DndContext,{sensors:y,collisionDetection:closestCorners,onDragStart:T=>{let{active:k}=T,L=x(k.id);if(L){let N=L.cards.find(P=>P.id===k.id);N&&(h(N),v(L.id));}},onDragOver:T=>{let{active:k,over:L}=T;if(!L)return;let N=k.id,P=L.id,M=x(N),S=x(P)||t.find(E=>E.id===P);if(!M||!S||M.id===S.id)return;let H=S.cards.findIndex(E=>E.id===P),D=H===-1?S.cards.length:H;n?.(N,M.id,S.id,D);},onDragEnd:T=>{let{active:k,over:L}=T;if(L&&k.id!==L.id){let N=x(k.id),P=x(L.id)||t.find(M=>M.id===L.id);if(N&&P){let M=P.cards.findIndex(H=>H.id===L.id),S=M===-1?P.cards.length:M;n?.(k.id,N.id,P.id,S);}}h(null),v(null);},children:[jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(xb,{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:m("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",bl[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})]})]})})})]})});Rb.displayName="KanbanBoard";var wb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Cb=q.createContext(null);function Ns(){let e=q.useContext(Cb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Tb=q.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[u,f]=jT({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=q.useState(false),[h,b]=q.useState(false),[v,y]=q.useState(0),[x,w]=q.useState([]),C=q.useCallback(N=>{N&&(y(N.selectedScrollSnap()),g(N.canScrollPrev()),b(N.canScrollNext()));},[]),R=q.useCallback(()=>{f?.scrollPrev();},[f]),T=q.useCallback(()=>{f?.scrollNext();},[f]),k=q.useCallback(N=>{f?.scrollTo(N);},[f]),L=q.useCallback(N=>{N.key==="ArrowLeft"?(N.preventDefault(),R()):N.key==="ArrowRight"&&(N.preventDefault(),T());},[R,T]);return q.useEffect(()=>{!f||!l||l(f);},[f,l]),q.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Cb.Provider,{value:{carouselRef:u,api:f,scrollPrev:R,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:x,scrollTo:k,orientation:a},children:jsxs("div",{ref:d,className:m(wb({variant:t,className:e})),onKeyDownCapture:L,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:u,className:"overflow-hidden",children:jsx("div",{className:m("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(vl,{}),jsx(hl,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((N,P)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>k(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});Tb.displayName="Carousel";var Mb=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex",e),...t}));Mb.displayName="CarouselContent";var Nb=q.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=Ns();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});Nb.displayName="CarouselItem";var vl=q.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=Ns();return jsxs(se,{ref:a,variant:t,size:n,isIconOnly:r,className:m("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"})]})});vl.displayName="CarouselPrevious";var hl=q.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=Ns();return jsxs(se,{ref:a,variant:t,size:n,isIconOnly:r,className:m("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"})]})});hl.displayName="CarouselNext";var kb=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"}}),ks={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"}},yl={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}"]},Pb=q.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=q.useState(r.length>0?"recent":o),[u,f]=q.useState(""),g=u?Object.values(yl).flat().filter(b=>b.toLowerCase().includes(u.toLowerCase())):c==="recent"?r:yl[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:m(kb({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(Ra,{placeholder:"Search emojis...",value:u,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(Ne,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(ks).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:ks[b].name,children:v},b))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:ks[c].name}),jsx(Ne,{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"})]})})]})});Pb.displayName="EmojiPicker";var Eb=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"}}),CM=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"}}),TM=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"}}),Ye=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Fn,{children:[jsx(Kn,{children:jsx(se,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx($n,{side:"top",className:"text-xs",children:t})]}),Sb=q.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,...u},f)=>{let p=useEditor({extensions:[eM.configure({heading:{levels:[1,2,3]}}),tM.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),nM,rM.configure({types:["heading","paragraph"]}),oM.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});q.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),q.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(Bn,{children:jsxs("div",{ref:f,className:m(Eb({variant:t,size:n,className:e})),...u,children:[i&&!s&&jsxs("div",{className:m(CM({size:n})),children:[jsx(Ye,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(Ye,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{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(Ye,{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(Ye,{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(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(Ye,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(Ye,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(Ye,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(Ye,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(Ye,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(Ye,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(Ye,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(On,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(Ye,{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:m(TM({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Sb.displayName="RichTextEditor";var Db=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 DM(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function Lb(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,u=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(u),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 Hb=q.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:u,...f},p)=>{let g=q.useRef(null),[h,b]=q.useState(),[v,y]=q.useState(),[x,w]=q.useState(1),[C,R]=q.useState(0),T=P=>{let{width:M,height:S}=P.currentTarget;if(r){let H=DM(M,S,r);b(H);}else b(u||{unit:"%",x:10,y:10,width:80,height:80});},k=P=>{b(P),o?.(P);},L=async P=>{if(y(P),a&&g.current&&P.width&&P.height){let M=await Lb(g.current,P,C,x);a(M);}},N=()=>{R(P=>(P+90)%360);};return q.useEffect(()=>{v&&g.current&&a&&Lb(g.current,v,C,x).then(P=>{a(P);});},[x,C,v,a]),jsxs("div",{ref:p,className:m(Db({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(MM,{crop:h,onChange:k,onComplete:L,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(za,{value:[x],onValueChange:([P])=>w(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(se,{variant:"bordered",size:"sm",isIconOnly:true,onClick:N,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Hb.displayName="ImageCropper";var Tl=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"}}),VM={sm:96,md:128,lg:192},Vb=q.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:u=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??VM[n??"md"];return r?jsx("div",{ref:h,className:m(Tl({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(HM,{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:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:m(Tl({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"})})});Vb.displayName="QRCode";var Ab=({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});Ab.displayName="ThemeProvider";var $M=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),zb=q.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=q.useState(false);q.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],p=(u.indexOf(a||"system")+1)%u.length;s(u[p]);};return l?r==="cycle"?jsxs(se,{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(yn,{children:[jsx(Rn,{children:jsxs(se,{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(wn,{align:"end",children:[jsxs(Ft,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Ft,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Ft,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(se,{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"})]})});zb.displayName="ThemeToggle";var Ob=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Bb=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}}),Fb=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"}}),Kb=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:u,endContent:f,id:p,...g},h)=>{let b=q.useId(),v=p||b,y=`${v}-description`,x=`${v}-error`,w=a&&r;return jsxs("div",{className:m(Ob({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:m(Fb({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":w?x:n?y:void 0,"aria-required":o,className:m(Bb({size:s,isInvalid:a}),u&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!w&&jsx("p",{id:y,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Kb.displayName="TextField";var Ub=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),jM=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),$b=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Gb=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),_M=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"}}),jb=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:u,max:f,step:p=1,value:g,defaultValue:h,onChange:b,showButtons:v=true,formatOptions:y,fullWidth:x=false,disabled:w,id:C,...R},T)=>{let k=q.useId(),L=C||k,N=`${L}-description`,P=`${L}-error`,[M,S]=q.useState(h),[H,D]=q.useState(false),E=g!==void 0?g:M,I=a&&r,A=q.useCallback(z=>{z!==void 0&&(u!==void 0&&z<u&&(z=u),f!==void 0&&z>f&&(z=f)),g===void 0&&S(z),b?.(z);},[g,u,f,b]),O=()=>{let z=(E??0)+p;A(z);},V=()=>{let z=(E??0)-p;A(z);},K=z=>{let _=z.target.value;if(_==="")A(void 0);else {let U=parseFloat(_);isNaN(U)||A(U);}},$=z=>{z.key==="ArrowUp"?(z.preventDefault(),O()):z.key==="ArrowDown"&&(z.preventDefault(),V());},G=q.useMemo(()=>E===void 0?"":y?new Intl.NumberFormat(void 0,y).format(E):E.toString(),[E,y]),Y=u!==void 0&&E!==void 0&&E<=u,B=f!==void 0&&E!==void 0&&E>=f;return jsxs("div",{className:m(Ub({size:s}),e),children:[t&&jsxs("label",{htmlFor:L,className:m(_M({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx("button",{type:"button",onClick:V,disabled:w||Y,className:m($b({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:m(Gb({size:s}))})}),jsx("input",{ref:T,id:L,type:"text",inputMode:"decimal",value:G,onChange:K,onKeyDown:$,onFocus:()=>D(true),onBlur:()=>D(false),"aria-invalid":a,"aria-describedby":I?P:n?N:void 0,"aria-required":o,"aria-valuemin":u,"aria-valuemax":f,"aria-valuenow":E,disabled:w,className:m(jM({size:s,isInvalid:a,fullWidth:x}),!v&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...R}),v&&jsx("button",{type:"button",onClick:O,disabled:w||B,className:m($b({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:m(Gb({size:s}))})})]}),n&&!I&&jsx("p",{id:N,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),I&&jsx("p",{id:P,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});jb.displayName="NumberField";var Wb=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),qM=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}}),_b=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"}}),XM=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"}}),ZM=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"}}),Yb=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:y,placeholder:x="Search...",id:w,...C},R)=>{let T=q.useId(),k=w||T,L=`${k}-description`,N=`${k}-error`,[P,M]=q.useState(f),S=u!==void 0?u:P,H=a&&r,D=S.length>0,E=O=>{let V=O.target.value;u===void 0&&M(V),p?.(V);},I=()=>{u===void 0&&M(""),p?.(""),g?.();},A=O=>{O.key==="Enter"?(O.preventDefault(),h?.(S)):O.key==="Escape"&&D&&(O.preventDefault(),I());};return jsxs("div",{className:m(Wb({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(XM({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:m(_b({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:R,id:k,type:"search",value:S,onChange:E,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?N:n?L:void 0,"aria-required":o,disabled:y,className:m(qM({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&D&&!y&&jsx("button",{type:"button",onClick:I,className:m(ZM({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:m(_b({size:s}))})})]}),n&&!H&&jsx("p",{id:L,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:N,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Yb.displayName="SearchField";var qb=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),JM=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}}),eN=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"}}),tN=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"}}),Ds={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Dl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Sl=(e,t)=>String(e).padStart(t,"0"),aa=(e,t)=>{if(!e)return "";let n=Sl(e.getDate(),2),r=Sl(e.getMonth()+1,2),o=Sl(e.getFullYear(),4),a=Ds[t],s=Dl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ll=(e,t)=>{let n=Ds[t],r=e.split(n);if(r.length!==3)return null;let o=Dl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},nN=e=>{let t=Ds[e];return Dl[e].map(r=>r==="year"?"####":"##").join(t)},Hs=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="dd.MM.yyyy",showPickerIcon:v=true,mode:y="text",fullWidth:x=false,disabled:w,placeholder:C,id:R,...T},k)=>{let L=q.useId(),N=R||L,P=`${N}-description`,M=`${N}-error`,[S,H]=q.useState(f??null),[D,E]=q.useState(""),[I,A]=q.useState(false),[O,V]=q.useState(false),K=u!==void 0?u:S,$=a&&r,G=Ds[b],Y=nN(b);q.useEffect(()=>{O||E(aa(K,b));},[K,b,O]);let B=j=>{u===void 0&&H(j),p?.(j);},z=j=>{let we=j??null;B(we),E(aa(we,b)),A(false);},_=j=>{let we=j.target.value;we=we.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=we.replace(new RegExp(`\\${G}`,"g"),""),ce="",Be=0;for(let pe=0;pe<Y.length&&Be<Q.length;pe++)Y[pe]==="#"?(ce+=Q[Be],Be++):ce+=Y[pe];if(E(ce),ce.length===Y.length){let pe=Ll(ce,b);if(pe){if(g&&pe<g||h&&pe>h)return;B(pe);}}},U=()=>{V(true);},F=()=>{V(false),D.length!==Y.length?E(aa(K,b)):Ll(D,b)||E(aa(K,b));},X=()=>{w||A(true);},ae=()=>{!w&&y==="picker"&&v&&A(true);};return jsxs("div",{className:m(qb({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:m(tN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(rt,{open:v&&I,onOpenChange:A,children:[jsxs(nn,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:N,type:"text",inputMode:y==="text"?"numeric":void 0,value:D,onChange:y==="text"?_:void 0,onClick:ae,onFocus:U,onBlur:F,readOnly:y==="picker","aria-invalid":a,"aria-describedby":$?M:n?P:void 0,"aria-required":o,disabled:w,placeholder:C||b.toLowerCase(),className:m(JM({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),y==="picker"&&v&&"cursor-pointer",l),style:{borderColor:O||v&&I?"var(--color-foreground)":void 0},...T}),v&&jsx("button",{type:"button",onClick:X,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:m(eN({size:s}))})})]}),v&&jsx(ot,{className:"w-auto p-0",align:"start",children:jsx(Yr,{mode:"single",selected:K??void 0,onSelect:z,disabled:j=>!!(g&&j<g||h&&j>h),defaultMonth:K??void 0,showMonthAndYearPickers:true})})]}),n&&!$&&jsx("p",{id:P,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),$&&jsx("p",{id:M,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Hs.displayName="DatePicker";var rN=Hs,oN=Hs;var Xb=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),aN=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}}),sN=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"}}),Zb=q.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:y,fullWidth:x=false,id:w,...C},R)=>{let T=q.useId(),k=w||T,L=`${k}-description`,N=`${k}-error`,P=q.useRef(null),M=q.useRef(null),S=q.useRef(null),H=q.useRef(null),[D,E]=q.useState(f??null),I=u!==void 0?u:D,A=a&&r,O=W=>v===24?W:W===0?12:W>12?W-12:W,V=W=>W>=12?"PM":"AM",K=(W,oe)=>oe==="AM"?W===12?0:W:W===12?12:W+12,[$,G]=q.useState(I?String(O(I.hour)).padStart(2,"0"):""),[Y,B]=q.useState(I?String(I.minute).padStart(2,"0"):""),[z,_]=q.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[U,F]=q.useState(I?V(I.hour):"AM"),[X,ae]=q.useState(false);q.useEffect(()=>{u!==void 0&&(u?(G(String(O(u.hour)).padStart(2,"0")),B(String(u.minute).padStart(2,"0")),u.second!==void 0&&_(String(u.second).padStart(2,"0")),F(V(u.hour))):(G(""),B(""),_("")));},[u,v]);let j=(W,oe,Z,Le)=>{let ue=parseInt(W,10),Ue=parseInt(oe,10),je=b?parseInt(Z,10):void 0;if(isNaN(ue)||isNaN(Ue)||b&&isNaN(je)){u===void 0&&E(null),p?.(null);return}let he={hour:v===12?K(ue,Le):ue,minute:Ue,...b&&je!==void 0&&{second:je}};u===void 0&&E(he),p?.(he);},we=W=>{let oe=W.target.value.replace(/\D/g,"").slice(0,2);G(oe);let Z=v===24?23:12,Le=v===24?0:1;if(oe.length===2){let ue=parseInt(oe,10);ue>=Le&&ue<=Z&&(M.current?.focus(),M.current?.select());}},Q=W=>{let oe=W.target.value.replace(/\D/g,"").slice(0,2);if(B(oe),oe.length===2){let Z=parseInt(oe,10);Z>=0&&Z<=59&&(b?(S.current?.focus(),S.current?.select()):v===12&&H.current?.focus());}},ce=W=>{let oe=W.target.value.replace(/\D/g,"").slice(0,2);_(oe),oe.length===2&&v===12&&H.current?.focus();},Be=()=>{if($){let W=parseInt($,10),oe=v===24?23:12,Le=Math.min(Math.max(W,v===24?0:1),oe),ue=String(Le).padStart(2,"0");G(ue),j(ue,Y,z,U);}},pe=()=>{if(Y){let W=parseInt(Y,10),oe=Math.min(Math.max(W,0),59),Z=String(oe).padStart(2,"0");B(Z),j($,Z,z,U);}},wt=()=>{if(z){let W=parseInt(z,10),oe=Math.min(Math.max(W,0),59),Z=String(oe).padStart(2,"0");_(Z),j($,Y,Z,U);}},gt=()=>{let W=U==="AM"?"PM":"AM";F(W),j($,Y,z,W);},vn=W=>{let oe=W.key.toLowerCase();oe==="a"?(W.preventDefault(),U!=="AM"&&(F("AM"),j($,Y,z,"AM"))):oe==="p"?(W.preventDefault(),U!=="PM"&&(F("PM"),j($,Y,z,"PM"))):oe==="arrowup"||oe==="arrowdown"?(W.preventDefault(),gt()):oe==="arrowleft"&&(W.preventDefault(),b?(S.current?.focus(),S.current?.select()):(M.current?.focus(),M.current?.select()));},Fe=(W,oe)=>{if(W.key==="ArrowUp"||W.key==="ArrowDown"){W.preventDefault();let Z=W.key==="ArrowUp"?1:-1;if(oe==="hour"){let Le=parseInt($,10)||0,ue=v===24?23:12,Ue=v===24?0:1,je=Le+Z;je>ue&&(je=Ue),je<Ue&&(je=ue);let An=String(je).padStart(2,"0");G(An),j(An,Y,z,U);}else if(oe==="minute"){let ue=(parseInt(Y,10)||0)+Z;ue>59&&(ue=0),ue<0&&(ue=59);let Ue=String(ue).padStart(2,"0");B(Ue),j($,Ue,z,U);}else if(oe==="second"){let ue=(parseInt(z,10)||0)+Z;ue>59&&(ue=0),ue<0&&(ue=59);let Ue=String(ue).padStart(2,"0");_(Ue),j($,Y,Ue,U);}}W.key==="ArrowRight"&&(W.preventDefault(),oe==="hour"?(M.current?.focus(),M.current?.select()):oe==="minute"&&b?(S.current?.focus(),S.current?.select()):(oe==="minute"&&!b&&v===12||oe==="second"&&v===12)&&H.current?.focus()),W.key==="ArrowLeft"&&(W.preventDefault(),oe==="minute"?(P.current?.focus(),P.current?.select()):oe==="second"&&(M.current?.focus(),M.current?.select())),W.key==="Backspace"&&W.currentTarget.value===""&&(oe==="minute"?P.current?.focus():oe==="second"&&M.current?.focus());},Ct=m((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",y&&"cursor-not-allowed");return jsxs("div",{ref:R,className:m(Xb({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:k,className:m(sN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:m(aN({size:s,isInvalid:a,disabled:y,fullWidth:x}),l),style:{borderColor:X?"var(--color-foreground)":void 0},onFocus:()=>ae(true),onBlur:W=>{W.currentTarget.contains(W.relatedTarget)||ae(false);},children:[jsx("input",{ref:P,id:k,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:$,onChange:we,onBlur:Be,onKeyDown:W=>Fe(W,"hour"),onFocus:W=>W.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?N:n?L:void 0,"aria-required":o,disabled:y,className:Ct}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"mm",value:Y,onChange:Q,onBlur:pe,onKeyDown:W=>Fe(W,"minute"),onFocus:W=>W.target.select(),"aria-label":"Minute",disabled:y,className:Ct}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:S,type:"text",inputMode:"numeric",placeholder:"ss",value:z,onChange:ce,onBlur:wt,onKeyDown:W=>Fe(W,"second"),onFocus:W=>W.target.select(),"aria-label":"Second",disabled:y,className:Ct})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:gt,onKeyDown:vn,disabled:y,className:m("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",y&&"cursor-not-allowed"),"aria-label":"AM/PM",children:U})]}),n&&!A&&jsx("p",{id:L,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:N,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Zb.displayName="TimeField";var Jb=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"}}),ev=q.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...u},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],y=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>y(w.key,w.onPress),className:m("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:m(Jb({variant:t,orientation:n,size:r,density:o,className:e})),...u,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(yn,{children:[jsx(Rn,{"aria-label":"More actions",className:m("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(wn,{align:"end",children:g.map(w=>jsxs(Ft,{disabled:w.isDisabled,onClick:()=>y(w.key,w.onPress),children:[w.icon&&jsx("span",{className:m(v,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});ev.displayName="ActionGroup";var ov=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"}}),dN=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}}),av=q.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:m(ov({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:m(dN({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));av.displayName="StatusLight";var sv=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"}}),iv=q.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 u=()=>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:m(sv({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:u()}),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(Mt,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});iv.displayName="ActionBar";var lv=q.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:m("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]}));lv.displayName="ActionBarButton";var cv=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"}}),fN=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"}}),gN=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"}}),dv=q.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:u=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,y]=q.useState(o),x=r!==void 0,w=x?r:v,C=q.useRef(null),[R,T]=q.useState(false),[k,L]=q.useState(null),N=(V,K)=>{if(!C.current)return w[0];let $=C.current.getBoundingClientRect(),G;t==="horizontal"?G=(V-$.left)/$.width:G=1-(K-$.top)/$.height,G=Math.max(0,Math.min(1,G));let Y=i+G*(l-i),B=Math.round(Y/c)*c;return Math.max(i,Math.min(l,B))},P=(V,K)=>{let $=[...w];$[K]=V,K===0&&V>w[1]&&($[0]=w[1]),K===1&&V<w[0]&&($[1]=w[0]),x||y($),a?.($);},M=(V,K)=>{d||(V.preventDefault(),T(true),L(K),V.target.setPointerCapture(V.pointerId));},S=V=>{if(!R||k===null||d)return;let K=N(V.clientX,V.clientY);P(K,k);},H=()=>{R&&(T(false),L(null),s?.(w));},D=V=>{if(d)return;let K=N(V.clientX,V.clientY),$=Math.abs(w[0]-K),G=Math.abs(w[1]-K),Y=$<=G?0:1;P(K,Y);let B=[...w];B[Y]=K,s?.(B);},E=(V,K)=>{if(d)return;let $=w[K];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),$=Math.min(l,w[K]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),$=Math.max(i,w[K]-c);break;case "Home":V.preventDefault(),$=i;break;case "End":V.preventDefault(),$=l;break;default:return}P($,K);let G=[...w];G[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:[u&&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:m(cv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:m(fN({orientation:t,size:n})),onClick:D,children:jsx("div",{className:m("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,K)=>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:m(gN({size:n}),R&&k===K&&"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:$=>M($,K),onPointerMove:S,onPointerUp:H,onPointerCancel:H,onKeyDown:$=>E($,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});dv.displayName="RangeSlider";var Ol=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"}}),yN=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"}}),RN={help:HelpCircle,info:Info,warning:AlertCircle},pv=q.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:u,contentClassName:f},p)=>{let[g,h]=q.useState(false),[b,v]=q.useState(false),[y,x]=q.useState({top:0,left:0}),w=q.useRef(null),C=q.useRef(null),R=i!==void 0?i:g,T=q.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);q.useEffect(()=>{v(true);},[]),q.useEffect(()=>{if(!R||!w.current)return;let P=()=>{let M=w.current.getBoundingClientRect(),S=C.current?.getBoundingClientRect(),H=S?.width||288,D=S?.height||100,E=8,I=0,A=0;switch(a){case "top":I=M.top-D-E,A=M.left+M.width/2-H/2;break;case "bottom":I=M.bottom+E,A=M.left+M.width/2-H/2;break;case "left":I=M.top+M.height/2-D/2,A=M.left-H-E;break;case "right":I=M.top+M.height/2-D/2,A=M.right+E;break}if(a==="top"||a==="bottom")switch(s){case "start":A=M.left;break;case "center":A=M.left+M.width/2-H/2;break;case "end":A=M.right-H;break}if(a==="left"||a==="right")switch(s){case "start":I=M.top;break;case "center":I=M.top+M.height/2-D/2;break;case "end":I=M.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),I=Math.max(8,Math.min(I,window.innerHeight-D-8)),x({top:I,left:A});};return P(),requestAnimationFrame(P),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[R,a,s]),q.useEffect(()=>{if(!R)return;let P=M=>{C.current&&!C.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&T(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[R,T]),q.useEffect(()=>{if(!R)return;let P=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[R,T]);let k=RN[e??"help"],L=()=>{T(!R);},N=()=>{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?q.isValidElement(o)?q.cloneElement(o,{ref:w,onClick:P=>{o.props.onClick?.(P),L();}}):jsx("button",{ref:w,type:"button",onClick:L,className:m(Ol({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:L,className:m(Ol({variant:e,size:t}),u),"aria-label":"Help",children:jsx(k,{className:"h-full w-full"})}),b&&R&&Da.createPortal(jsxs("div",{ref:C,className:m(yN({size:t}),f),style:{position:"fixed",top:y.top,left:y.left,transformOrigin:N()},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)]})});pv.displayName="ContextualHelp";var gv=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),Bl=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 bv({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:u,errorMessage:f,maxTags:p,...g}){let[h,b]=q.useState(new Set),v=q.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),y=R=>{if(s==="none")return;let T;s==="single"?T=v.has(R)?new Set:new Set([R]):(T=new Set(v),T.has(R)?T.delete(R):T.add(R)),a||b(T),i?.(T);},x=(R,T)=>{T.stopPropagation(),c?.(R);},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}),u&&jsx("span",{className:"text-sm text-muted-foreground",children:u}),jsxs("div",{role:"group","aria-label":d,className:m(gv({spacing:t}),e),...g,children:[w.map(R=>{let T=v.has(R.key),k=s!=="none";return jsxs("span",{role:k?"button":void 0,tabIndex:k&&!R.isDisabled?0:void 0,"aria-pressed":k?T:void 0,onClick:()=>!R.isDisabled&&y(R.key),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&!R.isDisabled&&(L.preventDefault(),y(R.key));},style:R.color?{backgroundColor:R.color}:void 0,className:m(Bl({variant:R.color?void 0:n,size:r,isSelected:T,isDisabled:R.isDisabled}),k&&!R.isDisabled&&"cursor-pointer hover:opacity-80",R.color&&"text-white"),children:[R.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:R.icon}),R.label,l&&!R.isDisabled&&jsx("button",{type:"button",onClick:L=>x(R.key,L),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${R.label}`,children:jsx(X,{className:"h-3 w-3"})})]},R.key)}),C>0&&jsxs("span",{className:m(Bl({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}bv.displayName="TagGroup";var xv=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"}}),yv=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 Rv({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:u,...f}){let[p,g]=q.useState(new Set),h=q.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let y;a==="single"?y=h.has(v)?new Set:new Set([v]):(y=new Set(h),y.has(v)?y.delete(v):y.add(v)),o||g(y),s?.(y);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:m(xv({columns:t,gap:n,className:e})),...f,children:r.map(v=>{let y=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":y,onClick:()=>b(v.key),children:d(v,y)},v.key):jsxs("div",{role:"gridcell","aria-selected":y,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:m(yv({variant:l,size:c,isSelected:y,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&y&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}Rv.displayName="GridList";var wv=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"}}),Ks=(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)]},Cv=(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]},Tv=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},Mv=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Nv=q.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,...u},f)=>{let p=q.useRef(null),[g,h]=q.useState(false),b=q.useCallback(V=>{let K=Tv(V);return K?Cv(...K):[0,1,1]},[]),[v,y]=q.useState(()=>b(r||o)),x=e??v[0],w=t??v[1],C=n??v[2];q.useEffect(()=>{if(r){let V=b(r);y(V);}},[r,b]);let R=q.useCallback((V,K)=>{if(l||!p.current)return;let $=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-$.left)/$.width)),Y=Math.max(0,Math.min(1,(K-$.top)/$.height)),B=G,z=1-Y;t===void 0&&n===void 0&&y([x,B,z]),a?.({hue:x,saturation:B,brightness:z});let _=Ks(x,B,z);s?.(Mv(..._));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),R(V.clientX,V.clientY));},k=V=>{g&&R(V.clientX,V.clientY);},L=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[N,P,M]=Ks(x,1,1),S=`rgb(${N}, ${P}, ${M})`,H=w*100,D=(1-C)*100,[E,I,A]=Ks(x,w,C),O=`rgb(${E}, ${I}, ${A})`;return jsx("div",{ref:f,className:m(wv({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:S},onPointerDown:T,onPointerMove:k,onPointerUp:L,onPointerLeave:L,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${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)"}})]})})});Nv.displayName="ColorArea";var Pv=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"}}),PN=`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")`,kv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Ev=q.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,...u},f)=>{let p=q.useRef(null),[g,h]=q.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,y]=q.useState(t??b()),x=e??v,w=r==="hue"?x/360:x,C=q.useCallback((S,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),E=a!=="vertical",I;E?I=Math.max(0,Math.min(1,(S-D.left)/D.width)):I=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?I*360:I;e===void 0&&y(A),n?.(A);},[i,a,r,e,n]),R=S=>{i||(S.preventDefault(),h(true),S.target.setPointerCapture(S.pointerId),C(S.clientX,S.clientY));},T=S=>{g&&C(S.clientX,S.clientY);},k=S=>{h(false),S.target.releasePointerCapture(S.pointerId);},L=()=>{let S=a!=="vertical",H=S?"to right":"to top";switch(r){case "hue":return S?kv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return kv}},N=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,P=a!=="vertical",M=w*100;return jsx("div",{ref:f,className:m(Pv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?PN:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:R,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:L()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${M}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:N(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Ev.displayName="ColorSlider";var Sv=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"}}),LN=(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},Lv=q.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 u=q.useRef(null),[f,p]=q.useState(false),[g,h]=q.useState(t),b=e??g,v=q.useCallback((R,T)=>{if(o||!u.current)return;let k=u.current.getBoundingClientRect(),L=k.width/2,N=R-k.left,P=T-k.top,M=LN(N,P,L);e===void 0&&h(M),n?.(M);},[o,e,n]),y=R=>{o||(R.preventDefault(),p(true),R.target.setPointerCapture(R.pointerId),v(R.clientX,R.clientY));},x=R=>{f&&v(R.clientX,R.clientY);},w=R=>{p(false),R.target.releasePointerCapture(R.pointerId);},C=()=>{let R=[];for(let T=0;T<=360;T+=30)R.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${R.join(", ")})`};return jsx("div",{ref:d,className:m(Sv({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:y,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(DN,{hue:b,innerRadius:a,thumbSize:s})]})})});Lv.displayName="ColorWheel";var DN=({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 Iv=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"}}),vo=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"}}),Vv=q.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:u=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:y,...x},w)=>{let[C,R]=q.useState(false),[T,k]=q.useState(t),L=e!==void 0?e:T,N=q.useRef(null);q.useImperativeHandle(w,()=>N.current);let P=L.length>0,M=C&&(a.length>0||s.length>0||l.length>0||P),S=V=>{e===void 0&&k(V),n?.(V);},H=()=>{S(""),N.current?.focus();},D=V=>{V?.preventDefault(),L.trim()&&(r?.(L.trim()),R(false));},E=V=>{S(V.label),o?.(V),R(false);},I=V=>{S(V),r?.(V),R(false);},A=V=>{S(V),r?.(V),R(false);},O=q.useMemo(()=>{let V={};return a.forEach(K=>{let $=K.category||"Results";V[$]||(V[$]=[]),V[$].push(K);}),V},[a]);return jsxs(rt,{open:M,onOpenChange:R,children:[jsx(nn,{children:jsxs("form",{onSubmit:D,className:m(Iv({size:g,variant:h}),b),children:[u&&jsx(Search,{className:m(vo({size:g}),"ml-3")}),jsx("input",{ref:N,type:"text",value:L,onChange:V=>S(V.target.value),onFocus:()=>R(true),placeholder:v,disabled:y,className:m("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!u&&"pl-3"),...x}),d&&P&&!y&&jsx("button",{type:"button",onClick:H,className:m("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",vo({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(ot,{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&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((V,K)=>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:m(vo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:m(vo({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((V,K)=>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:m(vo({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(O).map(([V,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),K.map($=>jsxs("button",{type:"button",onClick:()=>E($),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[$.icon||jsx(Search,{className:m(vo({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:$.label}),$.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:$.description})]})]},$.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});Vv.displayName="SearchBar";var Av={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"})},Bv=q.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},u)=>{let[f,p]=q.useState(""),g=q.useRef(null),[h,b]=q.useState(false);q.useEffect(()=>{b(true);},[]),q.useEffect(()=>{e||p("");},[e]),q.useEffect(()=>{if(!e)return;let R=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[e,t]),q.useEffect(()=>{if(e)return Kt(),()=>$t()},[e]);let v=q.useMemo(()=>{let R={};return n.forEach(T=>{let k=T.category||"Results";R[k]||(R[k]=[]),R[k].push(T);}),R},[n]),y=R=>{R.onSelect?.(),c?.(R),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:Da.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:u,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(R=>jsxs(Command.Item,{value:R.label,onSelect:()=>y(R),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:R.icon||Av[R.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:R.label}),R.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:R.description})]}),R.shortcut&&jsx("div",{className:"flex items-center gap-1",children:R.shortcut.map((T,k)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},k))})]},R.id))]}),w&&Object.entries(v).map(([R,T])=>jsxs(Command.Group,{heading:R,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:R}),T.map(k=>jsxs(Command.Item,{value:`${k.label} ${k.keywords?.join(" ")||""}`,onSelect:()=>y(k),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:k.icon||Av[R]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:k.label}),k.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:k.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},k.id))]},R)),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)});Bv.displayName="SpotlightSearch";function _N(e="k"){let[t,n]=q.useState(false);return q.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 Fv=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"}}),JN={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Kv=q.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:u,className:f,...p},g)=>{let[h,b]=q.useState(true),[v,y]=q.useState(false);q.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&b(false);},[u]),q.useEffect(()=>{if(d&&h){let R=setTimeout(()=>{x();},d);return ()=>clearTimeout(R)}},[d,h]);let x=()=>{y(true),setTimeout(()=>{b(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!h)return null;let w=JN[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(Fv({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:m("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"})})]})});Kv.displayName="Banner";var ia=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"}}),nk=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"}}),Gl=q.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:u,className:f,onClick:p,disabled:g,...h},b)=>{let[v,y]=q.useState(false),x=o&&o.length>0,w=L=>{x&&y(!v),p?.(L);},C=L=>{L.onClick?.(),y(false);},R={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":"",k=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&ia({position:u})),children:[x&&v&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",R[a].container),children:o.map((L,N)=>jsxs("div",{className:m("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${N*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:L.label}),L.href?jsx("a",{href:L.href,className:m(ia({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.icon}):jsx("button",{type:"button",onClick:()=>C(L),className:m(ia({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.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:L.label})]},L.id))}),jsxs("button",{ref:b,type:"button",onClick:w,disabled:g,className:m(ia({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:m(nk({size:d}),T,k,"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:()=>y(false)})]})});Gl.displayName="FloatingActionButton";var rk=Gl;var _v=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"}}),Gv=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Wv=q.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,f]=q.useState(a||r[0]?.key),p=o!==void 0,g=p?o:u,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"}},y=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(_v({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,R=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:m(Gv({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:m(Gv({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:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(v(),"[&>svg]:h-full [&>svg]:w-full"),children:R}),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:m(y(),"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:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(w)),children:T},x.key):T})})});Wv.displayName="BottomNavigation";var ak="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",qv=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"}}),Xv=q.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:u},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),u?.(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:ak,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:m(qv({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})})})]})]})]})});Xv.displayName="ActionSheet";var Qv=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),jl=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"}}),Jv=q.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},u)=>{let f=q.useRef(null),[p,g]=q.useState(0),[h,b]=q.useState(false),v=q.useRef(0),y=q.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=N=>{i||(b(true),v.current=N.touches[0].clientX,y.current=p);},R=N=>{if(!h||i)return;let M=N.touches[0].clientX-v.current,S=y.current+M;(S>0&&n.length===0||S<0&&r.length===0)&&(S=0),S>x?S=x+(S-x)*.3:S<-w&&(S=-w+(S+w)*.3),g(S);},T=()=>{if(!h)return;b(false);let N=f.current?.offsetWidth||0,P=Math.abs(p)/N;if(l&&P>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},k=(N,P)=>{N.onAction?.(),s?.(P,N.key),g(0);},L=()=>{g(0);};return jsxs("div",{ref:u,className:m(Qv({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(N=>jsxs("button",{type:"button",onClick:()=>k(N,"right"),className:m(jl({variant:N.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[N.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:N.icon}),!N.icon&&N.label]},N.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(N=>jsxs("button",{type:"button",onClick:()=>k(N,"left"),className:m(jl({variant:N.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[N.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:N.icon}),!N.icon&&N.label]},N.key))}),jsx("div",{ref:f,className:m("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:R,onTouchEnd:T,onClick:p!==0?L:void 0,children:c})]})});Jv.displayName="SwipeActions";var th=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),lk=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"}}),nh=q.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:u="Refreshing...",children:f,...p},g)=>{let h=q.useRef(null),[b,v]=q.useState(0),[y,x]=q.useState("idle"),w=q.useRef(0),C=q.useRef(false),R=()=>l||y==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=M=>{R()&&(w.current=M.touches[0].clientY,C.current=true);},k=M=>{if(!C.current||!R())return;let H=M.touches[0].clientY-w.current;if(H<0){v(0),x("idle");return}let E=Math.min(H*.5,o);v(E),x(E>=r?"ready":"pulling");},L=async()=>{if(C.current)if(C.current=false,y==="ready"){x("refreshing"),v(r*.6);try{await n();}finally{x("idle"),v(0);}}else x("idle"),v(0);},N={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(y==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(N,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let M=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(N,"text-muted-foreground transition-transform"),style:{transform:`rotate(${M}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:y==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(th({variant:t,className:e})),...p,children:[jsx("div",{className:m(lk({size:i}),"z-10",y==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(r*.5),1)},children:P()}),jsx("div",{ref:h,className:m("transition-transform duration-200",y==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:T,onTouchMove:k,onTouchEnd:L,children:f})]})});nh.displayName="PullToRefresh";var Ar=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),ck={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},rh=q.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 u=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:ck,custom:i,transition:Ar(n,r,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});rh.displayName="Fade";var dk=(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]}}},oh=q.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},u)=>{let f=q.useMemo(()=>dk(i,l),[i,l]),p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ar(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});oh.displayName="Slide";var uk={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"},mk={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},ah=q.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},u)=>{let f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:mk,custom:i,transition:Ar(n,r,o),className:m(a),style:{transformOrigin:uk[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});ah.displayName="Scale";var sh=q.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},u)=>{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:u,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Ar(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});sh.displayName="Collapse";var ih=q.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},u)=>{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:u,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Ar(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});ih.displayName="Expand";var lh=q.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},u)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ar(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});lh.displayName="Rotate";var ch=q.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 u=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:m("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[u]:r?180:0},transition:Ar(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:`${u}(180deg)`},children:t})]})})});ch.displayName="Flip";var dh=q.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=q.useState([]),l=q.useRef(null),c=u=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=u.clientX-p.left,h=u.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(y=>[...y,v]);},d=u=>{i(f=>f.filter(p=>p.id!==u));};return jsxs("div",{ref:a,className:m("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(u=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(u.id),className:"pointer-events-none absolute rounded-full",style:{left:u.x-u.size/2,top:u.y-u.size/2,width:u.size,height:u.size,backgroundColor:e}},u.id))})]})});dh.displayName="Ripple";var uh=q.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=q.useState(false),d=s?l:t,u={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:u,initial:"idle",animate:d?"bounce":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});uh.displayName="Bounce";var gk={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=q.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=q.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:gk[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"shake":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});mh.displayName="Shake";var bk={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},ph=q.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:m(t&&bk[n],r),children:e}));ph.displayName="Pulse";var fh=q.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=q.useState(false),d=s?l:t,u={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:u,initial:"idle",animate:d?"wiggle":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});fh.displayName="Wiggle";var gh=q.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]=q.useState(false),d=t||l,u={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:u,className:m(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});gh.displayName="Pop";var wk=(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},bh=q.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:u},f)=>{let p=q.useRef(null),g=useInView(p,{once:true}),[h,b]=q.useState(!l);q.useEffect(()=>{if(l&&g){let x=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let v=useMotionValue(t),y=useTransform(v,x=>wk(x,r,s,i));return q.useEffect(()=>{if(h){let x=animate(v,e,{duration:n,ease:"easeOut",onComplete:u});return ()=>x.stop()}},[h,e,n,v,u]),jsx("span",{ref:p,className:m(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:y}),a]})})});bh.displayName="Counter";var vh=q.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:u},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=q.useState(""),[b,v]=q.useState(0),[y,x]=q.useState(false),[w,C]=q.useState(false),R=q.useRef(null),T=useInView(R,{once:true}),[k,L]=q.useState(!l);return q.useEffect(()=>{if(l&&T){let N=setTimeout(()=>L(true),n*1e3);return ()=>clearTimeout(N)}},[l,T,n]),q.useEffect(()=>{if(!k||w)return;let N=p[b],P;return y?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),v(M=>(M+1)%p.length)):g.length<N.length?P=setTimeout(()=>{h(N.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{x(true);},r):(C(true),u?.()),()=>clearTimeout(P)},[k,g,b,y,w,p,t,i,r,s,u]),jsxs("span",{ref:R,className:m(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:m("ml-0.5",d),children:a})]})});vh.displayName="Typewriter";var hh=q.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=q.useRef(null),d=useInView(c,{once:true,amount:.5}),u=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:m("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,y)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&y<p.length-1&&"\xA0"]},y))})})});hh.displayName="TextReveal";var xh=q.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=q.useState(0);q.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(u=>(u+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:m("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])})})});xh.displayName="WordRotate";var Ch=q.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:u=[.4,0,.2,1]},f)=>{let p=q.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:u}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});Ch.displayName="ScrollReveal";var Th=q.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}),u=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?u: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:m("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(Tk,{progress:f,position:e})]})});Th.displayName="ScrollProgress";var Tk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=q.useState(0);return q.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:m("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,"%"]})},Mh=q.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=q.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}),u=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:u,y:f},children:e})})});Mh.displayName="Parallax";var Ph=q.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 u={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:m("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(${u[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
|
|
55
|
+
`,document.body.appendChild(ue),Z.dataTransfer.setDragImage(ue,20,15),setTimeout(()=>{document.body.removeChild(ue);},0),h(e),C?.({event:Z,node:e});},pe=Z=>{if(Z.preventDefault(),Z.stopPropagation(),!g||g.key===e.key||q)return;let Le=Z.currentTarget.getBoundingClientRect(),ue=Z.clientY-Le.top,Ue=Le.height,je;ue<Ue*.25?je=-1:ue>Ue*.75?je=1:je=0,!(w&&!w({dropNode:e,dropPosition:je,dragNode:g}))&&(y(e.key,je),R?.({event:Z,node:e}));},wt=Z=>{Z.preventDefault(),Z.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:Z,node:e,expandedKeys:K()});},gt=Z=>{Z.stopPropagation(),k?.({event:Z,node:e});},bn=Z=>{Z.preventDefault(),Z.stopPropagation(),!(!g||g.key===e.key||q)&&(v!==null&&x(e,v),h(null),y(null,null));},Fe=Z=>{h(null),y(null,null),S?.({event:Z,node:e});},en=Z=>{q||ae&&i(e.key,e,Z);},Ct=Z=>{Z.stopPropagation(),!q&&!G&&a(e.key,e);},_=X.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]),oe=[...r,n];return jsxs("div",{className:"relative",children:[N&&t>0&&jsxs(Fragment,{children:[r.map((Z,Le)=>!Z&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Le} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Le)),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:Y,"aria-selected":ae?O:void 0,"aria-disabled":q,draggable:we,onDragStart:Be,onDragOver:pe,onDragEnter:wt,onDragLeave:gt,onDrop:bn,onDragEnd:Fe,onClick:en,className:m("relative",ug({size:V,isSelected:O,isDragging:U,isDisabled:q,isHoverable:ae&&!q}),_,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[we&&M&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:Ct,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",Y&&"rotate-90")})}),j&&jsx(Qw,{checked:F,indeterminate:W,disabled:q,onClick:Z=>u(e.key,e,Z)}),P&&ce&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:ce}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),$&&Y&&jsx("div",{role:"group",children:e.children.map((Z,Le)=>jsx(pg,{node:Z,level:t+1,isLast:Le===e.children.length-1,parentIsLastPath:oe},Z.key))})]})},Jw=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},eC=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},fg=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||fg(n,t))return true;return false},gg=X.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:u=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:y=[],onCheck:x,showLine:w=false,showIcon:C=false,showHandle:R=true,dragIcon:T,icon:k,leafIcon:S=jsx(File,{className:"h-4 w-4"}),folderIcon:N=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:M,onDragEnter:E,onDragOver:H,onDragLeave:D,onDragEnd:L,onDrop:I,blockNode:A=false,disabled:z=false,...V},K)=>{let $=X.useCallback(()=>l?new Set(Jw(r)):new Set(i),[l,i,r]),[G,Y]=X.useState($),O=s!==void 0,F=O?new Set(s):G,W=X.useCallback((he,We)=>{let Bt=new Set(F),Ae=!Bt.has(he);Ae?Bt.add(he):Bt.delete(he),O||Y(Bt),c?.(Array.from(Bt),{expanded:Ae,node:We});},[F,O,c]),[U,B]=X.useState(new Set(p)),q=f!==void 0,ae=q?new Set(f):U,j=X.useCallback((he,We,Bt)=>{let Ae=new Set(ae),vn=!Ae.has(he);u?vn?Ae.add(he):Ae.delete(he):(Ae.clear(),vn&&Ae.add(he)),q||B(Ae);let zr=[],ko=pa=>{for(let Or of pa)Ae.has(Or.key)&&zr.push(Or),Or.children&&ko(Or.children);};ko(r),g?.(Array.from(Ae),{selected:vn,selectedNodes:zr,node:We,event:Bt});},[ae,u,q,g,r]),[we,Q]=X.useState(new Set(y)),[ce,Be]=X.useState(new Set),pe=v!==void 0,wt=pe?new Set(Array.isArray(v)?v:v.checked):we,gt=pe&&!Array.isArray(v)?new Set(v.halfChecked):ce,bn=X.useCallback((he,We,Bt)=>{let Ae=new Set(wt),vn=new Set(gt),zr=!Ae.has(he);if(zr?(Ae.add(he),vn.delete(he)):Ae.delete(he),!b&&We.children){let ei=eC(We);for(let An of ei)zr?(Ae.add(An),vn.delete(An)):Ae.delete(An);}pe||(Q(Ae),Be(vn));let ko=[],pa=ei=>{for(let An of ei)Ae.has(An.key)&&ko.push(An),An.children&&pa(An.children);};pa(r);let Or=b?{checked:Array.from(Ae),halfChecked:Array.from(vn)}:Array.from(Ae);x?.(Or,{checked:zr,checkedNodes:ko,node:We,event:Bt,halfCheckedKeys:Array.from(vn)});},[wt,gt,b,pe,x,r]),[Fe,en]=X.useState(null),[Ct,_]=X.useState(null),[oe,Z]=X.useState(null),Le=X.useCallback((he,We)=>{_(he),Z(We);},[]),ue=X.useCallback((he,We)=>{!Fe||!I||We===0&&fg(Fe,he.key)||I({event:{},node:he,dragNode:Fe,dropPosition:We,dropToGap:We!==0});},[Fe,I]),Ue=X.useCallback(()=>Array.from(F),[F]),je={expandedKeys:F,toggleExpand:W,selectedKeys:ae,handleSelect:j,selectable:d,multiple:u,checkedKeys:wt,halfCheckedKeys:gt,handleCheck:bn,checkable:h,checkStrictly:b,draggable:o,draggedNode:Fe,setDraggedNode:en,dragOverKey:Ct,dragOverPosition:oe,setDragOver:Le,handleDrop:ue,allowDrop:a,onDragStart:M,onDragEnter:E,onDragOver:H,onDragLeave:D,onDragEnd:L,showLine:w,showIcon:C,showHandle:R,dragIcon:T,icon:k,leafIcon:S,folderIcon:N,folderOpenIcon:P,blockNode:A,disabled:z,size:n,data:r,getAllKeys:Ue},Vn=he=>{let We=he.relatedTarget,Bt=he.currentTarget;(!We||!Bt.contains(We))&&Le(null,null);};return jsx(mg.Provider,{value:je,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":u||h,className:m(dg({variant:t,size:n,className:e})),onDragLeave:Vn,...V,children:r.map((he,We)=>jsx(pg,{node:he,level:0,isLast:We===r.length-1},he.key))})})});gg.displayName="Tree";var vg=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}}),sC=({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))})},iC=(e,t)=>{let[n,r]=X.useState(e);return X.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},hg=X.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:u="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:y,...x},w)=>{let[C,R]=X.useState(false),[T,k]=X.useState(r),[S,N]=X.useState([]),[P,M]=X.useState(false),[E,H]=X.useState(false),[D,L]=X.useState(0),I=X.useRef(null),A=X.useRef(null),z=n!==void 0?n:T,V=iC(z,l);X.useEffect(()=>{let j=A.current;if(!j)return;let we=()=>{L(j.offsetWidth);};we();let Q=new ResizeObserver(we);return Q.observe(j),()=>{Q.disconnect();}},[]),X.useImperativeHandle(w,()=>I.current);let K=i?S:s,$=X.useMemo(()=>i?K:K.filter(j=>j.label.toLowerCase().includes(z.toLowerCase())),[K,z,i]);X.useEffect(()=>{if(!i)return;if(V.length<c){N([]);return}let j=false;return (async()=>{M(true);try{let Q=await i(V);j||N(Q);}catch{j||N([]);}finally{j||M(false);}})(),()=>{j=true;}},[V,i,c]);let G=j=>{n===void 0&&k(j),o?.(j);},Y=j=>{let we=j.target.value;G(we),we.length>=c&&R(true);},O=j=>{G(j.label),a?.(j),R(false);},F=()=>{G(""),I.current?.focus();},W=()=>{H(true),R(true);},U=()=>{H(false);},B=j=>{j.key==="Escape"&&R(false),j.key==="ArrowDown"&&!C&&$.length>0&&R(true);},q=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ae=p&&z?"pr-8":"pr-3";return jsxs(rt,{open:C,onOpenChange:R,children:[jsxs(tn,{ref:A,className:m("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:z,onChange:Y,onFocus:W,onBlur:U,onKeyDown:B,disabled:y,placeholder:d,className:m(vg({size:t,fullWidth:v}),ae,e),style:{borderColor:E?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&z&&!y&&jsx("button",{type:"button",onClick:F,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X$1,{className:q})})]}),jsx(ot,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:j=>j.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ne,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:m(q,"animate-spin")}),f]}):$.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):$.map(j=>jsxs(Command.Item,{value:j.value,disabled:j.disabled,onSelect:()=>O(j),className:m("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:m("mr-2 h-4 w-4 shrink-0",z===j.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(sC,{text:j.label,query:z}):j.label})]},j.value))})})})})]})});hg.displayName="Autocomplete";var Xi=X.createContext(null),qi=X.createContext(null),Zi=()=>{let e=X.useContext(Xi);if(!e)throw new Error("useFormContext must be used within a Form");return e},ss=()=>{let e=X.useContext(qi);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},lC={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})},xg=X.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=X.useState(e),[u,f]=X.useState({}),[p,g]=X.useState({}),[h,b]=X.useState({}),[v,y]=X.useState(false),x=X.useRef(new Map),w=X.useCallback((D,L)=>{x.current.set(D,L);},[]),C=X.useCallback(D=>{x.current.delete(D);},[]),R=X.useCallback(D=>{let L=x.current.get(D)||[],I=c[D];for(let A of L)if(!A.validate(I))return f(z=>({...z,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),T=X.useCallback(()=>{let D=true,L={};return x.current.forEach((I,A)=>{let z=c[A];for(let V of I)if(!V.validate(z)){L[A]=V.message,D=false;break}L[A]||(L[A]=null);}),f(L),D},[c]),k=X.useCallback((D,L)=>{d(I=>({...I,[D]:L})),b(I=>({...I,[D]:true})),o&&setTimeout(()=>{R(D);},0);},[o,R]),S=X.useCallback((D,L)=>{f(I=>({...I,[D]:L}));},[]),N=X.useCallback((D,L)=>{g(I=>({...I,[D]:L})),L&&r&&R(D);},[r,R]),P=X.useCallback(D=>({value:c[D],error:u[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,u,p,h]),M=X.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),E=async D=>{D.preventDefault();let L={};if(x.current.forEach((A,z)=>{L[z]=true;}),g(L),!T()){n?.(u);return}if(t){y(true);try{await t(c);}finally{y(false);}}},H={values:c,errors:u,touched:p,dirty:h,isSubmitting:v,setValue:k,setError:S,setTouched:N,validateField:R,validateAll:T,registerField:w,unregisterField:C,getFieldState:P,reset:M};return jsx(Xi.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:E,className:m("space-y-4",s),...i,children:a})})});xg.displayName="Form";var yg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=Zi(),a=X.useId();X.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(qi.Provider,{value:i,children:r})};yg.displayName="FormField";var Rg=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("space-y-1.5",e),...t}));Rg.displayName="FormItem";var wg=X.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=ss();return jsxs(fr,{ref:o,htmlFor:a,className:m(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});wg.displayName="FormLabel";var Cg=({children:e})=>{let{name:t,id:n,error:r,touched:o}=ss(),a=Zi(),s=a.getFieldState(t),i=c=>{let d=c.target,u=d.type==="checkbox"?d.checked:d.value;a.setValue(t,u);},l=()=>{a.setTouched(t,true);};return X.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})};Cg.displayName="FormControl";var Tg=X.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-xs text-muted-foreground",e),...t}));Tg.displayName="FormDescription";var Mg=X.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=ss(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:m("text-xs text-danger",e),role:"alert",...n,children:i}):null});Mg.displayName="FormMessage";var kg=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"}}),Pg=X.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:m(kg({size:t,className:e})),...i,children:[jsxs(gr,{"data-user-avatar":true,children:[o&&jsx(Ur,{src:o,alt:n}),jsx(br,{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})]})});Pg.displayName="User";var Sg=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"}}),Lg=X.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:m(Sg({variant:t,size:n,radius:r,className:e})),...o}));Lg.displayName="Code";function Vg(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 Ag=X.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=Vg(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:m("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,y)=>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:y+1}),v.map((x,w)=>jsx("span",{...b({token:x})},w))]},y))})}),!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"})})]})]})});Ag.displayName="CodeBlock";var zg=X.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=Vg(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],f=u.language||"bash";return jsxs("div",{ref:r,className:m("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:m("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:u.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((y,x)=>jsx("span",{...h({token:y})},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"})})]})]})});zg.displayName="TabbedCodeBlock";var Og=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"}}),Bg=X.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[u,f]=X.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:m(Og({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:m("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":u?"Copied":a,children:u?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});Bg.displayName="Snippet";var tl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),Fg=X.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,...u},f)=>{let[p,g]=X.useState("loading");X.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:m(tl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(tl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Ca,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:b,className:m("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...u})]})});Fg.displayName="Image";var $g=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"}}),Gg=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 RC({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,u]=X.useState(null),[f,p]=X.useState(null),g=(x,w)=>{i||(u(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){u(null),p(null);return}let C=[...r],[R]=C.splice(d,1);C.splice(w,0,R),o?.(C),u(null),p(null);},y=()=>{u(null),p(null);};return jsx("div",{ref:c,className:m($g({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:y,className:m(Gg({variant:t,size:n,isDragging:d===w,isDragOver:f===w}),!i&&"cursor-move"),children:[s&&jsx("div",{className:m("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 wC=X.forwardRef(RC);var Wg=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"}}),Ug={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},NC={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},jg={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},Yg=X.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in jg,l=i?jg[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(u=>jsx("div",{className:m(NC[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${u*.15}s`}},u))});case "pulse":return jsx("div",{className:m(Ug[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:m(Ug[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:m(Wg({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:m("text-sm",l),style:c,children:r})]})})});Yg.displayName="Loading";var EC=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),SC=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}}),LC=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"}}),DC=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"}}),fs={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},rl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},nl=(e,t)=>String(e).padStart(t,"0"),Xg=(e,t)=>{if(!e)return "";let n=nl(e.getDate(),2),r=nl(e.getMonth()+1,2),o=nl(e.getFullYear(),4),a=fs[t],s=rl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},us=(e,t)=>{let n=fs[t],r=e.split(n);if(r.length!==3)return null;let o=rl[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},HC=e=>{let t=fs[e];return rl[e].map(r=>r==="year"?"####":"##").join(t)},Wo=(e,t)=>{if(!e?.from)return "";let n=Xg(e.from,t),r=e.to?Xg(e.to,t):"";return n&&r?`${n} - ${r}`:n},qg=X.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="dd.MM.yyyy",showPickerIcon:v=true,mode:y="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:R,placeholder:T,id:k,...S},N)=>{let P=X.useId(),M=k||P,E=`${M}-description`,H=`${M}-error`,[D,L]=X.useState(f),[I,A]=X.useState(""),[z,V]=X.useState(false),[K,$]=X.useState(false),G=u!==void 0?u:D,Y=a&&r,O=HC(b),F=fs[b],W=" - ";X.useEffect(()=>{K||A(Wo(G,b));},[G,b,K]);let U=ce=>{u===void 0&&L(ce),p?.(ce);},B=ce=>{U(ce),A(Wo(ce,b)),ce?.from&&ce?.to&&V(false);},q=ce=>{let Be=ce.target.value;Be=Be.replace(new RegExp(`[^0-9\\${F}\\s-]`,"g"),"");let pe=`${O}${W}${O}`,wt=Be.replace(new RegExp(`[\\${F}\\s-]`,"g"),""),gt="",bn=0;for(let Fe=0;Fe<pe.length&&bn<wt.length;Fe++)pe[Fe]==="#"?(gt+=wt[bn],bn++):gt+=pe[Fe];if(A(gt),gt.length===pe.length){let Fe=gt.split(W);if(Fe.length===2){let en=us(Fe[0].trim(),b),Ct=us(Fe[1].trim(),b);if(en&&Ct){if(g&&(en<g||Ct<g)||h&&(en>h||Ct>h))return;en<=Ct&&U({from:en,to:Ct});}}}},ae=()=>{$(true);},j=()=>{$(false);let ce=`${O}${W}${O}`;if(I.length!==ce.length)A(Wo(G,b));else {let Be=I.split(W);if(Be.length!==2)A(Wo(G,b));else {let pe=us(Be[0].trim(),b),wt=us(Be[1].trim(),b);(!pe||!wt||pe>wt)&&A(Wo(G,b));}}},we=()=>{R||V(true);},Q=()=>{!R&&y==="picker"&&v&&V(true);};return jsxs("div",{className:m(EC({size:s}),e),children:[t&&jsxs("label",{htmlFor:M,className:m(DC({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(rt,{open:v&&z,onOpenChange:V,children:[jsxs(tn,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:N,id:M,type:"text",inputMode:y==="text"?"numeric":void 0,value:I,onChange:y==="text"?q:void 0,onClick:Q,onFocus:ae,onBlur:j,readOnly:y==="picker","aria-invalid":a,"aria-describedby":Y?H:n?E:void 0,"aria-required":o,disabled:R,placeholder:T||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:m(SC({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),y==="picker"&&v&&"cursor-pointer",l),style:{borderColor:K||v&&z?"var(--color-foreground)":void 0},...S}),v&&jsx("button",{type:"button",onClick:we,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(LC({size:s}))})})]}),v&&jsx(ot,{className:"w-auto p-0",align:C,children:jsx(_r,{mode:"range",selected:G,onSelect:B,numberOfMonths:w,disabled:ce=>!!(g&&ce<g||h&&ce>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!Y&&jsx("p",{id:E,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),Y&&jsx("p",{id:H,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});qg.displayName="DateRangePicker";var to=e=>String(e).padStart(2,"0"),Zg=X.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]=X.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),u=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${to(x.hours)}:${to(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${to(w)}:${to(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let R=e.hours>=12;R&&x!==12?C=x+12:!R&&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,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(rt,{open:l,onOpenChange:c,children:[jsxs($n,{ref:i,disabled:a,className:m("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(ot,{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(Ne,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(se,{variant:y===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:to(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(Ne,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:u.map(x=>jsx(se,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:to(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(se,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(se,{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(se,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(se,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Zg.displayName="TimePicker";var Qg=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function AC({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},u){let f=X.useRef(null),[p,g]=X.useState(0);X.useImperativeHandle(u,()=>f.current);let h=n.length*(r+l)-l,b=r+l,v=Math.max(0,Math.floor(p/b)-a),y=Math.ceil(o/b)+2*a,x=Math.min(n.length-1,v+y),w=R=>{let T=R.currentTarget.scrollTop;g(T),c?.(T);},C=X.useMemo(()=>{let R=[];for(let T=v;T<=x;T++)n[T]!==void 0&&R.push({item:n[T],index:T,style:{position:"absolute",top:T*b,left:0,right:0,height:r}});return R},[n,v,x,b,r]);return jsx("div",{ref:f,className:m(Qg({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:R,index:T,style:k})=>jsx("div",{style:k,children:s(R,T)},i?i(R,T):T))})})}var zC=X.forwardRef(AC);var al=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),sl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),eb=X.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:u,scrollbarVisibility:f="visible",...p},g)=>{let h=X.useRef(null),b=X.useRef(null),v=X.useRef(false);X.useImperativeHandle(g,()=>h.current),X.useEffect(()=>{let w=b.current;if(!w)return;let C=new IntersectionObserver(R=>{let[T]=R;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 y=jsx("div",{className:m(sl({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||y),!a&&!s&&u&&jsx("div",{className:m(sl({size:n}),"text-muted-foreground text-sm"),children:u})]});return d?jsx("div",{ref:h,className:m(al({variant:t,className:e})),...p,children:x}):jsx(Ne,{ref:h,visibility:f,className:m(al({variant:t,className:e})),...p,children:x})});eb.displayName="InfiniteScroll";var qC=e=>e.map(t=>typeof t=="string"?{src:t}:t),il=X.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:u=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=X.useMemo(()=>qC(e),[e]),[v,y]=X.useState(r),[x,w]=X.useState(1),[C,R]=X.useState(0),[T,k]=X.useState(false),[S,N]=X.useState(false),[P,M]=X.useState({x:0,y:0}),[E,H]=X.useState({x:0,y:0}),[D,L]=X.useState(false),I=X.useRef(null),A=b[v];X.useEffect(()=>{L(true);},[]),X.useEffect(()=>{y(r);},[r]),X.useEffect(()=>{o?.(v);},[v,o]),X.useEffect(()=>{w(1),R(0),M({x:0,y:0});},[v]),X.useEffect(()=>{if(t)return Kt(),()=>$t()},[t]);let z=X.useCallback(()=>{y(Q=>Q>0?Q-1:b.length-1);},[b.length]),V=X.useCallback(()=>{y(Q=>Q<b.length-1?Q+1:0);},[b.length]),K=()=>{w(Q=>Math.min(Q+.5,4));},$=()=>{w(Q=>{let ce=Math.max(Q-.5,.5);return ce===1&&M({x:0,y:0}),ce});},G=()=>{R(Q=>(Q+90)%360);},Y=async()=>{if(A)try{let ce=await(await fetch(A.src)).blob(),Be=URL.createObjectURL(ce),pe=document.createElement("a");pe.href=Be,pe.download=A.alt||`image-${v+1}`,document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(Be);}catch{window.open(A.src,"_blank");}},O=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),k(!1);}catch{}else try{await I.current.requestFullscreen(),k(!0);}catch{}},F=Q=>{x>1&&(N(true),H({x:Q.clientX-P.x,y:Q.clientY-P.y}));},W=Q=>{S&&x>1&&M({x:Q.clientX-E.x,y:Q.clientY-E.y});},U=()=>{N(false);},B=()=>{n?.(false);},q=Q=>{p&&Q.target===Q.currentTarget&&B();},ae=X.useCallback(Q=>{switch(Q.key){case "ArrowLeft":z();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":K();break;case "-":$();break}},[z,V,n]);if(X.useEffect(()=>{if(t)return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[t,ae]),X.useEffect(()=>{let Q=()=>{k(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),b.length===0)return null;let j=a?X.isValidElement(a)?X.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[j,!D||!t?null:Ea.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:m("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:$,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:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick: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:Y,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:O,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$1,{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:F,onMouseMove:W,onMouseUp:U,onMouseLeave:U,children:[u&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:z,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:m("max-h-full max-w-full object-contain transition-transform duration-200",S?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.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,ce)=>jsx("button",{onClick:()=>y(ce),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===ce?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${ce+1}`,className:"h-full w-full object-cover"})},ce))})]})]}),document.body)]})});il.displayName="ImageViewer";var nb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=X.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:m("cursor-zoom-in",r),children:e}),jsx(il,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};nb.displayName="ImageViewerTrigger";var rb=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"}}),QC={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"},JC={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"},eT=e=>{let t=e.toLowerCase();return QC[t]||e.toUpperCase()},Xo=e=>{let t=e.toLowerCase();return JC[t]||t},bs=e=>{let t=Xo(e);return ["meta","control","alt","shift"].includes(t)},ob=X.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{X.useEffect(()=>{if(!a||!r||s)return;let u=Array.isArray(r)?r:[r],f=u.filter(bs).map(Xo),p=u.filter(h=>!bs(h)).map(Xo),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,y=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());b&&v&&y&&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(X.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:eT(f)})]},p)):o;return jsx("kbd",{ref:c,className:m(rb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});ob.displayName="Kbd";function tT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;X.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(bs).map(Xo),i=a.filter(c=>!bs(c)).map(Xo),l=c=>{let d=s.includes("meta")===c.metaKey,u=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&&u&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var ab=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"}}),sb=X.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=X.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),u(!0),o?.(),setTimeout(()=>{u(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:m(ab({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}})})});sb.displayName="CopyButton";var lb=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"}}),cT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],dT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],uT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function mT(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 pT(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 oo(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ro(e){return oo(e,new Date)}function ib(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return oo(r,t)||oo(o,t)||r<t&&o>t})}var cb=X.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=cT,date:l,onDateChange:c,onEventClick:d,onSlotClick:u,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[b,v]=X.useState(new Date),y=l??b,x=M=>{c?c(M):v(M);},w=f===1?uT:dT,C=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()-1):a==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),x(M);},R=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()+1):a==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),x(M);},T=()=>{x(new Date);},k=()=>a==="day"?y.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):y.toLocaleDateString(p,{year:"numeric",month:"long"}),S=()=>{let M=mT(y.getFullYear(),y.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(E=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:E},E))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((E,H)=>{let D=ib(o,E),L=E.getMonth()===y.getMonth(),I=oo(E,y);return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!L&&"bg-muted/30",I&&"bg-accent"),onClick:()=>u?.(E),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",ro(E)&&"bg-primary text-primary-foreground",!L&&"text-muted-foreground"),children:E.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.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:z=>{z.stopPropagation(),d?.(A);},children:A.title},A.id)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},H)})})]})},N=()=>{let M=pT(y,f),E=Array.from({length:24},(H,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((H,D)=>{let L=oo(H,y);return jsxs("div",{className:m("p-2 text-center border-l cursor-pointer hover:bg-accent/50",ro(H)&&"bg-primary/10",L&&!ro(H)&&"bg-accent"),onClick:()=>u?.(H),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[D]}),jsx("div",{className:m("text-lg font-semibold",ro(H)&&"text-primary",L&&!ro(H)&&"text-primary"),children:H.getDate()})]},D)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:E.map(H=>jsxs(X.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),M.map((D,L)=>{let I=new Date(D);I.setHours(H,0,0,0);let A=o.filter(z=>{let V=new Date(z.start);return oo(V,D)&&V.getHours()===H});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(I),children:A.map(z=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:z.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),d?.(z);},children:z.title},z.id))},L)})]},H))})})]})},P=()=>{let M=Array.from({length:24},(H,D)=>D),E=ib(o,y);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:m("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",ro(y)&&"bg-primary text-primary-foreground"),children:y.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(H=>{let D=new Date(y);D.setHours(H,0,0,0);let L=E.filter(I=>new Date(I.start).getHours()===H);return jsxs(X.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(D),children:L.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))})]},H)})})})]})};return jsxs("div",{ref:h,className:m(lb({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:k()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(se,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx(Na,{options:i,value:a,onValueChange:M=>s?.(M),size:"sm",radius:"md",className:"w-[120px]"}),jsx(se,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(se,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&S(),a==="week"&&N(),a==="day"&&P()]})});cb.displayName="FullCalendar";var Rs=({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))})]}),Zo=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),Qo=["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%))"],db=X.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=Qo,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(Zo({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(Rs,{})}),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))]})})}));db.displayName="LineChart";var ub=X.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=Qo,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},f)=>jsx("div",{ref:f,className:m(Zo({size:t,className:e})),...u,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(Rs,{})}),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))]})})}));ub.displayName="BarChart";var mb=X.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=Qo,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},f)=>jsx("div",{ref:f,className:m(Zo({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Rs,{})}),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}`))})]})})}));mb.displayName="PieChart";var pb=X.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=Qo,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},f)=>jsx("div",{ref:f,className:m(Zo({size:t,className:e})),...u,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(Rs,{})}),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))]})})}));pb.displayName="AreaChart";var pl={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function AT({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}}),u={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:u,className:m("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",pl[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 gb({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:m("flex flex-col min-w-[280px] w-[280px]",pl[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(Ne,{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(AT,{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(se,{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 vb=X.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},u)=>{let[f,p]=X.useState(false),[g,h]=X.useState(null),[b,v]=X.useState(null);X.useEffect(()=>{p(true);},[]);let y=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(gb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(k=>k.cards.some(S=>S.id===T));return jsxs(DndContext,{sensors:y,collisionDetection:closestCorners,onDragStart:T=>{let{active:k}=T,S=x(k.id);if(S){let N=S.cards.find(P=>P.id===k.id);N&&(h(N),v(S.id));}},onDragOver:T=>{let{active:k,over:S}=T;if(!S)return;let N=k.id,P=S.id,M=x(N),E=x(P)||t.find(L=>L.id===P);if(!M||!E||M.id===E.id)return;let H=E.cards.findIndex(L=>L.id===P),D=H===-1?E.cards.length:H;n?.(N,M.id,E.id,D);},onDragEnd:T=>{let{active:k,over:S}=T;if(S&&k.id!==S.id){let N=x(k.id),P=x(S.id)||t.find(M=>M.id===S.id);if(N&&P){let M=P.cards.findIndex(H=>H.id===S.id),E=M===-1?P.cards.length:M;n?.(k.id,N.id,P.id,E);}}h(null),v(null);},children:[jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(gb,{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:m("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",pl[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})]})]})})})]})});vb.displayName="KanbanBoard";var hb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),xb=X.createContext(null);function Cs(){let e=X.useContext(xb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var yb=X.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[u,f]=zT({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=X.useState(false),[h,b]=X.useState(false),[v,y]=X.useState(0),[x,w]=X.useState([]),C=X.useCallback(N=>{N&&(y(N.selectedScrollSnap()),g(N.canScrollPrev()),b(N.canScrollNext()));},[]),R=X.useCallback(()=>{f?.scrollPrev();},[f]),T=X.useCallback(()=>{f?.scrollNext();},[f]),k=X.useCallback(N=>{f?.scrollTo(N);},[f]),S=X.useCallback(N=>{N.key==="ArrowLeft"?(N.preventDefault(),R()):N.key==="ArrowRight"&&(N.preventDefault(),T());},[R,T]);return X.useEffect(()=>{!f||!l||l(f);},[f,l]),X.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(xb.Provider,{value:{carouselRef:u,api:f,scrollPrev:R,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:x,scrollTo:k,orientation:a},children:jsxs("div",{ref:d,className:m(hb({variant:t,className:e})),onKeyDownCapture:S,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:u,className:"overflow-hidden",children:jsx("div",{className:m("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(fl,{}),jsx(gl,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((N,P)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>k(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});yb.displayName="Carousel";var Rb=X.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex",e),...t}));Rb.displayName="CarouselContent";var wb=X.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=Cs();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});wb.displayName="CarouselItem";var fl=X.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=Cs();return jsxs(se,{ref:a,variant:t,size:n,isIconOnly:r,className:m("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"})]})});fl.displayName="CarouselPrevious";var gl=X.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=Cs();return jsxs(se,{ref:a,variant:t,size:n,isIconOnly:r,className:m("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"})]})});gl.displayName="CarouselNext";var Cb=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"}}),Ts={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"}},vl={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}"]},Tb=X.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=X.useState(r.length>0?"recent":o),[u,f]=X.useState(""),g=u?Object.values(vl).flat().filter(b=>b.toLowerCase().includes(u.toLowerCase())):c==="recent"?r:vl[c]||[],h=b=>{n?.(b);};return jsxs("div",{ref:l,className:m(Cb({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(ha,{placeholder:"Search emojis...",value:u,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(Ne,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Ts).map(([b,{icon:v}])=>b==="recent"&&r.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Ts[b].name,children:v},b))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Ts[c].name}),jsx(Ne,{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"})]})})]})});Tb.displayName="EmojiPicker";var Mb=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"}}),gM=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"}}),bM=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"}}),Ye=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Bn,{children:[jsx(Fn,{children:jsx(se,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Kn,{side:"top",className:"text-xs",children:t})]}),Nb=X.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,...u},f)=>{let p=useEditor({extensions:[_T.configure({heading:{levels:[1,2,3]}}),WT.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),YT,XT.configure({types:["heading","paragraph"]}),qT.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});X.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),X.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(On,{children:jsxs("div",{ref:f,className:m(Mb({variant:t,size:n,className:e})),...u,children:[i&&!s&&jsxs("div",{className:m(gM({size:n})),children:[jsx(Ye,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(Ye,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{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(Ye,{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(Ye,{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(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(Ye,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(Ye,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(Ye,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(Ye,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(Ye,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(Ye,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(Ye,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(zn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Ye,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(Ye,{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:m(bM({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});Nb.displayName="RichTextEditor";var Pb=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 TM(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function kb(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,u=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(u),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 Eb=X.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:u,...f},p)=>{let g=X.useRef(null),[h,b]=X.useState(),[v,y]=X.useState(),[x,w]=X.useState(1),[C,R]=X.useState(0),T=P=>{let{width:M,height:E}=P.currentTarget;if(r){let H=TM(M,E,r);b(H);}else b(u||{unit:"%",x:10,y:10,width:80,height:80});},k=P=>{b(P),o?.(P);},S=async P=>{if(y(P),a&&g.current&&P.width&&P.height){let M=await kb(g.current,P,C,x);a(M);}},N=()=>{R(P=>(P+90)%360);};return X.useEffect(()=>{v&&g.current&&a&&kb(g.current,v,C,x).then(P=>{a(P);});},[x,C,v,a]),jsxs("div",{ref:p,className:m(Pb({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(vM,{crop:h,onChange:k,onComplete:S,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(Ia,{value:[x],onValueChange:([P])=>w(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(se,{variant:"bordered",size:"sm",isIconOnly:true,onClick:N,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Eb.displayName="ImageCropper";var Rl=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"}}),kM={sm:96,md:128,lg:192},Lb=X.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:u=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??kM[n??"md"];return r?jsx("div",{ref:h,className:m(Rl({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(MM,{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:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:m(Rl({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"})})});Lb.displayName="QRCode";var Db=({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});Db.displayName="ThemeProvider";var IM=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Hb=X.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=X.useState(false);X.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],p=(u.indexOf(a||"system")+1)%u.length;s(u[p]);};return l?r==="cycle"?jsxs(se,{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(xn,{children:[jsx(yn,{children:jsxs(se,{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(Rn,{align:"end",children:[jsxs(Ft,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Ft,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Ft,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(se,{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"})]})});Hb.displayName="ThemeToggle";var Ib=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Vb=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}}),Ab=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"}}),zb=X.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:u,endContent:f,id:p,...g},h)=>{let b=X.useId(),v=p||b,y=`${v}-description`,x=`${v}-error`,w=a&&r;return jsxs("div",{className:m(Ib({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:m(Ab({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":w?x:n?y:void 0,"aria-required":o,className:m(Vb({size:s,isInvalid:a}),u&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!w&&jsx("p",{id:y,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});zb.displayName="TextField";var Bb=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),zM=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}}),Ob=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"}}),OM=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"}}),BM=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"}}),Fb=X.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:y,placeholder:x="Search...",id:w,...C},R)=>{let T=X.useId(),k=w||T,S=`${k}-description`,N=`${k}-error`,[P,M]=X.useState(f),E=u!==void 0?u:P,H=a&&r,D=E.length>0,L=z=>{let V=z.target.value;u===void 0&&M(V),p?.(V);},I=()=>{u===void 0&&M(""),p?.(""),g?.();},A=z=>{z.key==="Enter"?(z.preventDefault(),h?.(E)):z.key==="Escape"&&D&&(z.preventDefault(),I());};return jsxs("div",{className:m(Bb({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(OM({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:m(Ob({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:R,id:k,type:"search",value:E,onChange:L,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?N:n?S:void 0,"aria-required":o,disabled:y,className:m(zM({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&D&&!y&&jsx("button",{type:"button",onClick:I,className:m(BM({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X$1,{className:m(Ob({size:s}))})})]}),n&&!H&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:N,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Fb.displayName="SearchField";var Kb=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),KM=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}}),$M=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"}}),GM=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":"."},Pl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Nl=(e,t)=>String(e).padStart(t,"0"),na=(e,t)=>{if(!e)return "";let n=Nl(e.getDate(),2),r=Nl(e.getMonth()+1,2),o=Nl(e.getFullYear(),4),a=Es[t],s=Pl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},kl=(e,t)=>{let n=Es[t],r=e.split(n);if(r.length!==3)return null;let o=Pl[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},UM=e=>{let t=Es[e];return Pl[e].map(r=>r==="year"?"####":"##").join(t)},Ss=X.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="dd.MM.yyyy",showPickerIcon:v=true,mode:y="text",fullWidth:x=false,disabled:w,placeholder:C,id:R,...T},k)=>{let S=X.useId(),N=R||S,P=`${N}-description`,M=`${N}-error`,[E,H]=X.useState(f??null),[D,L]=X.useState(""),[I,A]=X.useState(false),[z,V]=X.useState(false),K=u!==void 0?u:E,$=a&&r,G=Es[b],Y=UM(b);X.useEffect(()=>{z||L(na(K,b));},[K,b,z]);let O=j=>{u===void 0&&H(j),p?.(j);},F=j=>{let we=j??null;O(we),L(na(we,b)),A(false);},W=j=>{let we=j.target.value;we=we.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=we.replace(new RegExp(`\\${G}`,"g"),""),ce="",Be=0;for(let pe=0;pe<Y.length&&Be<Q.length;pe++)Y[pe]==="#"?(ce+=Q[Be],Be++):ce+=Y[pe];if(L(ce),ce.length===Y.length){let pe=kl(ce,b);if(pe){if(g&&pe<g||h&&pe>h)return;O(pe);}}},U=()=>{V(true);},B=()=>{V(false),D.length!==Y.length?L(na(K,b)):kl(D,b)||L(na(K,b));},q=()=>{w||A(true);},ae=()=>{!w&&y==="picker"&&v&&A(true);};return jsxs("div",{className:m(Kb({size:s}),e),children:[t&&jsxs("label",{htmlFor:N,className:m(GM({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(rt,{open:v&&I,onOpenChange:A,children:[jsxs(tn,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:N,type:"text",inputMode:y==="text"?"numeric":void 0,value:D,onChange:y==="text"?W:void 0,onClick:ae,onFocus:U,onBlur:B,readOnly:y==="picker","aria-invalid":a,"aria-describedby":$?M:n?P:void 0,"aria-required":o,disabled:w,placeholder:C||b.toLowerCase(),className:m(KM({size:s,isInvalid:a,fullWidth:x,showPickerIcon:v}),y==="picker"&&v&&"cursor-pointer",l),style:{borderColor:z||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:m($M({size:s}))})})]}),v&&jsx(ot,{className:"w-auto p-0",align:"start",children:jsx(_r,{mode:"single",selected:K??void 0,onSelect:F,disabled:j=>!!(g&&j<g||h&&j>h),defaultMonth:K??void 0,showMonthAndYearPickers:true})})]}),n&&!$&&jsx("p",{id:P,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),$&&jsx("p",{id:M,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Ss.displayName="DatePicker";var jM=Ss,_M=Ss;var $b=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),WM=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}}),YM=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"}}),Gb=X.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:y,fullWidth:x=false,id:w,...C},R)=>{let T=X.useId(),k=w||T,S=`${k}-description`,N=`${k}-error`,P=X.useRef(null),M=X.useRef(null),E=X.useRef(null),H=X.useRef(null),[D,L]=X.useState(f??null),I=u!==void 0?u:D,A=a&&r,z=_=>v===24?_:_===0?12:_>12?_-12:_,V=_=>_>=12?"PM":"AM",K=(_,oe)=>oe==="AM"?_===12?0:_:_===12?12:_+12,[$,G]=X.useState(I?String(z(I.hour)).padStart(2,"0"):""),[Y,O]=X.useState(I?String(I.minute).padStart(2,"0"):""),[F,W]=X.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[U,B]=X.useState(I?V(I.hour):"AM"),[q,ae]=X.useState(false);X.useEffect(()=>{u!==void 0&&(u?(G(String(z(u.hour)).padStart(2,"0")),O(String(u.minute).padStart(2,"0")),u.second!==void 0&&W(String(u.second).padStart(2,"0")),B(V(u.hour))):(G(""),O(""),W("")));},[u,v]);let j=(_,oe,Z,Le)=>{let ue=parseInt(_,10),Ue=parseInt(oe,10),je=b?parseInt(Z,10):void 0;if(isNaN(ue)||isNaN(Ue)||b&&isNaN(je)){u===void 0&&L(null),p?.(null);return}let he={hour:v===12?K(ue,Le):ue,minute:Ue,...b&&je!==void 0&&{second:je}};u===void 0&&L(he),p?.(he);},we=_=>{let oe=_.target.value.replace(/\D/g,"").slice(0,2);G(oe);let Z=v===24?23:12,Le=v===24?0:1;if(oe.length===2){let ue=parseInt(oe,10);ue>=Le&&ue<=Z&&(M.current?.focus(),M.current?.select());}},Q=_=>{let oe=_.target.value.replace(/\D/g,"").slice(0,2);if(O(oe),oe.length===2){let Z=parseInt(oe,10);Z>=0&&Z<=59&&(b?(E.current?.focus(),E.current?.select()):v===12&&H.current?.focus());}},ce=_=>{let oe=_.target.value.replace(/\D/g,"").slice(0,2);W(oe),oe.length===2&&v===12&&H.current?.focus();},Be=()=>{if($){let _=parseInt($,10),oe=v===24?23:12,Le=Math.min(Math.max(_,v===24?0:1),oe),ue=String(Le).padStart(2,"0");G(ue),j(ue,Y,F,U);}},pe=()=>{if(Y){let _=parseInt(Y,10),oe=Math.min(Math.max(_,0),59),Z=String(oe).padStart(2,"0");O(Z),j($,Z,F,U);}},wt=()=>{if(F){let _=parseInt(F,10),oe=Math.min(Math.max(_,0),59),Z=String(oe).padStart(2,"0");W(Z),j($,Y,Z,U);}},gt=()=>{let _=U==="AM"?"PM":"AM";B(_),j($,Y,F,_);},bn=_=>{let oe=_.key.toLowerCase();oe==="a"?(_.preventDefault(),U!=="AM"&&(B("AM"),j($,Y,F,"AM"))):oe==="p"?(_.preventDefault(),U!=="PM"&&(B("PM"),j($,Y,F,"PM"))):oe==="arrowup"||oe==="arrowdown"?(_.preventDefault(),gt()):oe==="arrowleft"&&(_.preventDefault(),b?(E.current?.focus(),E.current?.select()):(M.current?.focus(),M.current?.select()));},Fe=(_,oe)=>{if(_.key==="ArrowUp"||_.key==="ArrowDown"){_.preventDefault();let Z=_.key==="ArrowUp"?1:-1;if(oe==="hour"){let Le=parseInt($,10)||0,ue=v===24?23:12,Ue=v===24?0:1,je=Le+Z;je>ue&&(je=Ue),je<Ue&&(je=ue);let Vn=String(je).padStart(2,"0");G(Vn),j(Vn,Y,F,U);}else if(oe==="minute"){let ue=(parseInt(Y,10)||0)+Z;ue>59&&(ue=0),ue<0&&(ue=59);let Ue=String(ue).padStart(2,"0");O(Ue),j($,Ue,F,U);}else if(oe==="second"){let ue=(parseInt(F,10)||0)+Z;ue>59&&(ue=0),ue<0&&(ue=59);let Ue=String(ue).padStart(2,"0");W(Ue),j($,Y,Ue,U);}}_.key==="ArrowRight"&&(_.preventDefault(),oe==="hour"?(M.current?.focus(),M.current?.select()):oe==="minute"&&b?(E.current?.focus(),E.current?.select()):(oe==="minute"&&!b&&v===12||oe==="second"&&v===12)&&H.current?.focus()),_.key==="ArrowLeft"&&(_.preventDefault(),oe==="minute"?(P.current?.focus(),P.current?.select()):oe==="second"&&(M.current?.focus(),M.current?.select())),_.key==="Backspace"&&_.currentTarget.value===""&&(oe==="minute"?P.current?.focus():oe==="second"&&M.current?.focus());},Ct=m((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",y&&"cursor-not-allowed");return jsxs("div",{ref:R,className:m($b({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:k,className:m(YM({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:m(WM({size:s,isInvalid:a,disabled:y,fullWidth:x}),l),style:{borderColor:q?"var(--color-foreground)":void 0},onFocus:()=>ae(true),onBlur:_=>{_.currentTarget.contains(_.relatedTarget)||ae(false);},children:[jsx("input",{ref:P,id:k,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:$,onChange:we,onBlur:Be,onKeyDown:_=>Fe(_,"hour"),onFocus:_=>_.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?N:n?S:void 0,"aria-required":o,disabled:y,className:Ct}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"mm",value:Y,onChange:Q,onBlur:pe,onKeyDown:_=>Fe(_,"minute"),onFocus:_=>_.target.select(),"aria-label":"Minute",disabled:y,className:Ct}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:E,type:"text",inputMode:"numeric",placeholder:"ss",value:F,onChange:ce,onBlur:wt,onKeyDown:_=>Fe(_,"second"),onFocus:_=>_.target.select(),"aria-label":"Second",disabled:y,className:Ct})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:gt,onKeyDown:bn,disabled:y,className:m("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",y&&"cursor-not-allowed"),"aria-label":"AM/PM",children:U})]}),n&&!A&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:N,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Gb.displayName="TimeField";var jb=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"}}),_b=X.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...u},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],y=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>y(w.key,w.onPress),className:m("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:m(jb({variant:t,orientation:n,size:r,density:o,className:e})),...u,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(xn,{children:[jsx(yn,{"aria-label":"More actions",className:m("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(Rn,{align:"end",children:g.map(w=>jsxs(Ft,{disabled:w.isDisabled,onClick:()=>y(w.key,w.onPress),children:[w.icon&&jsx("span",{className:m(v,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});_b.displayName="ActionGroup";var qb=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"}}),QM=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}}),Zb=X.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:m(qb({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:m(QM({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));Zb.displayName="StatusLight";var Qb=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"}}),Jb=X.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 u=()=>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:m(Qb({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:u()}),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(Mt,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});Jb.displayName="ActionBar";var ev=X.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:m("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]}));ev.displayName="ActionBarButton";var tv=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"}}),nN=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"}}),rN=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"}}),nv=X.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:u=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,y]=X.useState(o),x=r!==void 0,w=x?r:v,C=X.useRef(null),[R,T]=X.useState(false),[k,S]=X.useState(null),N=(V,K)=>{if(!C.current)return w[0];let $=C.current.getBoundingClientRect(),G;t==="horizontal"?G=(V-$.left)/$.width:G=1-(K-$.top)/$.height,G=Math.max(0,Math.min(1,G));let Y=i+G*(l-i),O=Math.round(Y/c)*c;return Math.max(i,Math.min(l,O))},P=(V,K)=>{let $=[...w];$[K]=V,K===0&&V>w[1]&&($[0]=w[1]),K===1&&V<w[0]&&($[1]=w[0]),x||y($),a?.($);},M=(V,K)=>{d||(V.preventDefault(),T(true),S(K),V.target.setPointerCapture(V.pointerId));},E=V=>{if(!R||k===null||d)return;let K=N(V.clientX,V.clientY);P(K,k);},H=()=>{R&&(T(false),S(null),s?.(w));},D=V=>{if(d)return;let K=N(V.clientX,V.clientY),$=Math.abs(w[0]-K),G=Math.abs(w[1]-K),Y=$<=G?0:1;P(K,Y);let O=[...w];O[Y]=K,s?.(O);},L=(V,K)=>{if(d)return;let $=w[K];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),$=Math.min(l,w[K]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),$=Math.max(i,w[K]-c);break;case "Home":V.preventDefault(),$=i;break;case "End":V.preventDefault(),$=l;break;default:return}P($,K);let G=[...w];G[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],z={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[u&&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:m(tv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:m(nN({orientation:t,size:n})),onClick:D,children:jsx("div",{className:m("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,K)=>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:m(rN({size:n}),R&&k===K&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${I(V)}% - ${z/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${I(V)}% - ${z/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:$=>M($,K),onPointerMove:E,onPointerUp:H,onPointerCancel:H,onKeyDown:$=>L($,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});nv.displayName="RangeSlider";var Il=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"}}),lN=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"}}),cN={help:HelpCircle,info:Info,warning:AlertCircle},av=X.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:u,contentClassName:f},p)=>{let[g,h]=X.useState(false),[b,v]=X.useState(false),[y,x]=X.useState({top:0,left:0}),w=X.useRef(null),C=X.useRef(null),R=i!==void 0?i:g,T=X.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);X.useEffect(()=>{v(true);},[]),X.useEffect(()=>{if(!R||!w.current)return;let P=()=>{let M=w.current.getBoundingClientRect(),E=C.current?.getBoundingClientRect(),H=E?.width||288,D=E?.height||100,L=8,I=0,A=0;switch(a){case "top":I=M.top-D-L,A=M.left+M.width/2-H/2;break;case "bottom":I=M.bottom+L,A=M.left+M.width/2-H/2;break;case "left":I=M.top+M.height/2-D/2,A=M.left-H-L;break;case "right":I=M.top+M.height/2-D/2,A=M.right+L;break}if(a==="top"||a==="bottom")switch(s){case "start":A=M.left;break;case "center":A=M.left+M.width/2-H/2;break;case "end":A=M.right-H;break}if(a==="left"||a==="right")switch(s){case "start":I=M.top;break;case "center":I=M.top+M.height/2-D/2;break;case "end":I=M.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),I=Math.max(8,Math.min(I,window.innerHeight-D-8)),x({top:I,left:A});};return P(),requestAnimationFrame(P),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[R,a,s]),X.useEffect(()=>{if(!R)return;let P=M=>{C.current&&!C.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&T(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[R,T]),X.useEffect(()=>{if(!R)return;let P=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[R,T]);let k=cN[e??"help"],S=()=>{T(!R);},N=()=>{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?X.isValidElement(o)?X.cloneElement(o,{ref:w,onClick:P=>{o.props.onClick?.(P),S();}}):jsx("button",{ref:w,type:"button",onClick:S,className:m(Il({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{w.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:S,className:m(Il({variant:e,size:t}),u),"aria-label":"Help",children:jsx(k,{className:"h-full w-full"})}),b&&R&&Ea.createPortal(jsxs("div",{ref:C,className:m(lN({size:t}),f),style:{position:"fixed",top:y.top,left:y.left,transformOrigin:N()},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)]})});av.displayName="ContextualHelp";var iv=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),Vl=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 lv({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:u,errorMessage:f,maxTags:p,...g}){let[h,b]=X.useState(new Set),v=X.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),y=R=>{if(s==="none")return;let T;s==="single"?T=v.has(R)?new Set:new Set([R]):(T=new Set(v),T.has(R)?T.delete(R):T.add(R)),a||b(T),i?.(T);},x=(R,T)=>{T.stopPropagation(),c?.(R);},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}),u&&jsx("span",{className:"text-sm text-muted-foreground",children:u}),jsxs("div",{role:"group","aria-label":d,className:m(iv({spacing:t}),e),...g,children:[w.map(R=>{let T=v.has(R.key),k=s!=="none";return jsxs("span",{role:k?"button":void 0,tabIndex:k&&!R.isDisabled?0:void 0,"aria-pressed":k?T:void 0,onClick:()=>!R.isDisabled&&y(R.key),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&!R.isDisabled&&(S.preventDefault(),y(R.key));},style:R.color?{backgroundColor:R.color}:void 0,className:m(Vl({variant:R.color?void 0:n,size:r,isSelected:T,isDisabled:R.isDisabled}),k&&!R.isDisabled&&"cursor-pointer hover:opacity-80",R.color&&"text-white"),children:[R.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:R.icon}),R.label,l&&!R.isDisabled&&jsx("button",{type:"button",onClick:S=>x(R.key,S),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${R.label}`,children:jsx(X$1,{className:"h-3 w-3"})})]},R.key)}),C>0&&jsxs("span",{className:m(Vl({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}lv.displayName="TagGroup";var uv=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"}}),mv=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 pv({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:u,...f}){let[p,g]=X.useState(new Set),h=X.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let y;a==="single"?y=h.has(v)?new Set:new Set([v]):(y=new Set(h),y.has(v)?y.delete(v):y.add(v)),o||g(y),s?.(y);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:m(uv({columns:t,gap:n,className:e})),...f,children:r.map(v=>{let y=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":y,onClick:()=>b(v.key),children:d(v,y)},v.key):jsxs("div",{role:"gridcell","aria-selected":y,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:m(mv({variant:l,size:c,isSelected:y,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&y&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}pv.displayName="GridList";var fv=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"}}),Os=(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)]},gv=(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]},bv=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},vv=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),hv=X.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,...u},f)=>{let p=X.useRef(null),[g,h]=X.useState(false),b=X.useCallback(V=>{let K=bv(V);return K?gv(...K):[0,1,1]},[]),[v,y]=X.useState(()=>b(r||o)),x=e??v[0],w=t??v[1],C=n??v[2];X.useEffect(()=>{if(r){let V=b(r);y(V);}},[r,b]);let R=X.useCallback((V,K)=>{if(l||!p.current)return;let $=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-$.left)/$.width)),Y=Math.max(0,Math.min(1,(K-$.top)/$.height)),O=G,F=1-Y;t===void 0&&n===void 0&&y([x,O,F]),a?.({hue:x,saturation:O,brightness:F});let W=Os(x,O,F);s?.(vv(...W));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),R(V.clientX,V.clientY));},k=V=>{g&&R(V.clientX,V.clientY);},S=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[N,P,M]=Os(x,1,1),E=`rgb(${N}, ${P}, ${M})`,H=w*100,D=(1-C)*100,[L,I,A]=Os(x,w,C),z=`rgb(${L}, ${I}, ${A})`;return jsx("div",{ref:f,className:m(fv({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:E},onPointerDown:T,onPointerMove:k,onPointerUp:S,onPointerLeave:S,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${c/2}px)`,backgroundColor:z,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});hv.displayName="ColorArea";var yv=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"}}),bN=`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")`,xv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Rv=X.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,...u},f)=>{let p=X.useRef(null),[g,h]=X.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,y]=X.useState(t??b()),x=e??v,w=r==="hue"?x/360:x,C=X.useCallback((E,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),L=a!=="vertical",I;L?I=Math.max(0,Math.min(1,(E-D.left)/D.width)):I=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?I*360:I;e===void 0&&y(A),n?.(A);},[i,a,r,e,n]),R=E=>{i||(E.preventDefault(),h(true),E.target.setPointerCapture(E.pointerId),C(E.clientX,E.clientY));},T=E=>{g&&C(E.clientX,E.clientY);},k=E=>{h(false),E.target.releasePointerCapture(E.pointerId);},S=()=>{let E=a!=="vertical",H=E?"to right":"to top";switch(r){case "hue":return E?xv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return xv}},N=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,P=a!=="vertical",M=w*100;return jsx("div",{ref:f,className:m(yv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?bN:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:R,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:S()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${M}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:N(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Rv.displayName="ColorSlider";var wv=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"}}),xN=(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},Cv=X.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 u=X.useRef(null),[f,p]=X.useState(false),[g,h]=X.useState(t),b=e??g,v=X.useCallback((R,T)=>{if(o||!u.current)return;let k=u.current.getBoundingClientRect(),S=k.width/2,N=R-k.left,P=T-k.top,M=xN(N,P,S);e===void 0&&h(M),n?.(M);},[o,e,n]),y=R=>{o||(R.preventDefault(),p(true),R.target.setPointerCapture(R.pointerId),v(R.clientX,R.clientY));},x=R=>{f&&v(R.clientX,R.clientY);},w=R=>{p(false),R.target.releasePointerCapture(R.pointerId);},C=()=>{let R=[];for(let T=0;T<=360;T+=30)R.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${R.join(", ")})`};return jsx("div",{ref:d,className:m(wv({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:y,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(yN,{hue:b,innerRadius:a,thumbSize:s})]})})});Cv.displayName="ColorWheel";var yN=({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 Nv=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"}}),go=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"}}),kv=X.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:u=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:y,...x},w)=>{let[C,R]=X.useState(false),[T,k]=X.useState(t),S=e!==void 0?e:T,N=X.useRef(null);X.useImperativeHandle(w,()=>N.current);let P=S.length>0,M=C&&(a.length>0||s.length>0||l.length>0||P),E=V=>{e===void 0&&k(V),n?.(V);},H=()=>{E(""),N.current?.focus();},D=V=>{V?.preventDefault(),S.trim()&&(r?.(S.trim()),R(false));},L=V=>{E(V.label),o?.(V),R(false);},I=V=>{E(V),r?.(V),R(false);},A=V=>{E(V),r?.(V),R(false);},z=X.useMemo(()=>{let V={};return a.forEach(K=>{let $=K.category||"Results";V[$]||(V[$]=[]),V[$].push(K);}),V},[a]);return jsxs(rt,{open:M,onOpenChange:R,children:[jsx(tn,{children:jsxs("form",{onSubmit:D,className:m(Nv({size:g,variant:h}),b),children:[u&&jsx(Search,{className:m(go({size:g}),"ml-3")}),jsx("input",{ref:N,type:"text",value:S,onChange:V=>E(V.target.value),onFocus:()=>R(true),placeholder:v,disabled:y,className:m("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!u&&"pl-3"),...x}),d&&P&&!y&&jsx("button",{type:"button",onClick:H,className:m("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",go({size:g})),children:jsx(X$1,{className:"h-full w-full"})})]})}),jsx(ot,{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&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((V,K)=>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:m(go({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:m(go({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((V,K)=>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:m(go({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(z).map(([V,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),K.map($=>jsxs("button",{type:"button",onClick:()=>L($),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[$.icon||jsx(Search,{className:m(go({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:$.label}),$.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:$.description})]})]},$.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});kv.displayName="SearchBar";var Pv={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"})},Lv=X.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},u)=>{let[f,p]=X.useState(""),g=X.useRef(null),[h,b]=X.useState(false);X.useEffect(()=>{b(true);},[]),X.useEffect(()=>{e||p("");},[e]),X.useEffect(()=>{if(!e)return;let R=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[e,t]),X.useEffect(()=>{if(e)return Kt(),()=>$t()},[e]);let v=X.useMemo(()=>{let R={};return n.forEach(T=>{let k=T.category||"Results";R[k]||(R[k]=[]),R[k].push(T);}),R},[n]),y=R=>{R.onSelect?.(),c?.(R),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:Ea.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:u,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$1,{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(R=>jsxs(Command.Item,{value:R.label,onSelect:()=>y(R),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:R.icon||Pv[R.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:R.label}),R.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:R.description})]}),R.shortcut&&jsx("div",{className:"flex items-center gap-1",children:R.shortcut.map((T,k)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},k))})]},R.id))]}),w&&Object.entries(v).map(([R,T])=>jsxs(Command.Group,{heading:R,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:R}),T.map(k=>jsxs(Command.Item,{value:`${k.label} ${k.keywords?.join(" ")||""}`,onSelect:()=>y(k),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:k.icon||Pv[R]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:k.label}),k.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:k.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},k.id))]},R)),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)});Lv.displayName="SpotlightSearch";function IN(e="k"){let[t,n]=X.useState(false);return X.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 Dv=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"}}),KN={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Hv=X.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:u,className:f,...p},g)=>{let[h,b]=X.useState(true),[v,y]=X.useState(false);X.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&b(false);},[u]),X.useEffect(()=>{if(d&&h){let R=setTimeout(()=>{x();},d);return ()=>clearTimeout(R)}},[d,h]);let x=()=>{y(true),setTimeout(()=>{b(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!h)return null;let w=KN[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(Dv({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:m("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$1,{className:"h-4 w-4"})})]})});Hv.displayName="Banner";var oa=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"}}),UN=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"}}),Bl=X.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:u,className:f,onClick:p,disabled:g,...h},b)=>{let[v,y]=X.useState(false),x=o&&o.length>0,w=S=>{x&&y(!v),p?.(S);},C=S=>{S.onClick?.(),y(false);},R={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":"",k=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&oa({position:u})),children:[x&&v&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",R[a].container),children:o.map((S,N)=>jsxs("div",{className:m("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${N*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:S.label}),S.href?jsx("a",{href:S.href,className:m(oa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.icon}):jsx("button",{type:"button",onClick:()=>C(S),className:m(oa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.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:S.label})]},S.id))}),jsxs("button",{ref:b,type:"button",onClick:w,disabled:g,className:m(oa({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:m(UN({size:d}),T,k,"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:()=>y(false)})]})});Bl.displayName="FloatingActionButton";var jN=Bl;var Ov=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"}}),Vv=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Bv=X.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,f]=X.useState(a||r[0]?.key),p=o!==void 0,g=p?o:u,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"}},y=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(Ov({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,R=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:m(Vv({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:m(Vv({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:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(v(),"[&>svg]:h-full [&>svg]:w-full"),children:R}),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:m(y(),"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:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(w)),children:T},x.key):T})})});Bv.displayName="BottomNavigation";var WN="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",Kv=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"}}),$v=X.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:u},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),u?.(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:WN,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:m(Kv({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})})})]})]})]})});$v.displayName="ActionSheet";var Uv=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),Kl=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"}}),jv=X.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},u)=>{let f=X.useRef(null),[p,g]=X.useState(0),[h,b]=X.useState(false),v=X.useRef(0),y=X.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=N=>{i||(b(true),v.current=N.touches[0].clientX,y.current=p);},R=N=>{if(!h||i)return;let M=N.touches[0].clientX-v.current,E=y.current+M;(E>0&&n.length===0||E<0&&r.length===0)&&(E=0),E>x?E=x+(E-x)*.3:E<-w&&(E=-w+(E+w)*.3),g(E);},T=()=>{if(!h)return;b(false);let N=f.current?.offsetWidth||0,P=Math.abs(p)/N;if(l&&P>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},k=(N,P)=>{N.onAction?.(),s?.(P,N.key),g(0);},S=()=>{g(0);};return jsxs("div",{ref:u,className:m(Uv({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(N=>jsxs("button",{type:"button",onClick:()=>k(N,"right"),className:m(Kl({variant:N.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[N.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:N.icon}),!N.icon&&N.label]},N.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(N=>jsxs("button",{type:"button",onClick:()=>k(N,"left"),className:m(Kl({variant:N.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[N.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:N.icon}),!N.icon&&N.label]},N.key))}),jsx("div",{ref:f,className:m("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:R,onTouchEnd:T,onClick:p!==0?S:void 0,children:c})]})});jv.displayName="SwipeActions";var Wv=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),qN=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"}}),Yv=X.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:u="Refreshing...",children:f,...p},g)=>{let h=X.useRef(null),[b,v]=X.useState(0),[y,x]=X.useState("idle"),w=X.useRef(0),C=X.useRef(false),R=()=>l||y==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=M=>{R()&&(w.current=M.touches[0].clientY,C.current=true);},k=M=>{if(!C.current||!R())return;let H=M.touches[0].clientY-w.current;if(H<0){v(0),x("idle");return}let L=Math.min(H*.5,o);v(L),x(L>=r?"ready":"pulling");},S=async()=>{if(C.current)if(C.current=false,y==="ready"){x("refreshing"),v(r*.6);try{await n();}finally{x("idle"),v(0);}}else x("idle"),v(0);},N={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(y==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(N,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let M=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(N,"text-muted-foreground transition-transform"),style:{transform:`rotate(${M}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:y==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(Wv({variant:t,className:e})),...p,children:[jsx("div",{className:m(qN({size:i}),"z-10",y==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(r*.5),1)},children:P()}),jsx("div",{ref:h,className:m("transition-transform duration-200",y==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:T,onTouchMove:k,onTouchEnd:S,children:f})]})});Yv.displayName="PullToRefresh";var Ir=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),ZN={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},Xv=X.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 u=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:ZN,custom:i,transition:Ir(n,r,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});Xv.displayName="Fade";var QN=(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]}}},qv=X.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},u)=>{let f=X.useMemo(()=>QN(i,l),[i,l]),p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ir(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});qv.displayName="Slide";var JN={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"},ek={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Zv=X.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},u)=>{let f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:ek,custom:i,transition:Ir(n,r,o),className:m(a),style:{transformOrigin:JN[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Zv.displayName="Scale";var Qv=X.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},u)=>{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:u,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Ir(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Qv.displayName="Collapse";var Jv=X.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},u)=>{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:u,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Ir(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Jv.displayName="Expand";var eh=X.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},u)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Ir(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});eh.displayName="Rotate";var th=X.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 u=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:m("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[u]:r?180:0},transition:Ir(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:`${u}(180deg)`},children:t})]})})});th.displayName="Flip";var nh=X.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=X.useState([]),l=X.useRef(null),c=u=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=u.clientX-p.left,h=u.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(y=>[...y,v]);},d=u=>{i(f=>f.filter(p=>p.id!==u));};return jsxs("div",{ref:a,className:m("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(u=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(u.id),className:"pointer-events-none absolute rounded-full",style:{left:u.x-u.size/2,top:u.y-u.size/2,width:u.size,height:u.size,backgroundColor:e}},u.id))})]})});nh.displayName="Ripple";var rh=X.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=X.useState(false),d=s?l:t,u={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:u,initial:"idle",animate:d?"bounce":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});rh.displayName="Bounce";var rk={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]},oh=X.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=X.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:rk[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"shake":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});oh.displayName="Shake";var ok={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},ah=X.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:m(t&&ok[n],r),children:e}));ah.displayName="Pulse";var sh=X.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=X.useState(false),d=s?l:t,u={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:u,initial:"idle",animate:d?"wiggle":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});sh.displayName="Wiggle";var ih=X.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]=X.useState(false),d=t||l,u={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:u,className:m(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});ih.displayName="Pop";var dk=(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},lh=X.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:u},f)=>{let p=X.useRef(null),g=useInView(p,{once:true}),[h,b]=X.useState(!l);X.useEffect(()=>{if(l&&g){let x=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let v=useMotionValue(t),y=useTransform(v,x=>dk(x,r,s,i));return X.useEffect(()=>{if(h){let x=animate(v,e,{duration:n,ease:"easeOut",onComplete:u});return ()=>x.stop()}},[h,e,n,v,u]),jsx("span",{ref:p,className:m(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:y}),a]})})});lh.displayName="Counter";var ch=X.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:u},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=X.useState(""),[b,v]=X.useState(0),[y,x]=X.useState(false),[w,C]=X.useState(false),R=X.useRef(null),T=useInView(R,{once:true}),[k,S]=X.useState(!l);return X.useEffect(()=>{if(l&&T){let N=setTimeout(()=>S(true),n*1e3);return ()=>clearTimeout(N)}},[l,T,n]),X.useEffect(()=>{if(!k||w)return;let N=p[b],P;return y?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),v(M=>(M+1)%p.length)):g.length<N.length?P=setTimeout(()=>{h(N.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{x(true);},r):(C(true),u?.()),()=>clearTimeout(P)},[k,g,b,y,w,p,t,i,r,s,u]),jsxs("span",{ref:R,className:m(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:m("ml-0.5",d),children:a})]})});ch.displayName="Typewriter";var dh=X.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=X.useRef(null),d=useInView(c,{once:true,amount:.5}),u=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:m("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,y)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&y<p.length-1&&"\xA0"]},y))})})});dh.displayName="TextReveal";var uh=X.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=X.useState(0);X.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(u=>(u+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:m("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])})})});uh.displayName="WordRotate";var gh=X.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:u=[.4,0,.2,1]},f)=>{let p=X.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:u}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});gh.displayName="ScrollReveal";var bh=X.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}),u=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?u: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:m("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(mk,{progress:f,position:e})]})});bh.displayName="ScrollProgress";var mk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=X.useState(0);return X.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:m("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,"%"]})},vh=X.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=X.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}),u=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:u,y:f},children:e})})});vh.displayName="Parallax";var yh=X.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 u={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:m("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(${u[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 q from'react';import {createContext,useState,useEffect,useContext,useC
|
|
|
69
69
|
0% { transform: translateY(-100%); }
|
|
70
70
|
100% { transform: translateY(100%); }
|
|
71
71
|
}
|
|
72
|
-
`})]})});Ph.displayName="Shimmer";var Mk={sm:24,md:40,lg:56,xl:80},Nk={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"}},Eh=q.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=Mk[t],d=Nk[n],u={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:m(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:r,className:d.circle,variants:u,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?.()})]})});Eh.displayName="Checkmark";var To={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},Sh=q.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=q.useCallback(()=>{let i={...To,...n};Co(i),o?.();},[n,o]);return q.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});Sh.displayName="Confetti";var kk=()=>{let e=q.useCallback(r=>{let o={...To,...r};Co(o);},[]),t=q.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Co({...To,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Co({...To,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=q.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&Co({...To,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&Co({...To,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},Lh=q.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:m("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:m("rounded-[inherit]",s),style:l,children:e})});Lh.displayName="Glow";var kh=(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}),Dh=q.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]=q.useState([]);return q.useEffect(()=>{let d=Array.from({length:t},()=>kh(r,o));c(d);let u=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=kh(r,o),p});},a*500);return ()=>clearInterval(u)},[t,r,o,a]),jsxs("div",{ref:i,className:m("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))]})});Dh.displayName="Sparkles";var Hh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("h1",{ref:r,className:m("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...n,children:t}));Hh.displayName="H1";var Ih=q.forwardRef(({className:e,children:t,...n},r)=>jsx("h2",{ref:r,className:m("scroll-m-20 text-3xl font-semibold tracking-tight",e),...n,children:t}));Ih.displayName="H2";var Vh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("h3",{ref:r,className:m("scroll-m-20 text-2xl font-semibold tracking-tight",e),...n,children:t}));Vh.displayName="H3";var Ah=q.forwardRef(({className:e,children:t,...n},r)=>jsx("h4",{ref:r,className:m("scroll-m-20 text-xl font-semibold tracking-tight",e),...n,children:t}));Ah.displayName="H4";var zh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));zh.displayName="Paragraph";var Oh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("blockquote",{ref:r,className:m("mt-6 border-l-2 pl-6 italic",e),...n,children:t}));Oh.displayName="Blockquote";var Bh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("code",{ref:r,className:m("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...n,children:t}));Bh.displayName="InlineCode";var Fh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-xl text-muted-foreground",e),...n,children:t}));Fh.displayName="Lead";var Kh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("text-lg font-semibold",e),...n,children:t}));Kh.displayName="Large";var $h=q.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:m("text-sm font-medium leading-none",e),...n,children:t}));$h.displayName="Small";var Gh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-sm text-muted-foreground",e),...n,children:t}));Gh.displayName="Muted";var Uh=q.forwardRef(({className:e,children:t,...n},r)=>jsx("ul",{ref:r,className:m("my-6 ml-6 list-disc [&>li]:mt-2",e),...n,children:t}));Uh.displayName="UL";function Mo(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 Lk(){return Mo("(max-width: 767px)")}function Dk(){return Mo("(min-width: 768px) and (max-width: 1023px)")}function Hk(){return Mo("(min-width: 1024px)")}function Ik(){return Mo("(prefers-color-scheme: dark)")?"dark":"light"}function Vk(){return Mo("(prefers-reduced-motion: reduce)")}function ua(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 Fk(){let{width:e}=ua();return e}function Kk(){let{height:e}=ua();return e}function $k(e){let{width:t}=ua();return t>=e}function Gk(){let{width:e}=ua();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function _k(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 Yk(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 Zk(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function Qk(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 Jk(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 nP(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 rP(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 aP(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 sP(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 iP(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 lP(){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 _h(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 Wh(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 cP(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=_h(e);useEffect(()=>{if(!r)return;let c=u=>{Wh(u,l)&&(o&&u.preventDefault(),a&&u.stopPropagation(),i.current(u));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[r,o,a,s,l]);}function dP(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:_h(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:u,handler:f}of i)if(Wh(d,u)){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 uP(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 mP(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 pP(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 fP(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 gP(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(u=>{a&&(l.current=u,i.current=false,r?.(u),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},n));},[e,n,r,a]),d=useCallback(u=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(u),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function bP(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 vP(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 hP(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function xP(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 RP(){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 wP(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 CP(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 Xh=["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 TP(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(Xh)).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 u=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),u.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 MP(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(Xh)).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 u=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),u.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 NP(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]),u=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",u,{passive:true}),d(),()=>{f.removeEventListener("scroll",u);}},[r,u,d]),o}function kP(){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 nx(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 PP(e=true){let{lock:t,unlock:n}=nx();useEffect(()=>{e?t():n();},[e,t,n]);}function ax(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(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),o&&u.isIntersecting&&d.disconnect();},{root:t,rootMargin:n,threshold:r});return d.observe(c),()=>{d.disconnect();}},[t,n,r,o,a]),{ref:s,...i}}function SP(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(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),a&&u.isIntersecting&&d.disconnect();},{root:n,rootMargin:r,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,n,r,o,a,s]),i}function LP(e="200px"){let{ref:t,isIntersecting:n}=ax({rootMargin:e,once:true});return {ref:t,isVisible:n}}function DP(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),u=useRef(e);return u.current=e,useEffect(()=>{let f=d.current;if(!f||!n)return;let p=new MutationObserver((g,h)=>{u.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 HP(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,u=useRef(t);u.current=t,useEffect(()=>{let f=e.current;if(!f||!r)return;let p=new MutationObserver((g,h)=>{u.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 IP(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 u,f;n==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:u,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 u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,n,l]),{ref:o,...a}}function VP(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 u,f;r==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:u,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 u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,n,r,l]),a}function AP(){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 cx(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,u=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():u();},[d,u,f]),g=useCallback(v=>{v?u():f();},[u,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:u,close:f,toggle:p,setIsOpen:g,getButtonProps:h,getDisclosureProps:b}),[d,u,f,p,g,h,b])}function BP(e){return cx({...e,defaultOpen:true})}function FP(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function KP(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 $P(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 UP(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]),u=useCallback(()=>{i(a(e));},[a,e]),f=s<=n,p=s>=r;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:u,isMin:f,isMax:p}),[s,l,c,d,u,f,p])}function jP(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function _P(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function WP(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function YP(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 ZP(e=[]){let[t,n]=useState(e),r=useCallback(C=>{n(C);},[]),o=useCallback(C=>{n(R=>[...R,C]);},[]),a=useCallback(C=>{n(R=>[...R,...C]);},[]),s=useCallback((C,R)=>{n(T=>{let k=[...T];return k.splice(C,0,R),k});},[]),i=useCallback((C,R)=>{n(T=>{let k=[...T];return k[C]=R,k});},[]),l=useCallback(C=>{n(R=>R.filter((T,k)=>k!==C));},[]),c=useCallback(C=>{n(R=>{let T=R.indexOf(C);return T===-1?R:R.filter((k,L)=>L!==T)});},[]),d=useCallback(C=>{n(R=>R.filter(T=>!C(T)));},[]),u=useCallback(()=>{let C;return n(R=>R.length===0?R:(C=R[0],R.slice(1))),C},[]),f=useCallback(C=>{n(R=>[C,...R]);},[]),p=useCallback(()=>{let C;return n(R=>R.length===0?R:(C=R[R.length-1],R.slice(0,-1))),C},[]),g=useCallback(()=>{n([]);},[]),h=useCallback(()=>{n(e);},[e]),b=useCallback((C,R)=>{n(T=>{let k=[...T],[L]=k.splice(C,1);return k.splice(R,0,L),k});},[]),v=useCallback((C,R)=>{n(T=>{let k=[...T];return [k[C],k[R]]=[k[R],k[C]],k});},[]),y=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:u,unshift:f,pop:p,clear:g,reset:h,move:b,swap:v,filter:y,find:x,includes:w,length:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i,l,c,d,u,f,p,g,h,b,v,y,x,w])}function QP(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]),u=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:u,entries:f,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d,u,f])}function JP(e={}){let[t,n]=useState(e),r=useCallback(d=>t[d],[t]),o=useCallback((d,u)=>{n(f=>({...f,[d]:u}));},[]),a=useCallback(d=>{n(u=>({...u,...d}));},[]),s=useCallback(d=>{n(u=>{let{[d]:f,...p}=u;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 gx(e=[]){let[t,n]=useState(()=>new Set(e)),r=useCallback(u=>{n(f=>{let p=new Set(f);return p.add(u),p});},[]),o=useCallback(u=>{n(f=>{let p=new Set(f);return u.forEach(g=>p.add(g)),p});},[]),a=useCallback(u=>{n(f=>{let p=new Set(f);return p.delete(u),p});},[]),s=useCallback(u=>t.has(u),[t]),i=useCallback(u=>{n(f=>{let p=new Set(f);return p.has(u)?p.delete(u):p.add(u),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 tE(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=gx(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 nE(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 rE(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 xx(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 aE(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(u){c=u instanceof Error?u:new Error(String(u)),d<t&&await new Promise(f=>setTimeout(f,n));}throw c},[t,n]);return {...xx(s,false),retryCount:r}}var wx=new Map,sE=300*1e3;function iE(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}),u=useRef(null),f=useRef(true),p=useCallback(async()=>{if(!e||!s)return;let h=l||e,b=wx.get(h);if(b&&Date.now()-b.timestamp<sE){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}u.current&&u.current.abort(),u.current=new AbortController,d(v=>({...v,isLoading:true,error:null}));try{let v=await fetch(e,{...r,signal:u.current.signal});if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);let y=await v.json(),x=o?o(y):y;wx.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 y=v instanceof Error?v:new Error(String(v));f.current&&d({data:null,error:y,isLoading:false,isSuccess:false,isError:true});}},[e,s,r,o,l]),g=useCallback(()=>{u.current&&u.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 lE(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(),u=n?n(d):d;return a({data:u,error:null,isLoading:!1,isSuccess:!0,isError:!1}),u}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 ti(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 dE(e,t){let[n,r]=useState(false);ti(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 uE(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;ti(()=>{s(g=>{let h=g-1;return h<=0?(l(false),c.current?.(),0):h});},i&&!d?n:null);let u=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:u,pause:f,reset:p}}function mE(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);ti(()=>{a(p=>p+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),u=useCallback(()=>i(p=>!p),[]),f=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:f,toggle:u}}function Mx(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 pE(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 fE(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function gE(e,t=true){let[n,r]=useState(false);return Mx(()=>{r(true);},t?e:null),n}function bE(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),u=useRef(0),f=useRef(0),p=useRef(0),g=useCallback(v=>{let y=d.current?v-d.current:0;d.current=v,p.current++,v-f.current>=1e3&&(a(p.current),p.current=0,f.current=v),u.current++,i(u.current),l.current(y,v),c.current=requestAnimationFrame(g);},[]),h=useCallback(()=>{c.current===null&&(d.current=0,f.current=performance.now(),p.current=0,c.current=requestAnimationFrame(g),r(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,r(false));},[]);return useEffect(()=>(t&&h(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,h]),{start:h,stop:b,isRunning:n,frameCount:s,fps:o}}function vE(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=u=>{i.current===null&&(i.current=u);let f=u-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 hE(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=u=>{c.current===null&&(c.current=u);let f=Math.min((u-c.current)/1e3,.064);c.current=u;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 Ex=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function xE(e,t={}){let{events:n=Ex,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 yE(e,t,n,r={}){let{events:o=Ex,initialState:a=false,enabled:s=true}=r,[i,l]=useState(a),c=useRef(null),d=useRef(a),u=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 u(),o.forEach(f=>{window.addEventListener(f,u);}),()=>{c.current&&clearTimeout(c.current),o.forEach(f=>{window.removeEventListener(f,u);});}},[s,o,u]),i}function Lx(){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 CE(){return Lx()==="visible"}function TE(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function ME(){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 NE(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 Vx(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 SE(){let e=useRef(null),t=Vx(e);return {ref:e,...t}}function HE(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}));},[]),u=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&&u(),t)){let f=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(f);}}},[t,n,l,u,c,d,r,o,a]),{...s,getCurrentPosition:u,isSupported:l}}function IE(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 VE(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 AE(){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 zE(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 u=d instanceof Error?d:new Error(String(d));return o(u),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 BE(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,u]=useState([]),f=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!f)return;let v=()=>{u(window.speechSynthesis.getVoices());};return v(),window.speechSynthesis.addEventListener("voiceschanged",v),()=>{window.speechSynthesis.removeEventListener("voiceschanged",v);}},[f]);let p=useCallback(v=>{if(!f)return;window.speechSynthesis.cancel();let y=new SpeechSynthesisUtterance(v);y.voice=t,y.rate=n,y.pitch=r,y.volume=o,y.lang=a,y.onstart=()=>i(true),y.onend=()=>{i(false),c(false);},y.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(y);},[f,t,n,r,o,a]),g=useCallback(()=>{f&&(window.speechSynthesis.cancel(),i(false),c(false));},[f]),h=useCallback(()=>{f&&(window.speechSynthesis.pause(),c(true));},[f]),b=useCallback(()=>{f&&(window.speechSynthesis.resume(),c(false));},[f]);return {speak:p,stop:g,pause:h,resume:b,isSpeaking:s,isPaused:l,isSupported:f,voices:d}}function FE(e={}){let{lang:t="en-US",continuous:n=false,interimResults:r=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,u]=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),u(null);},x.onend=()=>{a(false);},x.onerror=w=>{u(new Error(w.error)),a(false);},x.onresult=w=>{let C="",R="";for(let T=w.resultIndex;T<w.results.length;T++){let k=w.results[T];k.isFinal?R+=k[0].transcript:C+=k[0].transcript;}R&&i(T=>T+R),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();},[]),y=useCallback(()=>{i(""),c(""),u(null);},[]);return {start:h,stop:b,abort:v,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:y}}export{gu as Accordion,bu as AccordionItem,iv as ActionBar,lv as ActionBarButton,ev as ActionGroup,Xv as ActionSheet,_x as Alert,Yx as AlertDescription,Wx as AlertTitle,vb as AreaChart,Gu as AspectRatio,wg as Autocomplete,vr as Avatar,hr as AvatarFallback,vp as AvatarGroup,_r as AvatarImage,Gf as BackTop,Qx as Badge,Kv as Banner,gb as BarChart,Oh as Blockquote,Wv as BottomNavigation,uh as Bounce,Iu as Breadcrumb,Fu as BreadcrumbEllipsis,Au as BreadcrumbItem,zu as BreadcrumbLink,Vu as BreadcrumbList,Ou as BreadcrumbPage,Bu as BreadcrumbSeparator,se as Button,Oc as ButtonGroup,Sf as COUNTRIES,Yr as Calendar,Gc as Card,Wc as CardContent,_c as CardDescription,Yc as CardFooter,Uc as CardHeader,jc as CardTitle,Tb as Carousel,Mb as CarouselContent,Nb as CarouselItem,hl as CarouselNext,vl as CarouselPrevious,So as Checkbox,Eh as Checkmark,wp as Chip,Pp as CircularProgress,Mt as CloseButton,Vg as Code,Fg as CodeBlock,sh as Collapse,wu as Collapsible,Cu as CollapsibleContent,wi as CollapsibleTrigger,Nv as ColorArea,yf as ColorPicker,Ev as ColorSlider,Go as ColorSwatch,hf as ColorSwatchPicker,Lv as ColorWheel,Ii as Command,Q0 as CommandDialog,ap as CommandEmpty,sp as CommandGroup,rp as CommandInput,lp as CommandItem,op as CommandList,ip as CommandSeparator,cp as CommandShortcut,Sh as Confetti,jd as ContextMenu,eu as ContextMenuCheckboxItem,Xd as ContextMenuContent,Wd as ContextMenuGroup,Jd as ContextMenuItem,Yd as ContextMenuPortal,tu as ContextMenuSection,nu as ContextMenuSeparator,ru as ContextMenuShortcut,qd as ContextMenuSub,Qd as ContextMenuSubContent,Zd as ContextMenuSubTrigger,_d as ContextMenuTrigger,pv as ContextualHelp,db as CopyButton,bh as Counter,Mf as CurrencyInput,ea as DEFAULT_COLORS,A0 as DataTable,oN as DateField,rN as DateInput,Hs as DatePicker,eb as DateRangePicker,Ni as Drawer,pm as DrawerBody,vm as DrawerClose,um as DrawerContent,bm as DrawerDescription,fm as DrawerFooter,Tm as DrawerGroup,Mm as DrawerGroupLabel,mm as DrawerHeader,Nm as DrawerInset,ym as DrawerMenu,Cm as DrawerMenuButton,Rm as DrawerMenuItem,E0 as DrawerProvider,xm as DrawerSeparator,cm as DrawerSidebar,gm as DrawerTitle,hm as DrawerToggle,dm as DrawerTrigger,yn as Dropdown,wn as DropdownContent,xd as DropdownGroup,Ft as DropdownItem,Iy as DropdownLabel,mi as DropdownSection,vd as DropdownSeparator,hd as DropdownShortcut,yd as DropdownSub,wd as DropdownSubContent,Rd as DropdownSubTrigger,Rn as DropdownTrigger,yl as EMOJIS,ks as EMOJI_CATEGORIES,Pb as EmojiPicker,Kp as EmptyState,ih as Expand,rk as FAB,rh as Fade,Ji as FieldContext,ff as FileUpload,ch as Flip,Gl as FloatingActionButton,Cg as Form,Qi as FormContext,kg as FormControl,Pg as FormDescription,Tg as FormField,Mg as FormItem,Ng as FormLabel,Eg as FormMessage,pb as FullCalendar,Lh as Glow,Rv as GridList,Hh as H1,Ih as H2,Vh as H3,Ah as H4,Su as HoverCard,Du as HoverCardContent,Lu as HoverCardTrigger,Ug as Image,Hb as ImageCropper,dl as ImageViewer,sb as ImageViewerTrigger,ob as InfiniteScroll,Bh as InlineCode,Ra as Input,Lp as InputOTP,Dp as InputOTPGroup,Ip as InputOTPSeparator,Hp as InputOTPSlot,Rb as KanbanBoard,lb as Kbd,br as Label,Kh as Large,Fh as Lead,fb as LineChart,Kf as Link,ew as List,Yp as ListItem,qp as ListItemText,Qg as Loading,Gi as MASK_PRESETS,Pf as MaskedInput,Yf as Menubar,ag as MenubarCheckboxItem,rg as MenubarContent,Xf as MenubarGroup,og as MenubarItem,Yw as MenubarLabel,qf as MenubarMenu,Zf as MenubarPortal,Jf as MenubarRadioGroup,sg as MenubarRadioItem,Wi as MenubarSection,ig as MenubarSeparator,lg as MenubarShortcut,Qf as MenubarSub,ng as MenubarSubContent,tg as MenubarSubTrigger,eg as MenubarTrigger,qm as Modal,Jm as ModalBody,Zm as ModalClose,Ya as ModalContent,np as ModalDescription,ep as ModalFooter,Qm as ModalHeader,Hi as ModalOverlay,Di as ModalPortal,Wa as ModalRoot,tp as ModalTitle,Xm as ModalTrigger,Gh as Muted,If as Navbar,Vf as NavbarBrand,Af as NavbarContent,zf as NavbarItem,Of as NavbarLink,qu as NavigationMenu,em as NavigationMenuContent,rm as NavigationMenuIndicator,Zu as NavigationMenuItem,nm as NavigationMenuLink,Xu as NavigationMenuList,Ju as NavigationMenuTrigger,Mi as NavigationMenuViewport,jb as NumberField,mp as NumberInput,Bm as Pagination,Fm as PaginationContent,Um as PaginationEllipsis,Km as PaginationItem,Ua as PaginationLink,Gm as PaginationNext,$m as PaginationPrevious,zh as Paragraph,Mh as Parallax,up as PasswordInput,Lf as PhoneInput,bb as PieChart,gh as Pop,rt as Popover,nn as PopoverAnchor,ot as PopoverContent,Gn as PopoverTrigger,Fa as Progress,nh as PullToRefresh,ph as Pulse,Vb as QRCode,su as RadioGroup,iu as RadioGroupItem,dv as RangeSlider,xp as Rating,TR as ResizableHandle,CR as ResizablePanel,wR as ResizablePanelGroup,Sb as RichTextEditor,dh as Ripple,lh as Rotate,ah as Scale,Ne as ScrollArea,Th as ScrollProgress,Ch as ScrollReveal,Vv as SearchBar,Yb as SearchField,cf as SegmentedControl,df as SegmentedControlItem,Ea as Select,On as Separator,mh as Shake,Id as Sheet,Ad as SheetClose,Bd as SheetContent,Gd as SheetDescription,Kd as SheetFooter,Fd as SheetHeader,zd as SheetOverlay,hi as SheetPortal,$d as SheetTitle,Vd as SheetTrigger,Ph as Shimmer,Na as Skeleton,oh as Slide,za as Slider,$h as Small,Gg as Snippet,SC as SortableList,Dh as Sparkles,xa as Spinner,Bv as SpotlightSearch,Up as StatCard,av as StatusLight,mg as Step,dg as Steps,Jv as SwipeActions,Jc as Switch,Kg as TabbedCodeBlock,Pm as Table,Sm as TableBody,Vm as TableCaption,Im as TableCell,Lm as TableFooter,Hm as TableHead,Em as TableHeader,Dm as TableRow,kd as Tabs,Sd as TabsContent,Pd as TabsList,Ed as TabsTrigger,bv as TagGroup,Op as TagInput,ey as TextBadge,Kb as TextField,hh as TextReveal,ed as Textarea,Ab as ThemeProvider,zb as ThemeToggle,Zb as TimeField,wf as TimeInput,tb as TimePicker,Jp as Timeline,nf as TimelineContent,tf as TimelineItem,rf as TimelineOpposite,Uy as Toaster,lu as Toggle,du as ToggleGroup,uu as ToggleGroupItem,Fn as Tooltip,$n as TooltipContent,Bn as TooltipProvider,Kn as TooltipTrigger,xg as Tree,vh as Typewriter,Uh as UL,Dg as User,jC as VirtualList,fh as Wiggle,xh as WordRotate,sv as actionBarVariants,Jb as actionGroupVariants,qv as actionSheetItemVariants,Ux as alertVariants,ns as applyMask,Rg as autocompleteInputVariants,bp as avatarGroupVariants,$f as backTopVariants,qx as badgeIndicatorVariants,Fv as bannerVariants,_v as bottomNavigationVariants,Ac as buttonGroupVariants,Gr as buttonVariants,Ay as calculatePasswordStrength,$c as cardVariants,wb as carouselVariants,Jo as chartContainerVariants,Rp as chipVariants,kp as circularProgressVariants,im as closeButtonVariants,m as cn,Ig as codeVariants,wv as colorAreaVariants,Pv as colorSliderVariants,vf as colorSwatchPickerVariants,bf as colorSwatchVariants,Sv as colorWheelVariants,Ol as contextualHelpTriggerVariants,cb as copyButtonVariants,Cf as currencyInputVariants,qb as datePickerVariants,Ld as defaultPasswordRequirements,wm as drawerMenuButtonVariants,kb as emojiPickerVariants,Fp as emptyStateVariants,ia as fabVariants,uf as fileUploadVariants,$i as formatCurrency,aa as formatDate,es as formatFileSize,rs as formatPhoneNumber,mb as fullCalendarVariants,mf as getFileIcon,kf as getMaskPlaceholder,zy as getPasswordStrengthColor,Oy as getPasswordStrengthLabel,yv as gridListItemVariants,xv as gridListVariants,Tv as hexToRgb,Ks as hsvToRgb,Db as imageCropperVariants,ol as imageVariants,cl as infiniteScrollLoaderVariants,ll as infiniteScrollVariants,Sp as inputOTPVariants,Bb as inputSizeVariants,ib as kbdVariants,Fb as labelSizeVariants,Wp as listItemVariants,Fo as listVariants,Zg as loadingVariants,Nf as maskedInputVariants,Li as modalContentVariants,Hf as navbarVariants,tm as navigationMenuLinkStyle,Qu as navigationMenuTriggerStyle,Ub as numberFieldVariants,Ll as parseDate,Tf as parseFormattedValue,Lw as phoneInputVariants,th as pullToRefreshVariants,Tl as qrCodeVariants,cv as rangeSliderVariants,hp as ratingVariants,Mv as rgbToHex,Cv as rgbToHsv,Eb as richTextEditorVariants,Iv as searchBarVariants,Wb as searchFieldVariants,sf as segmentedControlItemVariants,af as segmentedControlVariants,pd as selectVariants,Od as sheetVariants,nd as skeletonVariants,$g as snippetVariants,Wg as sortableItemVariants,_g as sortableListVariants,Ic as spinnerVariants,Gp as statCardVariants,ov as statusLightVariants,ug as stepVariants,cg as stepsVariants,jl as swipeActionVariants,Qv as swipeActionsVariants,Ca as switchColors,Bl as tagGroupItemVariants,gv as tagGroupVariants,zp as tagVariants,Jx as textBadgeVariants,Ob as textFieldVariants,$M as themeToggleVariants,Xb as timeFieldVariants,Rf as timeInputVariants,ef as timelineItemVariants,Qp as timelineVariants,Va as toggleVariants,gg as treeItemVariants,fg as treeVariants,Ui as unmask,vE as useAnimatedValue,xx as useAsync,aE as useAsyncRetry,PP as useBodyScrollLock,$P as useBooleanToggle,$k as useBreakpoint,Gk as useBreakpoints,ai as useButtonGroup,Ns as useCarousel,aP as useClickOutside,sP as useClickOutsideMultiple,kk as useConfetti,lP as useCopy,iP as useCopyToClipboard,uE as useCountdown,UP as useCounter,KP as useCycle,Zk as useDebounce,Qk as useDebouncedCallback,Jk as useDebouncedCallbackWithControls,fE as useDelayedValue,cx as useDisclosure,BP as useDisclosureOpen,IE as useDistance,CE as useDocumentIsVisible,Lx as useDocumentVisibility,TE as useDocumentVisibilityCallback,R0 as useDrawer,AP as useElementSize,mP as useEventListener,pP as useEventListenerRef,iE as useFetch,cs as useFieldContext,TP as useFocusTrap,MP as useFocusTrapRef,el as useFormContext,Vx as useFullscreen,SE as useFullscreenRef,HE as useGeolocation,cP as useHotkeys,dP as useHotkeysMap,bP as useHover,xP as useHoverDelay,hP as useHoverProps,vP as useHoverRef,xE as useIdle,yE as useIdleCallback,jP as useIncrementCounter,ax as useIntersectionObserver,SP as useIntersectionObserverRef,ti as useInterval,dE as useIntervalControls,Hk as useIsDesktop,Lk as useIsMobile,Dk as useIsTablet,fP as useKeyPress,uP as useKeyPressed,cT as useKeyboardShortcut,LP as useLazyLoad,ZP as useList,_k as useLocalStorage,gP as useLongPress,QP as useMap,zE as useMediaPermission,Mo as useMediaQuery,RP as useMouse,wP as useMouseElement,CP as useMouseElementRef,lE as useMutation,DP as useMutationObserver,HP as useMutationObserverRef,AE as useNotificationPermission,ME as useOnlineStatus,NE as useOnlineStatusCallback,VE as usePermission,Ik as usePrefersColorScheme,Vk as usePrefersReducedMotion,_P as usePrevious,YP as usePreviousDistinct,WP as usePreviousWithInitial,nE as useQueue,bE as useRafLoop,JP as useRecord,IP as useResizeObserver,VP as useResizeObserverRef,nx as useScrollLock,NP as useScrollPosition,tE as useSelection,Yk as useSessionStorage,gx as useSet,FE as useSpeechRecognition,BE as useSpeechSynthesis,_N as useSpotlight,hE as useSpringValue,rE as useStack,nP as useThrottle,rP as useThrottledCallback,Mx as useTimeout,pE as useTimeoutControls,gE as useTimeoutFlag,mE as useTimer,FP as useToggle,Kk as useWindowHeight,kP as useWindowScroll,ua as useWindowSize,Fk as useWindowWidth,Lg as userVariants,pf as validateFile,bC as validators,nb as virtualListVariants};//# sourceMappingURL=index.js.map
|
|
72
|
+
`})]})});yh.displayName="Shimmer";var pk={sm:24,md:40,lg:56,xl:80},fk={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"}},Rh=X.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=pk[t],d=fk[n],u={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:m(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:r,className:d.circle,variants:u,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?.()})]})});Rh.displayName="Checkmark";var wo={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},wh=X.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=X.useCallback(()=>{let i={...wo,...n};Ro(i),o?.();},[n,o]);return X.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});wh.displayName="Confetti";var gk=()=>{let e=X.useCallback(r=>{let o={...wo,...r};Ro(o);},[]),t=X.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Ro({...wo,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Ro({...wo,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=X.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&Ro({...wo,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&Ro({...wo,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},Ch=X.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:m("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:m("rounded-[inherit]",s),style:l,children:e})});Ch.displayName="Glow";var xh=(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}),Th=X.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]=X.useState([]);return X.useEffect(()=>{let d=Array.from({length:t},()=>xh(r,o));c(d);let u=setInterval(()=>{c(f=>{let p=[...f],g=Math.floor(Math.random()*t);return p[g]=xh(r,o),p});},a*500);return ()=>clearInterval(u)},[t,r,o,a]),jsxs("div",{ref:i,className:m("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))]})});Th.displayName="Sparkles";var Mh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("h1",{ref:r,className:m("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...n,children:t}));Mh.displayName="H1";var Nh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("h2",{ref:r,className:m("scroll-m-20 text-3xl font-semibold tracking-tight",e),...n,children:t}));Nh.displayName="H2";var kh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("h3",{ref:r,className:m("scroll-m-20 text-2xl font-semibold tracking-tight",e),...n,children:t}));kh.displayName="H3";var Ph=X.forwardRef(({className:e,children:t,...n},r)=>jsx("h4",{ref:r,className:m("scroll-m-20 text-xl font-semibold tracking-tight",e),...n,children:t}));Ph.displayName="H4";var Eh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));Eh.displayName="Paragraph";var Sh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("blockquote",{ref:r,className:m("mt-6 border-l-2 pl-6 italic",e),...n,children:t}));Sh.displayName="Blockquote";var Lh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("code",{ref:r,className:m("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...n,children:t}));Lh.displayName="InlineCode";var Dh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-xl text-muted-foreground",e),...n,children:t}));Dh.displayName="Lead";var Hh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("text-lg font-semibold",e),...n,children:t}));Hh.displayName="Large";var Ih=X.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:m("text-sm font-medium leading-none",e),...n,children:t}));Ih.displayName="Small";var Vh=X.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-sm text-muted-foreground",e),...n,children:t}));Vh.displayName="Muted";var Ah=X.forwardRef(({className:e,children:t,...n},r)=>jsx("ul",{ref:r,className:m("my-6 ml-6 list-disc [&>li]:mt-2",e),...n,children:t}));Ah.displayName="UL";function Co(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 xk(){return Co("(max-width: 767px)")}function yk(){return Co("(min-width: 768px) and (max-width: 1023px)")}function Rk(){return Co("(min-width: 1024px)")}function wk(){return Co("(prefers-color-scheme: dark)")?"dark":"light"}function Ck(){return Co("(prefers-reduced-motion: reduce)")}function la(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 Pk(){let{width:e}=la();return e}function Ek(){let{height:e}=la();return e}function Sk(e){let{width:t}=la();return t>=e}function Lk(){let{width:e}=la();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function Ik(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 Ak(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 Bk(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function Fk(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 Kk(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 Uk(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 jk(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 Wk(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 Yk(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 Xk(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 qk(){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 Oh(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 Bh(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 Zk(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=Oh(e);useEffect(()=>{if(!r)return;let c=u=>{Bh(u,l)&&(o&&u.preventDefault(),a&&u.stopPropagation(),i.current(u));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[r,o,a,s,l]);}function Qk(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:Oh(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:u,handler:f}of i)if(Bh(d,u)){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 Jk(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 eP(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 tP(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 nP(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 rP(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(u=>{a&&(l.current=u,i.current=false,r?.(u),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},n));},[e,n,r,a]),d=useCallback(u=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(u),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function oP(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 aP(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 sP(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function iP(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 cP(){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 dP(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 uP(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 $h=["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 mP(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($h)).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 u=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),u.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 pP(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($h)).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 u=d[0],f=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),f.focus()):document.activeElement===f&&(c.preventDefault(),u.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 fP(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]),u=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",u,{passive:true}),d(),()=>{f.removeEventListener("scroll",u);}},[r,u,d]),o}function gP(){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 Yh(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 bP(e=true){let{lock:t,unlock:n}=Yh();useEffect(()=>{e?t():n();},[e,t,n]);}function Zh(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(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),o&&u.isIntersecting&&d.disconnect();},{root:t,rootMargin:n,threshold:r});return d.observe(c),()=>{d.disconnect();}},[t,n,r,o,a]),{ref:s,...i}}function hP(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(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),a&&u.isIntersecting&&d.disconnect();},{root:n,rootMargin:r,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,n,r,o,a,s]),i}function xP(e="200px"){let{ref:t,isIntersecting:n}=Zh({rootMargin:e,once:true});return {ref:t,isVisible:n}}function yP(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),u=useRef(e);return u.current=e,useEffect(()=>{let f=d.current;if(!f||!n)return;let p=new MutationObserver((g,h)=>{u.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 RP(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,u=useRef(t);u.current=t,useEffect(()=>{let f=e.current;if(!f||!r)return;let p=new MutationObserver((g,h)=>{u.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 wP(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 u,f;n==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:u,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 u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,n,l]),{ref:o,...a}}function CP(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 u,f;r==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,f=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,f=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,f=d.contentRect.height);let p=()=>s({width:u,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 u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,n,r,l]),a}function TP(){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 tx(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,u=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():u();},[d,u,f]),g=useCallback(v=>{v?u():f();},[u,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:u,close:f,toggle:p,setIsOpen:g,getButtonProps:h,getDisclosureProps:b}),[d,u,f,p,g,h,b])}function kP(e){return tx({...e,defaultOpen:true})}function PP(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function EP(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 SP(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 DP(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]),u=useCallback(()=>{i(a(e));},[a,e]),f=s<=n,p=s>=r;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:u,isMin:f,isMax:p}),[s,l,c,d,u,f,p])}function HP(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function IP(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function VP(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function AP(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 BP(e=[]){let[t,n]=useState(e),r=useCallback(C=>{n(C);},[]),o=useCallback(C=>{n(R=>[...R,C]);},[]),a=useCallback(C=>{n(R=>[...R,...C]);},[]),s=useCallback((C,R)=>{n(T=>{let k=[...T];return k.splice(C,0,R),k});},[]),i=useCallback((C,R)=>{n(T=>{let k=[...T];return k[C]=R,k});},[]),l=useCallback(C=>{n(R=>R.filter((T,k)=>k!==C));},[]),c=useCallback(C=>{n(R=>{let T=R.indexOf(C);return T===-1?R:R.filter((k,S)=>S!==T)});},[]),d=useCallback(C=>{n(R=>R.filter(T=>!C(T)));},[]),u=useCallback(()=>{let C;return n(R=>R.length===0?R:(C=R[0],R.slice(1))),C},[]),f=useCallback(C=>{n(R=>[C,...R]);},[]),p=useCallback(()=>{let C;return n(R=>R.length===0?R:(C=R[R.length-1],R.slice(0,-1))),C},[]),g=useCallback(()=>{n([]);},[]),h=useCallback(()=>{n(e);},[e]),b=useCallback((C,R)=>{n(T=>{let k=[...T],[S]=k.splice(C,1);return k.splice(R,0,S),k});},[]),v=useCallback((C,R)=>{n(T=>{let k=[...T];return [k[C],k[R]]=[k[R],k[C]],k});},[]),y=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:u,unshift:f,pop:p,clear:g,reset:h,move:b,swap:v,filter:y,find:x,includes:w,length:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i,l,c,d,u,f,p,g,h,b,v,y,x,w])}function FP(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]),u=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:u,entries:f,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d,u,f])}function KP(e={}){let[t,n]=useState(e),r=useCallback(d=>t[d],[t]),o=useCallback((d,u)=>{n(f=>({...f,[d]:u}));},[]),a=useCallback(d=>{n(u=>({...u,...d}));},[]),s=useCallback(d=>{n(u=>{let{[d]:f,...p}=u;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 ix(e=[]){let[t,n]=useState(()=>new Set(e)),r=useCallback(u=>{n(f=>{let p=new Set(f);return p.add(u),p});},[]),o=useCallback(u=>{n(f=>{let p=new Set(f);return u.forEach(g=>p.add(g)),p});},[]),a=useCallback(u=>{n(f=>{let p=new Set(f);return p.delete(u),p});},[]),s=useCallback(u=>t.has(u),[t]),i=useCallback(u=>{n(f=>{let p=new Set(f);return p.has(u)?p.delete(u):p.add(u),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 GP(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=ix(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 UP(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 jP(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 ux(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 WP(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(u){c=u instanceof Error?u:new Error(String(u)),d<t&&await new Promise(f=>setTimeout(f,n));}throw c},[t,n]);return {...ux(s,false),retryCount:r}}var fx=new Map,YP=300*1e3;function XP(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}),u=useRef(null),f=useRef(true),p=useCallback(async()=>{if(!e||!s)return;let h=l||e,b=fx.get(h);if(b&&Date.now()-b.timestamp<YP){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}u.current&&u.current.abort(),u.current=new AbortController,d(v=>({...v,isLoading:true,error:null}));try{let v=await fetch(e,{...r,signal:u.current.signal});if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);let y=await v.json(),x=o?o(y):y;fx.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 y=v instanceof Error?v:new Error(String(v));f.current&&d({data:null,error:y,isLoading:false,isSuccess:false,isError:true});}},[e,s,r,o,l]),g=useCallback(()=>{u.current&&u.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 qP(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(),u=n?n(d):d;return a({data:u,error:null,isLoading:!1,isSuccess:!0,isError:!1}),u}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 Qs(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 QP(e,t){let[n,r]=useState(false);Qs(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 JP(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;Qs(()=>{s(g=>{let h=g-1;return h<=0?(l(false),c.current?.(),0):h});},i&&!d?n:null);let u=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:u,pause:f,reset:p}}function eE(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);Qs(()=>{a(p=>p+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),u=useCallback(()=>i(p=>!p),[]),f=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:f,toggle:u}}function vx(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 tE(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 nE(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function rE(e,t=true){let[n,r]=useState(false);return vx(()=>{r(true);},t?e:null),n}function oE(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),u=useRef(0),f=useRef(0),p=useRef(0),g=useCallback(v=>{let y=d.current?v-d.current:0;d.current=v,p.current++,v-f.current>=1e3&&(a(p.current),p.current=0,f.current=v),u.current++,i(u.current),l.current(y,v),c.current=requestAnimationFrame(g);},[]),h=useCallback(()=>{c.current===null&&(d.current=0,f.current=performance.now(),p.current=0,c.current=requestAnimationFrame(g),r(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,r(false));},[]);return useEffect(()=>(t&&h(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,h]),{start:h,stop:b,isRunning:n,frameCount:s,fps:o}}function aE(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=u=>{i.current===null&&(i.current=u);let f=u-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 sE(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=u=>{c.current===null&&(c.current=u);let f=Math.min((u-c.current)/1e3,.064);c.current=u;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 Rx=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function iE(e,t={}){let{events:n=Rx,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 lE(e,t,n,r={}){let{events:o=Rx,initialState:a=false,enabled:s=true}=r,[i,l]=useState(a),c=useRef(null),d=useRef(a),u=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 u(),o.forEach(f=>{window.addEventListener(f,u);}),()=>{c.current&&clearTimeout(c.current),o.forEach(f=>{window.removeEventListener(f,u);});}},[s,o,u]),i}function Cx(){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 uE(){return Cx()==="visible"}function mE(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function pE(){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 fE(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 kx(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 hE(){let e=useRef(null),t=kx(e);return {ref:e,...t}}function RE(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}));},[]),u=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&&u(),t)){let f=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(f);}}},[t,n,l,u,c,d,r,o,a]),{...s,getCurrentPosition:u,isSupported:l}}function wE(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 CE(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 TE(){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 ME(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 u=d instanceof Error?d:new Error(String(d));return o(u),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 kE(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,u]=useState([]),f=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!f)return;let v=()=>{u(window.speechSynthesis.getVoices());};return v(),window.speechSynthesis.addEventListener("voiceschanged",v),()=>{window.speechSynthesis.removeEventListener("voiceschanged",v);}},[f]);let p=useCallback(v=>{if(!f)return;window.speechSynthesis.cancel();let y=new SpeechSynthesisUtterance(v);y.voice=t,y.rate=n,y.pitch=r,y.volume=o,y.lang=a,y.onstart=()=>i(true),y.onend=()=>{i(false),c(false);},y.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(y);},[f,t,n,r,o,a]),g=useCallback(()=>{f&&(window.speechSynthesis.cancel(),i(false),c(false));},[f]),h=useCallback(()=>{f&&(window.speechSynthesis.pause(),c(true));},[f]),b=useCallback(()=>{f&&(window.speechSynthesis.resume(),c(false));},[f]);return {speak:p,stop:g,pause:h,resume:b,isSpeaking:s,isPaused:l,isSupported:f,voices:d}}function PE(e={}){let{lang:t="en-US",continuous:n=false,interimResults:r=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,u]=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),u(null);},x.onend=()=>{a(false);},x.onerror=w=>{u(new Error(w.error)),a(false);},x.onresult=w=>{let C="",R="";for(let T=w.resultIndex;T<w.results.length;T++){let k=w.results[T];k.isFinal?R+=k[0].transcript:C+=k[0].transcript;}R&&i(T=>T+R),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();},[]),y=useCallback(()=>{i(""),c(""),u(null);},[]);return {start:h,stop:b,abort:v,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:y}}export{uu as Accordion,mu as AccordionItem,Jb as ActionBar,ev as ActionBarButton,_b as ActionGroup,$v as ActionSheet,Ox as Alert,Fx as AlertDescription,Bx as AlertTitle,pb as AreaChart,Bu as AspectRatio,hg as Autocomplete,gr as Avatar,br as AvatarFallback,pp as AvatarGroup,Ur as AvatarImage,Bf as BackTop,Ux as Badge,Hv as Banner,ub as BarChart,Sh as Blockquote,Bv as BottomNavigation,rh as Bounce,Su as Breadcrumb,Au as BreadcrumbEllipsis,Du as BreadcrumbItem,Hu as BreadcrumbLink,Lu as BreadcrumbList,Iu as BreadcrumbPage,Vu as BreadcrumbSeparator,se as Button,Ic as ButtonGroup,Nf as COUNTRIES,_r as Calendar,Bc as Card,Gc as CardContent,$c as CardDescription,Uc as CardFooter,Fc as CardHeader,Kc as CardTitle,yb as Carousel,Rb as CarouselContent,wb as CarouselItem,gl as CarouselNext,fl as CarouselPrevious,Po as Checkbox,Rh as Checkmark,hp as Chip,Tp as CircularProgress,Mt as CloseButton,Lg as Code,Ag as CodeBlock,Qv as Collapse,hu as Collapsible,xu as CollapsibleContent,xi as CollapsibleTrigger,hv as ColorArea,bf as ColorPicker,Rv as ColorSlider,Ko as ColorSwatch,ff as ColorSwatchPicker,Cv as ColorWheel,Li as Command,U0 as CommandDialog,tp as CommandEmpty,np as CommandGroup,Jm as CommandInput,op as CommandItem,ep as CommandList,rp as CommandSeparator,ap as CommandShortcut,wh as Confetti,Kd as ContextMenu,qd as ContextMenuCheckboxItem,_d as ContextMenuContent,Gd as ContextMenuGroup,Xd as ContextMenuItem,Ud as ContextMenuPortal,Zd as ContextMenuSection,Qd as ContextMenuSeparator,Jd as ContextMenuShortcut,jd as ContextMenuSub,Yd as ContextMenuSubContent,Wd as ContextMenuSubTrigger,$d as ContextMenuTrigger,av as ContextualHelp,sb as CopyButton,lh as Counter,Rf as CurrencyInput,Qo as DEFAULT_COLORS,P0 as DataTable,_M as DateField,jM as DateInput,Ss as DatePicker,qg as DateRangePicker,Ci as Drawer,cm as DrawerBody,pm as DrawerClose,im as DrawerContent,mm as DrawerDescription,dm as DrawerFooter,ym as DrawerGroup,Rm as DrawerGroupLabel,lm as DrawerHeader,wm as DrawerInset,bm as DrawerMenu,xm as DrawerMenuButton,vm as DrawerMenuItem,R0 as DrawerProvider,gm as DrawerSeparator,am as DrawerSidebar,um as DrawerTitle,fm as DrawerToggle,sm as DrawerTrigger,xn as Dropdown,Rn as DropdownContent,gd as DropdownGroup,Ft as DropdownItem,Ny as DropdownLabel,ci as DropdownSection,pd as DropdownSeparator,fd as DropdownShortcut,bd as DropdownSub,hd as DropdownSubContent,vd as DropdownSubTrigger,yn as DropdownTrigger,vl as EMOJIS,Ts as EMOJI_CATEGORIES,Tb as EmojiPicker,zp as EmptyState,Jv as Expand,jN as FAB,Xv as Fade,qi as FieldContext,df as FileUpload,th as Flip,Bl as FloatingActionButton,xg as Form,Xi as FormContext,Cg as FormControl,Tg as FormDescription,yg as FormField,Rg as FormItem,wg as FormLabel,Mg as FormMessage,cb as FullCalendar,Ch as Glow,pv as GridList,Mh as H1,Nh as H2,kh as H3,Ph as H4,Nu as HoverCard,Pu as HoverCardContent,ku as HoverCardTrigger,Fg as Image,Eb as ImageCropper,il as ImageViewer,nb as ImageViewerTrigger,eb as InfiniteScroll,Lh as InlineCode,ha as Input,kp as InputOTP,Pp as InputOTPGroup,Sp as InputOTPSeparator,Ep as InputOTPSlot,vb as KanbanBoard,ob as Kbd,fr as Label,Hh as Large,Dh as Lead,db as LineChart,zf as Link,_R as List,Up as ListItem,jp as ListItemText,Yg as Loading,Fi as MASK_PRESETS,Tf as MaskedInput,Uf as Menubar,tg as MenubarCheckboxItem,Jf as MenubarContent,_f as MenubarGroup,eg as MenubarItem,Fw as MenubarLabel,jf as MenubarMenu,Wf as MenubarPortal,Xf as MenubarRadioGroup,ng as MenubarRadioItem,Ui as MenubarSection,rg as MenubarSeparator,og as MenubarShortcut,Yf as MenubarSub,Qf as MenubarSubContent,Zf as MenubarSubTrigger,qf as MenubarTrigger,jm as Modal,Xm as ModalBody,Wm as ModalClose,ja as ModalContent,Qm as ModalDescription,qm as ModalFooter,Ym as ModalHeader,Si as ModalOverlay,Ei as ModalPortal,Ua as ModalRoot,Zm as ModalTitle,_m as ModalTrigger,Vh as Muted,Sf as Navbar,Lf as NavbarBrand,Df as NavbarContent,Hf as NavbarItem,If as NavbarLink,ju as NavigationMenu,qu as NavigationMenuContent,Ju as NavigationMenuIndicator,Wu as NavigationMenuItem,Qu as NavigationMenuLink,_u as NavigationMenuList,Xu as NavigationMenuTrigger,wi as NavigationMenuViewport,lp as NumberInput,Vm as Pagination,Am as PaginationContent,Fm as PaginationEllipsis,zm as PaginationItem,Ka as PaginationLink,Bm as PaginationNext,Om as PaginationPrevious,Eh as Paragraph,vh as Parallax,ip as PasswordInput,kf as PhoneInput,mb as PieChart,ih as Pop,rt as Popover,tn as PopoverAnchor,ot as PopoverContent,$n as PopoverTrigger,za as Progress,Yv as PullToRefresh,ah as Pulse,Lb as QRCode,nu as RadioGroup,ru as RadioGroupItem,nv as RangeSlider,gp as Rating,bR as ResizableHandle,gR as ResizablePanel,fR as ResizablePanelGroup,Nb as RichTextEditor,nh as Ripple,eh as Rotate,Zv as Scale,Ne as ScrollArea,bh as ScrollProgress,gh as ScrollReveal,kv as SearchBar,Fb as SearchField,of as SegmentedControl,af as SegmentedControlItem,Na as Select,zn as Separator,oh as Shake,Sd as Sheet,Dd as SheetClose,Vd as SheetContent,Bd as SheetDescription,zd as SheetFooter,Ad as SheetHeader,Hd as SheetOverlay,gi as SheetPortal,Od as SheetTitle,Ld as SheetTrigger,yh as Shimmer,Ca as Skeleton,qv as Slide,Ia as Slider,Ih as Small,Bg as Snippet,wC as SortableList,Th as Sparkles,ba as Spinner,Lv as SpotlightSearch,Fp as StatCard,Zb as StatusLight,lg as Step,sg as Steps,jv as SwipeActions,Xc as Switch,zg as TabbedCodeBlock,Tm as Table,Nm as TableBody,Lm as TableCaption,Sm as TableCell,km as TableFooter,Em as TableHead,Mm as TableHeader,Pm as TableRow,Cd as Tabs,Nd as TabsContent,Td as TabsList,Md as TabsTrigger,lv as TagGroup,Ip as TagInput,_x as TextBadge,zb as TextField,dh as TextReveal,qc as Textarea,Db as ThemeProvider,Hb as ThemeToggle,Gb as TimeField,hf as TimeInput,Zg as TimePicker,Xp as Timeline,Qp as TimelineContent,Zp as TimelineItem,Jp as TimelineOpposite,Ay as Toaster,ou as Toggle,su as ToggleGroup,iu as ToggleGroupItem,Bn as Tooltip,Kn as TooltipContent,On as TooltipProvider,Fn as TooltipTrigger,gg as Tree,ch as Typewriter,Ah as UL,Pg as User,zC as VirtualList,sh as Wiggle,uh as WordRotate,Qb as actionBarVariants,jb as actionGroupVariants,Kv as actionSheetItemVariants,Ax as alertVariants,Ja as applyMask,vg as autocompleteInputVariants,mp as avatarGroupVariants,Of as backTopVariants,Kx as badgeIndicatorVariants,Dv as bannerVariants,Ov as bottomNavigationVariants,Dc as buttonGroupVariants,Kr as buttonVariants,Py as calculatePasswordStrength,Oc as cardVariants,hb as carouselVariants,Zo as chartContainerVariants,vp as chipVariants,Cp as circularProgressVariants,rm as closeButtonVariants,m as cn,Sg as codeVariants,fv as colorAreaVariants,yv as colorSliderVariants,pf as colorSwatchPickerVariants,mf as colorSwatchVariants,wv as colorWheelVariants,Il as contextualHelpTriggerVariants,ab as copyButtonVariants,xf as currencyInputVariants,Kb as datePickerVariants,kd as defaultPasswordRequirements,hm as drawerMenuButtonVariants,Cb as emojiPickerVariants,Ap as emptyStateVariants,oa as fabVariants,sf as fileUploadVariants,Bi as formatCurrency,na as formatDate,Za as formatFileSize,es as formatPhoneNumber,lb as fullCalendarVariants,lf as getFileIcon,Cf as getMaskPlaceholder,Ey as getPasswordStrengthColor,Sy as getPasswordStrengthLabel,mv as gridListItemVariants,uv as gridListVariants,bv as hexToRgb,Os as hsvToRgb,Pb as imageCropperVariants,tl as imageVariants,sl as infiniteScrollLoaderVariants,al as infiniteScrollVariants,Np as inputOTPVariants,Vb as inputSizeVariants,rb as kbdVariants,Ab as labelSizeVariants,Gp as listItemVariants,Oo as listVariants,Wg as loadingVariants,wf as maskedInputVariants,Pi as modalContentVariants,Ef as navbarVariants,Zu as navigationMenuLinkStyle,Yu as navigationMenuTriggerStyle,kl as parseDate,yf as parseFormattedValue,Cw as phoneInputVariants,Wv as pullToRefreshVariants,Rl as qrCodeVariants,tv as rangeSliderVariants,fp as ratingVariants,vv as rgbToHex,gv as rgbToHsv,Mb as richTextEditorVariants,Nv as searchBarVariants,Bb as searchFieldVariants,nf as segmentedControlItemVariants,tf as segmentedControlVariants,cd as selectVariants,Id as sheetVariants,Qc as skeletonVariants,Og as snippetVariants,Gg as sortableItemVariants,$g as sortableListVariants,Sc as spinnerVariants,Bp as statCardVariants,qb as statusLightVariants,ig as stepVariants,ag as stepsVariants,Kl as swipeActionVariants,Uv as swipeActionsVariants,ya as switchColors,Vl as tagGroupItemVariants,iv as tagGroupVariants,Hp as tagVariants,jx as textBadgeVariants,Ib as textFieldVariants,IM as themeToggleVariants,$b as timeFieldVariants,vf as timeInputVariants,qp as timelineItemVariants,Yp as timelineVariants,Da as toggleVariants,ug as treeItemVariants,dg as treeVariants,Ki as unmask,aE as useAnimatedValue,ux as useAsync,WP as useAsyncRetry,bP as useBodyScrollLock,SP as useBooleanToggle,Sk as useBreakpoint,Lk as useBreakpoints,ni as useButtonGroup,Cs as useCarousel,Wk as useClickOutside,Yk as useClickOutsideMultiple,gk as useConfetti,qk as useCopy,Xk as useCopyToClipboard,JP as useCountdown,DP as useCounter,EP as useCycle,Bk as useDebounce,Fk as useDebouncedCallback,Kk as useDebouncedCallbackWithControls,nE as useDelayedValue,tx as useDisclosure,kP as useDisclosureOpen,wE as useDistance,uE as useDocumentIsVisible,Cx as useDocumentVisibility,mE as useDocumentVisibilityCallback,p0 as useDrawer,TP as useElementSize,eP as useEventListener,tP as useEventListenerRef,XP as useFetch,ss as useFieldContext,mP as useFocusTrap,pP as useFocusTrapRef,Zi as useFormContext,kx as useFullscreen,hE as useFullscreenRef,RE as useGeolocation,Zk as useHotkeys,Qk as useHotkeysMap,oP as useHover,iP as useHoverDelay,sP as useHoverProps,aP as useHoverRef,iE as useIdle,lE as useIdleCallback,HP as useIncrementCounter,Zh as useIntersectionObserver,hP as useIntersectionObserverRef,Qs as useInterval,QP as useIntervalControls,Rk as useIsDesktop,xk as useIsMobile,yk as useIsTablet,nP as useKeyPress,Jk as useKeyPressed,tT as useKeyboardShortcut,xP as useLazyLoad,BP as useList,Ik as useLocalStorage,rP as useLongPress,FP as useMap,ME as useMediaPermission,Co as useMediaQuery,cP as useMouse,dP as useMouseElement,uP as useMouseElementRef,qP as useMutation,yP as useMutationObserver,RP as useMutationObserverRef,TE as useNotificationPermission,pE as useOnlineStatus,fE as useOnlineStatusCallback,CE as usePermission,wk as usePrefersColorScheme,Ck as usePrefersReducedMotion,IP as usePrevious,AP as usePreviousDistinct,VP as usePreviousWithInitial,UP as useQueue,oE as useRafLoop,KP as useRecord,wP as useResizeObserver,CP as useResizeObserverRef,Yh as useScrollLock,fP as useScrollPosition,GP as useSelection,Ak as useSessionStorage,ix as useSet,PE as useSpeechRecognition,kE as useSpeechSynthesis,IN as useSpotlight,sE as useSpringValue,jP as useStack,Uk as useThrottle,jk as useThrottledCallback,vx as useTimeout,tE as useTimeoutControls,rE as useTimeoutFlag,eE as useTimer,PP as useToggle,Ek as useWindowHeight,gP as useWindowScroll,la as useWindowSize,Pk as useWindowWidth,kg as userVariants,cf as validateFile,lC as validators,Qg as virtualListVariants};//# sourceMappingURL=index.js.map
|
|
73
73
|
//# sourceMappingURL=index.js.map
|