@reeverdev/ui 0.2.252 → 0.2.253
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ 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=Hx[o],R=t==="vertical"||t==="both",M=t==="horizontal"||t==="both",k=[R&&p.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&p.bottom&&`linear-gradient(to top, transparent, black ${C})`,M&&p.left&&`linear-gradient(to right, transparent, black ${C})`,M&&p.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})]})});De.displayName="ScrollArea";var nd=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=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:p=240,size:f,radius:g,className:h,...v},b)=>{let[y,x]=q.useState(false),[w,C]=q.useState(""),[R,M]=q.useState(r||""),[k,D]=q.useState(r||[]),[P,S]=q.useState({top:0,left:0,width:0}),T=q.useRef(null),N=q.useRef(null),H=q.useRef(null),L=q.useRef(null),E=n!==void 0?n:R,I=n!==void 0?n:k,V=n!==void 0,K=G=>{d&&E===G?(V||M(""),o?.("")):(V||M(G),o?.(G)),x(false),C("");},B=G=>{let _=I.includes(G)?I.filter(Q=>Q!==G):[...I,G];V||D(_),o?.(_);},O=(G,_)=>{_.stopPropagation();let Q=I.filter(Y=>Y!==G);V||D(Q),o?.(Q);},z=G=>{G.stopPropagation(),t?(V||D([]),o?.([])):(V||M(""),o?.(""));},$=e.find(G=>G.value===E),W=e.filter(G=>I.includes(G.value)),A=W.slice(0,u),F=W.length-u,j=s?e.filter(G=>G.label.toLowerCase().includes(w.toLowerCase())):e;q.useEffect(()=>{if(y&&N.current){let G=N.current.getBoundingClientRect();S({top:G.bottom+4,left:G.left,width:G.width}),s&&setTimeout(()=>L.current?.focus(),0);}y||C("");},[y,s]),q.useEffect(()=>{let G=_=>{let Q=_.target,Y=T.current&&!T.current.contains(Q),ge=H.current&&!H.current.contains(Q);Y&&ge&&(x(false),C(""));};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]),q.useEffect(()=>{if(!y)return;let G=_=>{H.current?.contains(_.target)||(x(false),C(""));};return window.addEventListener("scroll",G,true),()=>window.removeEventListener("scroll",G,true)},[y]);let U=t?I.length>0:!!E;return jsxs("div",{ref:T,className:m("relative",h),...v,children:[jsxs("div",{ref:G=>{N.current=G,typeof b=="function"?b(G):b&&(b.current=G);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:m(nd({size:f,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:m(!$&&"text-muted-foreground"),children:$?$.label:a}),t&&jsx(Fragment,{children:W.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[A.map(G=>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:[G.label,jsx("span",{role:"button",tabIndex:0,onClick:_=>O(G.value,_),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&O(G.value,_);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},G.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:z,onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&z(G);},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"&&Pa.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:P.top,left:P.left,minWidth:P.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:L,type:"text",value:w,onChange:G=>C(G.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(De,{style:{maxHeight:p},onWheel:G=>G.stopPropagation(),children:jsx("div",{className:"p-1",children:j.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):j.map(G=>{let _=t?I.includes(G.value):E===G.value;return jsxs("div",{role:"option","aria-selected":_,onClick:()=>{G.disabled||(t?B(G.value):K(G.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",G.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:_&&jsx(Check,{className:"h-4 w-4"})}),G.label]},G.value)})})})]}),document.body)]})});Na.displayName="Select";var rd=q.createContext(null),Ho=()=>{let e=q.useContext(rd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},oi=q.createContext({radius:"md"}),ai=q.createContext(null),Wt=({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),p=q.useId(),f=q.useRef(new Map),g=q.useCallback(b=>{l||a(b),r?.(b),b||i(-1);},[l,r]),h=q.useCallback((b,y)=>{f.current.set(b,y);},[]),v=q.useCallback(b=>{f.current.delete(b);},[]);return jsx(rd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:p,activeIndex:s,setActiveIndex:i,items:f,registerItem:h,unregisterItem:v},children:e})};Wt.displayName="Dropdown";var _t=q.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ho();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})});_t.displayName="DropdownTrigger";var Kx={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Yt=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},p)=>{let{open:f,onOpenChange:g,triggerRef:h,contentRef:v,contentId:b,activeIndex:y,setActiveIndex:x,items:w}=Ho(),[C,R]=q.useState({top:0,left:0}),[M,k]=q.useState(t),[D,P]=q.useState(false),S=q.useRef(0);if(q.useEffect(()=>{P(true);},[]),q.useEffect(()=>{f&&(S.current=w.current.size);},[f,w]),q.useEffect(()=>{if(!f||!h.current||!v.current)return;let N=()=>{if(!h.current||!v.current)return;let H=h.current.getBoundingClientRect(),L=v.current.getBoundingClientRect(),E=window.innerWidth,I=window.innerHeight,V=0,K=0,B=t;switch(t){case "top":V=H.top-L.height-n,V<a&&(V=H.bottom+n,B="bottom");break;case "bottom":V=H.bottom+n,V+L.height>I-a&&(V=H.top-L.height-n,B="top");break;case "left":K=H.left-L.width-n,K<a&&(K=H.right+n,B="right");break;case "right":K=H.right+n,K+L.width>E-a&&(K=H.left-L.width-n,B="left");break}if(B==="top"||B==="bottom"){switch(r){case "start":K=H.left+o;break;case "center":K=H.left+H.width/2-L.width/2;break;case "end":K=H.right-L.width-o;break}K<a?K=a:K+L.width>E-a&&(K=E-L.width-a);}else {switch(r){case "start":V=H.top+o;break;case "center":V=H.top+H.height/2-L.height/2;break;case "end":V=H.bottom-L.height-o;break}V<a?V=a:V+L.height>I-a&&(V=I-L.height-a);}R({top:V,left:K}),k(B);};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,true),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,true);}},[f,t,n,r,o,a,h]),q.useEffect(()=>{if(!f)return;let N=H=>{let L=H.target;v.current&&!v.current.contains(L)&&h.current&&!h.current.contains(L)&&(s?.(),g(false));};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f,g,s,h,v]),q.useEffect(()=>{if(!f)return;let N=H=>{let L=Array.from(w.current.entries()).sort(([I],[V])=>I-V).map(([,I])=>I),E=L.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&&L[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[f,g,i,y,x,w,l,h]),q.useEffect(()=>{f&&y>=0&&Array.from(w.current.entries()).sort(([H],[L])=>H-L).map(([,H])=>H)[y]?.focus();},[f,y,w]),!D||!f)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"}[M];return Pa.createPortal(jsx("div",{ref:N=>{v.current=N,typeof p=="function"?p(N):p&&(p.current=N);},id:b,role:"menu","aria-orientation":"vertical","data-state":f?"open":"closed","data-side":M,"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",Kx[c],T,e),style:{top:C.top,left:C.left},...u,children:jsx(oi.Provider,{value:{radius:c},children:d})}),document.body)});Yt.displayName="DropdownContent";var od=0,ad={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Tt=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:p,setActiveIndex:f,registerItem:g,unregisterItem:h}=Ho(),{radius:v}=q.useContext(oi),[b]=q.useState(()=>od++),y=q.useRef(null);q.useEffect(()=>(!n&&y.current&&g(b,y.current),()=>{h(b);}),[n,b,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),u(false);},w=R=>{a?.(R),n||f(b);};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":p===b?"":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",ad[v],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Tt.displayName="DropdownItem";var si=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}));si.displayName="DropdownSection";var sd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));sd.displayName="DropdownSeparator";var id=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});id.displayName="DropdownShortcut";var ld=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));ld.displayName="DropdownGroup";var cd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),{contentRef:s}=Ho(),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(ai.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};cd.displayName="DropdownSub";var dd=q.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=q.useContext(ai),{setActiveIndex:d,registerItem:u,unregisterItem:p}=Ho(),{radius:f}=q.useContext(oi),[g]=q.useState(()=>od++),h=q.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:v,onOpenChange:b,triggerRef:y}=c;q.useEffect(()=>(!n&&h.current&&u(g,h.current),()=>{p(g);}),[n,g,u,p]);let x=R=>{o?.(R),n||(d(g),b(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),b(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":v,tabIndex:n?-1:0,"aria-disabled":n,"data-state":v?"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",ad[f],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"})]})});dd.displayName="DropdownSubTrigger";var ud=q.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=q.useContext(ai);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:p}=l,[f,g]=q.useState({top:0,left:0}),[h,v]=q.useState(false),b=q.useRef(null),y=q.useRef(null);q.useEffect(()=>{v(true);},[]),q.useEffect(()=>{if(!c||!u.current||!b.current)return;(()=>{if(!u.current||!b.current)return;let R=u.current.getBoundingClientRect(),M=b.current.getBoundingClientRect(),k=window.innerWidth,D=window.innerHeight,P=R.top+n,S=R.right+t;S+M.width>k-r&&(S=R.left-M.width-t),P+M.height>D-r&&(P=D-M.height-r),P<r&&(P=r),g({top:P,left:S});})();},[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)||p?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return q.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Pa.createPortal(jsx("div",{ref:C=>{b.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:f.top,left:f.left},onMouseEnter:x,onMouseLeave:w,...s}),document.body)});ud.displayName="DropdownSubContent";var $x=si;var fd=q.createContext(null),ii=()=>{let e=q.useContext(fd);if(!e)throw new Error("Popover components must be used within a Popover");return e},Mt=({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(fd.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};Mt.displayName="Popover";var _n=q.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=ii(),c=p=>{t?.(p),s(!a);},d=p=>{i.current=p,typeof o=="function"?o(p):o&&(o.current=p);},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:p=>{e.props.onClick?.(p),c(p);}}):jsx("button",{ref:d,type:"button",...u,children:e})});_n.displayName="PopoverTrigger";var Yn=q.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=ii();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Yn.displayName="PopoverAnchor";var Nt=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},p)=>{let{open:f,onOpenChange:g,triggerRef:h,contentId:v}=ii(),[b,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(!f||!h.current||!C)return;let k=()=>{if(!h.current||!C)return;let D=h.current.getBoundingClientRect(),P=C.getBoundingClientRect(),S=0,T=0;switch(n){case "top":S=D.top-P.height-r;break;case "bottom":S=D.bottom+r;break;case "left":T=D.left-P.width-r;break;case "right":T=D.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":T=D.left+a;break;case "center":T=D.left+D.width/2-P.width/2;break;case "end":T=D.right-P.width-a;break}else switch(o){case "start":S=D.top+a;break;case "center":S=D.top+D.height/2-P.height/2;break;case "end":S=D.bottom-P.height-a;break}y({top:S,left:T});};return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,true),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true);}},[f,n,r,o,a,h,C]),q.useEffect(()=>{if(!f)return;let k=D=>{let P=D.target;C&&C.contains(P)||h.current&&h.current.contains(P)||P.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",k),()=>document.removeEventListener("mouseup",k)},[f,g,s,h,C]),q.useEffect(()=>{if(!f)return;let k=D=>{D.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[f,g,i]),!x||!f)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"}[n];return Pa.createPortal(jsx("div",{ref:k=>{R(D=>D!==k?k:D),typeof p=="function"?p(k):p&&(p.current=k);},id:v,role:"dialog","data-state":f?"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",M,e),style:{...t,top:b.top,left:b.left},...u,children:d}),document.body)});Nt.displayName="PopoverContent";var gd=q.createContext(null),ci=()=>{let e=q.useContext(gd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},bd=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),p=t!==void 0,f=p?t:d,g=h=>{p||u(h),r?.(h);};return jsx(gd.Provider,{value:{value:f,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})})});bd.displayName="Tabs";var li={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"}},vd=q.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=ci(),l=q.useRef(null),[c,d]=q.useState({opacity:0});q.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let b=g.querySelector('[data-state="active"]');if(b){let y=g.getBoundingClientRect(),x=b.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 v=new ResizeObserver(h);return v.observe(g),()=>{v.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"},p=s==="vertical",f=()=>o==="solid"?p?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?p?"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",p&&"flex-col h-auto w-auto",li[a].list,u[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",li[a].indicator,f()),style:c,"aria-hidden":"true"}),t]})});vd.displayName="TabsList";var hd=q.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=ci(),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",li[c].trigger,u[l],e),onClick:p=>{r?.(p),i(t);},...o})});hd.displayName="TabsTrigger";var xd=q.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=ci(),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});xd.displayName="TabsContent";var Wx=({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 yd=q.createContext(null),Ea=()=>{let e=q.useContext(yd);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},di=q.createContext(null),Rd=({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(yd.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};Rd.displayName="ContextMenu";var wd=q.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Ea(),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})});wd.displayName="ContextMenuTrigger";var Cd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Cd.displayName="ContextMenuGroup";var Td=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};Td.displayName="ContextMenuPortal";var Md=({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(di.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Md.displayName="ContextMenuSub";var Nd=q.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Ea(),[d,u]=q.useState(false),[p,f]=q.useState(l),g=q.useRef(null);return q.useEffect(()=>{u(true);},[]),q.useEffect(()=>{if(!s||!g.current){f(l);return}let v=g.current.getBoundingClientRect(),{x:b,y}=l;b+v.width>window.innerWidth&&(b=window.innerWidth-v.width-8),y+v.height>window.innerHeight&&(y=window.innerHeight-v.height-8),f({x:b,y});},[s,l]),q.useEffect(()=>{if(!s)return;let h=v=>{let b=v.target;g.current&&!g.current.contains(b)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),q.useEffect(()=>{if(!s)return;let h=v=>{v.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Pa.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:p.y,left:p.x},...o,children:r}),document.body)});Nd.displayName="ContextMenuContent";var kd=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=q.useContext(di);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=f=>{r?.(f),c(true);},p=f=>{o?.(f),c(false);};return jsxs("div",{ref:f=>{d.current=f,typeof s=="function"?s(f):s&&(s.current=f);},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:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});kd.displayName="ContextMenuSubTrigger";var Pd=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=q.useContext(di);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}),[p,f]=q.useState(false),g=q.useRef(null);q.useEffect(()=>{f(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=b=>{n?.(b),l(true);},v=b=>{r?.(b),l(false);};return !p||!i?null:Pa.createPortal(jsx("div",{ref:b=>{g.current=b,typeof a=="function"?a(b):a&&(a.current=b);},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:v,...o}),document.body)});Pd.displayName="ContextMenuSubContent";var Ed=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Ea(),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})});Ed.displayName="ContextMenuItem";var Ld=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Ea(),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]})});Ld.displayName="ContextMenuCheckboxItem";var Sd=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}));Sd.displayName="ContextMenuSection";var Dd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));Dd.displayName="ContextMenuSeparator";var Hd=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Hd.displayName="ContextMenuShortcut";var Ad=q.createContext(null),Zx=()=>{let e=q.useContext(Ad);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},zd=q.createContext(null),Sa=()=>{let e=q.useContext(zd);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},Vo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},La={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},secondary:{border:"border-input",borderChecked:"border-secondary",indicator:"bg-secondary",ring:"ring-secondary/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},Od=q.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...u},p)=>{let[f,g]=q.useState(n),h=t!==void 0,v=h?t:f,b=q.useId(),y=x=>{h||g(x),r?.(x);};return jsx("div",{ref:p,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...u,children:jsx(Ad.Provider,{value:{name:o||b,value:v,onValueChange:y,disabled:a,required:s,size:l,color:c},children:d})})});Od.displayName="RadioGroup";var Bd=q.forwardRef(({className:e,value:t,disabled:n,children:r,...o},a)=>{let s=Zx(),[i,l]=q.useState(false),c=s.value===t,d=n||s.disabled,u=()=>{d||s.onValueChange(t);},p=Vo[s.size||"md"];return jsx(zd.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:u,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:m("flex items-start cursor-pointer select-none",p.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[r,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Bd.displayName="Radio";var Fd=q.forwardRef(({className:e,children:t},n)=>{let{isChecked:r,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=Sa(),d=Vo[l],u=!(c in La),p=u?null:La[c],f=u?{borderColor:r?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:n,type:"button",role:"radio","aria-checked":r,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:f,className:m("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,p&&(r?p.borderChecked:p.border),p&&a&&p.ring,!u&&!r&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:r?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(ui,{})})});Fd.displayName="RadioControl";var ui=q.forwardRef(({className:e,forceMount:t},n)=>{let{isChecked:r,size:o,color:a}=Sa(),s=Vo[o],i=!(a in La),l=i?null:La[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||r)&&jsx(motion.span,{ref:n,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:m("rounded-full",s.indicator,l?.indicator,e)})})});ui.displayName="RadioIndicator";var Kd=q.forwardRef(({className:e,children:t,...n},r)=>{let{size:o,isDisabled:a}=Sa(),s=Vo[o];return jsx("span",{ref:r,className:m("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...n,children:t})});Kd.displayName="RadioLabel";var $d=q.forwardRef(({className:e,children:t,...n},r)=>{let{size:o}=Sa(),a=Vo[o];return jsx("span",{ref:r,className:m("text-muted-foreground leading-snug",a.description,e),...n,children:t})});$d.displayName="RadioDescription";var Gd=q.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("flex flex-col gap-0.5",e),...n,children:t}));Gd.displayName="RadioContent";var Ha=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"}}),Ud=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),p=r!==void 0,f=p?r:d,g=()=>{if(s)return;let v=!f;p||u(v),a?.(v);},h=v=>{v.key==="Enter"&&v.preventDefault(),i?.(v);};return jsx("button",{type:"button","aria-pressed":f,"data-state":f?"on":"off",disabled:s,ref:c,className:m(Ha({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Ud.displayName="Toggle";var jd=q.createContext(null),ty=()=>{let e=q.useContext(jd);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},Wd=q.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[u,p]=q.useState(()=>r==="single"?a?[a]:[]:a||[]),f=o!==void 0,g=f?r==="single"?o?[o]:[]:o:u,h=v=>{if(r==="single"){let b=g.includes(v)?[]:[v];f||p(b),s?.(b[0]||"");}else {let b=g.includes(v)?g.filter(y=>y!==v):[...g,v];f||p(b),s?.(b);}};return jsx("div",{ref:d,role:"group",className:m("flex items-center justify-center gap-1",e),...c,children:jsx(jd.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});Wd.displayName="ToggleGroup";var _d=q.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=ty(),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(Ha({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});_d.displayName="ToggleGroupItem";var qt=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",trackColor:d="primary",name:u,...p},f)=>{let[g,h]=q.useState(n),v=t!==void 0,b=v?t:g,y=q.useRef(null),[x,w]=q.useState(false),[C,R]=q.useState(null),M=(B,O)=>{if(!y.current)return b[0];let z=y.current.getBoundingClientRect(),$;c==="horizontal"?$=(B-z.left)/z.width:$=1-(O-z.top)/z.height,$=Math.max(0,Math.min(1,$));let W=a+$*(s-a),A=Math.round(W/i)*i;return Math.max(a,Math.min(s,A))},k=(B,O)=>{let z=[...b];z[O]=B,O>0&&B<b[O-1]&&(z[O]=b[O-1]),O<b.length-1&&B>b[O+1]&&(z[O]=b[O+1]),v||h(z),r?.(z);},D=(B,O)=>{l||(B.preventDefault(),w(true),R(O),B.target.setPointerCapture(B.pointerId));},P=B=>{if(!x||C===null||l)return;let O=M(B.clientX,B.clientY);k(O,C);},S=()=>{x&&(w(false),R(null),o?.(b));},T=B=>{if(l)return;let O=M(B.clientX,B.clientY),z=0,$=Math.abs(b[0]-O);for(let W=1;W<b.length;W++){let A=Math.abs(b[W]-O);A<$&&($=A,z=W);}k(O,z),o?.([...b.slice(0,z),O,...b.slice(z+1)]);},N=(B,O)=>{if(l)return;let z=b[O];switch(B.key){case "ArrowRight":case "ArrowUp":B.preventDefault(),z=Math.min(s,b[O]+i);break;case "ArrowLeft":case "ArrowDown":B.preventDefault(),z=Math.max(a,b[O]-i);break;case "Home":B.preventDefault(),z=a;break;case "End":B.preventDefault(),z=s;break;default:return}k(z,O),o?.([...b.slice(0,O),z,...b.slice(O+1)]);},H=B=>(B-a)/(s-a)*100,L={primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},E=!(d in L),I=E?null:L[d],V=E?{backgroundColor:d}:void 0,K=E?{borderColor:d}:void 0;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),...p,children:[jsx("div",{ref:y,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:T,children:jsx("div",{className:m("absolute",I?.track),style:c==="horizontal"?{left:b.length>1?`${H(b[0])}%`:0,right:`${100-H(b[b.length-1])}%`,top:0,bottom:0,...V}:{bottom:b.length>1?`${H(b[0])}%`:0,top:`${100-H(b[b.length-1])}%`,left:0,right:0,...V}})}),b.map((B,O)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":B,"aria-orientation":c,"aria-disabled":l,className:m("absolute block h-5 w-5 rounded-full border-2 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",I?.thumb,x&&C===O&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${H(B)}% - 10px)`,top:"50%",transform:"translateY(-50%)",...K}:{bottom:`calc(${H(B)}% - 10px)`,left:"50%",transform:"translateX(-50%)",...K},onPointerDown:z=>D(z,O),onPointerMove:P,onPointerUp:S,onPointerCancel:S,onKeyDown:z=>N(z,O)},O)),u&&b.map((B,O)=>jsx("input",{type:"hidden",name:b.length>1?`${u}[${O}]`:u,value:B},O))]})});qt.displayName="Slider";var Yd=q.createContext(null),qd=()=>{let e=q.useContext(Yd);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},pi=q.createContext(null),Xd=()=>{let e=q.useContext(pi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Zd=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||[]),p=q.useRef(new Map),f=q.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,v=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);}},b=q.useCallback((w,C)=>{p.current.set(w,C),f.current.includes(w)||f.current.push(w);},[]),y=q.useCallback(w=>{p.current.delete(w),f.current=f.current.filter(C=>C!==w);},[]),x=q.useCallback(w=>{let C=f.current;if(C.length===0)return;let R=document.activeElement,M;p.current.forEach((T,N)=>{T===R&&(M=N);});let k=M?C.indexOf(M):-1,D;switch(w){case "first":D=0;break;case "last":D=C.length-1;break;case "next":D=k===-1?0:(k+1)%C.length;break;case "prev":D=k===-1?C.length-1:(k-1+C.length)%C.length;break}let P=C[D];p.current.get(P)?.focus();},[]);return jsx(Yd.Provider,{value:{type:t,value:h,onValueChange:v,collapsible:a,disabled:s,registerTrigger:b,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:m("w-full",e),...l,children:i})})});Zd.displayName="Accordion";var Qd=q.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=qd(),d=c.value.includes(t),u=n||c.disabled||false,p=q.useId(),f=q.useId();return r!==void 0?jsx(pi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:p,triggerId:f},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(Jd,{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(eu,{children:s})]})}):jsx(pi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:p,triggerId:f},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})})});Qd.displayName="AccordionItem";var Jd=q.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=qd(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=Xd(),p=q.useRef(null);q.useEffect(()=>{let g=p.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let f=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=>{p.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:f,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});Jd.displayName="AccordionTrigger";var eu=q.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Xd();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})})})});eu.displayName="AccordionContent";var nu=q.createContext(null),ru=()=>{let e=q.useContext(nu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},ou=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,p=u?t:c,f=q.useId(),g=q.useId(),h=v=>{o||(u||d(v),r?.(v));};return jsx(nu.Provider,{value:{open:p,onOpenChange:h,disabled:o,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":p?"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(fi,{})]}),s]})})});ou.displayName="Collapsible";var fi=q.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=ru();return jsx(de,{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")})})});fi.displayName="CollapsibleTrigger";var au=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),[p,f]=q.useState(false),[g,h]=q.useState(a);q.useEffect(()=>{a?(h(true),u(0),f(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(f(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(0));},[a]);let v=()=>{f(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:p?d:a?"auto":0,transition:p?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:v,...r,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});au.displayName="CollapsibleContent";var sy=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"}}),su={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},za=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,p=su[i]||"",f=!su[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(sy({size:s}),e),...l,children:jsx("div",{className:m("h-full w-full flex-1 transition-all rounded-full",p),style:{transform:`translateX(-${100-d}%)`,...f?{backgroundColor:i}:{}}})})]})});za.displayName="Progress";var du=q.createContext(null),uu=()=>{let e=q.useContext(du);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},mu=({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),p=q.useId(),f=q.useRef(null),g=q.useRef(null),h=q.useCallback(v=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),v?f.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 v=()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",v,true),()=>window.removeEventListener("scroll",v,true)},[s,d,c,r]),q.useEffect(()=>()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current);},[]),jsx(du.Provider,{value:{open:d,onOpenChange:h,triggerRef:u,contentId:p},children:e})};mu.displayName="HoverCard";var pu=q.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=uu();return jsx("a",{ref:f=>{l.current=f,typeof s=="function"?s(f):s&&(s.current=f);},onMouseEnter:f=>{t?.(f),i(true);},onMouseLeave:f=>{n?.(f),i(false);},onFocus:f=>{r?.(f),i(true);},onBlur:f=>{o?.(f),i(false);},...a,children:e})});pu.displayName="HoverCardTrigger";var fu=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:p,contentId:f}=uu(),[g,h]=q.useState({top:0,left:0}),[v,b]=q.useState(false),y=q.useRef(null);q.useEffect(()=>{b(true);},[]),q.useEffect(()=>{if(!d||!p.current||!y.current)return;(()=>{if(!p.current||!y.current)return;let M=p.current.getBoundingClientRect(),k=y.current.getBoundingClientRect(),D=0,P=0;switch(t){case "top":D=M.top-k.height-n;break;case "bottom":D=M.bottom+n;break;case "left":P=M.left-k.width-n;break;case "right":P=M.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":P=M.left+o;break;case "center":P=M.left+M.width/2-k.width/2;break;case "end":P=M.right-k.width-o;break}else switch(r){case "start":D=M.top+o;break;case "center":D=M.top+M.height/2-k.height/2;break;case "end":D=M.bottom-k.height-o;break}h({top:D,left:P});})();},[d,t,n,r,o,p]);let x=R=>{a?.(R),u(true);},w=R=>{s?.(R),u(false);};if(!v||!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 Pa.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:f,"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)});fu.displayName="HoverCardContent";var gu=q.createContext({size:"md",variant:"default",radius:"md"}),Ba=()=>q.useContext(gu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var cy=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"}}),dy=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"}}),uy=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"}}),bu=q.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(gu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));bu.displayName="Breadcrumb";var vu=q.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=Ba();return jsx("ol",{ref:n,className:m(cy({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});vu.displayName="BreadcrumbList";var hu=q.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})});hu.displayName="BreadcrumbItem";var xu=q.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));xu.displayName="BreadcrumbLink";var yu=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}));yu.displayName="BreadcrumbPage";var Ru=({children:e,className:t,...n})=>{let{size:r}=Ba();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(dy({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};Ru.displayName="BreadcrumbSeparator";var wu=({className:e,...t})=>{let{size:n}=Ba();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(uy({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};wu.displayName="BreadcrumbEllipsis";var Mu=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})}));Mu.displayName="AspectRatio";var Pu=q.createContext(null),bi=()=>{let e=q.useContext(Pu);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Eu=q.createContext(null),Lu=()=>{let e=q.useContext(Eu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Su=q.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=q.useState(null);return jsx(Pu.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(vi,{})]})})});Su.displayName="NavigationMenu";var Du=q.forwardRef(({className:e,...t},n)=>{let{orientation:r}=bi();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})});Du.displayName="NavigationMenuList";var Hu=q.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=bi(),s=q.useId(),i=q.useRef(null),l=o===s,c=q.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Eu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:m("relative",e),...n,children:t})})});Hu.displayName="NavigationMenuItem";var Iu=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"),Vu=q.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Lu(),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(Iu(),"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"})]})});Vu.displayName="NavigationMenuTrigger";var Au=q.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Lu(),l=q.useRef(null),[c,d]=q.useState({top:0,left:0});q.useEffect(()=>{if(!a||!i.current)return;let f=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,true),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,true);}},[a,i]);let u=f=>{t?.(f),s(true);},p=f=>{n?.(f),s(false);};return a?Pa.createPortal(jsx("div",{ref:f=>{l.current=f,typeof o=="function"?o(f):o&&(o.current=f);},"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:p,...r}),document.body):null});Au.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"),Ou=q.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:m(zu(),t&&"bg-accent text-accent-foreground",e),...n}));Ou.displayName="NavigationMenuLink";var vi=q.forwardRef((e,t)=>null);vi.displayName="NavigationMenuViewport";var Bu=q.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=bi();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});Bu.displayName="NavigationMenuIndicator";var Ao=0,hi=null;function Pn(){Ao===0&&(hi=document.body.style.overflow,document.body.style.overflow="hidden"),Ao++;}function En(){Ao--,Ao<=0&&(Ao=0,document.body.style.overflow=hi??"",hi=null);}var Gu=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none 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"}}),vt=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(Gu({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});vt.displayName="CloseButton";var Fa=q.createContext(null);function wy(){let e=q.useContext(Fa);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Ln(){return q.useContext(Fa)}var Cy="16rem",Ty="18rem",My="3rem",Ny="b",ky={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},Py={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},xi=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:p,...f},g)=>{let h=c??"overlay",v=h==="overlay",[b,y]=q.useState(false),[x,w]=q.useState(false),[C,R]=q.useState(e),M=t??C,k=q.useCallback(T=>{let N=typeof T=="function"?T(M):T;n?n(N):R(N);},[n,M]);q.useEffect(()=>{let T=()=>{y(window.innerWidth<768);};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);let D=q.useCallback(()=>v?k(T=>!T):b?w(T=>!T):k(T=>!T),[b,k,w,v]);q.useEffect(()=>{if(v)return;let T=N=>{N.key===Ny&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),D());};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[D,v]);let P=M?"expanded":"collapsed",S=q.useMemo(()=>({placement:r,state:P,open:M,setOpen:k,isMobile:b,openMobile:x,setOpenMobile:w,toggleDrawer:D,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,P,M,k,b,x,w,D,l,h,o,a,s,i]);return v?jsx(Fa.Provider,{value:S,children:jsx(Drawer.Root,{open:M,onOpenChange:k,direction:r,dismissible:s,children:p})}):jsx(Fa.Provider,{value:S,children:jsx(Xr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":Cy,"--drawer-width-icon":My,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...f,children:p})})})});xi.displayName="Drawer";var ju=q.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Ln();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:p}=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(Ey,{open:u,onOpenChange:p,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",v=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":v&&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})})]})});ju.displayName="DrawerSidebar";var Ey=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=q.useState(false);return q.useEffect(()=>{a(true);},[]),q.useEffect(()=>{if(t)return Pn(),()=>En()},[t]),!o||!t?null:Pa.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":Ty},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Wu=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Ln();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"})]})});Wu.displayName="DrawerTrigger";var _u=q.forwardRef(({className:e,children:t,...n},r)=>{let o=Ln(),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?ky[i]:Py[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},f={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",p[l])}),jsxs(Drawer.Content,{ref:r,className:m("fixed z-50 flex flex-col border bg-background",f[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})});_u.displayName="DrawerContent";var Yu=q.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Ln(),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(vt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Yu.displayName="DrawerHeader";var qu=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}));qu.displayName="DrawerBody";var Xu=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}));Xu.displayName="DrawerFooter";var Zu=q.forwardRef(({className:e,...t},n)=>Ln()?.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}));Zu.displayName="DrawerTitle";var Qu=q.forwardRef(({className:e,...t},n)=>Ln()?.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}));Qu.displayName="DrawerDescription";var Ju=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Ln();return jsx(vt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});Ju.displayName="DrawerClose";var em=q.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Ln();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,p=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:f=>{t?.(f),s();},...r,children:[c?jsx(u,{className:"h-4 w-4 shrink-0"}):jsx(p,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});em.displayName="DrawerToggle";var tm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));tm.displayName="DrawerSeparator";var nm=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}));nm.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 om=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"}}),am=q.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Ln(),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(om({variant:t,size:n}),o),...s,children:a});return r?jsxs(Un,{children:[jsx(jn,{children:u}),jsx(Wn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):u});am.displayName="DrawerMenuButton";var sm=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}));sm.displayName="DrawerGroup";var im=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}));im.displayName="DrawerGroupLabel";var lm=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}));lm.displayName="DrawerInset";var Ly=xi;var dm=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})}));dm.displayName="Table";var um=q.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:m("[&_tr]:border-b",e),...t}));um.displayName="TableHeader";var mm=q.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:m("[&_tr:last-child]:border-0",e),...t}));mm.displayName="TableBody";var pm=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}));pm.displayName="TableFooter";var fm=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}));fm.displayName="TableRow";var gm=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}));gm.displayName="TableHead";var bm=q.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));bm.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 Ay({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:p,onPaginationChange:f,emptyContent:g="No data",loading:h=false,striped:v=false,hoverable:b=true,...y},x){let[w,C]=q.useState(new Set),[R,M]=q.useState({columnId:null,direction:null}),[k,D]=q.useState({pageIndex:0,pageSize:u[0]||10}),P=o??w,S=l??R,T=p??k,N=A=>{a?a(A):C(A);},H=A=>{c?c(A):M(A);},L=A=>{f?f(A):D(A);},E=q.useMemo(()=>{if(!S.columnId||!S.direction)return t;let A=n.find(F=>F.id===S.columnId);return A?[...t].sort((F,j)=>{let U=A.accessor(F),G=A.accessor(j);if(U===G)return 0;if(U==null)return 1;if(G==null)return -1;let _=String(U).localeCompare(String(G),void 0,{numeric:true});return S.direction==="asc"?_:-_}):t},[t,S,n]),I=q.useMemo(()=>{if(!d)return E;let A=T.pageIndex*T.pageSize;return E.slice(A,A+T.pageSize)},[E,d,T]),V=Math.ceil(E.length/T.pageSize),K=A=>{if(A===true){let F=new Set(I.map((j,U)=>s(j,U)));N(F);}else N(new Set);},B=(A,F)=>{let j=new Set(P);F?j.add(A):j.delete(A),N(j);},O=I.length>0&&I.every((A,F)=>P.has(s(A,F))),z=I.some((A,F)=>P.has(s(A,F))),$=A=>{if(!n.find(U=>U.id===A)?.sortable&&!i)return;let j="asc";S.columnId===A&&(S.direction==="asc"?j="desc":S.direction==="desc"&&(j=null)),H({columnId:j?A:null,direction:j});},W=A=>S.columnId!==A?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):S.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className: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:O?true:z?"indeterminate":false,onCheckedChange:K,"aria-label":"Select all"})}),n.map(A=>{let F=A.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:A.width},onClick:()=>F&&$(A.id),children:jsxs("div",{className:"flex items-center gap-2",children:[A.header,F&&W(A.id)]})},A.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((A,F)=>{let j=s(A,F),U=P.has(j);return jsxs("tr",{className:m("border-b transition-colors",b&&"hover:bg-muted/50",v&&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(So,{checked:U,onCheckedChange:G=>B(j,!!G),"aria-label":`Select row ${F+1}`})}),n.map(G=>jsx("td",{className:"p-4 align-middle",children:G.cell?G.cell(A,F):G.accessor(A)},G.id))]},j)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:T.pageSize,onChange:A=>L({pageIndex:0,pageSize:Number(A.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(A=>jsx("option",{value:A,children:A},A))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",T.pageIndex+1," of ",V||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(de,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>L({...T,pageIndex:T.pageIndex-1}),disabled:T.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(de,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>L({...T,pageIndex:T.pageIndex+1}),disabled:T.pageIndex>=V-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var zy=q.forwardRef(Ay);var yi=["January","February","March","April","May","June","July","August","September","October","November","December"];function Uy({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(Wt,{children:[jsx(_t,{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:yi[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Yt,{className:"min-w-[120px] p-0",children:jsx(De,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:yi.map((c,d)=>jsx(Tt,{onSelect:()=>s(d),className:m("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(Wt,{children:[jsx(_t,{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(Yt,{className:"min-w-[80px] p-0",children:jsx(De,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Tt,{onSelect:()=>i(c),className:m("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function jy(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(Uy,{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=yi[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 Zr({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(()=>jy(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})}Zr.displayName="Calendar";var Rm=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});Rm.displayName="Pagination";var wm=q.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:m("flex flex-row items-center gap-1",e),...t}));wm.displayName="PaginationContent";var Cm=q.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:m("",e),...t}));Cm.displayName="PaginationItem";var qy={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},Ka=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:m(Ur({variant:t?"solid":"light",size:n,radius:r}),o&&qy[n],e),...a});Ka.displayName="PaginationLink";var Tm=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to previous page",isIconOnly:false,className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});Tm.displayName="PaginationPrevious";var Mm=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to next page",isIconOnly:false,className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Mm.displayName="PaginationNext";var Xy={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},Nm=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:m("flex items-center justify-center",Xy[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});Nm.displayName="PaginationEllipsis";var zo=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}));zo.displayName="VisuallyHidden";var Pm={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},Qy={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"},Em=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"),Ti=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=q.createContext(null),Mr=()=>{let e=q.useContext(Ga);if(!e)throw new Error("Modal components must be used within a Modal");return e},Sm=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:p},f)=>{let[g,h]=q.useState(false),v=e!==void 0,b=v?e:g,[y,x]=q.useState(false),w=q.useRef(null),C=q.useId(),R=q.useId();q.useEffect(()=>{x(true);},[]);let M=q.useCallback(S=>{v||h(S),t?.(S);},[v,t]);q.useEffect(()=>{if(b)return Pn(),()=>En()},[b]),q.useEffect(()=>{if(!b||i)return;let S=T=>{T.key==="Escape"&&M(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[b,i,M]);let k=S=>{s&&S.target===S.currentTarget&&M(false);},D=n?q.isValidElement(n)?q.cloneElement(n,{onClick:S=>{n.props.onClick?.(S),M(true);}}):jsx("button",{type:"button",onClick:()=>M(true),children:n}):null,P=()=>!y||!b?null:d==="outside"?Pa.createPortal(jsx("div",{"data-state":b?"open":"closed",className:m(Em(),Pm[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:k,children:jsxs("div",{ref:S=>{w.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"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",p),children:[jsx(zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>M(false)})]})}),document.body):Pa.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":b?"open":"closed",className:m(Em(),Pm[l]),onClick:k,"aria-hidden":"true"}),jsxs("div",{ref:S=>{w.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:m(Ti({size:u}),Qy[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",p),children:[jsx(zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>M(false)})]})]}),document.body);return jsxs(Ga.Provider,{value:{open:b,onOpenChange:M,scrollBehavior:d,titleId:C,descriptionId:R},children:[D,P()]})});Sm.displayName="Modal";var Ua=({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(p=>{i||s(p),r?.(p);},[i,r]);return jsx(Ga.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Ua.displayName="ModalRoot";var Dm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Mr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Dm.displayName="ModalTrigger";var Mi=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};Mi.displayName="ModalPortal";var Ni=q.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Mr();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});Ni.displayName="ModalOverlay";var Hm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Mr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Hm.displayName="ModalClose";var ja=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}=Mr(),[p,f]=q.useState(false);return q.useEffect(()=>{f(true);},[]),q.useEffect(()=>{if(l)return Pn(),()=>En()},[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]),!p||!l?null:jsxs(Mi,{children:[jsx(Ni,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Ti({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ja.displayName="ModalContent";var Im=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Im.displayName="ModalHeader";var Vm=({className:e,children:t})=>(q.useContext(Ga)?.scrollBehavior??"inside")==="inside"?jsx(De,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Vm.displayName="ModalBody";var Am=({className:e,children:t,...n})=>{let{onOpenChange:r}=Mr();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)})};Am.displayName="ModalFooter";var zm=q.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Mr();return jsx("h2",{ref:n,id:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});zm.displayName="ModalTitle";var Om=q.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Mr();return jsx("p",{ref:n,id:r,className:m("text-sm text-muted-foreground",e),...t})});Om.displayName="ModalDescription";var ki=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}));ki.displayName=Command.displayName;var t0=({children:e,...t})=>jsx(Ua,{...t,children:jsx(ja,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(ki,{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})})}),Bm=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})]}));Bm.displayName=Command.Input.displayName;var Fm=q.forwardRef(({className:e,children:t,...n},r)=>jsx(De,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:m("overflow-hidden",e),...n,children:t})}));Fm.displayName=Command.List.displayName;var Km=q.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Km.displayName=Command.Empty.displayName;var $m=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}));$m.displayName=Command.Group.displayName;var Gm=q.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:m("-mx-1 h-px bg-border",e),...t}));Gm.displayName=Command.Separator.displayName;var Um=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]}));Um.displayName=Command.Item.displayName;var jm=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});jm.displayName="CommandShortcut";var o0={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"}},a0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},_m=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),[p,f]=q.useState(false),g=o0[s],h=a0[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:p?"var(--color-foreground)":void 0},onFocus:v=>{f(true),r?.(v);},onBlur:v=>{f(false),o?.(v);},...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})})]})});_m.displayName="PasswordInput";var c0={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},d0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Ym=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},p)=>{let[f,g]=q.useState(s),[h,v]=q.useState(false),b=a!==void 0,y=b?a:f,x=c0[c],w=d0[d],C=T=>{T!==void 0&&(r!==void 0&&T<r&&(T=r),o!==void 0&&T>o&&(T=o)),b||g(T),i?.(T);},R=()=>{C((y??0)+n);},M=()=>{C((y??0)-n);},k=T=>{let N=T.target.value;if(N==="")C(void 0);else {let H=parseFloat(N);isNaN(H)||C(H);}},D=T=>{T.key==="ArrowUp"?(T.preventDefault(),R()):T.key==="ArrowDown"&&(T.preventDefault(),M());},P=r===void 0||(y??0)>r,S=o===void 0||(y??0)<o;return t?jsxs("div",{className:m("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:M,disabled:l||!P,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:p,value:y??"",onChange:k,onKeyDown:D,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...u}),jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:R,disabled:l||!S,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:p,value:y??"",onChange:k,onKeyDown:D,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...u})});Ym.displayName="NumberInput";var Qm=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),qm=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"}}),Jm=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,p)=>{let f=jsxs(Rr,{className:m(qm({size:r})),children:[u.src&&jsx(qr,{src:u.src,alt:u.alt||""}),jsx(wr,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]},p);return o&&u.alt?jsxs(Un,{children:[jsx(jn,{children:f}),jsx(Wn,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:u.alt})]},p):f},d=jsxs("div",{ref:s,className:m(Qm({size:r,className:e})),...a,children:[i.map((u,p)=>c(u,p)),l>0&&jsx(Rr,{className:m(qm({size:r})),children:jsxs(wr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(Xr,{delayDuration:300,children:d}):d});Jm.displayName="AvatarGroup";var ep=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"}}),tp=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,...p},f)=>{let[g,h]=q.useState(n),[v,b]=q.useState(null),y=t!==void 0,x=y?t:g,w=v!==null?v:x,C=N=>{l||c||(y||h(N),r?.(N));},R=(N,H=false)=>{let L=i&&H?N+.5:N+1;C(L);},M=(N,H)=>{if(l||c)return;let L=N.currentTarget.getBoundingClientRect(),E=i&&N.clientX<L.left+L.width/2;b(E?H+.5:H+1);},k=()=>{b(null);},D=s==="heart"?Heart:Star,P=N=>w>=N+1?"full":w>=N+.5?"half":"empty",S=d?{color:d,fill:d}:{},T=u?{color:u}:{};return jsx("div",{ref:f,className:m(ep({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:k,role:"radiogroup","aria-label":"Rating",...p,children:Array.from({length:o},(N,H)=>{let L=P(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(),V=i&&E.clientX<I.left+I.width/2;R(H,V);},onMouseMove:E=>M(E,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(D,{className:m("text-muted-foreground/30",L!=="empty"&&"absolute inset-0"),style:L==="empty"?T:void 0}),L!=="empty"&&jsx(D,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",L==="half"&&"clip-path-half"),style:{...S,clipPath:L==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});tp.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}}),v0={sm:"sm",md:"sm",lg:"sm"},op=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:p,...f},g)=>{let h=a||!!p,v=b=>{b.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:p,onKeyDown:h&&!d?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),p?.(b));}:void 0,className:m(rp({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...f,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(vt,{size:v0[r??"md"],onClick:v,disabled:d,className:"ml-0.5 h-4 w-4"})]})});op.displayName="Chip";var ap=createContext({direction:"horizontal"}),M0=({className:e,direction:t="horizontal",children:n,...r})=>jsx(ap.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})}),N0=Panel,k0=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(ap),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"}}),E0={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"}},sp={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)"},dp=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=E0[t],p=(u.size-u.strokeWidth)/2,f=2*Math.PI*p,g=f-d/100*f;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:p,strokeWidth:u.strokeWidth,fill:"none"}),jsx("circle",{cx:u.size/2,cy:u.size/2,r:p,strokeWidth:u.strokeWidth,fill:"none",strokeLinecap:"round",stroke:sp[n]||sp.default,strokeDasharray:`${f} ${f}`,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)})]})});dp.displayName="CircularProgress";var up=q.createContext(null),D0=()=>{let e=q.useContext(up);if(!e)throw new Error("OTP components must be used within InputOTP");return e},mp=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"}}),pp=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,...p},f)=>{let[g,h]=q.useState(o),[v,b]=q.useState(0),[y,x]=q.useState(false),w=q.useRef(null),C=r!==void 0?r:g;q.useImperativeHandle(f,()=>w.current),q.useEffect(()=>{b(Math.min(C.length,n-1));},[C,n]),q.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=T=>{let N=T.target.value;if(i&&N){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));N=N.split("").filter(L=>H.test(L)).join("");}N=N.slice(0,n),r===void 0&&h(N),a?.(N);},M=T=>{T.key==="ArrowLeft"?b(N=>Math.max(0,N-1)):T.key==="ArrowRight"&&b(N=>Math.min(C.length,n-1,N+1));},k=()=>{w.current?.focus();},D=()=>{x(true),b(Math.min(C.length,n-1));},P=()=>{x(false);},S={value:C,activeIndex:y?v:-1,maxLength:n,disabled:l,radius:d};return jsx(up.Provider,{value:S,children:jsxs("div",{className:m(mp({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:M,onFocus:D,onBlur:P,disabled:l,maxLength:n,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...p}),u]})})});pp.displayName="InputOTP";var fp=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center",e),...t}));fp.displayName="InputOTPGroup";var H0={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"},I0={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"},gp=q.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=D0(),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",H0[i],I0[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"})})]})});gp.displayName="InputOTPSlot";var bp=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"})}));bp.displayName="InputOTPSeparator";var xp=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"}}),yp=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:p,renderTag:f,...g},h)=>{let[v,b]=q.useState(""),[y,x]=q.useState(false),w=q.useRef(null);q.useImperativeHandle(h,()=>w.current);let C=T=>{let N=T.trim();if(N.length<i||N.length>l||s&&r.length>=s||!d&&r.some(L=>L.text.toLowerCase()===N.toLowerCase()))return;let H={id:crypto.randomUUID(),text:N};o?.([...r,H]),b("");},R=T=>{u||p||o?.(r.filter(N=>N.id!==T));},M=T=>{if(c.includes(T.key)){if(T.key==="Tab"&&!v)return;T.preventDefault(),C(v);}T.key==="Backspace"&&!v&&r.length>0&&R(r[r.length-1].id);},k=T=>{let N=T.target.value;if(N.includes(",")){N.split(",").forEach(L=>{L.trim()&&C(L);});return}b(N);},D=T=>{T.preventDefault(),T.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(L=>{C(L);});},P=()=>{w.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 transition-colors",u&&"cursor-not-allowed opacity-50",e),style:{borderColor:y?"var(--color-foreground)":void 0},onClick:P,children:[r.map(T=>f?f(T,()=>R(T.id)):jsxs("span",{className:m(xp({variant:t,size:n})),children:[T.text,!u&&!p&&jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),R(T.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${T.text}`,children:jsx(X,{className:"h-3 w-3"})})]},T.id)),!S&&!p&&jsx("input",{ref:w,type:"text",value:v,onChange:k,onKeyDown:M,onPaste:D,onFocus:()=>x(true),onBlur:()=>x(false),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})]})});yp.displayName="TagInput";var wp=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"}}),Cp=q.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m(wp({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]}));Cp.displayName="EmptyState";var Mp=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"}}),Np=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,p=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:m(Mp({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",p),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})]})});Np.displayName="StatCard";var Go=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"}}),Di=({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 tR({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:p,listeners:f,setNodeRef:g,transform:h,transition:v,isDragging:b}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:v};return jsxs("div",{ref:g,...p,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",b&&"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",...f,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(Di,{checked:l,onClick:x=>u?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function nR({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:p=[],onSelect:f,checkable:g=false,checkedKeys:h,defaultCheckedKeys:v=[],onCheck:b,emptyContent:y,children:x,...w},C){let[R,M]=q.useState(false),[k,D]=q.useState(null);q.useEffect(()=>{M(true);},[]);let[P,S]=q.useState(new Set(p)),T=u!==void 0,N=T?new Set(u):P,[H,L]=q.useState(new Set(v)),E=h!==void 0,I=E?new Set(h):H,V=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=q.useCallback((F,j)=>{if(!r)return;let U=new Set(N),G=!U.has(F.id);d?G?U.add(F.id):U.delete(F.id):(U.clear(),G&&U.add(F.id)),T||S(U);let _=r.filter(Q=>U.has(Q.id));f?.(Array.from(U),{selected:G,selectedItems:_,item:F,event:j});},[r,N,d,T,f]),B=q.useCallback((F,j)=>{if(!r)return;let U=new Set(I),G=!U.has(F.id);G?U.add(F.id):U.delete(F.id),E||L(U);let _=r.filter(Q=>U.has(Q.id));b?.(Array.from(U),{checked:G,checkedItems:_,item:F,event:j});},[r,I,E,b]),O=F=>{if(!r)return;let j=r.find(U=>U.id===F.active.id);j&&D(j);},z=F=>{let{active:j,over:U}=F;if(D(null),!r||!U||j.id===U.id)return;let G=r.findIndex(Q=>Q.id===j.id),_=r.findIndex(Q=>Q.id===U.id);if(G!==-1&&_!==-1){let Q=[...r],[Y]=Q.splice(G,1);Q.splice(_,0,Y),s?.(Q);}},W=(a||c||g)&&r&&o,A=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}):W?a?R?jsxs(DndContext,{sensors:V,collisionDetection:closestCenter,onDragStart:O,onDragEnd:z,children:[jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(F=>F.id),strategy:verticalListSortingStrategy,children:r.map((F,j)=>jsx(tR,{item:F,index:j,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:N.has(F.id),isChecked:I.has(F.id),isCards:A,onSelect:K,onCheck:B},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(Go({variant:t,size:n,className:e})),...w,children:r.map((F,j)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(Di,{checked:I.has(F.id),onClick:U=>B(F,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,j)})]},F.id))}):jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:r.map((F,j)=>{let U=N.has(F.id),G=I.has(F.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?_=>K(F,_):void 0,className:m("flex items-center gap-3 transition-all",A&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",A&&U&&"border-primary bg-accent",!A&&c&&!g&&"cursor-pointer hover:bg-muted/50",!A&&g&&"cursor-pointer hover:bg-muted/50",!A&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Di,{checked:G,onClick:_=>B(F,_)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,j)})]},F.id)})}):jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:x})}var rR=q.forwardRef(nR),Ep=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Lp=q.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(Ep({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})]}));Lp.displayName="ListItem";var Sp=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]}));Sp.displayName="ListItemText";var Ip=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Vp=q.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:m(Ip({position:t,className:e})),...n}));Vp.displayName="Timeline";var Ap=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=q.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(Ap({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 Op=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 pt-0.5",e),...t}));Op.displayName="TimelineContent";var Bp=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Bp.displayName="TimelineOpposite";var Fp=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"}}),Kp=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]},$p=(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},Gp=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:p,...f},g)=>{let[h,v]=q.useState(false),[b,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),V=[],K=[];(u?I:[I[0]]).forEach(O=>{let z=$p(O,c,d);z.length>0?K.push({file:O,errors:z}):V.push(O);}),w(K),V.length>0&&r?.(V),K.length>0&&o?.(K);},[c,d,u,r,o]),M=q.useCallback(E=>{if(E.preventDefault(),E.stopPropagation(),!p&&(v(true),E.dataTransfer.items)){let V=Array.from(E.dataTransfer.items).some(K=>{if(K.kind!=="file")return true;if(d&&d.length>0){let B=K.type;return !d.some(O=>O.endsWith("/*")?B.startsWith(O.slice(0,-2)):B===O)}return false});y(V);}},[p,d]),k=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),!p&&(E.dataTransfer.dropEffect="copy");},[p]),D=q.useCallback(E=>{E.preventDefault(),E.stopPropagation();let I=E.currentTarget.getBoundingClientRect(),V=E.clientX,K=E.clientY;(V<I.left||V>I.right||K<I.top||K>I.bottom)&&(v(false),y(false));},[]),P=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),v(false),y(false),!p&&R(E.dataTransfer.files);},[p,R]),S=q.useCallback(()=>{p||C.current?.click();},[p]),T=q.useCallback(E=>{R(E.target.files),E.target.value="";},[R]),N=q.useCallback(E=>{p||(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.current?.click());},[p]),H=b?"error":h?"active":t,L=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...f,children:[jsxs("div",{role:"button",tabIndex:p?-1:0,onDragEnter:M,onDragOver:k,onDragLeave:D,onDrop:P,onClick:S,onKeyDown:N,className:m(Fp({variant:H,size:n}),p&&"opacity-50 cursor-not-allowed",!p&&"cursor-pointer focus:outline-none"),"aria-disabled":p,children:[jsx("input",{ref:C,type:"file",accept:L,multiple:u,disabled:p,onChange:T,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:E,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:E.name}),":"," ",I.map(V=>V.message).join(", ")]},E.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(E=>{let I=Kp(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:[Za(E.file.size),E.error&&jsx("span",{className:"ml-2 text-danger",children:E.error})]}),E.progress!==void 0&&E.progress<100&&jsx(za,{value:E.progress,className:"mt-2 h-1"})]}),jsxs(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:V=>{V.stopPropagation(),a?.(E.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},E.id)})})]})});Gp.displayName="FileUpload";var pR=`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")`,jp=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}}),Wo=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},p)=>jsx("button",{ref:p,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:m(jp({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?pR: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}})}));Wo.displayName="ColorSwatch";var Wp=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),_p=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,...p},f)=>{let[g,h]=q.useState(t),v=e??g,b=q.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:m(Wp({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...p,children:a.map(x=>{let w=v?y(v)===y(x):false;return jsx(Wo,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:b,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});_p.displayName="ColorSwatchPicker";var bR=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Yp={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},qp=q.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=bR,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=q.useState(e??t),p=q.useId();q.useEffect(()=>{e!==void 0&&u(e);},[e]);let f=v=>{u(v),n?.(v);},g=v=>{u(v),n?.(v);},h=v=>{let b=v.target.value.toUpperCase();u(b),n?.(b);};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",Yp[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:p}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(Mt,{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",Yp[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(Nt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:f,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(yr,{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:f,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(yr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(v=>jsx(Wo,{color:v,size:"sm",isSelected:d.toLowerCase()===v.toLowerCase(),onSelect:g},v))})]})]})})]})});qp.displayName="ColorPicker";var Xp=cva("flex w-full border border-input bg-background px-3 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-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"}},defaultVariants:{size:"md",radius:"md"}}),Hi=e=>String(e).padStart(2,"0"),RR=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},wR=(e,t)=>`${Hi(e)}:${Hi(t)}`,Zp=q.forwardRef(({className:e,size:t,radius:n,value:r,onChange:o,use24Hour:a=true,minuteStep:s=1,showPicker:i=true,minTime:l,maxTime:c,label:d,isRequired:u,description:p,errorMessage:f,isInvalid:g,disabled:h,...v},b)=>{let[y,x]=q.useState(r??""),[w,C]=q.useState(false),[R,M]=q.useState(false),k=q.useId(),D=v.id||k,P=g||!!f;q.useEffect(()=>{r!==void 0&&x(r);},[r]);let{hours:S,minutes:T}=RR(y||"00:00"),N=O=>{let z=O.target.value;x(z),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(z)&&o?.(z);},H=(O,z)=>{let $=Math.max(0,Math.min(23,O)),W=Math.max(0,Math.min(59,z)),A=wR($,W);x(A),o?.(A);},L=()=>H(S+1,T),E=()=>H(S-1,T),I=()=>H(S,T+s),V=()=>H(S,T-s),K=({value:O,onIncrement:z,onDecrement:$})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:z,disabled:h,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:Hi(O)}),jsx(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$,disabled:h,children:jsx(ChevronDown,{className:"h-4 w-4"})})]}),B=jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:b,id:D,type:"time",value:y,onChange:N,disabled:h,required:u,"aria-invalid":P,"aria-describedby":p||f?`${D}-description`:void 0,className:m(Xp({size:t,radius:n}),i&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",P&&"border-danger focus:border-danger",!d&&e),style:{borderColor:P?void 0:R?"var(--color-foreground)":void 0},onFocus:()=>M(true),onBlur:()=>M(false),...v}),i&&jsxs(Mt,{open:w,onOpenChange:C,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 cursor-pointer",disabled:h,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(Nt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(K,{value:S,onIncrement:L,onDecrement:E,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(K,{value:T,onIncrement:I,onDecrement:V,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(de,{variant:"bordered",size:"sm",onClick:()=>{let O=new Date;H(O.getHours(),O.getMinutes());},children:"Now"}),jsx(de,{size:"sm",onClick:()=>C(false),children:"Done"})]})]})]})]});return !d&&!p&&!f?B:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[d&&jsxs("label",{htmlFor:D,className:"text-sm font-medium leading-none",children:[d,u&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),B,(p||f)&&jsx("p",{id:`${D}-description`,className:m("text-xs",P?"text-danger":"text-muted-foreground"),children:f||p})]})});Zp.displayName="TimeInput";var Qp=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"}}),TR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},MR=(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}},Ii=(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},Jp=(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},ef=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:p,thousandSeparator:f=",",decimalSeparator:g=".",radius:h="md",disabled:v,placeholder:b,...y},x)=>{let[w,C]=q.useState(r),[R,M]=q.useState(""),[k,D]=q.useState(false),P=n!==void 0?n:w,S=p??MR(a,s);q.useEffect(()=>{!k&&P!==void 0&&M(Ii(P,i,f,g));},[P,i,f,g,k]);let T=I=>{let V=I.target.value;if(!V){M(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${f}${g}.-]*$`).test(V))return;M(V);let B=Jp(V,f,g);if(B!==void 0){let O=B;l!==void 0&&B<l&&(O=l),c!==void 0&&B>c&&(O=c),n===void 0&&C(O),o?.(O);}},N=()=>{D(true),P!==void 0&&M(P.toString().replace(".",g));},H=()=>{D(false),M(P!==void 0?Ii(P,i,f,g):"");},L=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:S}),E=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:S});return jsxs("div",{className:"relative flex items-center",children:[L&&jsx("div",{className:"absolute left-3 pointer-events-none",children:L}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:T,onFocus:N,onBlur:H,disabled:v,placeholder:b??`0${g}${"0".repeat(i)}`,className:m(Qp({size:t}),TR[h],L&&"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})]})});ef.displayName="CurrencyInput";var tf=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"}}),Vi={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:"#####-####"}},PR=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},er=e=>["#","A","*"].includes(e),Ja=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(er(s)){if(o<e.length){let i=e[o];PR(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},Ai=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];er(o)&&(n+=e[r]);}return n},nf=(e,t)=>e.split("").map(n=>er(n)?t:n).join(""),ER=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)er(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,er(t[i])&&s++;for(;a<t.length&&!er(t[a]);)a++;return Math.min(a,e.length)},rf=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},p)=>{let f=typeof a=="string"&&a in Vi?Vi[a].mask:a,[g,h]=q.useState(r),[v,b]=q.useState(""),[y,x]=q.useState(false),w=q.useRef(null),C=n!==void 0?n:g;q.useImperativeHandle(p,()=>w.current),q.useEffect(()=>{let D=Ja(C,f,true);b(D);},[C,f]);let R=D=>{let P=D.target.value,S=D.target.selectionStart??0,T=P.replace(/[^\w]/g,""),N=Ja(T,f,true),H=Ai(N,f);b(N),n===void 0&&h(l?N:H),o?.(H,N),requestAnimationFrame(()=>{if(w.current){let L=ER(N,f,S);w.current.setSelectionRange(L,L);}});},M=D=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(D.key)||D.ctrlKey||D.metaKey)return;let P=w.current;if(!P)return;let S=P.selectionStart??0;if(D.key==="Backspace"&&S>0){let T=S-1;for(;T>0&&!er(f[T]);)T--;let N=Ai(v,f),H=0;for(let I=0;I<T&&I<f.length;I++)er(f[I])&&H++;let L=N.slice(0,Math.max(0,H-1))+N.slice(H),E=Ja(L,f,true);b(E),n===void 0&&h(l?E:L),o?.(L,E),D.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(T,T);});}},k=i?nf(f,s):d;return jsx("input",{ref:w,type:"text",value:v,onChange:R,onKeyDown:M,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:k,className:m(tf({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...u})});rf.displayName="MaskedInput";var IR=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"}}),af=[{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},VR=e=>e.replace(/#/g,"_"),sf=q.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=af,showCountrySelect:c=true,showDialCode:d=false,disabled:u,placeholder:p,radius:f="md",...g},h)=>{let[v,b]=q.useState(r),[y,x]=q.useState(a??s),[w,C]=q.useState(false),[R,M]=q.useState(false),[k,D]=q.useState(false),[P,S]=q.useState({top:0,left:0,width:0}),T=q.useRef(null),N=q.useRef(null),H=n!==void 0?n:v,L=a??y,E=l.find($=>$.code===L)??l[0],I=es(H,E.format);q.useEffect(()=>{D(true);},[]),q.useEffect(()=>{if(R&&T.current){let $=T.current.getBoundingClientRect();S({top:$.bottom+4,left:$.left,width:Math.max($.width,280)});}},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{T.current&&!T.current.contains(W.target)&&N.current&&!N.current.contains(W.target)&&M(false);};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{W.key==="Escape"&&M(false);};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{N.current?.contains(W.target)||M(false);};return window.addEventListener("scroll",$,true),()=>window.removeEventListener("scroll",$,true)},[R]);let V=$=>{let A=$.target.value.replace(/\D/g,"");n===void 0&&b(A);let F=es(A,E.format),j=`${E.dialCode} ${F}`;o?.(A,j,E);},K=$=>{let W=l.find(j=>j.code===$);if(!W)return;a===void 0&&x($),i?.(W);let A=es(H,W.format),F=`${W.dialCode} ${A}`;o?.(H,F,W),M(false);},B=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",O=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"}[f],u&&"cursor-not-allowed opacity-50"),style:{borderColor:O?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:T,type:"button",disabled:u,onClick:()=>M(!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",B),style:{borderColor:O?"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&&Pa.createPortal(jsx("div",{ref:N,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:P.top,left:P.left,minWidth:P.width},children:jsx(De,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map($=>jsxs("div",{role:"option","aria-selected":$.code===L,onClick:()=>K($.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:$.code===L&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:$.flag}),jsx("span",{className:"flex-1",children:$.name}),jsx("span",{className:"text-xs text-muted-foreground",children:$.dialCode})]})]},$.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:V,onFocus:()=>C(true),onBlur:()=>C(false),disabled:u,placeholder:p??VR(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})]})]})});sf.displayName="PhoneInput";var cf=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}}),df=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],p={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:m(cf({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",p),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",p),children:a})]})});df.displayName="Navbar";var uf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));uf.displayName="NavbarBrand";var mf=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})});mf.displayName="NavbarContent";var pf=q.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:m("flex items-center",t&&"text-primary font-medium",e),...n}));pf.displayName="NavbarItem";var ff=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}));ff.displayName="NavbarLink";var KR={none:"",hover:"hover:underline",always:"underline"},gf={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},vf=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 gf,p=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&&gf[t],KR[n],a&&"pointer-events-none opacity-50",e),style:p,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});vf.displayName="Link";var hf=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"}}),xf=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,...p},f)=>{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 v=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(y);},b=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m(hf({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(de,{ref:f,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:v,"aria-label":"Back to top",className:"shadow-lg",...p,children:r||jsx(ArrowUp,{className:b})})})});xf.displayName="BackTop";var qR=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),XR=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),yf=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"}}),Rf=q.createContext(null),nr=()=>{let e=q.useContext(Rf);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},wf=q.createContext(null),Yo=()=>{let e=q.useContext(wf);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},Oi=q.createContext(null),Cf=q.createContext(null),Tf=q.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=q.useState(null);return jsx(Rf.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",qR({radius:n}),e),...r,children:t})})});Tf.displayName="Menubar";var Mf=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=nr(),r=q.useId(),o=q.useRef(null),a=t===r,s=q.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(wf.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Mf.displayName="MenubarMenu";var Nf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Nf.displayName="MenubarGroup";var kf=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};kf.displayName="MenubarPortal";var Pf=({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(Oi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Pf.displayName="MenubarSub";var Ef=q.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Cf.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Ef.displayName="MenubarRadioGroup";var Lf=q.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=nr(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=Yo(),p=g=>{t?.(g),u(!d);},f=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",XR({radius:i}),e),onClick:p,onMouseEnter:f,...r})});Lf.displayName="MenubarTrigger";var Sf=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=nr(),l=q.useContext(Oi);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,p=g=>{r?.(g),d(true);},f=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:p,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Sf.displayName="MenubarSubTrigger";var Df=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=nr(),i=q.useContext(Oi);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,p]=q.useState({top:0,left:0}),[f,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),p({top:C,left:R});})();},[l,t,d]);let v=y=>{n?.(y),c(true);},b=y=>{r?.(y),c(false);};return !f||!l?null:Pa.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",yf({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Df.displayName="MenubarSubContent";var Hf=q.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=nr(),{triggerRef:l,open:c,onOpenChange:d}=Yo(),[u,p]=q.useState({top:0,left:0}),[f,g]=q.useState(false),h=q.useRef(null);return q.useEffect(()=>{g(true);},[]),q.useEffect(()=>{if(!c||!l.current||!h.current)return;let v=()=>{if(!l.current||!h.current)return;let b=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=b.bottom+r,w=b.left+n;t==="center"?w=b.left+b.width/2-y.width/2:t==="end"&&(w=b.right-y.width-n),p({top:x,left:w});};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,true),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,true);}},[c,t,n,r,l]),q.useEffect(()=>{if(!c)return;let v=b=>{let y=b.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,d,l]),q.useEffect(()=>{if(!c)return;let v=b=>{b.key==="Escape"&&d(false);};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c,d]),!f||!c?null:Pa.createPortal(jsx("div",{ref:v=>{h.current=v,typeof s=="function"?s(v):s&&(s.current=v);},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",yf({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});Hf.displayName="MenubarContent";var If=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=Yo(),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})});If.displayName="MenubarItem";var Vf=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=nr(),{onOpenChange:c}=Yo(),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]})});Vf.displayName="MenubarCheckboxItem";var Af=q.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=Yo(),c=q.useContext(Cf),d=c?.value===n,u=p=>{if(r){p.preventDefault();return}o?.(p),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]})});Af.displayName="MenubarRadioItem";var Bi=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}));Bi.displayName="MenubarSection";var ZR=Bi,zf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));zf.displayName="MenubarSeparator";var Of=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Of.displayName="MenubarShortcut";var Bf=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"}}),Ff=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(Bf({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)})});Ff.displayName="Steps";var Kf=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"}}),JR=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"}}),ew=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"}}),$f=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(Kf({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(JR({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(ew({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));$f.displayName="Step";var Uf=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"}}),jf=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}}),Wf=q.createContext(null),lw=()=>{let e=q.useContext(Wf);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},cw=({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"})})}),_f=({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:p,draggable:f,draggedNode:g,setDraggedNode:h,dragOverKey:v,dragOverPosition:b,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:M,onDragLeave:k,onDragEnd:D,showLine:P,showIcon:S,showHandle:T,dragIcon:N,icon:H,leafIcon:L,folderIcon:E,folderOpenIcon:I,blockNode:V,disabled:K,size:B,getAllKeys:O}=lw(),z=e.children&&e.children.length>0,$=e.isLeaf??!z,W=o.has(e.key),A=s.has(e.key),F=c.has(e.key),j=d.has(e.key),U=g?.key===e.key,G=v===e.key,_=!!(K||e.disabled),Q=l&&e.selectable!==false,Y=p&&e.checkable!==false,ge=q.useMemo(()=>_?false:typeof f=="boolean"?f:typeof f=="function"?f(e):f&&typeof f=="object"?f.nodeDraggable?f.nodeDraggable(e):true:false,[f,e,_]),X=q.useMemo(()=>N!==void 0?N:typeof f=="object"&&f.icon!==void 0?f.icon:jsx(GripVertical,{className:"h-4 w-4"}),[N,f]),J=q.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:W,isLeaf:$}):H:$?L:W?I:E,[e.icon,H,W,$,L,E,I]),we=se=>{if(!ge)return;se.stopPropagation(),se.dataTransfer.effectAllowed="move";let ne=se.currentTarget,xe=ne.cloneNode(true),Vt=document.documentElement.classList.contains("dark"),ct=Vt?"#0a0a0a":"#ffffff",Fr=Vt?"#27272a":"#e4e4e7";xe.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=Hx[o],R=t==="vertical"||t==="both",M=t==="horizontal"||t==="both",k=[R&&p.top&&`linear-gradient(to bottom, transparent, black ${C})`,R&&p.bottom&&`linear-gradient(to top, transparent, black ${C})`,M&&p.left&&`linear-gradient(to right, transparent, black ${C})`,M&&p.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})]})});De.displayName="ScrollArea";var nd=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=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:p=240,size:f,radius:g,className:h,...v},b)=>{let[y,x]=q.useState(false),[w,C]=q.useState(""),[R,M]=q.useState(r||""),[k,D]=q.useState(r||[]),[P,S]=q.useState({top:0,left:0,width:0}),T=q.useRef(null),N=q.useRef(null),H=q.useRef(null),L=q.useRef(null),E=n!==void 0?n:R,I=n!==void 0?n:k,V=n!==void 0,K=G=>{d&&E===G?(V||M(""),o?.("")):(V||M(G),o?.(G)),x(false),C("");},B=G=>{let _=I.includes(G)?I.filter(Q=>Q!==G):[...I,G];V||D(_),o?.(_);},O=(G,_)=>{_.stopPropagation();let Q=I.filter(Y=>Y!==G);V||D(Q),o?.(Q);},z=G=>{G.stopPropagation(),t?(V||D([]),o?.([])):(V||M(""),o?.(""));},$=e.find(G=>G.value===E),W=e.filter(G=>I.includes(G.value)),A=W.slice(0,u),F=W.length-u,j=s?e.filter(G=>G.label.toLowerCase().includes(w.toLowerCase())):e;q.useEffect(()=>{if(y&&N.current){let G=N.current.getBoundingClientRect();S({top:G.bottom+4,left:G.left,width:G.width}),s&&setTimeout(()=>L.current?.focus(),0);}y||C("");},[y,s]),q.useEffect(()=>{let G=_=>{let Q=_.target,Y=T.current&&!T.current.contains(Q),ge=H.current&&!H.current.contains(Q);Y&&ge&&(x(false),C(""));};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]),q.useEffect(()=>{if(!y)return;let G=_=>{H.current?.contains(_.target)||(x(false),C(""));};return window.addEventListener("scroll",G,true),()=>window.removeEventListener("scroll",G,true)},[y]);let U=t?I.length>0:!!E;return jsxs("div",{ref:T,className:m("relative",h),...v,children:[jsxs("div",{ref:G=>{N.current=G,typeof b=="function"?b(G):b&&(b.current=G);},role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-disabled":c,onClick:()=>!c&&x(!y),className:m(nd({size:f,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50"),children:[!t&&jsx("span",{className:m(!$&&"text-muted-foreground"),children:$?$.label:a}),t&&jsx(Fragment,{children:W.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[A.map(G=>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:[G.label,jsx("span",{role:"button",tabIndex:0,onClick:_=>O(G.value,_),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&O(G.value,_);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},G.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:z,onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&z(G);},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"&&Pa.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:P.top,left:P.left,minWidth:P.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:L,type:"text",value:w,onChange:G=>C(G.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(De,{style:{maxHeight:p},onWheel:G=>G.stopPropagation(),children:jsx("div",{className:"p-1",children:j.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):j.map(G=>{let _=t?I.includes(G.value):E===G.value;return jsxs("div",{role:"option","aria-selected":_,onClick:()=>{G.disabled||(t?B(G.value):K(G.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",G.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:_&&jsx(Check,{className:"h-4 w-4"})}),G.label]},G.value)})})})]}),document.body)]})});Na.displayName="Select";var rd=q.createContext(null),Ho=()=>{let e=q.useContext(rd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},oi=q.createContext({radius:"md"}),ai=q.createContext(null),Wt=({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),p=q.useId(),f=q.useRef(new Map),g=q.useCallback(b=>{l||a(b),r?.(b),b||i(-1);},[l,r]),h=q.useCallback((b,y)=>{f.current.set(b,y);},[]),v=q.useCallback(b=>{f.current.delete(b);},[]);return jsx(rd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:p,activeIndex:s,setActiveIndex:i,items:f,registerItem:h,unregisterItem:v},children:e})};Wt.displayName="Dropdown";var _t=q.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ho();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})});_t.displayName="DropdownTrigger";var Kx={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Yt=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},p)=>{let{open:f,onOpenChange:g,triggerRef:h,contentRef:v,contentId:b,activeIndex:y,setActiveIndex:x,items:w}=Ho(),[C,R]=q.useState({top:0,left:0}),[M,k]=q.useState(t),[D,P]=q.useState(false),S=q.useRef(0);if(q.useEffect(()=>{P(true);},[]),q.useEffect(()=>{f&&(S.current=w.current.size);},[f,w]),q.useEffect(()=>{if(!f||!h.current||!v.current)return;let N=()=>{if(!h.current||!v.current)return;let H=h.current.getBoundingClientRect(),L=v.current.getBoundingClientRect(),E=window.innerWidth,I=window.innerHeight,V=0,K=0,B=t;switch(t){case "top":V=H.top-L.height-n,V<a&&(V=H.bottom+n,B="bottom");break;case "bottom":V=H.bottom+n,V+L.height>I-a&&(V=H.top-L.height-n,B="top");break;case "left":K=H.left-L.width-n,K<a&&(K=H.right+n,B="right");break;case "right":K=H.right+n,K+L.width>E-a&&(K=H.left-L.width-n,B="left");break}if(B==="top"||B==="bottom"){switch(r){case "start":K=H.left+o;break;case "center":K=H.left+H.width/2-L.width/2;break;case "end":K=H.right-L.width-o;break}K<a?K=a:K+L.width>E-a&&(K=E-L.width-a);}else {switch(r){case "start":V=H.top+o;break;case "center":V=H.top+H.height/2-L.height/2;break;case "end":V=H.bottom-L.height-o;break}V<a?V=a:V+L.height>I-a&&(V=I-L.height-a);}R({top:V,left:K}),k(B);};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,true),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,true);}},[f,t,n,r,o,a,h]),q.useEffect(()=>{if(!f)return;let N=H=>{let L=H.target;v.current&&!v.current.contains(L)&&h.current&&!h.current.contains(L)&&(s?.(),g(false));};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f,g,s,h,v]),q.useEffect(()=>{if(!f)return;let N=H=>{let L=Array.from(w.current.entries()).sort(([I],[V])=>I-V).map(([,I])=>I),E=L.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&&L[y]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[f,g,i,y,x,w,l,h]),q.useEffect(()=>{f&&y>=0&&Array.from(w.current.entries()).sort(([H],[L])=>H-L).map(([,H])=>H)[y]?.focus();},[f,y,w]),!D||!f)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"}[M];return Pa.createPortal(jsx("div",{ref:N=>{v.current=N,typeof p=="function"?p(N):p&&(p.current=N);},id:b,role:"menu","aria-orientation":"vertical","data-state":f?"open":"closed","data-side":M,"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",Kx[c],T,e),style:{top:C.top,left:C.left},...u,children:jsx(oi.Provider,{value:{radius:c},children:d})}),document.body)});Yt.displayName="DropdownContent";var od=0,ad={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Tt=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:p,setActiveIndex:f,registerItem:g,unregisterItem:h}=Ho(),{radius:v}=q.useContext(oi),[b]=q.useState(()=>od++),y=q.useRef(null);q.useEffect(()=>(!n&&y.current&&g(b,y.current),()=>{h(b);}),[n,b,g,h]);let x=R=>{if(n){R.preventDefault();return}o?.(R),r?.(),u(false);},w=R=>{a?.(R),n||f(b);};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":p===b?"":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",ad[v],t&&"pl-8",!n&&"cursor-pointer",e),onClick:x,onMouseEnter:w,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Tt.displayName="DropdownItem";var si=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}));si.displayName="DropdownSection";var sd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));sd.displayName="DropdownSeparator";var id=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});id.displayName="DropdownShortcut";var ld=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));ld.displayName="DropdownGroup";var cd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=q.useState(n),{contentRef:s}=Ho(),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(ai.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};cd.displayName="DropdownSub";var dd=q.forwardRef(({className:e,inset:t,disabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=q.useContext(ai),{setActiveIndex:d,registerItem:u,unregisterItem:p}=Ho(),{radius:f}=q.useContext(oi),[g]=q.useState(()=>od++),h=q.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:v,onOpenChange:b,triggerRef:y}=c;q.useEffect(()=>(!n&&h.current&&u(g,h.current),()=>{p(g);}),[n,g,u,p]);let x=R=>{o?.(R),n||(d(g),b(true));},w=R=>{a?.(R);},C=R=>{s?.(R),(R.key==="ArrowRight"||R.key==="Enter"||R.key===" ")&&(R.preventDefault(),b(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":v,tabIndex:n?-1:0,"aria-disabled":n,"data-state":v?"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",ad[f],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"})]})});dd.displayName="DropdownSubTrigger";var ud=q.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=q.useContext(ai);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:p}=l,[f,g]=q.useState({top:0,left:0}),[h,v]=q.useState(false),b=q.useRef(null),y=q.useRef(null);q.useEffect(()=>{v(true);},[]),q.useEffect(()=>{if(!c||!u.current||!b.current)return;(()=>{if(!u.current||!b.current)return;let R=u.current.getBoundingClientRect(),M=b.current.getBoundingClientRect(),k=window.innerWidth,D=window.innerHeight,P=R.top+n,S=R.right+t;S+M.width>k-r&&(S=R.left-M.width-t),P+M.height>D-r&&(P=D-M.height-r),P<r&&(P=r),g({top:P,left:S});})();},[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)||p?.current?.contains(R)||(y.current=setTimeout(()=>{d(false);},100));};return q.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),!h||!c?null:Pa.createPortal(jsx("div",{ref:C=>{b.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:f.top,left:f.left},onMouseEnter:x,onMouseLeave:w,...s}),document.body)});ud.displayName="DropdownSubContent";var $x=si;var fd=q.createContext(null),ii=()=>{let e=q.useContext(fd);if(!e)throw new Error("Popover components must be used within a Popover");return e},Mt=({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(fd.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};Mt.displayName="Popover";var _n=q.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=ii(),c=p=>{t?.(p),s(!a);},d=p=>{i.current=p,typeof o=="function"?o(p):o&&(o.current=p);},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:p=>{e.props.onClick?.(p),c(p);}}):jsx("button",{ref:d,type:"button",...u,children:e})});_n.displayName="PopoverTrigger";var Yn=q.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=ii();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});Yn.displayName="PopoverAnchor";var Nt=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},p)=>{let{open:f,onOpenChange:g,triggerRef:h,contentId:v}=ii(),[b,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(!f||!h.current||!C)return;let k=()=>{if(!h.current||!C)return;let D=h.current.getBoundingClientRect(),P=C.getBoundingClientRect(),S=0,T=0;switch(n){case "top":S=D.top-P.height-r;break;case "bottom":S=D.bottom+r;break;case "left":T=D.left-P.width-r;break;case "right":T=D.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":T=D.left+a;break;case "center":T=D.left+D.width/2-P.width/2;break;case "end":T=D.right-P.width-a;break}else switch(o){case "start":S=D.top+a;break;case "center":S=D.top+D.height/2-P.height/2;break;case "end":S=D.bottom-P.height-a;break}y({top:S,left:T});};return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,true),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true);}},[f,n,r,o,a,h,C]),q.useEffect(()=>{if(!f)return;let k=D=>{let P=D.target;C&&C.contains(P)||h.current&&h.current.contains(P)||P.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",k),()=>document.removeEventListener("mouseup",k)},[f,g,s,h,C]),q.useEffect(()=>{if(!f)return;let k=D=>{D.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[f,g,i]),!x||!f)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"}[n];return Pa.createPortal(jsx("div",{ref:k=>{R(D=>D!==k?k:D),typeof p=="function"?p(k):p&&(p.current=k);},id:v,role:"dialog","data-state":f?"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",M,e),style:{...t,top:b.top,left:b.left},...u,children:d}),document.body)});Nt.displayName="PopoverContent";var gd=q.createContext(null),ci=()=>{let e=q.useContext(gd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},bd=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),p=t!==void 0,f=p?t:d,g=h=>{p||u(h),r?.(h);};return jsx(gd.Provider,{value:{value:f,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})})});bd.displayName="Tabs";var li={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"}},vd=q.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=ci(),l=q.useRef(null),[c,d]=q.useState({opacity:0});q.useEffect(()=>{let g=l.current;if(!g)return;let h=()=>{let b=g.querySelector('[data-state="active"]');if(b){let y=g.getBoundingClientRect(),x=b.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 v=new ResizeObserver(h);return v.observe(g),()=>{v.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"},p=s==="vertical",f=()=>o==="solid"?p?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?p?"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",p&&"flex-col h-auto w-auto",li[a].list,u[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",li[a].indicator,f()),style:c,"aria-hidden":"true"}),t]})});vd.displayName="TabsList";var hd=q.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c}=ci(),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",li[c].trigger,u[l],e),onClick:p=>{r?.(p),i(t);},...o})});hd.displayName="TabsTrigger";var xd=q.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a}=ci(),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});xd.displayName="TabsContent";var Wx=({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 yd=q.createContext(null),Ea=()=>{let e=q.useContext(yd);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},di=q.createContext(null),Rd=({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(yd.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};Rd.displayName="ContextMenu";var wd=q.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=Ea(),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})});wd.displayName="ContextMenuTrigger";var Cd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Cd.displayName="ContextMenuGroup";var Td=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};Td.displayName="ContextMenuPortal";var Md=({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(di.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Md.displayName="ContextMenuSub";var Nd=q.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=Ea(),[d,u]=q.useState(false),[p,f]=q.useState(l),g=q.useRef(null);return q.useEffect(()=>{u(true);},[]),q.useEffect(()=>{if(!s||!g.current){f(l);return}let v=g.current.getBoundingClientRect(),{x:b,y}=l;b+v.width>window.innerWidth&&(b=window.innerWidth-v.width-8),y+v.height>window.innerHeight&&(y=window.innerHeight-v.height-8),f({x:b,y});},[s,l]),q.useEffect(()=>{if(!s)return;let h=v=>{let b=v.target;g.current&&!g.current.contains(b)&&(t?.(),i(false));};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,i,t]),q.useEffect(()=>{if(!s)return;let h=v=>{v.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s,i,n]),!d||!s?null:Pa.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:p.y,left:p.x},...o,children:r}),document.body)});Nd.displayName="ContextMenuContent";var kd=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=q.useContext(di);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=f=>{r?.(f),c(true);},p=f=>{o?.(f),c(false);};return jsxs("div",{ref:f=>{d.current=f,typeof s=="function"?s(f):s&&(s.current=f);},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:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});kd.displayName="ContextMenuSubTrigger";var Pd=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=q.useContext(di);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}),[p,f]=q.useState(false),g=q.useRef(null);q.useEffect(()=>{f(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=b=>{n?.(b),l(true);},v=b=>{r?.(b),l(false);};return !p||!i?null:Pa.createPortal(jsx("div",{ref:b=>{g.current=b,typeof a=="function"?a(b):a&&(a.current=b);},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:v,...o}),document.body)});Pd.displayName="ContextMenuSubContent";var Ed=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=Ea(),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})});Ed.displayName="ContextMenuItem";var Ld=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=Ea(),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]})});Ld.displayName="ContextMenuCheckboxItem";var Sd=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}));Sd.displayName="ContextMenuSection";var Dd=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));Dd.displayName="ContextMenuSeparator";var Hd=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Hd.displayName="ContextMenuShortcut";var Ad=q.createContext(null),Zx=()=>{let e=q.useContext(Ad);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},zd=q.createContext(null),Sa=()=>{let e=q.useContext(zd);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},Vo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},La={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},secondary:{border:"border-input",borderChecked:"border-secondary",indicator:"bg-secondary",ring:"ring-secondary/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},Od=q.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,disabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...u},p)=>{let[f,g]=q.useState(n),h=t!==void 0,v=h?t:f,b=q.useId(),y=x=>{h||g(x),r?.(x);};return jsx("div",{ref:p,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...u,children:jsx(Ad.Provider,{value:{name:o||b,value:v,onValueChange:y,disabled:a,required:s,size:l,color:c},children:d})})});Od.displayName="RadioGroup";var Bd=q.forwardRef(({className:e,value:t,disabled:n,children:r,...o},a)=>{let s=Zx(),[i,l]=q.useState(false),c=s.value===t,d=n||s.disabled,u=()=>{d||s.onValueChange(t);},p=Vo[s.size||"md"];return jsx(zd.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:u,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:m("flex items-start cursor-pointer select-none",p.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[r,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Bd.displayName="Radio";var Fd=q.forwardRef(({className:e,children:t},n)=>{let{isChecked:r,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=Sa(),d=Vo[l],u=!(c in La),p=u?null:La[c],f=u?{borderColor:r?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:n,type:"button",role:"radio","aria-checked":r,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:f,className:m("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,p&&(r?p.borderChecked:p.border),p&&a&&p.ring,!u&&!r&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:r?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(ui,{})})});Fd.displayName="RadioControl";var ui=q.forwardRef(({className:e,forceMount:t},n)=>{let{isChecked:r,size:o,color:a}=Sa(),s=Vo[o],i=!(a in La),l=i?null:La[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||r)&&jsx(motion.span,{ref:n,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:m("rounded-full",s.indicator,l?.indicator,e)})})});ui.displayName="RadioIndicator";var Kd=q.forwardRef(({className:e,children:t,...n},r)=>{let{size:o,isDisabled:a}=Sa(),s=Vo[o];return jsx("span",{ref:r,className:m("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...n,children:t})});Kd.displayName="RadioLabel";var $d=q.forwardRef(({className:e,children:t,...n},r)=>{let{size:o}=Sa(),a=Vo[o];return jsx("span",{ref:r,className:m("text-muted-foreground leading-snug",a.description,e),...n,children:t})});$d.displayName="RadioDescription";var Gd=q.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("flex flex-col gap-0.5",e),...n,children:t}));Gd.displayName="RadioContent";var Ha=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-input bg-transparent hover:bg-accent data-[state=on]:bg-primary data-[state=on]:text-primary-foreground data-[state=on]:border-primary",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"}}),Ud=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),p=r!==void 0,f=p?r:d,g=()=>{if(s)return;let v=!f;p||u(v),a?.(v);},h=v=>{v.key==="Enter"&&v.preventDefault(),i?.(v);};return jsx("button",{type:"button","aria-pressed":f,"data-state":f?"on":"off",disabled:s,ref:c,className:m(Ha({variant:t,size:n,className:e})),onClick:g,onKeyDown:h,...l})});Ud.displayName="Toggle";var jd=q.createContext(null),ty=()=>{let e=q.useContext(jd);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},Wd=q.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,disabled:i,children:l,...c},d)=>{let[u,p]=q.useState(()=>r==="single"?a?[a]:[]:a||[]),f=o!==void 0,g=f?r==="single"?o?[o]:[]:o:u,h=v=>{if(r==="single"){let b=g.includes(v)?[]:[v];f||p(b),s?.(b[0]||"");}else {let b=g.includes(v)?g.filter(y=>y!==v):[...g,v];f||p(b),s?.(b);}};return jsx("div",{ref:d,role:"group",className:m("flex items-center justify-center gap-1",e),...c,children:jsx(jd.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:h,disabled:i},children:l})})});Wd.displayName="ToggleGroup";var _d=q.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=ty(),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(Ha({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});_d.displayName="ToggleGroupItem";var qt=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",trackColor:d="primary",name:u,...p},f)=>{let[g,h]=q.useState(n),v=t!==void 0,b=v?t:g,y=q.useRef(null),[x,w]=q.useState(false),[C,R]=q.useState(null),M=(B,O)=>{if(!y.current)return b[0];let z=y.current.getBoundingClientRect(),$;c==="horizontal"?$=(B-z.left)/z.width:$=1-(O-z.top)/z.height,$=Math.max(0,Math.min(1,$));let W=a+$*(s-a),A=Math.round(W/i)*i;return Math.max(a,Math.min(s,A))},k=(B,O)=>{let z=[...b];z[O]=B,O>0&&B<b[O-1]&&(z[O]=b[O-1]),O<b.length-1&&B>b[O+1]&&(z[O]=b[O+1]),v||h(z),r?.(z);},D=(B,O)=>{l||(B.preventDefault(),w(true),R(O),B.target.setPointerCapture(B.pointerId));},P=B=>{if(!x||C===null||l)return;let O=M(B.clientX,B.clientY);k(O,C);},S=()=>{x&&(w(false),R(null),o?.(b));},T=B=>{if(l)return;let O=M(B.clientX,B.clientY),z=0,$=Math.abs(b[0]-O);for(let W=1;W<b.length;W++){let A=Math.abs(b[W]-O);A<$&&($=A,z=W);}k(O,z),o?.([...b.slice(0,z),O,...b.slice(z+1)]);},N=(B,O)=>{if(l)return;let z=b[O];switch(B.key){case "ArrowRight":case "ArrowUp":B.preventDefault(),z=Math.min(s,b[O]+i);break;case "ArrowLeft":case "ArrowDown":B.preventDefault(),z=Math.max(a,b[O]-i);break;case "Home":B.preventDefault(),z=a;break;case "End":B.preventDefault(),z=s;break;default:return}k(z,O),o?.([...b.slice(0,O),z,...b.slice(O+1)]);},H=B=>(B-a)/(s-a)*100,L={primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},E=!(d in L),I=E?null:L[d],V=E?{backgroundColor:d}:void 0,K=E?{borderColor:d}:void 0;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),...p,children:[jsx("div",{ref:y,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?"h-2 w-full":"h-full w-2"),onClick:T,children:jsx("div",{className:m("absolute",I?.track),style:c==="horizontal"?{left:b.length>1?`${H(b[0])}%`:0,right:`${100-H(b[b.length-1])}%`,top:0,bottom:0,...V}:{bottom:b.length>1?`${H(b[0])}%`:0,top:`${100-H(b[b.length-1])}%`,left:0,right:0,...V}})}),b.map((B,O)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":B,"aria-orientation":c,"aria-disabled":l,className:m("absolute block h-5 w-5 rounded-full border-2 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",I?.thumb,x&&C===O&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${H(B)}% - 10px)`,top:"50%",transform:"translateY(-50%)",...K}:{bottom:`calc(${H(B)}% - 10px)`,left:"50%",transform:"translateX(-50%)",...K},onPointerDown:z=>D(z,O),onPointerMove:P,onPointerUp:S,onPointerCancel:S,onKeyDown:z=>N(z,O)},O)),u&&b.map((B,O)=>jsx("input",{type:"hidden",name:b.length>1?`${u}[${O}]`:u,value:B},O))]})});qt.displayName="Slider";var Yd=q.createContext(null),qd=()=>{let e=q.useContext(Yd);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},pi=q.createContext(null),Xd=()=>{let e=q.useContext(pi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},Zd=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||[]),p=q.useRef(new Map),f=q.useRef([]),g=n!==void 0,h=g?t==="single"?n?[n]:[]:n:d,v=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);}},b=q.useCallback((w,C)=>{p.current.set(w,C),f.current.includes(w)||f.current.push(w);},[]),y=q.useCallback(w=>{p.current.delete(w),f.current=f.current.filter(C=>C!==w);},[]),x=q.useCallback(w=>{let C=f.current;if(C.length===0)return;let R=document.activeElement,M;p.current.forEach((T,N)=>{T===R&&(M=N);});let k=M?C.indexOf(M):-1,D;switch(w){case "first":D=0;break;case "last":D=C.length-1;break;case "next":D=k===-1?0:(k+1)%C.length;break;case "prev":D=k===-1?C.length-1:(k-1+C.length)%C.length;break}let P=C[D];p.current.get(P)?.focus();},[]);return jsx(Yd.Provider,{value:{type:t,value:h,onValueChange:v,collapsible:a,disabled:s,registerTrigger:b,unregisterTrigger:y,focusTrigger:x},children:jsx("div",{ref:c,"data-orientation":"vertical",className:m("w-full",e),...l,children:i})})});Zd.displayName="Accordion";var Qd=q.forwardRef(({className:e,value:t,disabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=qd(),d=c.value.includes(t),u=n||c.disabled||false,p=q.useId(),f=q.useId();return r!==void 0?jsx(pi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:p,triggerId:f},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(Jd,{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(eu,{children:s})]})}):jsx(pi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:p,triggerId:f},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})})});Qd.displayName="AccordionItem";var Jd=q.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=qd(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=Xd(),p=q.useRef(null);q.useEffect(()=>{let g=p.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let f=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=>{p.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:f,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});Jd.displayName="AccordionTrigger";var eu=q.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=Xd();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})})})});eu.displayName="AccordionContent";var nu=q.createContext(null),ru=()=>{let e=q.useContext(nu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},ou=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,p=u?t:c,f=q.useId(),g=q.useId(),h=v=>{o||(u||d(v),r?.(v));};return jsx(nu.Provider,{value:{open:p,onOpenChange:h,disabled:o,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":p?"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(fi,{})]}),s]})})});ou.displayName="Collapsible";var fi=q.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,disabled:i,contentId:l,triggerId:c}=ru();return jsx(de,{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")})})});fi.displayName="CollapsibleTrigger";var au=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),[p,f]=q.useState(false),[g,h]=q.useState(a);q.useEffect(()=>{a?(h(true),u(0),f(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(f(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(0));},[a]);let v=()=>{f(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:p?d:a?"auto":0,transition:p?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:v,...r,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});au.displayName="CollapsibleContent";var sy=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"}}),su={primary:"bg-primary",secondary:"bg-secondary-foreground",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},za=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,p=su[i]||"",f=!su[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(sy({size:s}),e),...l,children:jsx("div",{className:m("h-full w-full flex-1 transition-all rounded-full",p),style:{transform:`translateX(-${100-d}%)`,...f?{backgroundColor:i}:{}}})})]})});za.displayName="Progress";var du=q.createContext(null),uu=()=>{let e=q.useContext(du);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},mu=({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),p=q.useId(),f=q.useRef(null),g=q.useRef(null),h=q.useCallback(v=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),v?f.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 v=()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",v,true),()=>window.removeEventListener("scroll",v,true)},[s,d,c,r]),q.useEffect(()=>()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current);},[]),jsx(du.Provider,{value:{open:d,onOpenChange:h,triggerRef:u,contentId:p},children:e})};mu.displayName="HoverCard";var pu=q.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=uu();return jsx("a",{ref:f=>{l.current=f,typeof s=="function"?s(f):s&&(s.current=f);},onMouseEnter:f=>{t?.(f),i(true);},onMouseLeave:f=>{n?.(f),i(false);},onFocus:f=>{r?.(f),i(true);},onBlur:f=>{o?.(f),i(false);},...a,children:e})});pu.displayName="HoverCardTrigger";var fu=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:p,contentId:f}=uu(),[g,h]=q.useState({top:0,left:0}),[v,b]=q.useState(false),y=q.useRef(null);q.useEffect(()=>{b(true);},[]),q.useEffect(()=>{if(!d||!p.current||!y.current)return;(()=>{if(!p.current||!y.current)return;let M=p.current.getBoundingClientRect(),k=y.current.getBoundingClientRect(),D=0,P=0;switch(t){case "top":D=M.top-k.height-n;break;case "bottom":D=M.bottom+n;break;case "left":P=M.left-k.width-n;break;case "right":P=M.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":P=M.left+o;break;case "center":P=M.left+M.width/2-k.width/2;break;case "end":P=M.right-k.width-o;break}else switch(r){case "start":D=M.top+o;break;case "center":D=M.top+M.height/2-k.height/2;break;case "end":D=M.bottom-k.height-o;break}h({top:D,left:P});})();},[d,t,n,r,o,p]);let x=R=>{a?.(R),u(true);},w=R=>{s?.(R),u(false);};if(!v||!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 Pa.createPortal(jsx("div",{ref:R=>{y.current=R,typeof c=="function"?c(R):c&&(c.current=R);},id:f,"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)});fu.displayName="HoverCardContent";var gu=q.createContext({size:"md",variant:"default",radius:"md"}),Ba=()=>q.useContext(gu);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var cy=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"}}),dy=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"}}),uy=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"}}),bu=q.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(gu.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));bu.displayName="Breadcrumb";var vu=q.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=Ba();return jsx("ol",{ref:n,className:m(cy({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});vu.displayName="BreadcrumbList";var hu=q.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})});hu.displayName="BreadcrumbItem";var xu=q.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));xu.displayName="BreadcrumbLink";var yu=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}));yu.displayName="BreadcrumbPage";var Ru=({children:e,className:t,...n})=>{let{size:r}=Ba();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(dy({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};Ru.displayName="BreadcrumbSeparator";var wu=({className:e,...t})=>{let{size:n}=Ba();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(uy({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};wu.displayName="BreadcrumbEllipsis";var Mu=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})}));Mu.displayName="AspectRatio";var Pu=q.createContext(null),bi=()=>{let e=q.useContext(Pu);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Eu=q.createContext(null),Lu=()=>{let e=q.useContext(Eu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Su=q.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=q.useState(null);return jsx(Pu.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(vi,{})]})})});Su.displayName="NavigationMenu";var Du=q.forwardRef(({className:e,...t},n)=>{let{orientation:r}=bi();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})});Du.displayName="NavigationMenuList";var Hu=q.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=bi(),s=q.useId(),i=q.useRef(null),l=o===s,c=q.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Eu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:m("relative",e),...n,children:t})})});Hu.displayName="NavigationMenuItem";var Iu=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"),Vu=q.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Lu(),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(Iu(),"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"})]})});Vu.displayName="NavigationMenuTrigger";var Au=q.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Lu(),l=q.useRef(null),[c,d]=q.useState({top:0,left:0});q.useEffect(()=>{if(!a||!i.current)return;let f=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,true),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,true);}},[a,i]);let u=f=>{t?.(f),s(true);},p=f=>{n?.(f),s(false);};return a?Pa.createPortal(jsx("div",{ref:f=>{l.current=f,typeof o=="function"?o(f):o&&(o.current=f);},"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:p,...r}),document.body):null});Au.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"),Ou=q.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:m(zu(),t&&"bg-accent text-accent-foreground",e),...n}));Ou.displayName="NavigationMenuLink";var vi=q.forwardRef((e,t)=>null);vi.displayName="NavigationMenuViewport";var Bu=q.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=bi();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});Bu.displayName="NavigationMenuIndicator";var Ao=0,hi=null;function Pn(){Ao===0&&(hi=document.body.style.overflow,document.body.style.overflow="hidden"),Ao++;}function En(){Ao--,Ao<=0&&(Ao=0,document.body.style.overflow=hi??"",hi=null);}var Gu=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none 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"}}),vt=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(Gu({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});vt.displayName="CloseButton";var Fa=q.createContext(null);function wy(){let e=q.useContext(Fa);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Ln(){return q.useContext(Fa)}var Cy="16rem",Ty="18rem",My="3rem",Ny="b",ky={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},Py={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},xi=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:p,...f},g)=>{let h=c??"overlay",v=h==="overlay",[b,y]=q.useState(false),[x,w]=q.useState(false),[C,R]=q.useState(e),M=t??C,k=q.useCallback(T=>{let N=typeof T=="function"?T(M):T;n?n(N):R(N);},[n,M]);q.useEffect(()=>{let T=()=>{y(window.innerWidth<768);};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);let D=q.useCallback(()=>v?k(T=>!T):b?w(T=>!T):k(T=>!T),[b,k,w,v]);q.useEffect(()=>{if(v)return;let T=N=>{N.key===Ny&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),D());};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[D,v]);let P=M?"expanded":"collapsed",S=q.useMemo(()=>({placement:r,state:P,open:M,setOpen:k,isMobile:b,openMobile:x,setOpenMobile:w,toggleDrawer:D,collapsible:l,mode:h,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,P,M,k,b,x,w,D,l,h,o,a,s,i]);return v?jsx(Fa.Provider,{value:S,children:jsx(Drawer.Root,{open:M,onOpenChange:k,direction:r,dismissible:s,children:p})}):jsx(Fa.Provider,{value:S,children:jsx(Xr,{delayDuration:0,children:jsx("div",{ref:g,style:{"--drawer-width":Cy,"--drawer-width-icon":My,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...f,children:p})})})});xi.displayName="Drawer";var ju=q.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Ln();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:p}=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(Ey,{open:u,onOpenChange:p,placement:i,children:r});if(t){let g=d==="collapsed",h=l==="offcanvas",v=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":v&&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})})]})});ju.displayName="DrawerSidebar";var Ey=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=q.useState(false);return q.useEffect(()=>{a(true);},[]),q.useEffect(()=>{if(t)return Pn(),()=>En()},[t]),!o||!t?null:Pa.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":Ty},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Wu=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Ln();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"})]})});Wu.displayName="DrawerTrigger";var _u=q.forwardRef(({className:e,children:t,...n},r)=>{let o=Ln(),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?ky[i]:Py[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},f={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",p[l])}),jsxs(Drawer.Content,{ref:r,className:m("fixed z-50 flex flex-col border bg-background",f[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})});_u.displayName="DrawerContent";var Yu=q.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Ln(),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(vt,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});Yu.displayName="DrawerHeader";var qu=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}));qu.displayName="DrawerBody";var Xu=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}));Xu.displayName="DrawerFooter";var Zu=q.forwardRef(({className:e,...t},n)=>Ln()?.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}));Zu.displayName="DrawerTitle";var Qu=q.forwardRef(({className:e,...t},n)=>Ln()?.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}));Qu.displayName="DrawerDescription";var Ju=q.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Ln();return jsx(vt,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});Ju.displayName="DrawerClose";var em=q.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Ln();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,p=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:f=>{t?.(f),s();},...r,children:[c?jsx(u,{className:"h-4 w-4 shrink-0"}):jsx(p,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});em.displayName="DrawerToggle";var tm=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));tm.displayName="DrawerSeparator";var nm=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}));nm.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 om=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"}}),am=q.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Ln(),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(om({variant:t,size:n}),o),...s,children:a});return r?jsxs(Un,{children:[jsx(jn,{children:u}),jsx(Wn,{side:"right",align:"center",hidden:d!=="collapsed"||c,...typeof r=="string"?{children:r}:r})]}):u});am.displayName="DrawerMenuButton";var sm=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}));sm.displayName="DrawerGroup";var im=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}));im.displayName="DrawerGroupLabel";var lm=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}));lm.displayName="DrawerInset";var Ly=xi;var dm=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})}));dm.displayName="Table";var um=q.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:m("[&_tr]:border-b",e),...t}));um.displayName="TableHeader";var mm=q.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:m("[&_tr:last-child]:border-0",e),...t}));mm.displayName="TableBody";var pm=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}));pm.displayName="TableFooter";var fm=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}));fm.displayName="TableRow";var gm=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}));gm.displayName="TableHead";var bm=q.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));bm.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 Ay({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:p,onPaginationChange:f,emptyContent:g="No data",loading:h=false,striped:v=false,hoverable:b=true,...y},x){let[w,C]=q.useState(new Set),[R,M]=q.useState({columnId:null,direction:null}),[k,D]=q.useState({pageIndex:0,pageSize:u[0]||10}),P=o??w,S=l??R,T=p??k,N=A=>{a?a(A):C(A);},H=A=>{c?c(A):M(A);},L=A=>{f?f(A):D(A);},E=q.useMemo(()=>{if(!S.columnId||!S.direction)return t;let A=n.find(F=>F.id===S.columnId);return A?[...t].sort((F,j)=>{let U=A.accessor(F),G=A.accessor(j);if(U===G)return 0;if(U==null)return 1;if(G==null)return -1;let _=String(U).localeCompare(String(G),void 0,{numeric:true});return S.direction==="asc"?_:-_}):t},[t,S,n]),I=q.useMemo(()=>{if(!d)return E;let A=T.pageIndex*T.pageSize;return E.slice(A,A+T.pageSize)},[E,d,T]),V=Math.ceil(E.length/T.pageSize),K=A=>{if(A===true){let F=new Set(I.map((j,U)=>s(j,U)));N(F);}else N(new Set);},B=(A,F)=>{let j=new Set(P);F?j.add(A):j.delete(A),N(j);},O=I.length>0&&I.every((A,F)=>P.has(s(A,F))),z=I.some((A,F)=>P.has(s(A,F))),$=A=>{if(!n.find(U=>U.id===A)?.sortable&&!i)return;let j="asc";S.columnId===A&&(S.direction==="asc"?j="desc":S.direction==="desc"&&(j=null)),H({columnId:j?A:null,direction:j});},W=A=>S.columnId!==A?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):S.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:x,className: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:O?true:z?"indeterminate":false,onCheckedChange:K,"aria-label":"Select all"})}),n.map(A=>{let F=A.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:A.width},onClick:()=>F&&$(A.id),children:jsxs("div",{className:"flex items-center gap-2",children:[A.header,F&&W(A.id)]})},A.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((A,F)=>{let j=s(A,F),U=P.has(j);return jsxs("tr",{className:m("border-b transition-colors",b&&"hover:bg-muted/50",v&&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(So,{checked:U,onCheckedChange:G=>B(j,!!G),"aria-label":`Select row ${F+1}`})}),n.map(G=>jsx("td",{className:"p-4 align-middle",children:G.cell?G.cell(A,F):G.accessor(A)},G.id))]},j)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:T.pageSize,onChange:A=>L({pageIndex:0,pageSize:Number(A.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(A=>jsx("option",{value:A,children:A},A))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",T.pageIndex+1," of ",V||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(de,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>L({...T,pageIndex:T.pageIndex-1}),disabled:T.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(de,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>L({...T,pageIndex:T.pageIndex+1}),disabled:T.pageIndex>=V-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var zy=q.forwardRef(Ay);var yi=["January","February","March","April","May","June","July","August","September","October","November","December"];function Uy({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(Wt,{children:[jsx(_t,{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:yi[o]}),jsx(ChevronDown,{className:"h-3 w-3 text-muted-foreground shrink-0"})]})}),jsx(Yt,{className:"min-w-[120px] p-0",children:jsx(De,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:yi.map((c,d)=>jsx(Tt,{onSelect:()=>s(d),className:m("text-xs",o===d&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]}),jsxs(Wt,{children:[jsx(_t,{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(Yt,{className:"min-w-[80px] p-0",children:jsx(De,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:l.map(c=>jsx(Tt,{onSelect:()=>i(c),className:m("text-xs",a===c&&"bg-primary/10 text-primary font-medium"),children:c},c))})})})]})]})}function jy(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(Uy,{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=yi[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 Zr({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(()=>jy(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})}Zr.displayName="Calendar";var Rm=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});Rm.displayName="Pagination";var wm=q.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:m("flex flex-row items-center gap-1",e),...t}));wm.displayName="PaginationContent";var Cm=q.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:m("",e),...t}));Cm.displayName="PaginationItem";var qy={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},Ka=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:m(Ur({variant:t?"solid":"light",size:n,radius:r}),o&&qy[n],e),...a});Ka.displayName="PaginationLink";var Tm=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to previous page",isIconOnly:false,className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});Tm.displayName="PaginationPrevious";var Mm=({className:e,...t})=>jsxs(Ka,{"aria-label":"Go to next page",isIconOnly:false,className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});Mm.displayName="PaginationNext";var Xy={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},Nm=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:m("flex items-center justify-center",Xy[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});Nm.displayName="PaginationEllipsis";var zo=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}));zo.displayName="VisuallyHidden";var Pm={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},Qy={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"},Em=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"),Ti=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=q.createContext(null),Mr=()=>{let e=q.useContext(Ga);if(!e)throw new Error("Modal components must be used within a Modal");return e},Sm=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:p},f)=>{let[g,h]=q.useState(false),v=e!==void 0,b=v?e:g,[y,x]=q.useState(false),w=q.useRef(null),C=q.useId(),R=q.useId();q.useEffect(()=>{x(true);},[]);let M=q.useCallback(S=>{v||h(S),t?.(S);},[v,t]);q.useEffect(()=>{if(b)return Pn(),()=>En()},[b]),q.useEffect(()=>{if(!b||i)return;let S=T=>{T.key==="Escape"&&M(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[b,i,M]);let k=S=>{s&&S.target===S.currentTarget&&M(false);},D=n?q.isValidElement(n)?q.cloneElement(n,{onClick:S=>{n.props.onClick?.(S),M(true);}}):jsx("button",{type:"button",onClick:()=>M(true),children:n}):null,P=()=>!y||!b?null:d==="outside"?Pa.createPortal(jsx("div",{"data-state":b?"open":"closed",className:m(Em(),Pm[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:k,children:jsxs("div",{ref:S=>{w.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"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",p),children:[jsx(zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>M(false)})]})}),document.body):Pa.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":b?"open":"closed",className:m(Em(),Pm[l]),onClick:k,"aria-hidden":"true"}),jsxs("div",{ref:S=>{w.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":R,"data-state":b?"open":"closed",className:m(Ti({size:u}),Qy[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",p),children:[jsx(zo,{children:jsx("h2",{id:C,children:r})}),o,!a&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>M(false)})]})]}),document.body);return jsxs(Ga.Provider,{value:{open:b,onOpenChange:M,scrollBehavior:d,titleId:C,descriptionId:R},children:[D,P()]})});Sm.displayName="Modal";var Ua=({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(p=>{i||s(p),r?.(p);},[i,r]);return jsx(Ga.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Ua.displayName="ModalRoot";var Dm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Mr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Dm.displayName="ModalTrigger";var Mi=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};Mi.displayName="ModalPortal";var Ni=q.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Mr();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});Ni.displayName="ModalOverlay";var Hm=q.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Mr();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Hm.displayName="ModalClose";var ja=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}=Mr(),[p,f]=q.useState(false);return q.useEffect(()=>{f(true);},[]),q.useEffect(()=>{if(l)return Pn(),()=>En()},[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]),!p||!l?null:jsxs(Mi,{children:[jsx(Ni,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Ti({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(vt,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});ja.displayName="ModalContent";var Im=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Im.displayName="ModalHeader";var Vm=({className:e,children:t})=>(q.useContext(Ga)?.scrollBehavior??"inside")==="inside"?jsx(De,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Vm.displayName="ModalBody";var Am=({className:e,children:t,...n})=>{let{onOpenChange:r}=Mr();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)})};Am.displayName="ModalFooter";var zm=q.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Mr();return jsx("h2",{ref:n,id:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});zm.displayName="ModalTitle";var Om=q.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Mr();return jsx("p",{ref:n,id:r,className:m("text-sm text-muted-foreground",e),...t})});Om.displayName="ModalDescription";var ki=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}));ki.displayName=Command.displayName;var t0=({children:e,...t})=>jsx(Ua,{...t,children:jsx(ja,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(ki,{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})})}),Bm=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})]}));Bm.displayName=Command.Input.displayName;var Fm=q.forwardRef(({className:e,children:t,...n},r)=>jsx(De,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:m("overflow-hidden",e),...n,children:t})}));Fm.displayName=Command.List.displayName;var Km=q.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Km.displayName=Command.Empty.displayName;var $m=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}));$m.displayName=Command.Group.displayName;var Gm=q.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:m("-mx-1 h-px bg-border",e),...t}));Gm.displayName=Command.Separator.displayName;var Um=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]}));Um.displayName=Command.Item.displayName;var jm=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});jm.displayName="CommandShortcut";var o0={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"}},a0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},_m=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),[p,f]=q.useState(false),g=o0[s],h=a0[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:p?"var(--color-foreground)":void 0},onFocus:v=>{f(true),r?.(v);},onBlur:v=>{f(false),o?.(v);},...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})})]})});_m.displayName="PasswordInput";var c0={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},d0={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Ym=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},p)=>{let[f,g]=q.useState(s),[h,v]=q.useState(false),b=a!==void 0,y=b?a:f,x=c0[c],w=d0[d],C=T=>{T!==void 0&&(r!==void 0&&T<r&&(T=r),o!==void 0&&T>o&&(T=o)),b||g(T),i?.(T);},R=()=>{C((y??0)+n);},M=()=>{C((y??0)-n);},k=T=>{let N=T.target.value;if(N==="")C(void 0);else {let H=parseFloat(N);isNaN(H)||C(H);}},D=T=>{T.key==="ArrowUp"?(T.preventDefault(),R()):T.key==="ArrowDown"&&(T.preventDefault(),M());},P=r===void 0||(y??0)>r,S=o===void 0||(y??0)<o;return t?jsxs("div",{className:m("relative flex items-center border border-input transition-colors",x.wrapper,w,l&&"opacity-50",e),style:{borderColor:h?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",x.button),onClick:M,disabled:l||!P,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:p,value:y??"",onChange:k,onKeyDown:D,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...u}),jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",x.button),onClick:R,disabled:l||!S,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:x.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",x.input,w,e),style:{borderColor:h?"var(--color-foreground)":void 0},ref:p,value:y??"",onChange:k,onKeyDown:D,disabled:l,onFocus:()=>v(true),onBlur:()=>v(false),...u})});Ym.displayName="NumberInput";var Qm=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),qm=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"}}),Jm=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,p)=>{let f=jsxs(Rr,{className:m(qm({size:r})),children:[u.src&&jsx(qr,{src:u.src,alt:u.alt||""}),jsx(wr,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]},p);return o&&u.alt?jsxs(Un,{children:[jsx(jn,{children:f}),jsx(Wn,{className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:u.alt})]},p):f},d=jsxs("div",{ref:s,className:m(Qm({size:r,className:e})),...a,children:[i.map((u,p)=>c(u,p)),l>0&&jsx(Rr,{className:m(qm({size:r})),children:jsxs(wr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]});return o?jsx(Xr,{delayDuration:300,children:d}):d});Jm.displayName="AvatarGroup";var ep=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"}}),tp=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,...p},f)=>{let[g,h]=q.useState(n),[v,b]=q.useState(null),y=t!==void 0,x=y?t:g,w=v!==null?v:x,C=N=>{l||c||(y||h(N),r?.(N));},R=(N,H=false)=>{let L=i&&H?N+.5:N+1;C(L);},M=(N,H)=>{if(l||c)return;let L=N.currentTarget.getBoundingClientRect(),E=i&&N.clientX<L.left+L.width/2;b(E?H+.5:H+1);},k=()=>{b(null);},D=s==="heart"?Heart:Star,P=N=>w>=N+1?"full":w>=N+.5?"half":"empty",S=d?{color:d,fill:d}:{},T=u?{color:u}:{};return jsx("div",{ref:f,className:m(ep({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:k,role:"radiogroup","aria-label":"Rating",...p,children:Array.from({length:o},(N,H)=>{let L=P(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(),V=i&&E.clientX<I.left+I.width/2;R(H,V);},onMouseMove:E=>M(E,H),disabled:c||l,"aria-label":`Rate ${H+1} out of ${o}`,role:"radio","aria-checked":x===H+1,children:[jsx(D,{className:m("text-muted-foreground/30",L!=="empty"&&"absolute inset-0"),style:L==="empty"?T:void 0}),L!=="empty"&&jsx(D,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",L==="half"&&"clip-path-half"),style:{...S,clipPath:L==="half"?"inset(0 50% 0 0)":void 0}})]},H)})})});tp.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}}),v0={sm:"sm",md:"sm",lg:"sm"},op=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:p,...f},g)=>{let h=a||!!p,v=b=>{b.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:p,onKeyDown:h&&!d?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),p?.(b));}:void 0,className:m(rp({variant:t,color:n,size:r,radius:o,clickable:h}),d&&"opacity-50 cursor-not-allowed",e),...f,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(vt,{size:v0[r??"md"],onClick:v,disabled:d,className:"ml-0.5 h-4 w-4"})]})});op.displayName="Chip";var ap=createContext({direction:"horizontal"}),M0=({className:e,direction:t="horizontal",children:n,...r})=>jsx(ap.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})}),N0=Panel,k0=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(ap),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"}}),E0={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"}},sp={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)"},dp=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=E0[t],p=(u.size-u.strokeWidth)/2,f=2*Math.PI*p,g=f-d/100*f;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:p,strokeWidth:u.strokeWidth,fill:"none"}),jsx("circle",{cx:u.size/2,cy:u.size/2,r:p,strokeWidth:u.strokeWidth,fill:"none",strokeLinecap:"round",stroke:sp[n]||sp.default,strokeDasharray:`${f} ${f}`,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)})]})});dp.displayName="CircularProgress";var up=q.createContext(null),D0=()=>{let e=q.useContext(up);if(!e)throw new Error("OTP components must be used within InputOTP");return e},mp=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"}}),pp=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,...p},f)=>{let[g,h]=q.useState(o),[v,b]=q.useState(0),[y,x]=q.useState(false),w=q.useRef(null),C=r!==void 0?r:g;q.useImperativeHandle(f,()=>w.current),q.useEffect(()=>{b(Math.min(C.length,n-1));},[C,n]),q.useEffect(()=>{C.length===n&&s&&s(C);},[C,n,s]);let R=T=>{let N=T.target.value;if(i&&N){let H=new RegExp(i.replace("^","").replace("$","").replace("+",""));N=N.split("").filter(L=>H.test(L)).join("");}N=N.slice(0,n),r===void 0&&h(N),a?.(N);},M=T=>{T.key==="ArrowLeft"?b(N=>Math.max(0,N-1)):T.key==="ArrowRight"&&b(N=>Math.min(C.length,n-1,N+1));},k=()=>{w.current?.focus();},D=()=>{x(true),b(Math.min(C.length,n-1));},P=()=>{x(false);},S={value:C,activeIndex:y?v:-1,maxLength:n,disabled:l,radius:d};return jsx(up.Provider,{value:S,children:jsxs("div",{className:m(mp({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:M,onFocus:D,onBlur:P,disabled:l,maxLength:n,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...p}),u]})})});pp.displayName="InputOTP";var fp=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center",e),...t}));fp.displayName="InputOTPGroup";var H0={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"},I0={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"},gp=q.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,disabled:s,radius:i}=D0(),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",H0[i],I0[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"})})]})});gp.displayName="InputOTPSlot";var bp=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"})}));bp.displayName="InputOTPSeparator";var xp=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"}}),yp=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:p,renderTag:f,...g},h)=>{let[v,b]=q.useState(""),[y,x]=q.useState(false),w=q.useRef(null);q.useImperativeHandle(h,()=>w.current);let C=T=>{let N=T.trim();if(N.length<i||N.length>l||s&&r.length>=s||!d&&r.some(L=>L.text.toLowerCase()===N.toLowerCase()))return;let H={id:crypto.randomUUID(),text:N};o?.([...r,H]),b("");},R=T=>{u||p||o?.(r.filter(N=>N.id!==T));},M=T=>{if(c.includes(T.key)){if(T.key==="Tab"&&!v)return;T.preventDefault(),C(v);}T.key==="Backspace"&&!v&&r.length>0&&R(r[r.length-1].id);},k=T=>{let N=T.target.value;if(N.includes(",")){N.split(",").forEach(L=>{L.trim()&&C(L);});return}b(N);},D=T=>{T.preventDefault(),T.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(L=>{C(L);});},P=()=>{w.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 transition-colors",u&&"cursor-not-allowed opacity-50",e),style:{borderColor:y?"var(--color-foreground)":void 0},onClick:P,children:[r.map(T=>f?f(T,()=>R(T.id)):jsxs("span",{className:m(xp({variant:t,size:n})),children:[T.text,!u&&!p&&jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),R(T.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${T.text}`,children:jsx(X,{className:"h-3 w-3"})})]},T.id)),!S&&!p&&jsx("input",{ref:w,type:"text",value:v,onChange:k,onKeyDown:M,onPaste:D,onFocus:()=>x(true),onBlur:()=>x(false),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})]})});yp.displayName="TagInput";var wp=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"}}),Cp=q.forwardRef(({className:e,size:t,icon:n,title:r,description:o,action:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m(wp({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]}));Cp.displayName="EmptyState";var Mp=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"}}),Np=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,p=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:m(Mp({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",p),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})]})});Np.displayName="StatCard";var Go=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"}}),Di=({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 tR({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:p,listeners:f,setNodeRef:g,transform:h,transition:v,isDragging:b}=useSortable({id:e.id}),y={transform:CSS.Transform.toString(h),transition:v};return jsxs("div",{ref:g,...p,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",b&&"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",...f,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(Di,{checked:l,onClick:x=>u?.(e,x)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function nR({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:p=[],onSelect:f,checkable:g=false,checkedKeys:h,defaultCheckedKeys:v=[],onCheck:b,emptyContent:y,children:x,...w},C){let[R,M]=q.useState(false),[k,D]=q.useState(null);q.useEffect(()=>{M(true);},[]);let[P,S]=q.useState(new Set(p)),T=u!==void 0,N=T?new Set(u):P,[H,L]=q.useState(new Set(v)),E=h!==void 0,I=E?new Set(h):H,V=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=q.useCallback((F,j)=>{if(!r)return;let U=new Set(N),G=!U.has(F.id);d?G?U.add(F.id):U.delete(F.id):(U.clear(),G&&U.add(F.id)),T||S(U);let _=r.filter(Q=>U.has(Q.id));f?.(Array.from(U),{selected:G,selectedItems:_,item:F,event:j});},[r,N,d,T,f]),B=q.useCallback((F,j)=>{if(!r)return;let U=new Set(I),G=!U.has(F.id);G?U.add(F.id):U.delete(F.id),E||L(U);let _=r.filter(Q=>U.has(Q.id));b?.(Array.from(U),{checked:G,checkedItems:_,item:F,event:j});},[r,I,E,b]),O=F=>{if(!r)return;let j=r.find(U=>U.id===F.active.id);j&&D(j);},z=F=>{let{active:j,over:U}=F;if(D(null),!r||!U||j.id===U.id)return;let G=r.findIndex(Q=>Q.id===j.id),_=r.findIndex(Q=>Q.id===U.id);if(G!==-1&&_!==-1){let Q=[...r],[Y]=Q.splice(G,1);Q.splice(_,0,Y),s?.(Q);}},W=(a||c||g)&&r&&o,A=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}):W?a?R?jsxs(DndContext,{sensors:V,collisionDetection:closestCenter,onDragStart:O,onDragEnd:z,children:[jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:jsx(SortableContext,{items:r.map(F=>F.id),strategy:verticalListSortingStrategy,children:r.map((F,j)=>jsx(tR,{item:F,index:j,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:N.has(F.id),isChecked:I.has(F.id),isCards:A,onSelect:K,onCheck:B},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(Go({variant:t,size:n,className:e})),...w,children:r.map((F,j)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(Di,{checked:I.has(F.id),onClick:U=>B(F,U)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,j)})]},F.id))}):jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:r.map((F,j)=>{let U=N.has(F.id),G=I.has(F.id);return jsxs("div",{role:"listitem","aria-selected":c?U:void 0,onClick:c&&!g?_=>K(F,_):void 0,className:m("flex items-center gap-3 transition-all",A&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",A&&U&&"border-primary bg-accent",!A&&c&&!g&&"cursor-pointer hover:bg-muted/50",!A&&g&&"cursor-pointer hover:bg-muted/50",!A&&U&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(Di,{checked:G,onClick:_=>B(F,_)}),jsx("div",{className:"flex-1 min-w-0",children:o(F,j)})]},F.id)})}):jsx("div",{ref:C,role:"list",className:m(Go({variant:t,size:n,className:e})),...w,children:x})}var rR=q.forwardRef(nR),Ep=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Lp=q.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(Ep({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})]}));Lp.displayName="ListItem";var Sp=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]}));Sp.displayName="ListItemText";var Ip=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Vp=q.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:m(Ip({position:t,className:e})),...n}));Vp.displayName="Timeline";var Ap=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=q.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(Ap({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 Op=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 pt-0.5",e),...t}));Op.displayName="TimelineContent";var Bp=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Bp.displayName="TimelineOpposite";var Fp=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"}}),Kp=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]},$p=(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},Gp=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:p,...f},g)=>{let[h,v]=q.useState(false),[b,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),V=[],K=[];(u?I:[I[0]]).forEach(O=>{let z=$p(O,c,d);z.length>0?K.push({file:O,errors:z}):V.push(O);}),w(K),V.length>0&&r?.(V),K.length>0&&o?.(K);},[c,d,u,r,o]),M=q.useCallback(E=>{if(E.preventDefault(),E.stopPropagation(),!p&&(v(true),E.dataTransfer.items)){let V=Array.from(E.dataTransfer.items).some(K=>{if(K.kind!=="file")return true;if(d&&d.length>0){let B=K.type;return !d.some(O=>O.endsWith("/*")?B.startsWith(O.slice(0,-2)):B===O)}return false});y(V);}},[p,d]),k=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),!p&&(E.dataTransfer.dropEffect="copy");},[p]),D=q.useCallback(E=>{E.preventDefault(),E.stopPropagation();let I=E.currentTarget.getBoundingClientRect(),V=E.clientX,K=E.clientY;(V<I.left||V>I.right||K<I.top||K>I.bottom)&&(v(false),y(false));},[]),P=q.useCallback(E=>{E.preventDefault(),E.stopPropagation(),v(false),y(false),!p&&R(E.dataTransfer.files);},[p,R]),S=q.useCallback(()=>{p||C.current?.click();},[p]),T=q.useCallback(E=>{R(E.target.files),E.target.value="";},[R]),N=q.useCallback(E=>{p||(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.current?.click());},[p]),H=b?"error":h?"active":t,L=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...f,children:[jsxs("div",{role:"button",tabIndex:p?-1:0,onDragEnter:M,onDragOver:k,onDragLeave:D,onDrop:P,onClick:S,onKeyDown:N,className:m(Fp({variant:H,size:n}),p&&"opacity-50 cursor-not-allowed",!p&&"cursor-pointer focus:outline-none"),"aria-disabled":p,children:[jsx("input",{ref:C,type:"file",accept:L,multiple:u,disabled:p,onChange:T,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:E,errors:I})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:E.name}),":"," ",I.map(V=>V.message).join(", ")]},E.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(E=>{let I=Kp(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:[Za(E.file.size),E.error&&jsx("span",{className:"ml-2 text-danger",children:E.error})]}),E.progress!==void 0&&E.progress<100&&jsx(za,{value:E.progress,className:"mt-2 h-1"})]}),jsxs(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:V=>{V.stopPropagation(),a?.(E.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},E.id)})})]})});Gp.displayName="FileUpload";var pR=`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")`,jp=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}}),Wo=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},p)=>jsx("button",{ref:p,type:"button",disabled:c,onClick:h=>{l?.(h),r?.(e);},className:m(jp({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?pR: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}})}));Wo.displayName="ColorSwatch";var Wp=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),_p=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,...p},f)=>{let[g,h]=q.useState(t),v=e??g,b=q.useCallback(x=>{l||(e===void 0&&h(x),n?.(x));},[e,n,l]),y=x=>x.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:m(Wp({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...p,children:a.map(x=>{let w=v?y(v)===y(x):false;return jsx(Wo,{role:"option",color:x,size:s,shape:i,isSelected:w,onSelect:b,disabled:l,selectedRingColor:c,"aria-selected":w},x)})})});_p.displayName="ColorSwatchPicker";var bR=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Yp={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},qp=q.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,disabled:r,presets:o=bR,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=q.useState(e??t),p=q.useId();q.useEffect(()=>{e!==void 0&&u(e);},[e]);let f=v=>{u(v),n?.(v);},g=v=>{u(v),n?.(v);},h=v=>{let b=v.target.value.toUpperCase();u(b),n?.(b);};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",Yp[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:p}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(Mt,{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",Yp[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(Nt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:f,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(yr,{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:f,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(yr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(v=>jsx(Wo,{color:v,size:"sm",isSelected:d.toLowerCase()===v.toLowerCase(),onSelect:g},v))})]})]})})]})});qp.displayName="ColorPicker";var Xp=cva("flex w-full border border-input bg-background px-3 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-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"}},defaultVariants:{size:"md",radius:"md"}}),Hi=e=>String(e).padStart(2,"0"),RR=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},wR=(e,t)=>`${Hi(e)}:${Hi(t)}`,Zp=q.forwardRef(({className:e,size:t,radius:n,value:r,onChange:o,use24Hour:a=true,minuteStep:s=1,showPicker:i=true,minTime:l,maxTime:c,label:d,isRequired:u,description:p,errorMessage:f,isInvalid:g,disabled:h,...v},b)=>{let[y,x]=q.useState(r??""),[w,C]=q.useState(false),[R,M]=q.useState(false),k=q.useId(),D=v.id||k,P=g||!!f;q.useEffect(()=>{r!==void 0&&x(r);},[r]);let{hours:S,minutes:T}=RR(y||"00:00"),N=O=>{let z=O.target.value;x(z),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(z)&&o?.(z);},H=(O,z)=>{let $=Math.max(0,Math.min(23,O)),W=Math.max(0,Math.min(59,z)),A=wR($,W);x(A),o?.(A);},L=()=>H(S+1,T),E=()=>H(S-1,T),I=()=>H(S,T+s),V=()=>H(S,T-s),K=({value:O,onIncrement:z,onDecrement:$})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:z,disabled:h,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:Hi(O)}),jsx(de,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$,disabled:h,children:jsx(ChevronDown,{className:"h-4 w-4"})})]}),B=jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:b,id:D,type:"time",value:y,onChange:N,disabled:h,required:u,"aria-invalid":P,"aria-describedby":p||f?`${D}-description`:void 0,className:m(Xp({size:t,radius:n}),i&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",P&&"border-danger focus:border-danger",!d&&e),style:{borderColor:P?void 0:R?"var(--color-foreground)":void 0},onFocus:()=>M(true),onBlur:()=>M(false),...v}),i&&jsxs(Mt,{open:w,onOpenChange:C,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 cursor-pointer",disabled:h,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(Nt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(K,{value:S,onIncrement:L,onDecrement:E,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(K,{value:T,onIncrement:I,onDecrement:V,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(de,{variant:"bordered",size:"sm",onClick:()=>{let O=new Date;H(O.getHours(),O.getMinutes());},children:"Now"}),jsx(de,{size:"sm",onClick:()=>C(false),children:"Done"})]})]})]})]});return !d&&!p&&!f?B:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[d&&jsxs("label",{htmlFor:D,className:"text-sm font-medium leading-none",children:[d,u&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),B,(p||f)&&jsx("p",{id:`${D}-description`,className:m("text-xs",P?"text-danger":"text-muted-foreground"),children:f||p})]})});Zp.displayName="TimeInput";var Qp=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"}}),TR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},MR=(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}},Ii=(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},Jp=(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},ef=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:p,thousandSeparator:f=",",decimalSeparator:g=".",radius:h="md",disabled:v,placeholder:b,...y},x)=>{let[w,C]=q.useState(r),[R,M]=q.useState(""),[k,D]=q.useState(false),P=n!==void 0?n:w,S=p??MR(a,s);q.useEffect(()=>{!k&&P!==void 0&&M(Ii(P,i,f,g));},[P,i,f,g,k]);let T=I=>{let V=I.target.value;if(!V){M(""),n===void 0&&C(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${f}${g}.-]*$`).test(V))return;M(V);let B=Jp(V,f,g);if(B!==void 0){let O=B;l!==void 0&&B<l&&(O=l),c!==void 0&&B>c&&(O=c),n===void 0&&C(O),o?.(O);}},N=()=>{D(true),P!==void 0&&M(P.toString().replace(".",g));},H=()=>{D(false),M(P!==void 0?Ii(P,i,f,g):"");},L=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:S}),E=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:S});return jsxs("div",{className:"relative flex items-center",children:[L&&jsx("div",{className:"absolute left-3 pointer-events-none",children:L}),jsx("input",{ref:x,type:"text",inputMode:"decimal",value:R,onChange:T,onFocus:N,onBlur:H,disabled:v,placeholder:b??`0${g}${"0".repeat(i)}`,className:m(Qp({size:t}),TR[h],L&&"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})]})});ef.displayName="CurrencyInput";var tf=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"}}),Vi={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:"#####-####"}},PR=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},er=e=>["#","A","*"].includes(e),Ja=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(er(s)){if(o<e.length){let i=e[o];PR(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},Ai=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];er(o)&&(n+=e[r]);}return n},nf=(e,t)=>e.split("").map(n=>er(n)?t:n).join(""),ER=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)er(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,er(t[i])&&s++;for(;a<t.length&&!er(t[a]);)a++;return Math.min(a,e.length)},rf=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},p)=>{let f=typeof a=="string"&&a in Vi?Vi[a].mask:a,[g,h]=q.useState(r),[v,b]=q.useState(""),[y,x]=q.useState(false),w=q.useRef(null),C=n!==void 0?n:g;q.useImperativeHandle(p,()=>w.current),q.useEffect(()=>{let D=Ja(C,f,true);b(D);},[C,f]);let R=D=>{let P=D.target.value,S=D.target.selectionStart??0,T=P.replace(/[^\w]/g,""),N=Ja(T,f,true),H=Ai(N,f);b(N),n===void 0&&h(l?N:H),o?.(H,N),requestAnimationFrame(()=>{if(w.current){let L=ER(N,f,S);w.current.setSelectionRange(L,L);}});},M=D=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(D.key)||D.ctrlKey||D.metaKey)return;let P=w.current;if(!P)return;let S=P.selectionStart??0;if(D.key==="Backspace"&&S>0){let T=S-1;for(;T>0&&!er(f[T]);)T--;let N=Ai(v,f),H=0;for(let I=0;I<T&&I<f.length;I++)er(f[I])&&H++;let L=N.slice(0,Math.max(0,H-1))+N.slice(H),E=Ja(L,f,true);b(E),n===void 0&&h(l?E:L),o?.(L,E),D.preventDefault(),requestAnimationFrame(()=>{w.current&&w.current.setSelectionRange(T,T);});}},k=i?nf(f,s):d;return jsx("input",{ref:w,type:"text",value:v,onChange:R,onKeyDown:M,onFocus:()=>x(true),onBlur:()=>x(false),disabled:c,placeholder:k,className:m(tf({size:t}),e),style:{borderColor:y?"var(--color-foreground)":void 0},...u})});rf.displayName="MaskedInput";var IR=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"}}),af=[{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},VR=e=>e.replace(/#/g,"_"),sf=q.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=af,showCountrySelect:c=true,showDialCode:d=false,disabled:u,placeholder:p,radius:f="md",...g},h)=>{let[v,b]=q.useState(r),[y,x]=q.useState(a??s),[w,C]=q.useState(false),[R,M]=q.useState(false),[k,D]=q.useState(false),[P,S]=q.useState({top:0,left:0,width:0}),T=q.useRef(null),N=q.useRef(null),H=n!==void 0?n:v,L=a??y,E=l.find($=>$.code===L)??l[0],I=es(H,E.format);q.useEffect(()=>{D(true);},[]),q.useEffect(()=>{if(R&&T.current){let $=T.current.getBoundingClientRect();S({top:$.bottom+4,left:$.left,width:Math.max($.width,280)});}},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{T.current&&!T.current.contains(W.target)&&N.current&&!N.current.contains(W.target)&&M(false);};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{W.key==="Escape"&&M(false);};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[R]),q.useEffect(()=>{if(!R)return;let $=W=>{N.current?.contains(W.target)||M(false);};return window.addEventListener("scroll",$,true),()=>window.removeEventListener("scroll",$,true)},[R]);let V=$=>{let A=$.target.value.replace(/\D/g,"");n===void 0&&b(A);let F=es(A,E.format),j=`${E.dialCode} ${F}`;o?.(A,j,E);},K=$=>{let W=l.find(j=>j.code===$);if(!W)return;a===void 0&&x($),i?.(W);let A=es(H,W.format),F=`${W.dialCode} ${A}`;o?.(H,F,W),M(false);},B=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",O=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"}[f],u&&"cursor-not-allowed opacity-50"),style:{borderColor:O?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:T,type:"button",disabled:u,onClick:()=>M(!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",B),style:{borderColor:O?"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&&Pa.createPortal(jsx("div",{ref:N,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:P.top,left:P.left,minWidth:P.width},children:jsx(De,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map($=>jsxs("div",{role:"option","aria-selected":$.code===L,onClick:()=>K($.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:$.code===L&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:$.flag}),jsx("span",{className:"flex-1",children:$.name}),jsx("span",{className:"text-xs text-muted-foreground",children:$.dialCode})]})]},$.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:V,onFocus:()=>C(true),onBlur:()=>C(false),disabled:u,placeholder:p??VR(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})]})]})});sf.displayName="PhoneInput";var cf=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}}),df=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],p={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:m(cf({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",p),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",p),children:a})]})});df.displayName="Navbar";var uf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));uf.displayName="NavbarBrand";var mf=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})});mf.displayName="NavbarContent";var pf=q.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:m("flex items-center",t&&"text-primary font-medium",e),...n}));pf.displayName="NavbarItem";var ff=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}));ff.displayName="NavbarLink";var KR={none:"",hover:"hover:underline",always:"underline"},gf={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},vf=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 gf,p=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&&gf[t],KR[n],a&&"pointer-events-none opacity-50",e),style:p,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});vf.displayName="Link";var hf=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"}}),xf=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,...p},f)=>{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 v=y=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(y);},b=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m(hf({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(de,{ref:f,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:v,"aria-label":"Back to top",className:"shadow-lg",...p,children:r||jsx(ArrowUp,{className:b})})})});xf.displayName="BackTop";var qR=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),XR=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),yf=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"}}),Rf=q.createContext(null),nr=()=>{let e=q.useContext(Rf);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},wf=q.createContext(null),Yo=()=>{let e=q.useContext(wf);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},Oi=q.createContext(null),Cf=q.createContext(null),Tf=q.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=q.useState(null);return jsx(Rf.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",qR({radius:n}),e),...r,children:t})})});Tf.displayName="Menubar";var Mf=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=nr(),r=q.useId(),o=q.useRef(null),a=t===r,s=q.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(wf.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};Mf.displayName="MenubarMenu";var Nf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Nf.displayName="MenubarGroup";var kf=({children:e,container:t})=>{let[n,r]=q.useState(false);return q.useEffect(()=>{r(true);},[]),n?Pa.createPortal(e,t||document.body):null};kf.displayName="MenubarPortal";var Pf=({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(Oi.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};Pf.displayName="MenubarSub";var Ef=q.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(Cf.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));Ef.displayName="MenubarRadioGroup";var Lf=q.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=nr(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=Yo(),p=g=>{t?.(g),u(!d);},f=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",XR({radius:i}),e),onClick:p,onMouseEnter:f,...r})});Lf.displayName="MenubarTrigger";var Sf=q.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=nr(),l=q.useContext(Oi);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,p=g=>{r?.(g),d(true);},f=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:p,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Sf.displayName="MenubarSubTrigger";var Df=q.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=nr(),i=q.useContext(Oi);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,p]=q.useState({top:0,left:0}),[f,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),p({top:C,left:R});})();},[l,t,d]);let v=y=>{n?.(y),c(true);},b=y=>{r?.(y),c(false);};return !f||!l?null:Pa.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",yf({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Df.displayName="MenubarSubContent";var Hf=q.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=nr(),{triggerRef:l,open:c,onOpenChange:d}=Yo(),[u,p]=q.useState({top:0,left:0}),[f,g]=q.useState(false),h=q.useRef(null);return q.useEffect(()=>{g(true);},[]),q.useEffect(()=>{if(!c||!l.current||!h.current)return;let v=()=>{if(!l.current||!h.current)return;let b=l.current.getBoundingClientRect(),y=h.current.getBoundingClientRect(),x=b.bottom+r,w=b.left+n;t==="center"?w=b.left+b.width/2-y.width/2:t==="end"&&(w=b.right-y.width-n),p({top:x,left:w});};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,true),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,true);}},[c,t,n,r,l]),q.useEffect(()=>{if(!c)return;let v=b=>{let y=b.target;h.current&&!h.current.contains(y)&&l.current&&!l.current.contains(y)&&d(false);};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,d,l]),q.useEffect(()=>{if(!c)return;let v=b=>{b.key==="Escape"&&d(false);};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c,d]),!f||!c?null:Pa.createPortal(jsx("div",{ref:v=>{h.current=v,typeof s=="function"?s(v):s&&(s.current=v);},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",yf({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});Hf.displayName="MenubarContent";var If=q.forwardRef(({className:e,inset:t,disabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=Yo(),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})});If.displayName="MenubarItem";var Vf=q.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,disabled:o,onClick:a,...s},i)=>{let{radius:l}=nr(),{onOpenChange:c}=Yo(),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]})});Vf.displayName="MenubarCheckboxItem";var Af=q.forwardRef(({className:e,children:t,value:n,disabled:r,onClick:o,...a},s)=>{let{radius:i}=nr(),{onOpenChange:l}=Yo(),c=q.useContext(Cf),d=c?.value===n,u=p=>{if(r){p.preventDefault();return}o?.(p),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]})});Af.displayName="MenubarRadioItem";var Bi=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}));Bi.displayName="MenubarSection";var ZR=Bi,zf=q.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));zf.displayName="MenubarSeparator";var Of=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Of.displayName="MenubarShortcut";var Bf=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"}}),Ff=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(Bf({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)})});Ff.displayName="Steps";var Kf=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"}}),JR=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"}}),ew=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"}}),$f=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(Kf({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(JR({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(ew({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));$f.displayName="Step";var Uf=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"}}),jf=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}}),Wf=q.createContext(null),lw=()=>{let e=q.useContext(Wf);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},cw=({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"})})}),_f=({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:p,draggable:f,draggedNode:g,setDraggedNode:h,dragOverKey:v,dragOverPosition:b,setDragOver:y,handleDrop:x,allowDrop:w,onDragStart:C,onDragOver:R,onDragEnter:M,onDragLeave:k,onDragEnd:D,showLine:P,showIcon:S,showHandle:T,dragIcon:N,icon:H,leafIcon:L,folderIcon:E,folderOpenIcon:I,blockNode:V,disabled:K,size:B,getAllKeys:O}=lw(),z=e.children&&e.children.length>0,$=e.isLeaf??!z,W=o.has(e.key),A=s.has(e.key),F=c.has(e.key),j=d.has(e.key),U=g?.key===e.key,G=v===e.key,_=!!(K||e.disabled),Q=l&&e.selectable!==false,Y=p&&e.checkable!==false,ge=q.useMemo(()=>_?false:typeof f=="boolean"?f:typeof f=="function"?f(e):f&&typeof f=="object"?f.nodeDraggable?f.nodeDraggable(e):true:false,[f,e,_]),X=q.useMemo(()=>N!==void 0?N:typeof f=="object"&&f.icon!==void 0?f.icon:jsx(GripVertical,{className:"h-4 w-4"}),[N,f]),J=q.useMemo(()=>e.icon?e.icon:H?typeof H=="function"?H({expanded:W,isLeaf:$}):H:$?L:W?I:E,[e.icon,H,W,$,L,E,I]),we=se=>{if(!ge)return;se.stopPropagation(),se.dataTransfer.effectAllowed="move";let ne=se.currentTarget,xe=ne.cloneNode(true),Vt=document.documentElement.classList.contains("dark"),ct=Vt?"#0a0a0a":"#ffffff",Fr=Vt?"#27272a":"#e4e4e7";xe.style.cssText=`
|
|
44
44
|
position: fixed;
|
|
45
45
|
top: -9999px;
|
|
46
46
|
left: -9999px;
|