@anyreach/component-library-ui
Version:
React component library built on shadcn/ui foundation following atomic design principles
1 lines • 74.8 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ta=require("clsx"),aa=require("tailwind-merge"),A=require("react"),ra=require("@radix-ui/react-slot"),o=require("class-variance-authority"),d=require("lucide-react"),na=require("@radix-ui/react-label"),sa=require("@radix-ui/react-checkbox"),oa=require("@radix-ui/react-radio-group"),la=require("@radix-ui/react-select"),I=require("date-fns"),ca=require("@radix-ui/react-dialog"),ia=require("@radix-ui/react-toast"),da=require("@radix-ui/react-popover"),ma=require("@radix-ui/react-dropdown-menu");function Q(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const e=Q(A),qe=Q(na),ve=Q(sa),ie=Q(oa),D=Q(la),V=Q(ca),q=Q(ia),ae=Q(da),O=Q(ma);function n(...t){return aa.twMerge(ta.clsx(t))}const ua=typeof window<"u"?A.useLayoutEffect:A.useEffect;function $e(){const[t,r]=A.useState(!1);return A.useEffect(()=>{r(!0)},[]),t}function fa(){const[t,r]=A.useState({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0});return A.useEffect(()=>{if(typeof window>"u")return;function a(){r({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),t}const Ye=o.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-4 py-2",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),_=A.forwardRef(({className:t,variant:r,size:a,asChild:s=!1,icon:l,loading:c=!1,children:u,disabled:f,...g},v)=>{const h=s?ra.Slot:"button",b=l?A.cloneElement(l,{className:n("h-4 w-4",l.props.className)}):null,N=a==="icon"||!u&&(b||c)?"icon":a,y=f||c;return A.createElement(h,{className:n(Ye({variant:r,size:N,className:t})),ref:v,disabled:y,...g},c?A.createElement(d.Loader2,{className:"h-4 w-4 animate-spin"}):b,u)});_.displayName="Button";const he=o.cva("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{variant:{default:"",search:""}},defaultVariants:{variant:"default"}}),pe=e.forwardRef(({className:t,type:r,variant:a,icon:s,...l},c)=>{const u=s?e.cloneElement(s,{className:n("h-4 w-4 text-muted-foreground",s.props.className)}):null,f=a==="search"&&!u?e.createElement(d.Search,{className:"h-4 w-4 text-muted-foreground"}):null,g=u||f;return g?e.createElement("div",{className:"relative"},e.createElement("input",{type:a==="search"?"search":r,className:n(he({variant:a,className:t}),"pr-10"),ref:c,...l}),e.createElement("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none"},g)):e.createElement("input",{type:a==="search"?"search":r,className:n(he({variant:a,className:t})),ref:c,...l})});pe.displayName="Input";const pa=o.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xe=e.forwardRef(({className:t,...r},a)=>e.createElement(qe.Root,{ref:a,className:n(pa(),t),...r}));Xe.displayName=qe.Root.displayName;const Je=e.forwardRef(({className:t,...r},a)=>e.createElement(ve.Root,{ref:a,className:n("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",t),...r},e.createElement(ve.Indicator,{className:n("flex items-center justify-center text-current")},r.checked==="indeterminate"?e.createElement(d.Minus,{className:"h-4 w-4"}):e.createElement(d.Check,{className:"h-4 w-4"}))));Je.displayName=ve.Root.displayName;const Qe=e.forwardRef(({className:t,...r},a)=>e.createElement(ie.Root,{className:n("grid gap-2",t),...r,ref:a}));Qe.displayName=ie.Root.displayName;const Ze=e.forwardRef(({className:t,...r},a)=>e.createElement(ie.Item,{ref:a,className:n("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",t),...r},e.createElement(ie.Indicator,{className:"flex items-center justify-center"},e.createElement(d.Circle,{className:"h-2.5 w-2.5 fill-current text-current"}))));Ze.displayName=ie.Item.displayName;const We=o.cva("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{state:{default:"",required:"border-destructive focus-visible:ring-destructive",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),Ke=e.forwardRef(({className:t,state:r,required:a,disabled:s,...l},c)=>{const u=s?"disabled":a?"required":"default";return e.createElement("textarea",{className:n(We({state:u,className:t})),ref:c,required:a,disabled:s,...l})});Ke.displayName="Textarea";const et=o.cva("relative flex w-full touch-none select-none items-center",{variants:{state:{default:"",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),ga=o.cva("relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",{variants:{state:{default:"",disabled:"opacity-50"}},defaultVariants:{state:"default"}}),va=o.cva("absolute h-full bg-primary",{variants:{state:{default:"",disabled:"opacity-50"}},defaultVariants:{state:"default"}}),ha=o.cva("block h-5 w-5 rounded-full border-2 border-primary bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{state:{default:"",disabled:"cursor-not-allowed opacity-50"}},defaultVariants:{state:"default"}}),tt=e.forwardRef(({className:t,state:r,value:a=0,onValueChange:s,min:l=0,max:c=100,step:u=1,disabled:f,...g},v)=>{const[h,b]=e.useState(a),N=f?"disabled":"default",y=(h-l)/(c-l)*100,R=F=>{const w=Number(F.target.value);b(w),s==null||s(w)};return e.useEffect(()=>{b(a)},[a]),e.createElement("div",{className:n(et({state:N,className:t}))},e.createElement("div",{className:n(ga({state:N}))},e.createElement("div",{className:n(va({state:N})),style:{width:`${y}%`}})),e.createElement("input",{ref:v,type:"range",value:h,onChange:R,min:l,max:c,step:u,disabled:f,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed",...g}),e.createElement("div",{className:n(ha({state:N})),style:{left:`calc(${y}% - 10px)`,position:"absolute",top:"50%",transform:"translateY(-50%)"}}))});tt.displayName="Slider";const at=o.cva("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),ba=o.cva("aspect-square h-full w-full object-cover"),Ea=o.cva("flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),wa=o.cva("absolute bottom-0 right-0 h-3 w-3 rounded-full border-2 border-background",{variants:{status:{online:"bg-green-500",offline:"bg-gray-500",away:"bg-yellow-500",busy:"bg-red-500"}}}),ge=A.forwardRef(({className:t,size:r,src:a,alt:s,fallback:l,status:c,...u},f)=>{const[g,v]=A.useState(!1),h=$e(),b=y=>y.split(" ").map(R=>R.charAt(0).toUpperCase()).slice(0,2).join(""),N=()=>{v(!0)};return A.createElement("div",{ref:f,className:n(at({size:r,className:t})),...u},a&&!g&&h?A.createElement("img",{src:a,alt:s||"Avatar",className:n(ba()),onError:N}):A.createElement("div",{className:n(Ea({size:r}))},l?b(l):"?"),c&&A.createElement("div",{className:n(wa({status:c}))}))});ge.displayName="Avatar";const rt=o.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-zinc-50 text-zinc-900 shadow hover:bg-zinc-100 dark:bg-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-700",info:"border-transparent bg-blue-50 text-blue-900 shadow hover:bg-blue-100 dark:bg-blue-900/20 dark:text-blue-100 dark:hover:bg-blue-900/30",success:"border-transparent bg-green-50 text-green-900 shadow hover:bg-green-100 dark:bg-green-900/20 dark:text-green-100 dark:hover:bg-green-900/30",warning:"border-transparent bg-amber-50 text-amber-900 shadow hover:bg-amber-100 dark:bg-amber-900/20 dark:text-amber-100 dark:hover:bg-amber-900/30",danger:"border-transparent bg-red-50 text-red-900 shadow hover:bg-red-100 dark:bg-red-900/20 dark:text-red-100 dark:hover:bg-red-900/30"}},defaultVariants:{variant:"default"}});function xa({className:t,variant:r,...a}){return e.createElement("div",{className:n(rt({variant:r}),t),...a})}const nt=o.cva("relative h-2 w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),Na=o.cva("h-full w-full flex-1 bg-primary transition-all duration-300 ease-in-out"),be=e.forwardRef(({className:t,value:r=0,max:a=100,size:s,...l},c)=>{const u=Math.min(Math.max(r/a*100,0),100);return e.createElement("div",{ref:c,className:n(nt({size:s,className:t})),...l},e.createElement("div",{className:n(Na()),style:{transform:`translateX(-${100-u}%)`}}))});be.displayName="Progress";const st=o.cva("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"}},defaultVariants:{orientation:"horizontal"}}),re=e.forwardRef(({className:t,orientation:r,...a},s)=>e.createElement("div",{ref:s,className:n(st({orientation:r}),t),...a}));re.displayName="Separator";const ot=o.cva("rounded-lg border bg-card text-card-foreground shadow-md",{variants:{variant:{default:"bg-background",active:"bg-zinc-50 dark:bg-zinc-800/50"}},defaultVariants:{variant:"default"}}),ya=o.cva("flex flex-col space-y-1.5 p-6"),ka=o.cva("text-2xl font-semibold leading-none tracking-tight"),Sa=o.cva("text-sm text-muted-foreground"),Ca=o.cva("p-6 pt-0"),Va=o.cva("flex items-center p-6 pt-0"),Ee=e.forwardRef(({className:t,variant:r,...a},s)=>e.createElement("div",{ref:s,className:n(ot({variant:r,className:t})),...a}));Ee.displayName="Card";const we=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(ya(),t),...r}));we.displayName="CardHeader";const lt=e.forwardRef(({className:t,...r},a)=>e.createElement("h3",{ref:a,className:n(ka(),t),...r}));lt.displayName="CardTitle";const ct=e.forwardRef(({className:t,...r},a)=>e.createElement("p",{ref:a,className:n(Sa(),t),...r}));ct.displayName="CardDescription";const xe=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(Ca(),t),...r}));xe.displayName="CardContent";const it=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(Va(),t),...r}));it.displayName="CardFooter";const dt=o.cva("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground"),Ra=o.cva("inline-flex items-center gap-1.5"),Ma=o.cva("transition-colors hover:text-foreground"),Da=o.cva("font-normal text-foreground"),Ta=o.cva("text-muted-foreground"),za=o.cva("flex h-9 w-9 items-center justify-center"),Ne=e.forwardRef(({className:t,...r},a)=>e.createElement("nav",{ref:a,"aria-label":"breadcrumb",...r},e.createElement("ol",{className:n(dt(),t),...r})));Ne.displayName="Breadcrumb";const ye=e.forwardRef(({className:t,...r},a)=>e.createElement("ol",{ref:a,className:n(dt(),t),...r}));ye.displayName="BreadcrumbList";const ke=e.forwardRef(({className:t,...r},a)=>e.createElement("li",{ref:a,className:n(Ra(),t),...r}));ke.displayName="BreadcrumbItem";const Se=e.forwardRef(({className:t,...r},a)=>e.createElement("a",{ref:a,className:n(Ma(),t),...r}));Se.displayName="BreadcrumbLink";const Ce=e.forwardRef(({className:t,...r},a)=>e.createElement("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:n(Da(),t),...r}));Ce.displayName="BreadcrumbPage";const Ve=e.forwardRef(({className:t,children:r,...a},s)=>e.createElement("li",{ref:s,role:"presentation","aria-hidden":"true",className:n(Ta(),t),...a},r??e.createElement(d.ChevronRight,{className:"h-4 w-4"})));Ve.displayName="BreadcrumbSeparator";const mt=e.forwardRef(({className:t,...r},a)=>e.createElement("span",{ref:a,role:"presentation","aria-hidden":"true",className:n(za(),t),...r},e.createElement(d.MoreHorizontal,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"More")));mt.displayName="BreadcrumbEllipsis";const Ia=o.cva("mx-auto flex w-full justify-center"),Pa=o.cva("flex flex-row items-center gap-1"),La=o.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium 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",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",ghost:"hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",current:"border border-input bg-background text-foreground h-10 px-4 py-2 bg-primary text-primary-foreground hover:bg-primary/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"ghost",size:"default"}}),Re=({className:t,...r})=>e.createElement("nav",{role:"navigation","aria-label":"pagination",className:n(Ia(),t),...r});Re.displayName="Pagination";const Me=e.forwardRef(({className:t,...r},a)=>e.createElement("ul",{ref:a,className:n(Pa(),t),...r}));Me.displayName="PaginationContent";const te=e.forwardRef(({className:t,...r},a)=>e.createElement("li",{ref:a,className:n("",t),...r}));te.displayName="PaginationItem";const fe=e.forwardRef(({className:t,isActive:r,size:a="icon",variant:s,...l},c)=>e.createElement("a",{ref:c,"aria-current":r?"page":void 0,className:n(La({variant:r?"current":s||"ghost",size:a}),t),...l}));fe.displayName="PaginationLink";const De=e.forwardRef(({className:t,...r},a)=>e.createElement(fe,{ref:a,"aria-label":"Go to previous page",size:"default",className:n("gap-1 pl-2.5",t),...r},e.createElement(d.ChevronLeft,{className:"h-4 w-4"}),e.createElement("span",null,"Previous")));De.displayName="PaginationPrevious";const Te=e.forwardRef(({className:t,...r},a)=>e.createElement(fe,{ref:a,"aria-label":"Go to next page",size:"default",className:n("gap-1 pr-2.5",t),...r},e.createElement("span",null,"Next"),e.createElement(d.ChevronRight,{className:"h-4 w-4"})));Te.displayName="PaginationNext";const ze=e.forwardRef(({className:t,...r},a)=>e.createElement("span",{ref:a,"aria-hidden":!0,className:n("flex h-9 w-9 items-center justify-center",t),...r},e.createElement(d.MoreHorizontal,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"More pages")));ze.displayName="PaginationEllipsis";const ja=o.cva("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{variants:{variant:{default:""}},defaultVariants:{variant:"default"}}),_a=o.cva("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),Fa=o.cva("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),Ba=o.cva("-mx-1 my-1 h-px bg-muted"),Ua=o.cva("py-1.5 pl-8 pr-2 text-sm font-semibold"),de=D.Root,Aa=D.Group,me=D.Value,ne=e.forwardRef(({className:t,variant:r,children:a,...s},l)=>e.createElement(D.Trigger,{ref:l,className:n(ja({variant:r,className:t})),...s},a,e.createElement(D.Icon,{asChild:!0},e.createElement(d.ChevronDown,{className:"h-4 w-4 opacity-50"}))));ne.displayName=D.Trigger.displayName;const ut=e.forwardRef(({className:t,...r},a)=>e.createElement(D.ScrollUpButton,{ref:a,className:n("flex cursor-default items-center justify-center py-1",t),...r},e.createElement(d.ChevronUp,{className:"h-4 w-4"})));ut.displayName=D.ScrollUpButton.displayName;const ft=e.forwardRef(({className:t,...r},a)=>e.createElement(D.ScrollDownButton,{ref:a,className:n("flex cursor-default items-center justify-center py-1",t),...r},e.createElement(d.ChevronDown,{className:"h-4 w-4"})));ft.displayName=D.ScrollDownButton.displayName;const se=e.forwardRef(({className:t,children:r,position:a="popper",...s},l)=>e.createElement(D.Portal,null,e.createElement(D.Content,{ref:l,className:n(_a(),t),position:a,...s},e.createElement(ut,null),e.createElement(D.Viewport,{className:n("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},r),e.createElement(ft,null))));se.displayName=D.Content.displayName;const pt=e.forwardRef(({className:t,...r},a)=>e.createElement(D.Label,{ref:a,className:n(Ua(),t),...r}));pt.displayName=D.Label.displayName;const Z=e.forwardRef(({className:t,children:r,...a},s)=>e.createElement(D.Item,{ref:s,className:n(Fa(),t),...a},e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(D.ItemIndicator,null,e.createElement(d.Check,{className:"h-4 w-4"}))),e.createElement(D.ItemText,null,r)));Z.displayName=D.Item.displayName;const gt=e.forwardRef(({className:t,...r},a)=>e.createElement(D.Separator,{ref:a,className:n(Ba(),t),...r}));gt.displayName=D.Separator.displayName;const vt=o.cva("p-3 bg-background border rounded-lg shadow-sm"),Oa=o.cva("flex items-center justify-between w-full mb-4"),Oe=o.cva("grid grid-cols-7 gap-1"),Ga=o.cva("h-8 w-8 text-center text-sm font-medium text-muted-foreground flex items-center justify-center"),Ha=o.cva("h-8 w-8 text-center text-sm p-0 font-normal aria-selected:opacity-100 relative flex items-center justify-center cursor-pointer rounded-sm transition-colors",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",today:"bg-accent text-accent-foreground",outside:"text-muted-foreground opacity-50",disabled:"text-muted-foreground opacity-50 cursor-not-allowed",range:"bg-accent text-accent-foreground",rangeStart:"bg-primary text-primary-foreground rounded-l-sm rounded-r-none",rangeEnd:"bg-primary text-primary-foreground rounded-r-sm rounded-l-none",rangeMiddle:"bg-accent text-accent-foreground rounded-none"}},defaultVariants:{variant:"default"}}),ht=e.forwardRef(({className:t,selected:r,onSelect:a,keepRange:s=!1,disabled:l,showOutsideDays:c=!0,showDropdowns:u=!0,...f},g)=>{const[v,h]=e.useState(r instanceof Date?r:new Date),[b,N]=e.useState(null),y=I.startOfMonth(v),R=I.endOfMonth(y),F=I.startOfWeek(y),w=I.endOfWeek(R),j="d",B=[];let T=[],M=F,G="";const k=m=>r?Array.isArray(r)?r.some(x=>I.isSameDay(x,m)):I.isSameDay(r,m):!1,$=m=>{if(!s||!Array.isArray(r)||r.length!==2)return!1;const[x,L]=r.sort((z,i)=>z.getTime()-i.getTime());return m>=x&&m<=L},P=m=>{if(!s||!Array.isArray(r)||r.length!==2)return!1;const[x]=r.sort((L,z)=>L.getTime()-z.getTime());return I.isSameDay(m,x)},p=m=>{if(!s||!Array.isArray(r)||r.length!==2)return!1;const[,x]=r.sort((L,z)=>L.getTime()-z.getTime());return I.isSameDay(m,x)},W=m=>{if(!(l!=null&&l(m))){if(!s){a==null||a(m);return}if(!b)N(m),a==null||a([m]);else{const x=[b,m].sort((L,z)=>L.getTime()-z.getTime());a==null||a(x),N(null)}}},J=m=>{const x=parseInt(m);h(I.setMonth(v,x))},H=m=>{const x=parseInt(m);h(I.setYear(v,x))},oe=["January","February","March","April","May","June","July","August","September","October","November","December"],le=I.getYear(new Date),K=1900,E=le+10,U=Array.from({length:E-K+1},(m,x)=>K+x).reverse(),X=m=>{if(l!=null&&l(m))return"disabled";if(!I.isSameMonth(m,y))return"outside";if(I.isToday(m))return"today";if(s){if(P(m))return"rangeStart";if(p(m))return"rangeEnd";if($(m))return"rangeMiddle"}return k(m)?"selected":"default"};for(;M<=w;){for(let m=0;m<7;m++){G=I.format(M,j);const x=new Date(M),L=X(x),z=c||I.isSameMonth(M,y);T.push(e.createElement("div",{key:M.toString(),className:n(Ha({variant:L}),!z&&"invisible"),onClick:()=>z&&W(x)},e.createElement("span",null,G))),M=I.addDays(M,1)}B.push(e.createElement("div",{className:n(Oe()),key:M.toString()},T)),T=[]}const Y=["Su","Mo","Tu","We","Th","Fr","Sa"];return e.createElement("div",{ref:g,className:n(vt(),t),...f},e.createElement("div",{className:n(Oa())},e.createElement(_,{variant:"ghost",size:"icon",onClick:()=>h(I.subMonths(v,1))},e.createElement(d.ChevronLeft,{className:"h-4 w-4"})),u?e.createElement("div",{className:"flex items-center gap-2"},e.createElement(de,{value:I.getMonth(v).toString(),onValueChange:J},e.createElement(ne,{className:"w-[140px]"},e.createElement(me,null)),e.createElement(se,null,oe.map((m,x)=>e.createElement(Z,{key:m,value:x.toString()},m)))),e.createElement(de,{value:I.getYear(v).toString(),onValueChange:H},e.createElement(ne,{className:"w-[80px]"},e.createElement(me,null)),e.createElement(se,null,U.map(m=>e.createElement(Z,{key:m,value:m.toString()},m))))):e.createElement("div",{className:"font-semibold"},I.format(v,"MMMM yyyy")),e.createElement(_,{variant:"ghost",size:"icon",onClick:()=>h(I.addMonths(v,1))},e.createElement(d.ChevronRight,{className:"h-4 w-4"}))),e.createElement("div",{className:n(Oe())},Y.map(m=>e.createElement("div",{key:m,className:n(Ga())},m))),e.createElement("div",{className:"space-y-1"},B))});ht.displayName="Calendar";const bt=o.cva("relative w-full"),qa=o.cva("border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",{variants:{variant:{default:"border-border hover:border-border/80 hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-destructive bg-destructive/5"}},defaultVariants:{variant:"default"}}),$a=o.cva("mt-4 space-y-2"),Ya=o.cva("flex items-center gap-3 p-3 border rounded-lg bg-background"),Xa=o.cva("w-10 h-10 rounded bg-muted flex items-center justify-center flex-shrink-0"),Ja=o.cva("flex-1 min-w-0"),Qa=o.cva("text-sm font-medium truncate"),Za=o.cva("text-xs text-muted-foreground"),Et=e.forwardRef(({className:t,onFilesChange:r,onFileUpload:a,allowMultiple:s=!1,allowDragDrop:l=!0,allowClickToSelect:c=!0,accept:u,maxSize:f,showProgress:g=!0,showPreviews:v=!0,disabled:h,...b},N)=>{const[y,R]=e.useState([]),[F,w]=e.useState(!1),[j,B]=e.useState(null),T=e.useRef(null),M=E=>{if(E===0)return"0 Bytes";const U=1024,X=["Bytes","KB","MB","GB"],Y=Math.floor(Math.log(E)/Math.log(U));return parseFloat((E/Math.pow(U,Y)).toFixed(2))+" "+X[Y]},G=E=>f&&E.size>f?`File size exceeds ${M(f)}`:null,k=()=>Math.random().toString(36).substring(2,15),$=E=>{B(null);const U=[];let X=!1;for(const m of E){const x=G(m);if(x){B(x),X=!0;break}U.push(m)}if(X)return;const Y=U.map(m=>({file:m,progress:0,status:"uploading",id:k()}));R(s?m=>[...m,...Y]:Y),r==null||r(U),a&&Y.forEach(async m=>{try{const x=setInterval(()=>{R(L=>L.map(z=>z.id===m.id?{...z,progress:Math.min(z.progress+10,90)}:z))},200);await a(m.file),clearInterval(x),R(L=>L.map(z=>z.id===m.id?{...z,progress:100,status:"success"}:z))}catch{R(x=>x.map(L=>L.id===m.id?{...L,status:"error"}:L))}})},P=E=>{if(E.preventDefault(),w(!1),h||!l)return;const U=Array.from(E.dataTransfer.files);$(U)},p=E=>{E.preventDefault(),!h&&l&&w(!0)},W=E=>{E.preventDefault(),w(!1)},J=E=>{const U=Array.from(E.target.files||[]);U.length>0&&$(U)},H=()=>{var E;h||!c||(E=T.current)==null||E.click()},oe=E=>{R(U=>U.filter(X=>X.id!==E))},le=E=>E.type.startsWith("image/"),K=()=>j?"error":F?"active":"default";return e.createElement("div",{ref:N,className:n(bt(),t)},e.createElement("div",{className:n(qa({variant:K()})),onDrop:P,onDragOver:p,onDragLeave:W,onClick:H},e.createElement("input",{ref:T,type:"file",multiple:s,accept:u,onChange:J,disabled:h,className:"hidden",...b}),e.createElement("div",{className:"flex flex-col items-center gap-2"},e.createElement(d.Upload,{className:"h-8 w-8 text-muted-foreground"}),e.createElement("div",{className:"text-sm"},l&&c&&e.createElement("span",null,"Drag & drop files here, or"," ",e.createElement("span",{className:"font-medium text-primary"},"click to select")),l&&!c&&e.createElement("span",null,"Drag & drop files here"),!l&&c&&e.createElement("span",null,e.createElement("span",{className:"font-medium text-primary"},"Click to select files"))),u&&e.createElement("div",{className:"text-xs text-muted-foreground"},"Supported formats: ",u),f&&e.createElement("div",{className:"text-xs text-muted-foreground"},"Max size: ",M(f)))),j&&e.createElement("div",{className:"mt-2 text-sm text-destructive"},j),y.length>0&&e.createElement("div",{className:n($a())},y.map(E=>e.createElement("div",{key:E.id,className:n(Ya())},v&&e.createElement("div",{className:n(Xa())},le(E.file)?e.createElement(d.Image,{className:"h-5 w-5 text-muted-foreground"}):e.createElement(d.File,{className:"h-5 w-5 text-muted-foreground"})),e.createElement("div",{className:n(Ja())},e.createElement("div",{className:n(Qa())},E.file.name),e.createElement("div",{className:n(Za())},M(E.file.size),E.status==="success"&&" • Uploaded",E.status==="error"&&" • Failed"),g&&E.status==="uploading"&&e.createElement("div",{className:"mt-1"},e.createElement(be,{value:E.progress,size:"sm"}))),e.createElement(_,{variant:"ghost",size:"icon",onClick:()=>oe(E.id),className:"h-8 w-8"},e.createElement(d.X,{className:"h-4 w-4"}))))))});Et.displayName="FileInput";const Wa=o.cva("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg border-muted",{variants:{size:{default:"max-w-lg",sm:"max-w-md",lg:"max-w-2xl",xl:"max-w-4xl"}},defaultVariants:{size:"default"}}),Ka=o.cva("fixed inset-0 z-50 bg-background/80 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"),er=o.cva("flex flex-col space-y-1.5 text-center sm:text-left"),tr=o.cva("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"),ar=o.cva("text-lg font-semibold leading-none tracking-tight"),rr=o.cva("text-sm text-muted-foreground"),nr=V.Root,sr=V.Trigger,or=V.Portal,lr=V.Close,wt=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Overlay,{ref:a,className:n(Ka(),t),...r}));wt.displayName=V.Overlay.displayName;const xt=e.forwardRef(({className:t,size:r,children:a,...s},l)=>e.createElement(or,null,e.createElement(wt,null),e.createElement(V.Content,{ref:l,className:n(Wa({size:r,className:t})),...s},a,e.createElement(V.Close,{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 data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},e.createElement(d.X,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"Close")))));xt.displayName=V.Content.displayName;const Nt=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(er(),t),...r}));Nt.displayName="ModalHeader";const yt=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(tr(),t),...r}));yt.displayName="ModalFooter";const kt=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Title,{ref:a,className:n(ar(),t),...r}));kt.displayName=V.Title.displayName;const St=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Description,{ref:a,className:n(rr(),t),...r}));St.displayName=V.Description.displayName;const cr=o.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"}},defaultVariants:{side:"right"}}),ir=o.cva("fixed inset-0 z-50 bg-background/80 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"),dr=o.cva("flex flex-col space-y-2 text-center sm:text-left"),mr=o.cva("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"),ur=o.cva("text-lg font-semibold text-foreground"),fr=o.cva("text-sm text-muted-foreground"),pr=V.Root,gr=V.Trigger,vr=V.Close,hr=V.Portal,Ct=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Overlay,{className:n(ir(),t),...r,ref:a}));Ct.displayName=V.Overlay.displayName;const Vt=e.forwardRef(({side:t="right",className:r,children:a,...s},l)=>e.createElement(hr,null,e.createElement(Ct,null),e.createElement(V.Content,{ref:l,className:n(cr({side:t}),r),...s},a,e.createElement(V.Close,{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 data-[state=open]:bg-secondary"},e.createElement(d.X,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"Close")))));Vt.displayName=V.Content.displayName;const Rt=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(dr(),t),...r}));Rt.displayName="SheetHeader";const Mt=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:n(mr(),t),...r}));Mt.displayName="SheetFooter";const Dt=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Title,{ref:a,className:n(ur(),t),...r}));Dt.displayName=V.Title.displayName;const Tt=e.forwardRef(({className:t,...r},a)=>e.createElement(V.Description,{ref:a,className:n(fr(),t),...r}));Tt.displayName=V.Description.displayName;const br=o.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{info:"border bg-blue-50 text-blue-900 dark:bg-blue-900/20 dark:text-blue-100",success:"border bg-green-50 text-green-900 dark:bg-green-900/20 dark:text-green-100",error:"border bg-red-50 text-red-900 dark:bg-red-900/20 dark:text-red-100"}},defaultVariants:{variant:"info"}}),Er=o.cva("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"),wr=o.cva("text-sm font-semibold"),xr=o.cva("text-sm opacity-90"),Nr=o.cva("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-xs font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.info]:border-blue-200 group-[.info]:hover:border-blue-300 group-[.success]:border-green-200 group-[.success]:hover:border-green-300 group-[.error]:border-red-200 group-[.error]:hover:border-red-300"),yr=o.cva("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100"),kr=q.Provider,zt=e.forwardRef(({className:t,...r},a)=>e.createElement(q.Viewport,{ref:a,className:n(Er(),t),...r}));zt.displayName=q.Viewport.displayName;const It=e.forwardRef(({className:t,variant:r,...a},s)=>{const l=r==="success"?d.CheckCircle:r==="error"?d.AlertCircle:d.Info;return e.createElement(q.Root,{ref:s,className:n(br({variant:r}),t),duration:5e3,...a},e.createElement("div",{className:"flex items-start space-x-3"},e.createElement(l,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),e.createElement("div",{className:"flex-1"},a.children)))});It.displayName=q.Root.displayName;const Pt=e.forwardRef(({className:t,...r},a)=>e.createElement(q.Action,{ref:a,className:n(Nr(),t),...r}));Pt.displayName=q.Action.displayName;const Lt=e.forwardRef(({className:t,...r},a)=>e.createElement(q.Close,{ref:a,className:n(yr(),t),"toast-close":"",...r},e.createElement(d.X,{className:"h-4 w-4"})));Lt.displayName=q.Close.displayName;const jt=e.forwardRef(({className:t,...r},a)=>e.createElement(q.Title,{ref:a,className:n(wr(),t),...r}));jt.displayName=q.Title.displayName;const _t=e.forwardRef(({className:t,...r},a)=>e.createElement(q.Description,{ref:a,className:n(xr(),t),...r}));_t.displayName=q.Description.displayName;const Ft=o.cva("w-full border-collapse rounded-md border border-border",{variants:{variant:{default:"bg-background"}},defaultVariants:{variant:"default"}}),Sr=o.cva("bg-zinc-100 dark:bg-zinc-800 border-b border-border"),Cr=o.cva("px-4 py-3 text-left text-sm font-medium text-foreground"),Vr=o.cva("border-b border-border transition-colors hover:bg-muted/50",{variants:{variant:{default:"",selected:"bg-muted"}},defaultVariants:{variant:"default"}}),Ge=o.cva("px-4 py-3 text-sm text-foreground"),Ie=e.forwardRef(({className:t,variant:r,data:a,columns:s,totalCount:l,loading:c=!1,keepSearch:u=!0,keepFilters:f=!0,keepPagination:g=!0,keepSort:v=!0,pageSize:h=10,actionButtons:b=[],onRowClick:N,selectedRows:y=[],onSelectionChange:R,filterOptions:F={},initialState:w={},onStateChange:j,onSearchChange:B,onFilterChange:T,onSortChange:M,onPageChange:G,onPageSizeChange:k,...$},P)=>{const[p,W]=e.useState({search:"",filters:{},sortColumn:null,sortDirection:"asc",currentPage:1,pageSize:h,...w}),J=e.useRef(),H=e.useCallback(i=>{W(i),j==null||j(i)},[j]),oe=e.useCallback(i=>{const S={...p,search:i,currentPage:1};J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{H(S),B==null||B(i,S)},300),W(S)},[p,H,B]),le=e.useCallback((i,S)=>{const C={...p.filters};S==="__all__"||S===""?delete C[i]:C[i]=S;const ee={...p,filters:C,currentPage:1};H(ee),T==null||T(C,ee)},[p,H,T]),K=e.useCallback(i=>{if(!v)return;const S=p.sortColumn===i&&p.sortDirection==="asc"?"desc":"asc",C={...p,sortColumn:i,sortDirection:S};H(C),M==null||M(i,S,C)},[p,v,H,M]),E=e.useCallback(i=>{const S={...p,currentPage:i};H(S),G==null||G(i,S)},[p,H,G]),U=e.useCallback(i=>{const S={...p,pageSize:i,currentPage:1};H(S),k==null||k(i,S)},[p,H,k]),X=i=>p.sortColumn!==i?null:p.sortDirection==="asc"?e.createElement(d.ChevronUp,{className:"h-4 w-4"}):e.createElement(d.ChevronDown,{className:"h-4 w-4"}),Y=s.filter(i=>i.filterable),m=l??a.length,x=Math.ceil(m/p.pageSize),L=(p.currentPage-1)*p.pageSize+1,z=Math.min(p.currentPage*p.pageSize,m);return e.useEffect(()=>()=>{J.current&&clearTimeout(J.current)},[]),e.createElement("div",{ref:P,className:n("space-y-4",t),...$},(u||f||b.length>0)&&e.createElement("div",{className:"flex items-center justify-between gap-4"},e.createElement("div",{className:"flex items-center gap-4 flex-1"},u&&e.createElement("div",{className:"relative flex-1 max-w-sm"},e.createElement(pe,{placeholder:"Search...",value:p.search,onChange:i=>oe(i.target.value),icon:e.createElement(d.Search,null),disabled:c})),f&&Y.length>0&&e.createElement("div",{className:"flex items-center gap-2"},Y.map(i=>{var S;return e.createElement(de,{key:i.key,value:p.filters[i.key]||"__all__",onValueChange:C=>le(i.key,C),disabled:c},e.createElement(ne,{className:"w-[150px]"},e.createElement(me,{placeholder:`Filter ${i.title}`})),e.createElement(se,null,e.createElement(Z,{value:"__all__"},"All ",i.title),(S=F[i.key])==null?void 0:S.map(C=>e.createElement(Z,{key:C.value,value:C.value},C.label))))}))),b.length>0&&e.createElement("div",{className:"flex items-center gap-2"},b.map((i,S)=>e.createElement(e.Fragment,{key:S},i)))),e.createElement("div",{className:"rounded-md border relative"},c&&e.createElement("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10 rounded-md"},e.createElement(d.Loader2,{className:"h-6 w-6 animate-spin"})),e.createElement("table",{className:n(Ft({variant:r}))},e.createElement("thead",{className:n(Sr())},e.createElement("tr",null,s.map(i=>e.createElement("th",{key:i.key,className:n(Cr(),i.sortable&&v&&"cursor-pointer select-none hover:bg-zinc-200 dark:hover:bg-zinc-700",c&&"opacity-50"),style:{width:i.width},onClick:()=>!c&&i.sortable&&K(i.key)},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("span",null,i.title),i.sortable&&v&&X(i.key)))))),e.createElement("tbody",null,a.length===0?e.createElement("tr",null,e.createElement("td",{colSpan:s.length,className:n(Ge(),"text-center text-muted-foreground py-8")},c?"Loading...":"No data found")):a.map((i,S)=>{const C=(p.currentPage-1)*p.pageSize+S,ee=y.includes(C),ea=i.id||`row-${C}`;return e.createElement("tr",{key:ea,className:n(Vr({variant:ee?"selected":"default"}),N&&!c&&"cursor-pointer",c&&"opacity-50"),onClick:()=>!c&&(N==null?void 0:N(i,C))},s.map(ce=>e.createElement("td",{key:ce.key,className:n(Ge())},ce.render?ce.render(i[ce.key],i,C):i[ce.key])))})))),g&&x>1&&e.createElement("div",{className:"flex items-center justify-between"},e.createElement("div",{className:"text-sm text-muted-foreground"},"Showing ",L," to ",z," of ",m," entries"),e.createElement("div",{className:"flex items-center gap-2"},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("span",{className:"text-sm text-muted-foreground"},"Show:"),e.createElement(de,{value:String(p.pageSize),onValueChange:i=>U(Number(i)),disabled:c},e.createElement(ne,{className:"w-[70px]"},e.createElement(me,null)),e.createElement(se,null,[5,10,20,50,100].map(i=>e.createElement(Z,{key:i,value:String(i)},i))))),e.createElement(Re,null,e.createElement(Me,null,e.createElement(te,null,e.createElement(De,{href:"#",onClick:i=>{i.preventDefault(),!c&&p.currentPage>1&&E(p.currentPage-1)},className:c?"opacity-50 pointer-events-none":""})),Array.from({length:Math.min(5,x)},(i,S)=>{let C;return x<=5||p.currentPage<=3?C=S+1:p.currentPage>=x-2?C=x-4+S:C=p.currentPage-2+S,e.createElement(te,{key:C},e.createElement(fe,{href:"#",isActive:C===p.currentPage,onClick:ee=>{ee.preventDefault(),c||E(C)},className:c?"opacity-50 pointer-events-none":""},C))}),x>5&&p.currentPage<x-2&&e.createElement(te,null,e.createElement(ze,null)),e.createElement(te,null,e.createElement(Te,{href:"#",onClick:i=>{i.preventDefault(),!c&&p.currentPage<x&&E(p.currentPage+1)},className:c?"opacity-50 pointer-events-none":""})))))))});Ie.displayName="DataTable";const Rr=o.cva("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{variants:{variant:{default:"",outline:"border-2"},size:{default:"h-10",sm:"h-8",lg:"h-11"}},defaultVariants:{variant:"default",size:"default"}}),Mr=o.cva("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",{variants:{size:{default:"max-h-96",sm:"max-h-80",lg:"max-h-[28rem]"}},defaultVariants:{size:"default"}}),Dr=o.cva("relative flex cursor-default select-none items-center rounded-sm px-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{default:"py-1.5",sm:"py-1",lg:"py-2"}},defaultVariants:{size:"default"}}),Bt=o.cva("flex w-full rounded-md bg-transparent px-3 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{default:"h-10 py-2",sm:"h-8 py-1",lg:"h-11 py-2"}},defaultVariants:{size:"default"}}),Tr=o.cva("py-6 text-center text-sm text-muted-foreground"),Ut=ae.Root,Pe=e.forwardRef(({className:t,variant:r,size:a,children:s,...l},c)=>e.createElement(ae.Trigger,{ref:c,className:n(Rr({variant:r,size:a,className:t})),...l},s));Pe.displayName=ae.Trigger.displayName;const Le=e.forwardRef(({className:t,size:r,...a},s)=>e.createElement(ae.Portal,null,e.createElement(ae.Content,{ref:s,className:n(Mr({size:r}),t),...a})));Le.displayName=ae.Content.displayName;const je=e.forwardRef(({className:t,disabled:r,size:a,children:s,...l},c)=>e.createElement("div",{ref:c,className:n(Dr({size:a}),t),"data-disabled":r,...l},s));je.displayName="ComboboxItem";const zr=e.forwardRef(({options:t,value:r,onValueChange:a,placeholder:s="Select option...",searchPlaceholder:l="Search options...",emptyMessage:c="No options found.",disabled:u=!1,clearable:f=!1,searchable:g=!0,className:v,variant:h,size:b,...N},y)=>{const[R,F]=e.useState(!1),[w,j]=e.useState(""),B=e.useMemo(()=>!g||!w?t:t.filter(k=>k.label.toLowerCase().includes(w.toLowerCase())),[t,w,g]),T=e.useMemo(()=>t.find(k=>k.value===r),[t,r]),M=e.useCallback(k=>{const $=k===r?"":k;a==null||a($),F(!1),j("")},[r,a]),G=e.useCallback(k=>{k.preventDefault(),k.stopPropagation(),a==null||a(""),j("")},[a]);return e.createElement(Ut,{open:R,onOpenChange:F,...N},e.createElement(Pe,{ref:y,variant:h,size:b,className:n("w-full",v),disabled:u},e.createElement("span",{className:"truncate"},(T==null?void 0:T.label)??s),e.createElement("div",{className:"flex items-center gap-1"},f&&r&&e.createElement(_,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:G,tabIndex:-1},e.createElement(d.X,{className:"h-3 w-3"})),e.createElement(d.ChevronsUpDown,{className:"h-4 w-4 shrink-0 opacity-50"}))),e.createElement(Le,{className:"w-[--radix-popover-trigger-width] p-0",size:b},e.createElement("div",{className:"border-b"},g&&e.createElement("div",{className:"flex items-center border-b px-3"},e.createElement(d.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.createElement("input",{className:n(Bt({size:b}),"border-0"),placeholder:l,value:w,onChange:k=>j(k.target.value)}))),e.createElement("div",{className:"max-h-[300px] overflow-y-auto p-1"},B.length===0?e.createElement("div",{className:n(Tr())},c):e.createElement("div",{className:"space-y-1"},B.map(k=>e.createElement(je,{key:k.value,value:k.value,disabled:k.disabled,size:b,className:"cursor-pointer hover:bg-accent",onClick:()=>!k.disabled&&M(k.value)},e.createElement(d.Check,{className:n("mr-2 h-4 w-4",r===k.value?"opacity-100":"opacity-0")}),k.label))))))});zr.displayName="Combobox";const Ir=[{id:"acme-corp",name:"Acme Corporation",logoUrl:"https://images.unsplash.com/photo-1560179707-f14e90ef3623?w=32&h=32&fit=crop&crop=faces"},{id:"techstart-inc",name:"TechStart Inc",logoUrl:"https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=32&h=32&fit=crop&crop=faces"},{id:"global-solutions",name:"Global Solutions Ltd",logoUrl:"https://images.unsplash.com/photo-1572021335469-31706a17aaef?w=32&h=32&fit=crop&crop=faces"},{id:"innovation-labs",name:"Innovation Labs",logoUrl:"https://images.unsplash.com/photo-1551836022-d5d88e9218df?w=32&h=32&fit=crop&crop=faces"},{id:"digital-dynamics",name:"Digital Dynamics",logoUrl:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=32&h=32&fit=crop&crop=faces"},{id:"future-systems",name:"Future Systems",logoUrl:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=32&h=32&fit=crop&crop=faces"},{id:"nexus-tech",name:"Nexus Technologies",logoUrl:"https://images.unsplash.com/photo-1611224923853-80b023f02d71?w=32&h=32&fit=crop&crop=faces"},{id:"quantum-ventures",name:"Quantum Ventures",logoUrl:"https://images.unsplash.com/photo-1559136555-9303baea8ebd?w=32&h=32&fit=crop&crop=faces"},{id:"stellar-systems",name:"Stellar Systems",logoUrl:"https://images.unsplash.com/photo-1576091160399-112ba8d25d1f?w=32&h=32&fit=crop&crop=faces"},{id:"zenith-enterprises",name:"Zenith Enterprises",logoUrl:"https://images.unsplash.com/photo-1572021335469-31706a17aaef?w=32&h=32&fit=crop&crop=faces"},{id:"apex-solutions",name:"Apex Solutions",logoUrl:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=32&h=32&fit=crop&crop=faces"},{id:"vortex-media",name:"Vortex Media Group",logoUrl:"https://images.unsplash.com/photo-1551836022-d5d88e9218df?w=32&h=32&fit=crop&crop=faces"},{id:"crimson-capital",name:"Crimson Capital",logoUrl:"https://images.unsplash.com/photo-1560179707-f14e90ef3623?w=32&h=32&fit=crop&crop=faces"},{id:"phoenix-holdings",name:"Phoenix Holdings",logoUrl:"https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=32&h=32&fit=crop&crop=faces"},{id:"lightning-labs",name:"Lightning Labs",logoUrl:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=32&h=32&fit=crop&crop=faces"},{id:"omega-industries",name:"Omega Industries",logoUrl:"https://images.unsplash.com/photo-1611224923853-80b023f02d71?w=32&h=32&fit=crop&crop=faces"},{id:"catalyst-group",name:"Catalyst Group",logoUrl:"https://images.unsplash.com/photo-1559136555-9303baea8ebd?w=32&h=32&fit=crop&crop=faces"},{id:"infinite-reach",name:"Infinite Reach",logoUrl:"https://images.unsplash.com/photo-1576091160399-112ba8d25d1f?w=32&h=32&fit=crop&crop=faces"},{id:"prism-technologies",name:"Prism Technologies",logoUrl:"https://images.unsplash.com/photo-1572021335469-31706a17aaef?w=32&h=32&fit=crop&crop=faces"},{id:"vertex-dynamics",name:"Vertex Dynamics",logoUrl:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=32&h=32&fit=crop&crop=faces"},{id:"eclipse-ventures",name:"Eclipse Ventures",logoUrl:"https://images.unsplash.com/photo-1551836022-d5d88e9218df?w=32&h=32&fit=crop&crop=faces"},{id:"titan-corp",name:"Titan Corporation",logoUrl:"https://images.unsplash.com/photo-1560179707-f14e90ef3623?w=32&h=32&fit=crop&crop=faces"},{id:"meridian-systems",name:"Meridian Systems",logoUrl:"https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=32&h=32&fit=crop&crop=faces"},{id:"synapse-networks",name:"Synapse Networks",logoUrl:"https://images.unsplash.com/photo-1557804506-669a67965ba0?w=32&h=32&fit=crop&crop=faces"},{id:"aurora-digital",name:"Aurora Digital",logoUrl:"https://images.unsplash.com/photo-1611224923853-80b023f02d71?w=32&h=32&fit=crop&crop=faces"},{id:"matrix-solutions",name:"Matrix Solutions",logoUrl:"https://images.unsplash.com/photo-1559136555-9303baea8ebd?w=32&h=32&fit=crop&crop=faces"},{id:"nova-enterprises",name:"Nova Enterprises",logoUrl:"https://images.unsplash.com/photo-1576091160399-112ba8d25d1f?w=32&h=32&fit=crop&crop=faces"}],He=({logoUrl:t,name:r,className:a})=>{const[s,l]=e.useState(!1);return!t||s?e.createElement("div",{className:n("flex h-6 w-6 items-center justify-center rounded-sm bg-muted",a)},e.createElement(d.Building2,{className:"h-3 w-3 text-muted-foreground"})):e.createElement("img",{src:t,alt:`${r} logo`,className:n("h-6 w-6 rounded-sm object-cover",a),onError:()=>l(!0)})},Pr=()=>{const[t,r]=e.useState(""),a=e.useCallback(()=>window.location.pathname.split("/").filter(Boolean)[0]||"",[]);e.useEffect(()=>{const l=()=>{r(a())};l();const c=()=>l(),u=()=>l();window.addEventListener("popstate",c),window.addEventListener("hashchange",u);const f=window.history.pushState,g=window.history.replaceState;return window.history.pushState=function(...v){f.apply(this,v),l()},window.history.rep