@reeverdev/ui 0.2.149 → 0.2.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import*as W from'react';import {createContext,useState,useEffect,useContext,useC
52
52
  width: ${Ee.offsetWidth}px;
53
53
  opacity: 1;
54
54
  z-index: 9999;
55
- `,document.body.appendChild(ce),_.dataTransfer.setDragImage(ce,20,15),setTimeout(()=>{document.body.removeChild(ce);},0),h(e),C?.({event:_,node:e});},pt=_=>{if(_.preventDefault(),_.stopPropagation(),!g||g.key===e.key||ie)return;let Ee=_.currentTarget.getBoundingClientRect(),ce=_.clientY-Ee.top,Ke=Ee.height,$e;ce<Ke*.25?$e=-1:ce>Ke*.75?$e=1:$e=0,!(R&&!R({dropNode:e,dropPosition:$e,dragNode:g}))&&(w(e.key,$e),x?.({event:_,node:e}));},fn=_=>{_.preventDefault(),_.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:_,node:e,expandedKeys:K()});},Br=_=>{_.stopPropagation(),T?.({event:_,node:e});},Ao=_=>{_.preventDefault(),_.stopPropagation(),!(!g||g.key===e.key||ie)&&(v!==null&&y(e,v),h(null),w(null,null));},Kt=_=>{h(null),w(null,null),k?.({event:_,node:e});},Ta=_=>{ie||Ce&&i(e.key,e,_);},gn=_=>{_.stopPropagation(),!ie&&!q&&a(e.key,e);},G=W.useMemo(()=>{if(!Y||v===null)return "";switch(v){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[Y,v]),ne=[...n,r];return jsxs("div",{className:"relative",children:[M&&t>0&&jsxs(Fragment,{children:[n.map((_,Ee)=>!_&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Ee} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Ee)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:r?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":q?void 0:te,"aria-selected":Ce?$:void 0,"aria-disabled":ie,draggable:lt,onDragStart:Or,onDragOver:pt,onDragEnter:fn,onDragLeave:Br,onDrop:Ao,onDragEnd:Kt,onClick:Ta,className:u("relative",Ug({size:I,isSelected:$,isDragging:z,isDisabled:ie,isHoverable:Ce&&!ie}),G,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[lt&&E&&J!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:J}),jsx("button",{type:"button",onClick:gn,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",q&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",te&&"rotate-90")})}),U&&jsx(ET,{checked:O,indeterminate:j,disabled:ie,onClick:_=>m(e.key,e,_)}),P&&et&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:et}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),F&&te&&jsx("div",{role:"group",children:e.children.map((_,Ee)=>jsx(jg,{node:_,level:t+1,isLast:Ee===e.children.length-1,parentIsLastPath:ne},_.key))})]})},LT=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return r(e),t},ST=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return e.children&&r(e.children),t},Yg=(e,t)=>{if(!e.children)return false;for(let r of e.children)if(r.key===t||Yg(r,t))return true;return false},_g=W.forwardRef(({className:e,variant:t,size:r,data:n,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:w=[],onCheck:y,showLine:R=false,showIcon:C=false,showHandle:x=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:M=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:E,onDragEnter:S,onDragOver:H,onDragLeave:L,onDragEnd:D,onDrop:V,blockNode:A=false,disabled:B=false,...I},K)=>{let F=W.useCallback(()=>l?new Set(LT(n)):new Set(i),[l,i,n]),[q,te]=W.useState(F),$=s!==void 0,O=$?new Set(s):q,j=W.useCallback((pe,Ue)=>{let $t=new Set(O),He=!$t.has(pe);He?$t.add(pe):$t.delete(pe),$||te($t),c?.(Array.from($t),{expanded:He,node:Ue});},[O,$,c]),[z,Y]=W.useState(new Set(p)),ie=f!==void 0,Ce=ie?new Set(f):z,U=W.useCallback((pe,Ue,$t)=>{let He=new Set(Ce),fr=!He.has(pe);m?fr?He.add(pe):He.delete(pe):(He.clear(),fr&&He.add(pe)),ie||Y(He);let Gn=[],zo=Ma=>{for(let Un of Ma)He.has(Un.key)&&Gn.push(Un),Un.children&&zo(Un.children);};zo(n),g?.(Array.from(He),{selected:fr,selectedNodes:Gn,node:Ue,event:$t});},[Ce,m,ie,g,n]),[lt,J]=W.useState(new Set(w)),[et,Or]=W.useState(new Set),pt=v!==void 0,fn=pt?new Set(Array.isArray(v)?v:v.checked):lt,Br=pt&&!Array.isArray(v)?new Set(v.halfChecked):et,Ao=W.useCallback((pe,Ue,$t)=>{let He=new Set(fn),fr=new Set(Br),Gn=!He.has(pe);if(Gn?(He.add(pe),fr.delete(pe)):He.delete(pe),!b&&Ue.children){let xi=ST(Ue);for(let Kr of xi)Gn?(He.add(Kr),fr.delete(Kr)):He.delete(Kr);}pt||(J(He),Or(fr));let zo=[],Ma=xi=>{for(let Kr of xi)He.has(Kr.key)&&zo.push(Kr),Kr.children&&Ma(Kr.children);};Ma(n);let Un=b?{checked:Array.from(He),halfChecked:Array.from(fr)}:Array.from(He);y?.(Un,{checked:Gn,checkedNodes:zo,node:Ue,event:$t,halfCheckedKeys:Array.from(fr)});},[fn,Br,b,pt,y,n]),[Kt,Ta]=W.useState(null),[gn,G]=W.useState(null),[ne,_]=W.useState(null),Ee=W.useCallback((pe,Ue)=>{G(pe),_(Ue);},[]),ce=W.useCallback((pe,Ue)=>{!Kt||!V||Ue===0&&Yg(Kt,pe.key)||V({event:{},node:pe,dragNode:Kt,dropPosition:Ue,dropToGap:Ue!==0});},[Kt,V]),Ke=W.useCallback(()=>Array.from(O),[O]),$e={expandedKeys:O,toggleExpand:j,selectedKeys:Ce,handleSelect:U,selectable:d,multiple:m,checkedKeys:fn,halfCheckedKeys:Br,handleCheck:Ao,checkable:h,checkStrictly:b,draggable:o,draggedNode:Kt,setDraggedNode:Ta,dragOverKey:gn,dragOverPosition:ne,setDragOver:Ee,handleDrop:ce,allowDrop:a,onDragStart:E,onDragEnter:S,onDragOver:H,onDragLeave:L,onDragEnd:D,showLine:R,showIcon:C,showHandle:x,dragIcon:N,icon:T,leafIcon:k,folderIcon:M,folderOpenIcon:P,blockNode:A,disabled:B,size:r,data:n,getAllKeys:Ke},Fr=pe=>{let Ue=pe.relatedTarget,$t=pe.currentTarget;(!Ue||!$t.contains(Ue))&&Ee(null,null);};return jsx(Wg.Provider,{value:$e,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":m||h,className:u(Gg({variant:t,size:r,className:e})),onDragLeave:Fr,...I,children:n.map((pe,Ue)=>jsx(jg,{node:pe,level:0,isLast:Ue===n.length-1},pe.key))})})});_g.displayName="Tree";var qg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),zT=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let r=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),n=e.split(r);return jsx(Fragment,{children:n.map((o,a)=>r.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},OT=(e,t)=>{let[r,n]=W.useState(e);return W.useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r},Zg=W.forwardRef(({className:e,size:t,value:r,defaultValue:n="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:w,...y},R)=>{let[C,x]=W.useState(false),[N,T]=W.useState(n),[k,M]=W.useState([]),[P,E]=W.useState(false),[S,H]=W.useState(false),[L,D]=W.useState(0),V=W.useRef(null),A=W.useRef(null),B=r!==void 0?r:N,I=OT(B,l);W.useEffect(()=>{let U=A.current;if(!U)return;let lt=()=>{D(U.offsetWidth);};lt();let J=new ResizeObserver(lt);return J.observe(U),()=>{J.disconnect();}},[]),W.useImperativeHandle(R,()=>V.current);let K=i?k:s,F=W.useMemo(()=>i?K:K.filter(U=>U.label.toLowerCase().includes(B.toLowerCase())),[K,B,i]);W.useEffect(()=>{if(!i)return;if(I.length<c){M([]);return}let U=false;return (async()=>{E(true);try{let J=await i(I);U||M(J);}catch{U||M([]);}finally{U||E(false);}})(),()=>{U=true;}},[I,i,c]);let q=U=>{r===void 0&&T(U),o?.(U);},te=U=>{let lt=U.target.value;q(lt),lt.length>=c&&x(true);},$=U=>{q(U.label),a?.(U),x(false);},O=()=>{q(""),V.current?.focus();},j=()=>{H(true),x(true);},z=()=>{H(false);},Y=U=>{U.key==="Escape"&&x(false),U.key==="ArrowDown"&&!C&&F.length>0&&x(true);},ie=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ce=p&&B?"pr-8":"pr-3";return jsxs(tt,{open:C,onOpenChange:x,children:[jsxs(Jn,{ref:A,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:B,onChange:te,onFocus:j,onBlur:z,onKeyDown:Y,disabled:w,placeholder:d,className:u(qg({size:t,fullWidth:v}),Ce,e),style:{borderColor:S?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...y}),p&&B&&!w&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:ie})})]}),jsx(rt,{className:"p-0",align:"start",style:{width:L>0?L:void 0},onOpenAutoFocus:U=>U.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ae,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(ie,"animate-spin")}),f]}):F.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):F.map(U=>jsxs(Command.Item,{value:U.value,disabled:U.disabled,onSelect:()=>$(U),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",B===U.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(zT,{text:U.label,query:B}):U.label})]},U.value))})})})})]})});Zg.displayName="Autocomplete";var bl=W.createContext(null),vl=W.createContext(null),hl=()=>{let e=W.useContext(bl);if(!e)throw new Error("useFormContext must be used within a Form");return e},hs=()=>{let e=W.useContext(vl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},BT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:r=>typeof r=="string"&&r.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:r=>typeof r=="string"&&r.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:r=>typeof r=="number"&&r>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:r=>typeof r=="number"&&r<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:r=>typeof r=="string"&&e.test(r),message:t}),custom:(e,t)=>({validate:e,message:t})},Qg=W.forwardRef(({defaultValues:e={},onSubmit:t,onError:r,validateOnBlur:n=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=W.useState(e),[m,f]=W.useState({}),[p,g]=W.useState({}),[h,b]=W.useState({}),[v,w]=W.useState(false),y=W.useRef(new Map),R=W.useCallback((L,D)=>{y.current.set(L,D);},[]),C=W.useCallback(L=>{y.current.delete(L);},[]),x=W.useCallback(L=>{let D=y.current.get(L)||[],V=c[L];for(let A of D)if(!A.validate(V))return f(B=>({...B,[L]:A.message})),false;return f(A=>({...A,[L]:null})),true},[c]),N=W.useCallback(()=>{let L=true,D={};return y.current.forEach((V,A)=>{let B=c[A];for(let I of V)if(!I.validate(B)){D[A]=I.message,L=false;break}D[A]||(D[A]=null);}),f(D),L},[c]),T=W.useCallback((L,D)=>{d(V=>({...V,[L]:D})),b(V=>({...V,[L]:true})),o&&setTimeout(()=>{x(L);},0);},[o,x]),k=W.useCallback((L,D)=>{f(V=>({...V,[L]:D}));},[]),M=W.useCallback((L,D)=>{g(V=>({...V,[L]:D})),D&&n&&x(L);},[n,x]),P=W.useCallback(L=>({value:c[L],error:m[L]??null,touched:p[L]??false,dirty:h[L]??false}),[c,m,p,h]),E=W.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),S=async L=>{L.preventDefault();let D={};if(y.current.forEach((A,B)=>{D[B]=true;}),g(D),!N()){r?.(m);return}if(t){w(true);try{await t(c);}finally{w(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:T,setError:k,setTouched:M,validateField:x,validateAll:N,registerField:R,unregisterField:C,getFieldState:P,reset:E};return jsx(bl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:S,className:u("space-y-4",s),...i,children:a})})});Qg.displayName="Form";var Jg=({name:e,rules:t=[],defaultValue:r,children:n})=>{let o=hl(),a=W.useId();W.useEffect(()=>(o.registerField(e,t),r!==void 0&&o.values[e]===void 0&&o.setValue(e,r),()=>{o.unregisterField(e);}),[e,t,r,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(vl.Provider,{value:i,children:n})};Jg.displayName="FormField";var eb=W.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("space-y-1.5",e),...t}));eb.displayName="FormItem";var tb=W.forwardRef(({className:e,required:t,children:r,...n},o)=>{let{id:a,error:s,touched:i}=hs();return jsxs(xn,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...n,children:[r,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});tb.displayName="FormLabel";var rb=({children:e})=>{let{name:t,id:r,error:n,touched:o}=hs(),a=hl(),s=a.getFieldState(t),i=c=>{let d=c.target,m=d.type==="checkbox"?d.checked:d.value;a.setValue(t,m);},l=()=>{a.setTouched(t,true);};return W.cloneElement(e,{id:r,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":n&&o?"true":void 0,"aria-describedby":n&&o?`${r}-error`:void 0})};rb.displayName="FormControl";var nb=W.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:u("text-xs text-muted-foreground",e),...t}));nb.displayName="FormDescription";var ob=W.forwardRef(({className:e,message:t,...r},n)=>{let{id:o,error:a,touched:s}=hs(),i=t??(s?a:null);return i?jsx("p",{ref:n,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...r,children:i}):null});ob.displayName="FormMessage";var sb=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),ib=W.forwardRef(({className:e,size:t,name:r,description:n,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||r.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(sb({size:t,className:e})),...i,children:[jsxs(yn,{"data-user-avatar":true,children:[o&&jsx(Zn,{src:o,alt:r}),jsx(Rn,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:r}),n&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:n})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});ib.displayName="User";var cb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),db=W.forwardRef(({className:e,variant:t,size:r,radius:n,...o},a)=>jsx("code",{ref:a,className:u(cb({variant:t,size:r,radius:n,className:e})),...o}));db.displayName="Code";function fb(e){let[t,r]=useState(false);return useEffect(()=>{if(e){r(e==="dark");return}let n=()=>{r(document.documentElement.classList.contains("dark"));};n();let o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var gb=W.forwardRef(({code:e,language:t="bash",showLineNumbers:r=false,className:n,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=fb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",n),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((v,w)=>jsxs("div",{...h({line:v}),children:[r&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:w+1}),v.map((y,R)=>jsx("span",{...b({token:y})},R))]},w))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});gb.displayName="CodeBlock";var bb=W.forwardRef(({tabs:e,className:t,theme:r},n)=>{let[o,a]=useState(0),[s,i]=useState(false),c=fb(r)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:n,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((b,v)=>jsx("div",{...g({line:b}),children:b.map((w,y)=>jsx("span",{...h({token:w})},y))},v))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});bb.displayName="TabbedCodeBlock";var vb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),hb=W.forwardRef(({className:e,variant:t,size:r,code:n,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=W.useState(false),p=async()=>{try{await navigator.clipboard.writeText(n),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(vb({variant:t,size:r,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:n}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":m?"Copied":a,children:m?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});hb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),xb=W.forwardRef(({className:e,radius:t,src:r,alt:n,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=W.useState("loading");W.useEffect(()=>{r&&g("loading");},[r]);let h=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},v={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:u(wl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(wl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(za,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:r,alt:n,onLoad:h,onError:b,className:u("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...m})]})});xb.displayName="Image";var wb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),Cb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),Tb=W.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),Mb=W.forwardRef(({className:e,size:t="md",value:r,defaultValue:n="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=W.useState(n),m=r??c,f=p=>{let g;if(a){let h=Array.isArray(m)?m:[m].filter(Boolean);h.includes(p)?g=h.filter(b=>b!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(Tb.Provider,{value:{value:m,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:u(wb({size:t,className:e})),...i,children:s})})});Mb.displayName="Listbox";var Nb=W.forwardRef(({className:e,value:t,disabled:r,icon:n,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:m}=W.useContext(Tb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{r||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!r&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":r?"":void 0,tabIndex:r?-1:0,className:u(Cb({size:m}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[n&&jsx("span",{className:"mr-2 flex-shrink-0",children:n}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});Nb.displayName="ListboxItem";var Pb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Eb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function JT({className:e,variant:t,size:r,items:n,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=W.useState(null),[f,p]=W.useState(null),g=(y,R)=>{i||(m(R),y.dataTransfer.effectAllowed="move",y.dataTransfer.setData("text/plain",String(R)));},h=(y,R)=>{y.preventDefault(),!(i||d===null||d===R)&&p(R);},b=()=>{p(null);},v=(y,R)=>{if(y.preventDefault(),i||d===null||d===R){m(null),p(null);return}let C=[...n],[x]=C.splice(d,1);C.splice(R,0,x),o?.(C),m(null),p(null);},w=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(Pb({variant:t,size:r,className:e})),...l,children:n.map((y,R)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,R),onDragOver:C=>h(C,R),onDragLeave:b,onDrop:C=>v(C,R),onDragEnd:w,className:u(Eb({variant:t,size:r,isDragging:d===R,isDragOver:f===R}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(y,R)})]},y.id))})}var eM=W.forwardRef(JT);var Db=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),oM={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Hb=W.forwardRef(({className:e,variant:t,loading:r=true,size:n="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u("relative",e),...i,children:[s,jsx("div",{className:u(Db({variant:t,visible:r})),"aria-hidden":!r,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:u(oM[n],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Hb.displayName="LoadingOverlay";var Ib=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Vb=W.forwardRef(({className:e,color:t,isLoading:r=false,progress:n,showSpinner:o=false,...a},s)=>{let[i,l]=W.useState(0),[c,d]=W.useState(false),m=W.useRef(null);return W.useEffect(()=>{if(n!==void 0){l(n),d(n>0&&n<100);return}return r?(d(true),l(10),m.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{m.current&&clearInterval(m.current);}},[r,n]),!c&&n===void 0||n!==void 0&&(n<=0||n>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:u(Ib({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:u("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Vb.displayName="NProgress";var Bb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),Ab={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},dM={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Fb=W.forwardRef(({className:e,variant:t="spinner",size:r="md",fullScreen:n,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:u(dM[r||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:u(Ab[r||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:u(Ab[r||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:u(Bb({variant:t,size:r,fullScreen:n,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:u("text-sm",l),children:o})]})})});Fb.displayName="Loading";var Ml=class extends W.Component{constructor(t){super(t),this.state={hasError:false,error:null};}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){this.props.onError?.(t,r);}componentDidUpdate(t){this.state.hasError&&this.props.resetKeys&&this.props.resetKeys.some((n,o)=>n!==t.resetKeys?.[o])&&this.reset();}reset=()=>{this.props.onReset?.(),this.setState({hasError:false,error:null});};render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsx(Nl,{error:this.state.error,onReset:this.reset}):this.props.children}},Nl=W.forwardRef(({error:e,onReset:t,className:r},n)=>jsxs("div",{ref:n,className:u("flex min-h-[200px] flex-col items-center justify-center gap-4 rounded-lg border border-danger/20 bg-danger/5 p-6 text-center",r),role:"alert",children:[jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger/10",children:jsx(AlertTriangle,{className:"h-6 w-6 text-danger"})}),jsxs("div",{className:"space-y-2",children:[jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Something went wrong"}),e&&jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:e.message||"An unexpected error occurred"})]}),t&&jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-md bg-danger px-4 py-2 text-sm font-medium text-danger-foreground hover:bg-danger/90 transition-colors",children:[jsx(RefreshCw,{className:"h-4 w-4"}),"Try again"]})]}));Nl.displayName="DefaultErrorFallback";var pM=Ml;var $b=W.forwardRef(({value:e,defaultValue:t,onValueChange:r,placeholder:n="Pick a date range",dateFormat:o="LLL dd, y",disabled:a=false,minDate:s,maxDate:i,numberOfMonths:l=2,className:c,align:d="start"},m)=>{let[f,p]=W.useState(false),[g,h]=W.useState(t),b=e!==void 0,v=b?e:g,w=R=>{b||h(R),r?.(R);},y=R=>{if(!R)return n;let{from:C,to:x}=R;return C&&x?`${format(C,o)} - ${format(x,o)}`:C?format(C,o):n};return jsxs(tt,{open:f,onOpenChange:p,children:[jsxs(St,{ref:m,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!v?.from&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",c),children:[jsx(Calendar,{className:"h-4 w-4"}),y(v)]}),jsx(rt,{className:"w-auto p-0",align:d,children:jsx(to,{mode:"range",defaultMonth:v?.from,selected:v,onSelect:w,numberOfMonths:l,disabled:R=>!!(s&&R<s||i&&R>i),initialFocus:true})})]})});$b.displayName="DateRangePicker";var uo=e=>String(e).padStart(2,"0"),Gb=W.forwardRef(({value:e,onValueChange:t,placeholder:r="Pick a time",use24Hour:n=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=W.useState(false),d=n?Array.from({length:24},(y,R)=>R):Array.from({length:12},(y,R)=>R+1),m=Array.from({length:Math.floor(60/o)},(y,R)=>R*o),f=y=>{if(!y)return r;if(n)return `${uo(y.hours)}:${uo(y.minutes)}`;let R=y.hours%12||12,C=y.hours>=12?"PM":"AM";return `${uo(R)}:${uo(y.minutes)} ${C}`},p=y=>{let R=e?.minutes??0,C=y;if(!n&&e){let x=e.hours>=12;x&&y!==12?C=y+12:!x&&y===12&&(C=0);}t?.({hours:C,minutes:R});},g=y=>{let R=e?.hours??0;t?.({hours:R,minutes:y});},h=y=>{if(!e)return;let R=e.hours;y==="AM"&&e.hours>=12?R=e.hours-12:y==="PM"&&e.hours<12&&(R=e.hours+12),t?.({hours:R,minutes:e.minutes});},b=()=>{let y=new Date;t?.({hours:y.getHours(),minutes:y.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,w=e?n?e.hours:e.hours%12||12:void 0;return jsxs(tt,{open:l,onOpenChange:c,children:[jsxs(St,{ref:i,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(rt,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(y=>jsx(oe,{variant:w===y?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(y),children:uo(y)},y))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(y=>jsx(oe,{variant:e?.minutes===y?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(y),children:uo(y)},y))})})]}),!n&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(oe,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(oe,{variant:v==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(oe,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(oe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Gb.displayName="TimePicker";var Ub=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function vM({className:e,variant:t,items:r,itemHeight:n,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=W.useRef(null),[p,g]=W.useState(0);W.useImperativeHandle(m,()=>f.current);let h=r.length*(n+l)-l,b=n+l,v=Math.max(0,Math.floor(p/b)-a),w=Math.ceil(o/b)+2*a,y=Math.min(r.length-1,v+w),R=x=>{let N=x.currentTarget.scrollTop;g(N),c?.(N);},C=W.useMemo(()=>{let x=[];for(let N=v;N<=y;N++)r[N]!==void 0&&x.push({item:r[N],index:N,style:{position:"absolute",top:N*b,left:0,right:0,height:n}});return x},[r,v,y,b,n]);return jsx("div",{ref:f,className:u(Ub({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:R,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:x,index:N,style:T})=>jsx("div",{style:T,children:s(x,N)},i?i(x,N):N))})})}var hM=W.forwardRef(vM);var jb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ll=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Yb=W.forwardRef(({className:e,variant:t,size:r,children:n,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,...f},p)=>{let g=W.useRef(null),h=W.useRef(null),b=W.useRef(false);W.useImperativeHandle(p,()=>g.current),W.useEffect(()=>{let w=h.current;if(!w)return;let y=new IntersectionObserver(R=>{let[C]=R;C.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return y.observe(w),()=>{y.disconnect();}},[a,s,o,l,c,d]);let v=jsx("div",{className:u(Ll({size:r})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:u(jb({variant:t,className:e})),...f,children:[n,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||v),!a&&!s&&m&&jsx("div",{className:u(Ll({size:r}),"text-muted-foreground text-sm"),children:m})]})});Yb.displayName="InfiniteScroll";var na=W.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));na.displayName="VisuallyHidden";var Xb={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},wM={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"},qb=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"),Sl=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"}}),Ps=W.createContext(null),Sn=()=>{let e=W.useContext(Ps);if(!e)throw new Error("Modal components must be used within a Modal");return e},Qb=W.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=W.useState(false),b=e!==void 0,v=b?e:g,[w,y]=W.useState(false),R=W.useRef(null),C=W.useId(),x=W.useId();W.useEffect(()=>{y(true);},[]);let N=W.useCallback(P=>{b||h(P),t?.(P);},[b,t]);W.useEffect(()=>{if(v)return yt(),()=>Rt()},[v]),W.useEffect(()=>{if(!v||i)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,N]);let T=P=>{s&&P.target===P.currentTarget&&N(false);},k=r?W.isValidElement(r)?W.cloneElement(r,{onClick:P=>{r.props.onClick?.(P),N(true);}}):jsx("button",{type:"button",onClick:()=>N(true),children:r}):null,M=()=>!w||!v?null:d==="outside"?$a.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(qb(),Xb[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:T,children:jsxs("div",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(na,{children:jsx("h2",{id:C,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>N(false)})]})}),document.body):$a.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(qb(),Xb[l]),onClick:T,"aria-hidden":"true"}),jsxs("div",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u(Sl({size:m}),wM[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(na,{children:jsx("h2",{id:C,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>N(false)})]})]}),document.body);return jsxs(Ps.Provider,{value:{open:v,onOpenChange:N,scrollBehavior:d,titleId:C,descriptionId:x},children:[k,M()]})});Qb.displayName="Modal";var Jb=({children:e,open:t,defaultOpen:r=false,onOpenChange:n,scrollBehavior:o="inside"})=>{let[a,s]=W.useState(r),i=t!==void 0,l=i?t:a,c=W.useId(),d=W.useId(),m=W.useCallback(f=>{i||s(f),n?.(f);},[i,n]);return jsx(Ps.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Jb.displayName="ModalRoot";var ev=W.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=Sn();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(true);},...r,children:e})});ev.displayName="ModalTrigger";var Dl=({children:e,container:t})=>{let[r,n]=W.useState(false);return W.useEffect(()=>{n(true);},[]),r?$a.createPortal(e,t||document.body):null};Dl.displayName="ModalPortal";var Hl=W.forwardRef(({className:e,...t},r)=>{let{open:n,onOpenChange:o}=Sn();return n?jsx("div",{ref:r,"data-state":n?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Hl.displayName="ModalOverlay";var tv=W.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=Sn();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(false);},...r,children:e})});tv.displayName="ModalClose";var rv=W.forwardRef(({className:e,children:t,size:r,showCloseButton:n=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Sn(),[f,p]=W.useState(false);return W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(l)return yt(),()=>Rt()},[l]),W.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(Dl,{children:[jsx(Hl,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Sl({size:r}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,n&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});rv.displayName="ModalContent";var nv=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nv.displayName="ModalHeader";var ov=({className:e,children:t})=>(W.useContext(Ps)?.scrollBehavior??"inside")==="inside"?jsx(Ae,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});ov.displayName="ModalBody";var av=({className:e,children:t,...r})=>{let{onOpenChange:n}=Sn();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r,children:W.Children.map(t,o=>W.isValidElement(o)?W.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n(false);}}):o)})};av.displayName="ModalFooter";var sv=W.forwardRef(({className:e,...t},r)=>{let{titleId:n}=Sn();return jsx("h2",{ref:r,id:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});sv.displayName="ModalTitle";var iv=W.forwardRef(({className:e,...t},r)=>{let{descriptionId:n}=Sn();return jsx("p",{ref:r,id:n,className:u("text-sm text-muted-foreground",e),...t})});iv.displayName="ModalDescription";var HM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Il=W.forwardRef(({images:e,open:t,onOpenChange:r,initialIndex:n=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=W.useMemo(()=>HM(e),[e]),[v,w]=W.useState(n),[y,R]=W.useState(1),[C,x]=W.useState(0),[N,T]=W.useState(false),[k,M]=W.useState(false),[P,E]=W.useState({x:0,y:0}),[S,H]=W.useState({x:0,y:0}),[L,D]=W.useState(false),V=W.useRef(null),A=b[v];W.useEffect(()=>{D(true);},[]),W.useEffect(()=>{w(n);},[n]),W.useEffect(()=>{o?.(v);},[v,o]),W.useEffect(()=>{R(1),x(0),E({x:0,y:0});},[v]),W.useEffect(()=>{if(t)return yt(),()=>Rt()},[t]);let B=W.useCallback(()=>{w(J=>J>0?J-1:b.length-1);},[b.length]),I=W.useCallback(()=>{w(J=>J<b.length-1?J+1:0);},[b.length]),K=()=>{R(J=>Math.min(J+.5,4));},F=()=>{R(J=>{let et=Math.max(J-.5,.5);return et===1&&E({x:0,y:0}),et});},q=()=>{x(J=>(J+90)%360);},te=async()=>{if(A)try{let et=await(await fetch(A.src)).blob(),Or=URL.createObjectURL(et),pt=document.createElement("a");pt.href=Or,pt.download=A.alt||`image-${v+1}`,document.body.appendChild(pt),pt.click(),document.body.removeChild(pt),URL.revokeObjectURL(Or);}catch{window.open(A.src,"_blank");}},$=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=J=>{y>1&&(M(true),H({x:J.clientX-P.x,y:J.clientY-P.y}));},j=J=>{k&&y>1&&E({x:J.clientX-S.x,y:J.clientY-S.y});},z=()=>{M(false);},Y=()=>{r?.(false);},ie=J=>{p&&J.target===J.currentTarget&&Y();},Ce=W.useCallback(J=>{switch(J.key){case "ArrowLeft":B();break;case "ArrowRight":I();break;case "Escape":r?.(false);break;case "+":case "=":K();break;case "-":F();break}},[B,I,r]);if(W.useEffect(()=>{if(t)return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[t,Ce]),W.useEffect(()=>{let J=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",J),()=>document.removeEventListener("fullscreenchange",J)},[]),b.length===0)return null;let U=a?W.isValidElement(a)?W.cloneElement(a,{onClick:J=>{a.props.onClick?.(J),r?.(true);}}):jsx("button",{type:"button",onClick:()=>r?.(true),children:a}):null;return jsxs(Fragment,{children:[U,!L||!t?null:$a.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:ie}),jsxs("div",{ref:h,className:u("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&b.length>1&&jsxs("span",{className:"text-sm",children:[v+1," / ",b.length]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(y*100),"%"]}),jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:te,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:j,onMouseUp:z,onMouseLeave:z,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":y>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.y}px) scale(${y}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((J,et)=>jsx("button",{onClick:()=>w(et),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===et?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:J.src,alt:J.alt||`Thumbnail ${et+1}`,className:"h-full w-full object-cover"})},et))})]})]}),document.body)]})});Il.displayName="ImageViewer";var cv=({children:e,images:t,index:r=0,className:n})=>{let[o,a]=W.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",n),children:e}),jsx(Il,{images:t,open:o,onOpenChange:a,initialIndex:r})]})};cv.displayName="ImageViewerTrigger";var dv=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),uv=W.forwardRef(({className:e,color:t,size:r,position:n,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let m=a!=null;return jsxs("span",{ref:d,className:u(dv({color:t,size:m?void 0:r,position:n,ping:o}),m&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${n?.includes("right")?i:-i}px, ${n?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});uv.displayName="Indicator";var mv=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("relative inline-flex",e),...r,children:t}));mv.displayName="IndicatorWrapper";var fv=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),gv=W.forwardRef(({className:e,orientation:t,size:r,hideScrollbar:n=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=W.useRef(null),[c,d]=W.useState({top:false,bottom:false,left:false,right:false});W.useImperativeHandle(i,()=>l.current);let m=W.useCallback(()=>{let v=l.current;if(!v)return;let{scrollTop:w,scrollLeft:y,scrollHeight:R,scrollWidth:C,clientHeight:x,clientWidth:N}=v;d({top:w>0,bottom:w<R-x-1,left:y>0,right:y<C-N-1});},[]);W.useEffect(()=>{let v=l.current;if(v)return m(),v.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{v.removeEventListener("scroll",m),window.removeEventListener("resize",m);}},[m]);let p={sm:"20px",md:"40px",lg:"60px"}[r??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",b={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:u(fv({orientation:t,size:r}),n&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:b,...s,children:a})});gv.displayName="ScrollShadow";var bv=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",bordered:"rounded border border-current text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),BM={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},FM={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},KM=e=>{let t=e.toLowerCase();return BM[t]||e.toUpperCase()},aa=e=>{let t=e.toLowerCase();return FM[t]||t},Es=e=>{let t=aa(e);return ["meta","control","alt","shift"].includes(t)},vv=W.forwardRef(({className:e,variant:t,size:r,keys:n,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{W.useEffect(()=>{if(!a||!n||s)return;let m=Array.isArray(n)?n:[n],f=m.filter(Es).map(aa),p=m.filter(h=>!Es(h)).map(aa),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,w=f.includes("alt")===h.altKey,y=f.includes("shift")===h.shiftKey,R=p.length===0||p.includes(h.key.toLowerCase());b&&v&&w&&y&&R&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,a,s,i]);let d=()=>n?(Array.isArray(n)?n:[n]).map((f,p)=>jsxs(W.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:KM(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(bv({variant:t,size:r}),s&&"opacity-50",e),...l,children:d()})});vv.displayName="Kbd";function $M(e,t,r={}){let{disabled:n=false,preventDefault:o=true}=r;W.useEffect(()=>{if(n)return;let a=Array.isArray(e)?e:[e],s=a.filter(Es).map(aa),i=a.filter(c=>!Es(c)).map(aa),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,n,o]);}var hv=cva("inline-flex items-center justify-center rounded-md transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted",solid:"bg-muted hover:bg-muted/80",ghost:"hover:bg-accent hover:text-accent-foreground",bordered:"border border-current hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{variant:"default",size:"md"}}),xv=W.forwardRef(({className:e,variant:t,size:r,value:n,successDuration:o=2e3,onCopySuccess:a,onCopyError:s,copyIcon:i,successIcon:l,...c},d)=>{let[m,f]=W.useState(false),p={sm:14,md:16,lg:20}[r??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),f(!0),a?.(),setTimeout(()=>{f(!1);},o);}catch(h){s?.(h);}};return jsx("button",{ref:d,type:"button",className:u(hv({variant:t,size:r}),e),onClick:g,"aria-label":m?"Copied":"Copy to clipboard",...c,children:m?l??jsx(Check,{className:"text-success",style:{width:p,height:p}}):i??jsx(Copy,{style:{width:p,height:p}})})});xv.displayName="CopyButton";var Rv=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),qM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function QM(e,t,r){let n=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=n.getDay()-r;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function JM(e,t){let r=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),r.push(i);}return r}function Ds(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ss(e){return Ds(e,new Date)}function yv(e,t){return e.filter(r=>{let n=new Date(r.start),o=new Date(r.end);return Ds(n,t)||Ds(o,t)||n<t&&o>t})}var wv=W.forwardRef(({className:e,variant:t,size:r,events:n=[],view:o="month",onViewChange:a,date:s,onDateChange:i,onEventClick:l,onSlotClick:c,weekStartsOn:d=0,locale:m="en-US",...f},p)=>{let[g,h]=W.useState(new Date),b=s??g,v=M=>{i?i(M):h(M);},w=d===1?ZM:qM,y=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),v(M);},R=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),v(M);},C=()=>{v(new Date);},x=()=>o==="day"?b.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(m,{year:"numeric",month:"long"}),N=()=>{let M=QM(b.getFullYear(),b.getMonth(),d);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,E)=>{let S=yv(n,P),H=P.getMonth()===b.getMonth();return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!H&&"bg-muted/30"),onClick:()=>c?.(P),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Ss(P)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[S.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:D=>{D.stopPropagation(),l?.(L);},children:L.title},L.id)),S.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",S.length-3," more"]})]})]},E)})})]})},T=()=>{let M=JM(b,d),P=Array.from({length:24},(E,S)=>S);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((E,S)=>jsxs("div",{className:u("p-2 text-center border-l",Ss(E)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[S]}),jsx("div",{className:u("text-lg font-semibold",Ss(E)&&"text-primary"),children:E.getDate()})]},S))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(E=>jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),M.map((S,H)=>{let L=new Date(S);L.setHours(E,0,0,0);let D=n.filter(V=>{let A=new Date(V.start);return Ds(A,S)&&A.getHours()===E});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(L),children:D.map(V=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:V.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),l?.(V);},children:V.title},V.id))},H)})]},E))})})]})},k=()=>{let M=Array.from({length:24},(E,S)=>S),P=yv(n,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Ss(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(E=>{let S=new Date(b);S.setHours(E,0,0,0);let H=P.filter(L=>new Date(L.start).getHours()===E);return jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(S),children:H.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:D=>{D.stopPropagation(),l?.(L);},children:L.title},L.id))})]},E)})})})]})};return jsxs("div",{ref:p,className:u(Rv({variant:t,size:r,className:e})),...f,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:C,children:"Today"}),jsx(oe,{variant:"ghost",size:"icon",onClick:y,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"ghost",size:"icon",onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx("h2",{className:"text-lg font-semibold ml-2",children:x()})]}),jsx("div",{className:"flex items-center gap-1 border rounded-lg p-1",children:["month","week","day"].map(M=>jsx(oe,{variant:o===M?"solid":"ghost",size:"sm",onClick:()=>a?.(M),children:M.charAt(0).toUpperCase()+M.slice(1)},M))})]}),o==="month"&&N(),o==="week"&&T(),o==="day"&&k()]})});wv.displayName="FullCalendar";var As=({active:e,payload:t,label:r})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[r&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:r}),jsx("div",{className:"space-y-1",children:t.map((n,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:n.color},children:n.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof n.value=="number"?n.value.toLocaleString():n.value})]},o))})]}),ia=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),la=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],Cv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ia({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:r,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));Cv.displayName="LineChart";var Tv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:r,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));Tv.displayName="BarChart";var Mv=W.forwardRef(({className:e,size:t,data:r,dataKey:n="value",nameKey:o="name",colors:a=la,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(As,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:r,dataKey:n,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:r.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Mv.displayName="PieChart";var Nv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:r,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));Nv.displayName="AreaChart";var Ev=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),Lv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),$l=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function wN({card:e,columnId:t,variant:r,renderCard:n,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u($l({variant:r,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:n?n(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function CN({column:e,variant:t,renderCard:r,onCardClick:n,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:u(Lv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(Ae,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(wN,{card:i,columnId:e.id,variant:t,renderCard:r,onCardClick:n},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var Sv=W.forwardRef(({className:e,variant:t,columns:r,onCardMove:n,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[m,f]=W.useState(null),[p,g]=W.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),b=R=>r.find(C=>C.cards.some(x=>x.id===R));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:R=>{let{active:C}=R,x=b(C.id);if(x){let N=x.cards.find(T=>T.id===C.id);N&&(f(N),g(x.id));}},onDragOver:R=>{let{active:C,over:x}=R;if(!x)return;let N=C.id,T=x.id,k=b(N),M=b(T)||r.find(S=>S.id===T);if(!k||!M||k.id===M.id)return;let P=M.cards.findIndex(S=>S.id===T),E=P===-1?M.cards.length:P;n?.(N,k.id,M.id,E);},onDragEnd:R=>{let{active:C,over:x}=R;if(x&&C.id!==x.id){let N=b(C.id),T=b(x.id)||r.find(k=>k.id===x.id);if(N&&T){let k=T.cards.findIndex(P=>P.id===x.id),M=k===-1?T.cards.length:k;n?.(C.id,N.id,T.id,M);}}f(null),g(null);},children:[jsx("div",{ref:d,className:u(Ev({variant:t,className:e})),...c,children:r.map(R=>jsx(CN,{column:R,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},R.id))}),jsx(DragOverlay,{children:m&&p&&jsx("div",{className:u($l({variant:t,isDragging:true})),children:s?s(m,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:m.title}),m.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:m.description})]})]})})})]})});Sv.displayName="KanbanBoard";var Dv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Hv=W.createContext(null);function Os(){let e=W.useContext(Hv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Iv=W.forwardRef(({className:e,variant:t,children:r,opts:n,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=TN({...n,axis:a==="horizontal"?"x":"y"},o),[p,g]=W.useState(false),[h,b]=W.useState(false),[v,w]=W.useState(0),[y,R]=W.useState([]),C=W.useCallback(M=>{M&&(w(M.selectedScrollSnap()),g(M.canScrollPrev()),b(M.canScrollNext()));},[]),x=W.useCallback(()=>{f?.scrollPrev();},[f]),N=W.useCallback(()=>{f?.scrollNext();},[f]),T=W.useCallback(M=>{f?.scrollTo(M);},[f]),k=W.useCallback(M=>{M.key==="ArrowLeft"?(M.preventDefault(),x()):M.key==="ArrowRight"&&(M.preventDefault(),N());},[x,N]);return W.useEffect(()=>{!f||!l||l(f);},[f,l]),W.useEffect(()=>{if(f)return R(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Hv.Provider,{value:{carouselRef:m,api:f,scrollPrev:x,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:y,scrollTo:T,orientation:a},children:jsxs("div",{ref:d,className:u(Dv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:r})}),s&&jsxs(Fragment,{children:[jsx(Gl,{}),jsx(Ul,{})]}),i&&y.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:y.map((M,P)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});Iv.displayName="Carousel";var Vv=W.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("flex",e),...t}));Vv.displayName="CarouselContent";var Av=W.forwardRef(({className:e,basis:t="basis-full",...r},n)=>{let{orientation:o}=Os();return jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...r})});Av.displayName="CarouselItem";var Gl=W.forwardRef(({className:e,variant:t="bordered",size:r="icon",...n},o)=>{let{scrollPrev:a,canScrollPrev:s}=Os();return jsxs(oe,{ref:o,variant:t,size:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...n,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Gl.displayName="CarouselPrevious";var Ul=W.forwardRef(({className:e,variant:t="bordered",size:r="icon",...n},o)=>{let{scrollNext:a,canScrollNext:s}=Os();return jsxs(oe,{ref:o,variant:t,size:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...n,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Ul.displayName="CarouselNext";var zv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),Bs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},jl={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u{1F44D}","\u{1F44E}","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9BF}","\u{1F9B5}","\u{1F9B6}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F94C}","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},Ov=W.forwardRef(({className:e,size:t,onEmojiSelect:r,recentEmojis:n=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=W.useState(n.length>0?"recent":o),[m,f]=W.useState(""),g=m?Object.values(jl).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?n:jl[c]||[],h=b=>{r?.(b);};return jsxs("div",{ref:l,className:u(zv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(Da,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx("div",{className:"flex border-b px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&n.length===0?null:jsx("button",{className:u("flex-1 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Bs[b].name,children:v},b))}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Bs[c].name}),jsx(Ae,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,v)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(b),children:b},`${b}-${v}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});Ov.displayName="EmojiPicker";var Bv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),rk=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),nk=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),We=({icon:e,title:t,isActive:r,onClick:n,disabled:o})=>jsxs(Ur,{children:[jsx(Wr,{children:jsx(oe,{type:"button",variant:r?"solid":"ghost",size:"icon",className:"h-7 w-7",onClick:n,disabled:o,children:e})}),jsx(jr,{side:"top",className:"text-xs",children:t})]}),Fv=W.forwardRef(({className:e,variant:t,size:r,value:n="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[HN.configure({heading:{levels:[1,2,3]}}),IN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),VN,AN.configure({types:["heading","paragraph"]}),zN.configure({placeholder:a})],content:n,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});W.useEffect(()=>{p&&n!==p.getHTML()&&p.commands.setContent(n);},[n,p]),W.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,b=window.prompt("URL",h);if(b!==null){if(b===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:b}).run();}};return p?jsx(Gr,{children:jsxs("div",{ref:f,className:u(Bv({variant:t,size:r,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(rk({size:r})),children:[jsx(We,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(We,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(We,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(We,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(We,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(We,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(We,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(We,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(We,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(We,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(We,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(We,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:u(nk({size:r})),style:{minHeight:l,maxHeight:c}})]})}):null});Fv.displayName="RichTextEditor";var $v=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function uk(e,t,r){return centerCrop(makeAspectCrop({unit:"%",width:90},r,e,t),e,t)}async function Kv(e,t,r=0,n=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=r*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(n,n),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var Gv=W.forwardRef(({className:e,variant:t,src:r,aspectRatio:n,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=W.useRef(null),[h,b]=W.useState(),[v,w]=W.useState(),[y,R]=W.useState(1),[C,x]=W.useState(0),N=P=>{let{width:E,height:S}=P.currentTarget;if(n){let H=uk(E,S,n);b(H);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},T=P=>{b(P),o?.(P);},k=async P=>{if(w(P),a&&g.current&&P.width&&P.height){let E=await Kv(g.current,P,C,y);a(E);}},M=()=>{x(P=>(P+90)%360);};return W.useEffect(()=>{v&&g.current&&a&&Kv(g.current,v,C,y).then(P=>{a(P);});},[y,C,v,a]),jsxs("div",{ref:p,className:u($v({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(ok,{crop:h,onChange:T,onComplete:k,aspect:n,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:r,alt:"Crop preview",onLoad:N,style:{transform:`scale(${y}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Ya,{value:[y],onValueChange:([P])=>R(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(oe,{variant:"bordered",size:"icon",onClick:M,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Gv.displayName="ImageCropper";var ql=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),fk={sm:96,md:128,lg:192},Wv=W.forwardRef(({className:e,variant:t,size:r,value:n,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??fk[r??"md"];return n?jsx("div",{ref:h,className:u(ql({variant:t,size:r,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(mk,{value:n,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:u(ql({variant:t,size:r,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});Wv.displayName="QRCode";var jv=({children:e,defaultTheme:t="system",storageKey:r="reever-ui-theme",enableSystem:n=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:r,enableSystem:n,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});jv.displayName="ThemeProvider";var Rk=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Yv=W.forwardRef(({className:e,variant:t="ghost",size:r="md",mode:n="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=W.useState(false);W.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?n==="cycle"?jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(br,{children:[jsx(vr,{children:jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(hr,{align:"end",children:[jsxs(Ut,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Ut,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Ut,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Yv.displayName="ThemeToggle";var _v=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Xv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),qv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Zv=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let b=W.useId(),v=p||b,w=`${v}-description`,y=`${v}-error`,R=a&&n;return jsxs("div",{className:u(_v({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(qv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[m&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:m}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":R?y:r?w:void 0,"aria-required":o,className:u(Xv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),r&&!R&&jsx("p",{id:w,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),R&&jsx("p",{id:y,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});Zv.displayName="TextField";var eh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Tk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Qv=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Jv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Mk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),th=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:m,max:f,step:p=1,value:g,defaultValue:h,onChange:b,showButtons:v=true,formatOptions:w,fullWidth:y=false,disabled:R,id:C,...x},N)=>{let T=W.useId(),k=C||T,M=`${k}-description`,P=`${k}-error`,[E,S]=W.useState(h),[H,L]=W.useState(false),D=g!==void 0?g:E,V=a&&n,A=W.useCallback(O=>{O!==void 0&&(m!==void 0&&O<m&&(O=m),f!==void 0&&O>f&&(O=f)),g===void 0&&S(O),b?.(O);},[g,m,f,b]),B=()=>{let O=(D??0)+p;A(O);},I=()=>{let O=(D??0)-p;A(O);},K=O=>{let j=O.target.value;if(j==="")A(void 0);else {let z=parseFloat(j);isNaN(z)||A(z);}},F=O=>{O.key==="ArrowUp"?(O.preventDefault(),B()):O.key==="ArrowDown"&&(O.preventDefault(),I());},q=W.useMemo(()=>D===void 0?"":w?new Intl.NumberFormat(void 0,w).format(D):D.toString(),[D,w]),te=m!==void 0&&D!==void 0&&D<=m,$=f!==void 0&&D!==void 0&&D>=f;return jsxs("div",{className:u(eh({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(Mk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx("button",{type:"button",onClick:I,disabled:R||te,className:u(Qv({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:u(Jv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:q,onChange:K,onKeyDown:F,onFocus:()=>L(true),onBlur:()=>L(false),"aria-invalid":a,"aria-describedby":V?P:r?M:void 0,"aria-required":o,"aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":D,disabled:R,className:u(Tk({size:s,isInvalid:a,fullWidth:y}),!v&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...x}),v&&jsx("button",{type:"button",onClick:B,disabled:R||$,className:u(Qv({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:u(Jv({size:s}))})})]}),r&&!V&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),V&&jsx("p",{id:P,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});th.displayName="NumberField";var nh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Pk=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),rh=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Ek=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Lk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),oh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:w,placeholder:y="Search...",id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,[P,E]=W.useState(f),S=m!==void 0?m:P,H=a&&n,L=S.length>0,D=B=>{let I=B.target.value;m===void 0&&E(I),p?.(I);},V=()=>{m===void 0&&E(""),p?.(""),g?.();},A=B=>{B.key==="Enter"?(B.preventDefault(),h?.(S)):B.key==="Escape"&&L&&(B.preventDefault(),V());};return jsxs("div",{className:u(nh({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Ek({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx(Search,{className:u(rh({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:x,id:T,type:"search",value:S,onChange:D,onKeyDown:A,placeholder:y,"aria-invalid":a,"aria-describedby":H?M:r?k:void 0,"aria-required":o,disabled:w,className:u(Pk({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&L&&!w&&jsx("button",{type:"button",onClick:V,className:u(Lk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(rh({size:s}))})})]}),r&&!H&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),H&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});oh.displayName="SearchField";var ah=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Dk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-calendar-picker-indicator]:hidden",{variants:{size:{sm:"h-8 pl-3 pr-8 py-1.5 text-xs",md:"h-10 pl-3 pr-10 py-2 text-sm",lg:"h-12 pl-4 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Hk=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Ik=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),rc=(e,t="yyyy-MM-dd")=>{if(!e)return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return t.replace("yyyy",String(r)).replace("MM",n).replace("dd",o)},Vk=e=>{if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},sh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="yyyy-MM-dd",showIcon:v=true,fullWidth:w=false,disabled:y,id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=x||P,[S,H]=W.useState(f??null),[L,D]=W.useState(false),V=()=>{!y&&E.current&&E.current.showPicker?.();},A=m!==void 0?m:S,B=a&&n,I=te=>{let $=Vk(te.target.value);m===void 0&&H($),p?.($);},K=A?rc(A,"yyyy-MM-dd"):"",F=g?rc(g,"yyyy-MM-dd"):void 0,q=h?rc(h,"yyyy-MM-dd"):void 0;return jsxs("div",{className:u(ah({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Ik({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u("relative",w?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:T,type:"date",value:K,onChange:I,onFocus:()=>D(true),onBlur:()=>D(false),min:F,max:q,"aria-invalid":a,"aria-describedby":B?M:r?k:void 0,"aria-required":o,disabled:y,className:u(Dk({size:s,isInvalid:a,fullWidth:w}),!v&&"pr-3",l),style:{borderColor:L?"var(--color-foreground)":void 0},...C}),v&&jsx("button",{type:"button",onClick:V,disabled:y,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(Hk({size:s}))})})]}),r&&!B&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),B&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});sh.displayName="DateField";var ih=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Ak=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),zk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),lh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:w,fullWidth:y=false,id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=W.useRef(null),S=W.useRef(null),H=W.useRef(null),[L,D]=W.useState(f??null),V=m!==void 0?m:L,A=a&&n,B=G=>v===24?G:G===0?12:G>12?G-12:G,I=G=>G>=12?"PM":"AM",K=(G,ne)=>ne==="AM"?G===12?0:G:G===12?12:G+12,[F,q]=W.useState(V?String(B(V.hour)).padStart(2,"0"):""),[te,$]=W.useState(V?String(V.minute).padStart(2,"0"):""),[O,j]=W.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[z,Y]=W.useState(V?I(V.hour):"AM"),[ie,Ce]=W.useState(false);W.useEffect(()=>{m!==void 0&&(m?(q(String(B(m.hour)).padStart(2,"0")),$(String(m.minute).padStart(2,"0")),m.second!==void 0&&j(String(m.second).padStart(2,"0")),Y(I(m.hour))):(q(""),$(""),j("")));},[m,v]);let U=(G,ne,_,Ee)=>{let ce=parseInt(G,10),Ke=parseInt(ne,10),$e=b?parseInt(_,10):void 0;if(isNaN(ce)||isNaN(Ke)||b&&isNaN($e)){m===void 0&&D(null),p?.(null);return}let pe={hour:v===12?K(ce,Ee):ce,minute:Ke,...b&&$e!==void 0&&{second:$e}};m===void 0&&D(pe),p?.(pe);},lt=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);q(ne);let _=v===24?23:12,Ee=v===24?0:1;if(ne.length===2){let ce=parseInt(ne,10);ce>=Ee&&ce<=_&&(E.current?.focus(),E.current?.select());}},J=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);if($(ne),ne.length===2){let _=parseInt(ne,10);_>=0&&_<=59&&(b?(S.current?.focus(),S.current?.select()):v===12&&H.current?.focus());}},et=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);j(ne),ne.length===2&&v===12&&H.current?.focus();},Or=()=>{if(F){let G=parseInt(F,10),ne=v===24?23:12,Ee=Math.min(Math.max(G,v===24?0:1),ne),ce=String(Ee).padStart(2,"0");q(ce),U(ce,te,O,z);}},pt=()=>{if(te){let G=parseInt(te,10),ne=Math.min(Math.max(G,0),59),_=String(ne).padStart(2,"0");$(_),U(F,_,O,z);}},fn=()=>{if(O){let G=parseInt(O,10),ne=Math.min(Math.max(G,0),59),_=String(ne).padStart(2,"0");j(_),U(F,te,_,z);}},Br=()=>{let G=z==="AM"?"PM":"AM";Y(G),U(F,te,O,G);},Ao=G=>{let ne=G.key.toLowerCase();ne==="a"?(G.preventDefault(),z!=="AM"&&(Y("AM"),U(F,te,O,"AM"))):ne==="p"?(G.preventDefault(),z!=="PM"&&(Y("PM"),U(F,te,O,"PM"))):ne==="arrowup"||ne==="arrowdown"?(G.preventDefault(),Br()):ne==="arrowleft"&&(G.preventDefault(),b?(S.current?.focus(),S.current?.select()):(E.current?.focus(),E.current?.select()));},Kt=(G,ne)=>{if(G.key==="ArrowUp"||G.key==="ArrowDown"){G.preventDefault();let _=G.key==="ArrowUp"?1:-1;if(ne==="hour"){let Ee=parseInt(F,10)||0,ce=v===24?23:12,Ke=v===24?0:1,$e=Ee+_;$e>ce&&($e=Ke),$e<Ke&&($e=ce);let Fr=String($e).padStart(2,"0");q(Fr),U(Fr,te,O,z);}else if(ne==="minute"){let ce=(parseInt(te,10)||0)+_;ce>59&&(ce=0),ce<0&&(ce=59);let Ke=String(ce).padStart(2,"0");$(Ke),U(F,Ke,O,z);}else if(ne==="second"){let ce=(parseInt(O,10)||0)+_;ce>59&&(ce=0),ce<0&&(ce=59);let Ke=String(ce).padStart(2,"0");j(Ke),U(F,te,Ke,z);}}G.key==="ArrowRight"&&(G.preventDefault(),ne==="hour"?(E.current?.focus(),E.current?.select()):ne==="minute"&&b?(S.current?.focus(),S.current?.select()):(ne==="minute"&&!b&&v===12||ne==="second"&&v===12)&&H.current?.focus()),G.key==="ArrowLeft"&&(G.preventDefault(),ne==="minute"?(P.current?.focus(),P.current?.select()):ne==="second"&&(E.current?.focus(),E.current?.select())),G.key==="Backspace"&&G.currentTarget.value===""&&(ne==="minute"?P.current?.focus():ne==="second"&&E.current?.focus());},gn=u((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",w&&"cursor-not-allowed");return jsxs("div",{ref:x,className:u(ih({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:u(zk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(Ak({size:s,isInvalid:a,disabled:w,fullWidth:y}),l),style:{borderColor:ie?"var(--color-foreground)":void 0},onFocus:()=>Ce(true),onBlur:G=>{G.currentTarget.contains(G.relatedTarget)||Ce(false);},children:[jsx("input",{ref:P,id:T,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:F,onChange:lt,onBlur:Or,onKeyDown:G=>Kt(G,"hour"),onFocus:G=>G.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?M:r?k:void 0,"aria-required":o,disabled:w,className:gn}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:E,type:"text",inputMode:"numeric",placeholder:"mm",value:te,onChange:J,onBlur:pt,onKeyDown:G=>Kt(G,"minute"),onFocus:G=>G.target.select(),"aria-label":"Minute",disabled:w,className:gn}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:S,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:et,onBlur:fn,onKeyDown:G=>Kt(G,"second"),onFocus:G=>G.target.select(),"aria-label":"Second",disabled:w,className:gn})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:Br,onKeyDown:Ao,disabled:w,className:u("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",w&&"cursor-not-allowed"),"aria-label":"AM/PM",children:z})]}),r&&!A&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),A&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});lh.displayName="TimeField";var dh=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),uh=W.forwardRef(({className:e,variant:t,orientation:r,size:n,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[n??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[n??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[n??"md"],w=(R,C)=>{C&&C(),l&&l(R);},y=R=>jsxs("button",{type:"button",disabled:i||R.isDisabled,onClick:()=>w(R.key,R.onPress),className:u("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:b),"aria-label":R.label,children:[R.icon&&jsx("span",{className:v,children:R.icon}),c&&jsx("span",{children:R.label})]},R.key);return jsxs("div",{ref:f,role:"group",className:u(dh({variant:t,orientation:r,size:n,density:o,className:e})),...m,children:[p.map(R=>d?d(R):y(R)),g.length>0&&jsxs(br,{children:[jsx(vr,{"aria-label":"More actions",className:u("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",b),children:jsx(MoreHorizontal,{className:v})}),jsx(hr,{align:"end",children:g.map(R=>jsxs(Ut,{disabled:R.isDisabled,onClick:()=>w(R.key,R.onPress),children:[R.icon&&jsx("span",{className:u(v,"mr-2"),children:R.icon}),R.label]},R.key))})]})]})});uh.displayName="ActionGroup";var gh=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),Kk=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),bh=W.forwardRef(({className:e,variant:t,size:r,pulse:n=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(gh({variant:t,size:r,className:e})),...s,children:[jsx("span",{className:u(Kk({size:r,pulse:n})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));bh.displayName="StatusLight";var hh=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),Gk=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),Uk=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),Wk=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),xh=W.forwardRef(({className:e,size:t,illustration:r,heading:n,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(hh({size:t,className:e})),...s,children:[r&&jsx("div",{className:u(Gk({size:t})),"aria-hidden":"true",children:r}),n&&jsx("h3",{className:u(Uk({size:t})),children:n}),o&&jsx("p",{className:u(Wk({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));xh.displayName="IllustratedMessage";var wh=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),Qk={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Ch=W.forwardRef(({className:e,variant:t,title:r,icon:n,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[m,f]=W.useState(true);if(!m)return null;let p=Qk[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:u(wh({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:n||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[r&&jsx("div",{className:"font-medium",children:r}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Ch.displayName="InlineAlert";var Th=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),Mh=W.forwardRef(({className:e,position:t,size:r,selectedCount:n=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||n===0)return null;let m=()=>typeof i=="function"?i(n):i||`${n} item${n>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Th({position:t,size:r,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx(Ct,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});Mh.displayName="ActionBar";var Nh=W.forwardRef(({className:e,icon:t,children:r,...n},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),r]}));Nh.displayName="ActionBarButton";var Eh=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Lh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Sh({className:e,variant:t,size:r,items:n,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),[h,b]=W.useState(null),[v,w]=W.useState(null),y=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),R=T=>{if(a==="none")return;let k;a==="single"?k=y.has(T)?new Set:new Set([T]):(k=new Set(y),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{b(k),T.dataTransfer.effectAllowed="move";},x=(T,k)=>{T.preventDefault(),h!==k&&w(k);},N=()=>{if(h&&v&&h!==v){let T=n.findIndex(E=>E.key===h),k=n.findIndex(E=>E.key===v),M=[...n],[P]=M.splice(T,1);M.splice(k,0,P),l?.(M);}b(null),w(null);};return n.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:u(Eh({variant:t,size:r,className:e})),...f,children:n.map(T=>{let k=y.has(T.key),M=h===T.key,P=v===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>R(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:E=>C(E,T.key),onDragOver:E=>x(E,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&R(T.key),className:u(Lh({variant:t,size:r,isSelected:k,isDisabled:T.isDisabled}),M&&"opacity-50",P&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:u("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}Sh.displayName="ListView";var Dh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),nP=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),oP=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),Hh=W.forwardRef(({className:e,orientation:t="horizontal",size:r="md",value:n,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,w]=W.useState(o),y=n!==void 0,R=y?n:v,C=W.useRef(null),[x,N]=W.useState(false),[T,k]=W.useState(null),M=(I,K)=>{if(!C.current)return R[0];let F=C.current.getBoundingClientRect(),q;t==="horizontal"?q=(I-F.left)/F.width:q=1-(K-F.top)/F.height,q=Math.max(0,Math.min(1,q));let te=i+q*(l-i),$=Math.round(te/c)*c;return Math.max(i,Math.min(l,$))},P=(I,K)=>{let F=[...R];F[K]=I,K===0&&I>R[1]&&(F[0]=R[1]),K===1&&I<R[0]&&(F[1]=R[0]),y||w(F),a?.(F);},E=(I,K)=>{d||(I.preventDefault(),N(true),k(K),I.target.setPointerCapture(I.pointerId));},S=I=>{if(!x||T===null||d)return;let K=M(I.clientX,I.clientY);P(K,T);},H=()=>{x&&(N(false),k(null),s?.(R));},L=I=>{if(d)return;let K=M(I.clientX,I.clientY),F=Math.abs(R[0]-K),q=Math.abs(R[1]-K),te=F<=q?0:1;P(K,te);let $=[...R];$[te]=K,s?.($);},D=(I,K)=>{if(d)return;let F=R[K];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),F=Math.min(l,R[K]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),F=Math.max(i,R[K]-c);break;case "Home":I.preventDefault(),F=i;break;case "End":I.preventDefault(),F=l;break;default:return}P(F,K);let q=[...R];q[K]=F,s?.(q);},V=I=>(I-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],B={sm:14,md:20,lg:24}[r||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(R[0])}),jsx("span",{children:f(R[1])})]}),jsxs("div",{ref:b,className:u(Dh({orientation:t,size:r}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(nP({orientation:t,size:r})),onClick:L,children:jsx("div",{className:u("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(R[0])}%`,right:`${100-V(R[1])}%`,top:0,bottom:0}:{bottom:`${V(R[0])}%`,top:`${100-V(R[1])}%`,left:0,right:0}})}),R.map((I,K)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:u(oP({size:r}),x&&T===K&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${B/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${B/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:F=>E(F,K),onPointerMove:S,onPointerUp:H,onPointerCancel:H,onKeyDown:F=>D(F,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:R[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:R[1]})]})]})]})});Hh.displayName="RangeSlider";var cc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),cP=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),dP={help:HelpCircle,info:Info,warning:AlertCircle},Ah=W.forwardRef(({variant:e="help",size:t,title:r,children:n,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=W.useState(false),[b,v]=W.useState(false),[w,y]=W.useState({top:0,left:0}),R=W.useRef(null),C=W.useRef(null),x=i!==void 0?i:g,N=W.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!x||!R.current)return;let P=()=>{let E=R.current.getBoundingClientRect(),S=C.current?.getBoundingClientRect(),H=S?.width||288,L=S?.height||100,D=8,V=0,A=0;switch(a){case "top":V=E.top-L-D,A=E.left+E.width/2-H/2;break;case "bottom":V=E.bottom+D,A=E.left+E.width/2-H/2;break;case "left":V=E.top+E.height/2-L/2,A=E.left-H-D;break;case "right":V=E.top+E.height/2-L/2,A=E.right+D;break}if(a==="top"||a==="bottom")switch(s){case "start":A=E.left;break;case "center":A=E.left+E.width/2-H/2;break;case "end":A=E.right-H;break}if(a==="left"||a==="right")switch(s){case "start":V=E.top;break;case "center":V=E.top+E.height/2-L/2;break;case "end":V=E.bottom-L;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),V=Math.max(8,Math.min(V,window.innerHeight-L-8)),y({top:V,left:A});};return P(),requestAnimationFrame(P),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[x,a,s]),W.useEffect(()=>{if(!x)return;let P=E=>{C.current&&!C.current.contains(E.target)&&R.current&&!R.current.contains(E.target)&&N(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[x,N]),W.useEffect(()=>{if(!x)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[x,N]);let T=dP[e??"help"],k=()=>{N(!x);},M=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?W.isValidElement(o)?W.cloneElement(o,{ref:R,onClick:P=>{o.props.onClick?.(P),k();}}):jsx("button",{ref:R,type:"button",onClick:k,className:u(cc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:k,className:u(cc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),b&&x&&$a.createPortal(jsxs("div",{ref:C,className:u(cP({size:t}),f),style:{position:"fixed",top:w.top,left:w.left,transformOrigin:M()},role:"tooltip",children:[r&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:r}),jsx("div",{className:"text-muted-foreground",children:n}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Ah.displayName="ContextualHelp";var Oh=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),dc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Bh({className:e,spacing:t,variant:r,size:n,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,b]=W.useState(new Set),v=W.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),w=x=>{if(s==="none")return;let N;s==="single"?N=v.has(x)?new Set:new Set([x]):(N=new Set(v),N.has(x)?N.delete(x):N.add(x)),a||b(N),i?.(N);},y=(x,N)=>{N.stopPropagation(),c?.(x);},R=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u(Oh({spacing:t}),e),...g,children:[R.map(x=>{let N=v.has(x.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!x.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!x.isDisabled&&w(x.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!x.isDisabled&&(k.preventDefault(),w(x.key));},style:x.color?{backgroundColor:x.color}:void 0,className:u(dc({variant:x.color?void 0:r,size:n,isSelected:N,isDisabled:x.isDisabled}),T&&!x.isDisabled&&"cursor-pointer hover:opacity-80",x.color&&"text-white"),children:[x.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:x.icon}),x.label,l&&!x.isDisabled&&jsx("button",{type:"button",onClick:k=>y(x.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${x.label}`,children:jsx(X,{className:"h-3 w-3"})})]},x.key)}),C>0&&jsxs("span",{className:u(dc({variant:"surface",size:n}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Bh.displayName="TagGroup";var $h=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),Gh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Uh({className:e,columns:t,gap:r,items:n,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),h=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let w;a==="single"?w=h.has(v)?new Set:new Set([v]):(w=new Set(h),w.has(v)?w.delete(v):w.add(v)),o||g(w),s?.(w);};return n.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u($h({columns:t,gap:r,className:e})),...f,children:n.map(v=>{let w=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":w,onClick:()=>b(v.key),children:d(v,w)},v.key):jsxs("div",{role:"gridcell","aria-selected":w,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:u(Gh({variant:l,size:c,isSelected:w,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&w&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}Uh.displayName="GridList";var jh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),fP=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),gP=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),Js=W.forwardRef(({className:e,size:t,value:r,min:n=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:m="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(r-n)/(o-n)*100)),b=()=>{if(m!=="auto")return "";let w=(r-n)/(o-n),y=s!==void 0?(s-n)/(o-n):.25,R=i!==void 0?(i-n)/(o-n):.75;return (a!==void 0?(a-n)/(o-n):1)>=.5?w<=y?"bg-red-500":w<=R?"bg-yellow-500":"bg-green-500":w>=R?"bg-red-500":w>=y?"bg-yellow-500":"bg-green-500"},v=d?d(r,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:u("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:v})]}),jsx("div",{role:"meter","aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":o,"aria-label":l,className:u(jh({size:t})),children:jsx("div",{className:u(fP({variant:f})),children:jsx("div",{className:u(gP({color:m==="auto"?void 0:m,rounded:h>=100}),m==="auto"&&b()),style:{width:`${h}%`}})})})]})});Js.displayName="Meter";var Yh=W.forwardRef((e,t)=>jsx(Js,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Yh.displayName="DiskUsageMeter";var _h=W.forwardRef((e,t)=>jsx(Js,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));_h.displayName="BatteryMeter";var Xh=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ti=(e,t,r)=>{let n=o=>{let a=(o+e/60)%6;return r-r*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(n(5)*255),Math.round(n(3)*255),Math.round(n(1)*255)]},qh=(e,t,r)=>{e/=255,t/=255,r/=255;let n=Math.max(e,t,r),o=Math.min(e,t,r),a=n-o,s=0,i=n===0?0:a/n,l=n;if(a!==0)switch(n){case e:s=((t-r)/a+(t<r?6:0))*60;break;case t:s=((r-e)/a+2)*60;break;case r:s=((e-t)/a+4)*60;break}return [s,i,l]},Zh=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},Qh=(e,t,r)=>"#"+[e,t,r].map(n=>n.toString(16).padStart(2,"0")).join(""),Jh=W.forwardRef(({hue:e,saturation:t,brightness:r,value:n,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=W.useCallback(I=>{let K=Zh(I);return K?qh(...K):[0,1,1]},[]),[v,w]=W.useState(()=>b(n||o)),y=e??v[0],R=t??v[1],C=r??v[2];W.useEffect(()=>{if(n){let I=b(n);w(I);}},[n,b]);let x=W.useCallback((I,K)=>{if(l||!p.current)return;let F=p.current.getBoundingClientRect(),q=Math.max(0,Math.min(1,(I-F.left)/F.width)),te=Math.max(0,Math.min(1,(K-F.top)/F.height)),$=q,O=1-te;t===void 0&&r===void 0&&w([y,$,O]),a?.({hue:y,saturation:$,brightness:O});let j=ti(y,$,O);s?.(Qh(...j));},[l,y,t,r,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),x(I.clientX,I.clientY));},T=I=>{g&&x(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[M,P,E]=ti(y,1,1),S=`rgb(${M}, ${P}, ${E})`,H=R*100,L=(1-C)*100,[D,V,A]=ti(y,R,C),B=`rgb(${D}, ${V}, ${A})`;return jsx("div",{ref:f,className:u(Xh({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:S},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${L}% - ${c/2}px)`,backgroundColor:B,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Jh.displayName="ColorArea";var tx=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),xP=`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")`,ex="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",rx=W.forwardRef(({value:e,defaultValue:t,onChange:r,channel:n="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=()=>{switch(n){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,w]=W.useState(t??b()),y=e??v,R=n==="hue"?y/360:y,C=W.useCallback((S,H)=>{if(i||!p.current)return;let L=p.current.getBoundingClientRect(),D=a!=="vertical",V;D?V=Math.max(0,Math.min(1,(S-L.left)/L.width)):V=Math.max(0,Math.min(1,1-(H-L.top)/L.height));let A=n==="hue"?V*360:V;e===void 0&&w(A),r?.(A);},[i,a,n,e,r]),x=S=>{i||(S.preventDefault(),h(true),S.target.setPointerCapture(S.pointerId),C(S.clientX,S.clientY));},N=S=>{g&&C(S.clientX,S.clientY);},T=S=>{h(false),S.target.releasePointerCapture(S.pointerId);},k=()=>{let S=a!=="vertical",H=S?"to right":"to top";switch(n){case "hue":return S?ex:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return ex}},M=()=>n==="hue"?`hsl(${y}, 100%, 50%)`:o,P=a!=="vertical",E=R*100;return jsx("div",{ref:f,className:u(tx({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:n==="alpha"?xP:void 0,backgroundSize:n==="alpha"?"8px 8px":void 0},onPointerDown:x,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${E}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${E}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:M(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});rx.displayName="ColorSlider";var nx=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),wP=(e,t,r)=>{let n=e-r,o=t-r,a=Math.atan2(o,n)*180/Math.PI+90;return a<0&&(a+=360),a},ox=W.forwardRef(({value:e,defaultValue:t=0,onChange:r,size:n,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=W.useRef(null),[f,p]=W.useState(false),[g,h]=W.useState(t),b=e??g,v=W.useCallback((x,N)=>{if(o||!m.current)return;let T=m.current.getBoundingClientRect(),k=T.width/2,M=x-T.left,P=N-T.top,E=wP(M,P,k);e===void 0&&h(E),r?.(E);},[o,e,r]),w=x=>{o||(x.preventDefault(),p(true),x.target.setPointerCapture(x.pointerId),v(x.clientX,x.clientY));},y=x=>{f&&v(x.clientX,x.clientY);},R=x=>{p(false),x.target.releasePointerCapture(x.pointerId);},C=()=>{let x=[];for(let N=0;N<=360;N+=30)x.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${x.join(", ")})`};return jsx("div",{ref:d,className:u(nx({size:n}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:w,onPointerMove:y,onPointerUp:R,onPointerLeave:R,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(CP,{hue:b,innerRadius:a,thumbSize:s})]})})});ox.displayName="ColorWheel";var CP=({hue:e,innerRadius:t,thumbSize:r})=>{let n=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+n*Math.cos(o),s=50+n*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:r,height:r,left:`calc(${a}% - ${r/2}px)`,top:`calc(${s}% - ${r/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var sx=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),MP=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),NP=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),ix=W.forwardRef(({className:e,orientation:t,size:r,align:n,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:m=false,copyable:f=false,onCopy:p,...g},h)=>{let b=async()=>{if(!(!f||a===null||a===void 0))try{let v=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(v),p?.();}catch{}};return jsxs("div",{ref:h,className:u(sx({orientation:t,size:r,align:n,className:e})),...g,children:[jsxs("span",{className:u(MP({size:r}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,m&&":"]}),jsx("span",{className:u(NP({size:r,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?b:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b());}:void 0,children:a})]})});ix.displayName="LabeledValue";var lx=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),cx=W.forwardRef(({className:e,orientation:t,gap:r,...n},o)=>jsx("div",{ref:o,className:u(lx({orientation:t,gap:r,className:e})),...n}));cx.displayName="LabeledValueGroup";var px=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),To=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),fx=W.forwardRef(({value:e,defaultValue:t="",onChange:r,onSearch:n,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:w,...y},R)=>{let[C,x]=W.useState(false),[N,T]=W.useState(t),k=e!==void 0?e:N,M=W.useRef(null);W.useImperativeHandle(R,()=>M.current);let P=k.length>0,E=C&&(a.length>0||s.length>0||l.length>0||P),S=I=>{e===void 0&&T(I),r?.(I);},H=()=>{S(""),M.current?.focus();},L=I=>{I?.preventDefault(),k.trim()&&(n?.(k.trim()),x(false));},D=I=>{S(I.label),o?.(I),x(false);},V=I=>{S(I),n?.(I),x(false);},A=I=>{S(I),n?.(I),x(false);},B=W.useMemo(()=>{let I={};return a.forEach(K=>{let F=K.category||"Results";I[F]||(I[F]=[]),I[F].push(K);}),I},[a]);return jsxs(tt,{open:E,onOpenChange:x,children:[jsx(Jn,{children:jsxs("form",{onSubmit:L,className:u(px({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(To({size:g}),"ml-3")}),jsx("input",{ref:M,type:"text",value:k,onChange:I=>S(I.target.value),onFocus:()=>x(true),placeholder:v,disabled:w,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...y}),d&&P&&!w&&jsx("button",{type:"button",onClick:H,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",To({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(rt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,K)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(To({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:u(To({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,K)=>jsxs("button",{type:"button",onClick:()=>A(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(To({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(B).map(([I,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),K.map(F=>jsxs("button",{type:"button",onClick:()=>D(F),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[F.icon||jsx(Search,{className:u(To({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:F.label}),F.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:F.description})]})]},F.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});fx.displayName="SearchBar";var gx={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},hx=W.forwardRef(({open:e,onOpenChange:t,items:r=[],recentItems:n=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=W.useState(""),g=W.useRef(null),[h,b]=W.useState(false);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{e||p("");},[e]),W.useEffect(()=>{if(!e)return;let x=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t]),W.useEffect(()=>{if(e)return yt(),()=>Rt()},[e]);let v=W.useMemo(()=>{let x={};return r.forEach(N=>{let T=N.category||"Results";x[T]||(x[T]=[]),x[T].push(N);}),x},[r]),w=x=>{x.onSelect?.(),c?.(x),t?.(false);},y=()=>{t?.(false);},R=f.length>0,C=!R&&n.length>0;return !h||!e?null:$a.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:y}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),n.map(x=>jsxs(Command.Item,{value:x.label,onSelect:()=>w(x),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:x.icon||gx[x.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:x.label}),x.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:x.description})]}),x.shortcut&&jsx("div",{className:"flex items-center gap-1",children:x.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},x.id))]}),R&&Object.entries(v).map(([x,N])=>jsxs(Command.Group,{heading:x,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:x}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>w(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||gx[x]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},x)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});hx.displayName="SpotlightSearch";function BP(e="k"){let[t,r]=W.useState(false);return W.useEffect(()=>{let n=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),r(a=>!a));};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),{open:t,setOpen:r,toggle:()=>r(n=>!n)}}var Rx=W.createContext(null),ni=()=>{let e=W.useContext(Rx);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},YP=({children:e,notifications:t,onNotificationsChange:r})=>{let[n,o]=W.useState([]),[a,s]=W.useState(false),i=W.useRef(null),l=t!==void 0,c=l?t:n,d=W.useCallback(b=>{l?r?.(b):o(b);},[l,r]),m=c.filter(b=>!b.read).length,f=W.useCallback(b=>{d(c.map(v=>v.id===b?{...v,read:true}:v));},[c,d]),p=W.useCallback(()=>{d(c.map(b=>({...b,read:true})));},[c,d]),g=W.useCallback(b=>{d(c.filter(v=>v.id!==b));},[c,d]),h=W.useCallback(()=>{d([]);},[d]);return jsx(Rx.Provider,{value:{notifications:c,unreadCount:m,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},wx=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("relative inline-block",e),...r,children:t}));wx.displayName="NotificationCenter";var Cx=W.forwardRef(({className:e,showBadge:t=true,children:r,onClick:n,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=ni(),d=f=>{n?.(f),l(!i);},m=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:u("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[r||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:m})]})});Cx.displayName="NotificationCenterTrigger";var Tx=W.forwardRef(({className:e,align:t="end",sideOffset:r=8,emptyMessage:n="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:m,triggerRef:f}=ni(),[p,g]=W.useState(false),h=W.useRef(null),[b,v]=W.useState({top:0,left:0});return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!i||!f.current||!h.current)return;let w=()=>{if(!f.current||!h.current)return;let y=f.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),C=y.bottom+r,x=y.left;t==="center"?x=y.left+y.width/2-R.width/2:t==="end"&&(x=y.right-R.width),x+R.width>window.innerWidth-16&&(x=window.innerWidth-R.width-16),x<16&&(x=16),v({top:C,left:x});};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,true),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,true);}},[i,f,t,r]),W.useEffect(()=>{if(!i)return;let w=R=>{h.current&&!h.current.contains(R.target)&&f.current&&!f.current.contains(R.target)&&l(false);},y=R=>{R.key==="Escape"&&l(false);};return document.addEventListener("mousedown",w),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",y);}},[i,l,f]),!p||!i?null:$a.createPortal(jsxs("div",{ref:w=>{h.current=w,typeof s=="function"?s(w):s&&(s.current=w);},className:u("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:b.top,left:b.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:n})]}):c.map(w=>jsx(gc,{notification:w},w.id)))})]}),document.body)});Tx.displayName="NotificationCenterContent";var _P={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},XP={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},gc=({notification:e,onMarkAsRead:t,onRemove:r})=>{let{markAsRead:n,removeNotification:o}=ni(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:m,action:f}=e,p=XP[l],g=()=>{t?t():n(a);},h=()=>{r?r():o(a);},b=v=>{if(!v)return null;let w=typeof v=="string"?new Date(v):v,R=new Date().getTime()-w.getTime(),C=Math.floor(R/6e4),x=Math.floor(R/36e5),N=Math.floor(R/864e5);return C<1?"Just now":C<60?C+"m ago":x<24?x+"h ago":N<7?N+"d ago":w.toLocaleDateString()};return jsxs("div",{className:u("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",_P[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:m||jsx("div",{className:u("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:u("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:b(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};gc.displayName="NotificationItem";var Mx=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("divide-y",e),...r,children:t}));Mx.displayName="NotificationList";var Nx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),nE={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},kx=W.forwardRef(({message:e,type:t="default",variant:r="solid",showIcon:n=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,b]=W.useState(true),[v,w]=W.useState(false);W.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),W.useEffect(()=>{if(d&&h){let x=setTimeout(()=>{y();},d);return ()=>clearTimeout(x)}},[d,h]);let y=()=>{w(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let R=nE[t],C=n?o!==void 0?o:R?jsx(R,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Nx({variant:r,type:t,position:l}),c&&"animate-pulse",v&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:y,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});kx.displayName="Banner";var ga=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-current bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-current bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),sE=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),vc=W.forwardRef(({icon:e,label:t="Action button",extended:r,extendedLabel:n,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},b)=>{let[v,w]=W.useState(false),y=o&&o.length>0,R=k=>{y&&w(!v),p?.(k);},C=k=>{k.onClick?.(),w(false);},x={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&v?"rotate-45":"",T=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ga({position:m})),children:[y&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",x[a].container),children:o.map((k,M)=>jsxs("div",{className:u("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${M*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:u(ga({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:u(ga({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:b,type:"button",onClick:R,disabled:g,className:u(ga({variant:c,size:d,position:"relative"}),r&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":y?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(sE({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),r&&n&&jsx("span",{className:"font-medium",children:n})]}),y&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>w(false)})]})});vc.displayName="FloatingActionButton";var iE=vc;var Dx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),Ex=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Hx=W.forwardRef(({className:e,variant:t,size:r,items:n,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[m,f]=W.useState(a||n[0]?.key),p=o!==void 0,g=p?o:m,h=y=>{y.disabled||(p||f(y.key),s?.(y.key));},b=y=>t==="filled"?y?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":y?"text-primary":"text-muted-foreground hover:text-foreground",v=()=>{switch(r){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},w=()=>{switch(r){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(Dx({variant:t,size:r}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:n.map(y=>{let R=g===y.key,C=i==="all"||i==="active"&&R,x=R&&y.activeIcon?y.activeIcon:y.icon;if(l)return jsx("div",{onClick:()=>h(y),className:u(Ex({variant:t}),y.disabled&&"opacity-50 cursor-not-allowed"),children:l(y,R)},y.key);let N=jsxs("div",{onClick:()=>!y.href&&h(y),className:u(Ex({variant:t}),b(R),y.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":R?"page":void 0,"aria-disabled":y.disabled,tabIndex:y.disabled?-1:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),h(y));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(v(),"[&>svg]:h-full [&>svg]:w-full"),children:x}),y.badge!==void 0&&y.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:y.badge>99?"99+":y.badge}),y.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&y.label&&jsx("span",{className:u(w(),"font-medium truncate max-w-full px-1"),children:y.label})]},y.key);return y.href&&!y.disabled?jsx("a",{href:y.href,onClick:()=>h(y),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(R)),children:N},y.key):N})})});Hx.displayName="BottomNavigation";var cE="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",Vx=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),Ax=W.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[r&&jsx(Drawer.Trigger,{asChild:true,children:r}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:cE,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(n||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[n&&jsx(Drawer.Title,{className:"text-base font-semibold",children:n}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(Vx({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});Ax.displayName="ActionSheet";var Ox=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),xc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Bx=W.forwardRef(({className:e,variant:t,leftActions:r=[],rightActions:n=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=W.useRef(null),[p,g]=W.useState(0),[h,b]=W.useState(false),v=W.useRef(0),w=W.useRef(0),y=r.length*(o==="sm"?64:o==="lg"?96:80),R=n.length*(o==="sm"?64:o==="lg"?96:80),C=M=>{i||(b(true),v.current=M.touches[0].clientX,w.current=p);},x=M=>{if(!h||i)return;let E=M.touches[0].clientX-v.current,S=w.current+E;(S>0&&r.length===0||S<0&&n.length===0)&&(S=0),S>y?S=y+(S-y)*.3:S<-R&&(S=-R+(S+R)*.3),g(S);},N=()=>{if(!h)return;b(false);let M=f.current?.offsetWidth||0,P=Math.abs(p)/M;if(l&&P>.6){l==="right"&&p>0&&r[0]?(r[0].onAction?.(),s?.("right",r[0].key)):l==="left"&&p<0&&n[0]&&(n[0].onAction?.(),s?.("left",n[0].key)),g(0);return}p>y*a&&r.length>0?(g(y),s?.("right")):p<-R*a&&n.length>0?(g(-R),s?.("left")):g(0);},T=(M,P)=>{M.onAction?.(),s?.(P,M.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:m,className:u(Ox({variant:t,className:e})),...d,children:[r.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:y},children:r.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"right"),className:u(xc({variant:M.variant,size:o})),style:{opacity:Math.min(1,p/y)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),n.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:R},children:n.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"left"),className:u(xc({variant:M.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/R)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:x,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});Bx.displayName="SwipeActions";var Kx=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),mE=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),$x=W.forwardRef(({className:e,variant:t,onRefresh:r,pullThreshold:n=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=W.useRef(null),[b,v]=W.useState(0),[w,y]=W.useState("idle"),R=W.useRef(0),C=W.useRef(false),x=()=>l||w==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=E=>{x()&&(R.current=E.touches[0].clientY,C.current=true);},T=E=>{if(!C.current||!x())return;let H=E.touches[0].clientY-R.current;if(H<0){v(0),y("idle");return}let D=Math.min(H*.5,o);v(D),y(D>=n?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,w==="ready"){y("refreshing"),v(n*.6);try{await r();}finally{y("idle"),v(0);}}else y("idle"),v(0);},M={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(w==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(M,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let E=Math.min(b/n*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(M,"text-muted-foreground transition-transform"),style:{transform:`rotate(${E}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:w==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(Kx({variant:t,className:e})),...p,children:[jsx("div",{className:u(mE({size:i}),"z-10",w==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(n*.5),1)},children:P()}),jsx("div",{ref:h,className:u("transition-transform duration-200",w==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});$x.displayName="PullToRefresh";var Fn=(e,t,r)=>({duration:e,delay:t,ease:r||[.4,0,.2,1]}),pE={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},Gx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:pE,custom:i,transition:Fn(r,n,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});Gx.displayName="Fade";var fE=(e,t)=>{let r=typeof t=="number"?`${t}px`:t,n={up:{y:r},down:{y:`-${r}`},left:{x:r},right:{x:`-${r}`}};return {hidden:{opacity:0,...n[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...n[e]}}},Ux=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=W.useMemo(()=>fE(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Fn(r,n,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Ux.displayName="Slide";var gE={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},bE={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Wx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:bE,custom:i,transition:Fn(r,n,o),className:u(a),style:{transformOrigin:gE[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Wx.displayName="Scale";var jx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Fn(r,n,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});jx.displayName="Collapse";var Yx=W.forwardRef(({show:e=true,children:t,duration:r=.4,delay:n=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Fn(r,n,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Yx.displayName="Expand";var _x=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Fn(r,n,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});_x.displayName="Rotate";var Xx=W.forwardRef(({front:e,back:t,direction:r="horizontal",flipped:n=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=r==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:n?180:0},transition:Fn(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${m}(180deg)`},children:t})]})})});Xx.displayName="Flip";var qx=W.forwardRef(({color:e="currentColor",duration:t=.6,children:r,className:n,disabled:o=false},a)=>{let[s,i]=W.useState([]),l=W.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(w=>[...w,v]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",n),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:r}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});qx.displayName="Ripple";var Zx=W.forwardRef(({children:e,animate:t=true,height:r=10,duration:n=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-r,0],transition:{duration:n,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Zx.displayName="Bounce";var xE={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Qx=W.forwardRef(({children:e,animate:t=true,intensity:r="normal",duration:n=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:xE[r],transition:{duration:n,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Qx.displayName="Shake";var yE={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Jx=W.forwardRef(({children:e,animate:t=true,speed:r="normal",className:n},o)=>jsx("div",{ref:o,className:u(t&&yE[r],n),children:e}));Jx.displayName="Pulse";var ey=W.forwardRef(({children:e,animate:t=true,angle:r=10,duration:n=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-r,r,-r,r,0],transition:{duration:n,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ey.displayName="Wiggle";var ty=W.forwardRef(({children:e,animate:t=false,scale:r=1.2,duration:n=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=W.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:n},f=()=>{s&&(c(true),setTimeout(()=>c(false),n*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?r:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});ty.displayName="Pop";var NE=(e,t,r,n)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,r);return s?`${i}${n}${s}`:i},ry=W.forwardRef(({value:e,from:t=0,duration:r=2,decimals:n=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=W.useRef(null),g=useInView(p,{once:true}),[h,b]=W.useState(!l);W.useEffect(()=>{if(l&&g){let y=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(y)}},[l,g,c]);let v=useMotionValue(t),w=useTransform(v,y=>NE(y,n,s,i));return W.useEffect(()=>{if(h){let y=animate(v,e,{duration:r,ease:"easeOut",onComplete:m});return ()=>y.stop()}},[h,e,r,v,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:w}),a]})})});ry.displayName="Counter";var ny=W.forwardRef(({text:e,speed:t=50,delay:r=0,pauseBetween:n=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=W.useState(""),[b,v]=W.useState(0),[w,y]=W.useState(false),[R,C]=W.useState(false),x=W.useRef(null),N=useInView(x,{once:true}),[T,k]=W.useState(!l);return W.useEffect(()=>{if(l&&N){let M=setTimeout(()=>k(true),r*1e3);return ()=>clearTimeout(M)}},[l,N,r]),W.useEffect(()=>{if(!T||R)return;let M=p[b],P;return w?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(y(false),v(E=>(E+1)%p.length)):g.length<M.length?P=setTimeout(()=>{h(M.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{y(true);},n):(C(true),m?.()),()=>clearTimeout(P)},[T,g,b,w,R,p,t,i,n,s,m]),jsxs("span",{ref:x,className:u(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:u("ml-0.5",d),children:a})]})});ny.displayName="Typewriter";var oy=W.forwardRef(({children:e,direction:t="up",stagger:r=.05,duration:n=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=W.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:r,delayChildren:o}}},b={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:n,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,w)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&w<p.length-1&&"\xA0"]},w))})})});oy.displayName="TextReveal";var ay=W.forwardRef(({words:e,duration:t=2,animation:r="slide",animationDuration:n=.5,className:o,loop:a=true},s)=>{let[i,l]=W.useState(0);W.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(r){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:n},className:"inline-block",children:e[i]},e[i])})})});ay.displayName="WordRotate";var cy=W.forwardRef(({children:e,direction:t="up",distance:r=50,duration:n=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=W.useRef(null),g=useInView(p,{once:a,amount:s}),b={up:{x:0,y:r},down:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0},none:{x:0,y:0}}[t],v={hidden:{opacity:0,x:b.x,y:b.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:n,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});cy.displayName="ScrollReveal";var dy=W.forwardRef(({position:e="top",size:t=4,color:r="hsl(var(--primary))",backgroundColor:n="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",b=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:n},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:b,backgroundColor:r}}),i&&jsx(PE,{progress:f,position:e})]})});dy.displayName="ScrollProgress";var PE=({progress:e,position:t})=>{let r=useTransform(e,s=>Math.round(s*100)),[n,o]=W.useState(0);return W.useEffect(()=>{let s=r.on("change",o);return ()=>s()},[r]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[n,"%"]})},uy=W.forwardRef(({children:e,speed:t=.5,direction:r="vertical",className:n,container:o},a)=>{let s=W.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=r==="horizontal"?d:0,f=r==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",n),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});uy.displayName="Parallax";var fy=W.forwardRef(({children:e,width:t,height:r,duration:n=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:r,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${n}s infinite`}}),jsx("style",{children:`
55
+ `,document.body.appendChild(ce),_.dataTransfer.setDragImage(ce,20,15),setTimeout(()=>{document.body.removeChild(ce);},0),h(e),C?.({event:_,node:e});},pt=_=>{if(_.preventDefault(),_.stopPropagation(),!g||g.key===e.key||ie)return;let Ee=_.currentTarget.getBoundingClientRect(),ce=_.clientY-Ee.top,Ke=Ee.height,$e;ce<Ke*.25?$e=-1:ce>Ke*.75?$e=1:$e=0,!(R&&!R({dropNode:e,dropPosition:$e,dragNode:g}))&&(w(e.key,$e),x?.({event:_,node:e}));},fn=_=>{_.preventDefault(),_.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:_,node:e,expandedKeys:K()});},Br=_=>{_.stopPropagation(),T?.({event:_,node:e});},Ao=_=>{_.preventDefault(),_.stopPropagation(),!(!g||g.key===e.key||ie)&&(v!==null&&y(e,v),h(null),w(null,null));},Kt=_=>{h(null),w(null,null),k?.({event:_,node:e});},Ta=_=>{ie||Ce&&i(e.key,e,_);},gn=_=>{_.stopPropagation(),!ie&&!q&&a(e.key,e);},G=W.useMemo(()=>{if(!Y||v===null)return "";switch(v){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[Y,v]),ne=[...n,r];return jsxs("div",{className:"relative",children:[M&&t>0&&jsxs(Fragment,{children:[n.map((_,Ee)=>!_&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Ee} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Ee)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:r?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":q?void 0:te,"aria-selected":Ce?$:void 0,"aria-disabled":ie,draggable:lt,onDragStart:Or,onDragOver:pt,onDragEnter:fn,onDragLeave:Br,onDrop:Ao,onDragEnd:Kt,onClick:Ta,className:u("relative",Ug({size:I,isSelected:$,isDragging:z,isDisabled:ie,isHoverable:Ce&&!ie}),G,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[lt&&E&&J!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:J}),jsx("button",{type:"button",onClick:gn,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",q&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",te&&"rotate-90")})}),U&&jsx(ET,{checked:O,indeterminate:j,disabled:ie,onClick:_=>m(e.key,e,_)}),P&&et&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:et}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),F&&te&&jsx("div",{role:"group",children:e.children.map((_,Ee)=>jsx(jg,{node:_,level:t+1,isLast:Ee===e.children.length-1,parentIsLastPath:ne},_.key))})]})},LT=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return r(e),t},ST=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return e.children&&r(e.children),t},Yg=(e,t)=>{if(!e.children)return false;for(let r of e.children)if(r.key===t||Yg(r,t))return true;return false},_g=W.forwardRef(({className:e,variant:t,size:r,data:n,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:b=false,checkedKeys:v,defaultCheckedKeys:w=[],onCheck:y,showLine:R=false,showIcon:C=false,showHandle:x=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:M=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:P=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:E,onDragEnter:S,onDragOver:H,onDragLeave:L,onDragEnd:D,onDrop:V,blockNode:A=false,disabled:B=false,...I},K)=>{let F=W.useCallback(()=>l?new Set(LT(n)):new Set(i),[l,i,n]),[q,te]=W.useState(F),$=s!==void 0,O=$?new Set(s):q,j=W.useCallback((pe,Ue)=>{let $t=new Set(O),He=!$t.has(pe);He?$t.add(pe):$t.delete(pe),$||te($t),c?.(Array.from($t),{expanded:He,node:Ue});},[O,$,c]),[z,Y]=W.useState(new Set(p)),ie=f!==void 0,Ce=ie?new Set(f):z,U=W.useCallback((pe,Ue,$t)=>{let He=new Set(Ce),fr=!He.has(pe);m?fr?He.add(pe):He.delete(pe):(He.clear(),fr&&He.add(pe)),ie||Y(He);let Gn=[],zo=Ma=>{for(let Un of Ma)He.has(Un.key)&&Gn.push(Un),Un.children&&zo(Un.children);};zo(n),g?.(Array.from(He),{selected:fr,selectedNodes:Gn,node:Ue,event:$t});},[Ce,m,ie,g,n]),[lt,J]=W.useState(new Set(w)),[et,Or]=W.useState(new Set),pt=v!==void 0,fn=pt?new Set(Array.isArray(v)?v:v.checked):lt,Br=pt&&!Array.isArray(v)?new Set(v.halfChecked):et,Ao=W.useCallback((pe,Ue,$t)=>{let He=new Set(fn),fr=new Set(Br),Gn=!He.has(pe);if(Gn?(He.add(pe),fr.delete(pe)):He.delete(pe),!b&&Ue.children){let xi=ST(Ue);for(let Kr of xi)Gn?(He.add(Kr),fr.delete(Kr)):He.delete(Kr);}pt||(J(He),Or(fr));let zo=[],Ma=xi=>{for(let Kr of xi)He.has(Kr.key)&&zo.push(Kr),Kr.children&&Ma(Kr.children);};Ma(n);let Un=b?{checked:Array.from(He),halfChecked:Array.from(fr)}:Array.from(He);y?.(Un,{checked:Gn,checkedNodes:zo,node:Ue,event:$t,halfCheckedKeys:Array.from(fr)});},[fn,Br,b,pt,y,n]),[Kt,Ta]=W.useState(null),[gn,G]=W.useState(null),[ne,_]=W.useState(null),Ee=W.useCallback((pe,Ue)=>{G(pe),_(Ue);},[]),ce=W.useCallback((pe,Ue)=>{!Kt||!V||Ue===0&&Yg(Kt,pe.key)||V({event:{},node:pe,dragNode:Kt,dropPosition:Ue,dropToGap:Ue!==0});},[Kt,V]),Ke=W.useCallback(()=>Array.from(O),[O]),$e={expandedKeys:O,toggleExpand:j,selectedKeys:Ce,handleSelect:U,selectable:d,multiple:m,checkedKeys:fn,halfCheckedKeys:Br,handleCheck:Ao,checkable:h,checkStrictly:b,draggable:o,draggedNode:Kt,setDraggedNode:Ta,dragOverKey:gn,dragOverPosition:ne,setDragOver:Ee,handleDrop:ce,allowDrop:a,onDragStart:E,onDragEnter:S,onDragOver:H,onDragLeave:L,onDragEnd:D,showLine:R,showIcon:C,showHandle:x,dragIcon:N,icon:T,leafIcon:k,folderIcon:M,folderOpenIcon:P,blockNode:A,disabled:B,size:r,data:n,getAllKeys:Ke},Fr=pe=>{let Ue=pe.relatedTarget,$t=pe.currentTarget;(!Ue||!$t.contains(Ue))&&Ee(null,null);};return jsx(Wg.Provider,{value:$e,children:jsx("div",{ref:K,role:"tree","aria-multiselectable":m||h,className:u(Gg({variant:t,size:r,className:e})),onDragLeave:Fr,...I,children:n.map((pe,Ue)=>jsx(jg,{node:pe,level:0,isLast:Ue===n.length-1},pe.key))})})});_g.displayName="Tree";var qg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),zT=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let r=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),n=e.split(r);return jsx(Fragment,{children:n.map((o,a)=>r.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},OT=(e,t)=>{let[r,n]=W.useState(e);return W.useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r},Zg=W.forwardRef(({className:e,size:t,value:r,defaultValue:n="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:b=true,fullWidth:v=false,disabled:w,...y},R)=>{let[C,x]=W.useState(false),[N,T]=W.useState(n),[k,M]=W.useState([]),[P,E]=W.useState(false),[S,H]=W.useState(false),[L,D]=W.useState(0),V=W.useRef(null),A=W.useRef(null),B=r!==void 0?r:N,I=OT(B,l);W.useEffect(()=>{let U=A.current;if(!U)return;let lt=()=>{D(U.offsetWidth);};lt();let J=new ResizeObserver(lt);return J.observe(U),()=>{J.disconnect();}},[]),W.useImperativeHandle(R,()=>V.current);let K=i?k:s,F=W.useMemo(()=>i?K:K.filter(U=>U.label.toLowerCase().includes(B.toLowerCase())),[K,B,i]);W.useEffect(()=>{if(!i)return;if(I.length<c){M([]);return}let U=false;return (async()=>{E(true);try{let J=await i(I);U||M(J);}catch{U||M([]);}finally{U||E(false);}})(),()=>{U=true;}},[I,i,c]);let q=U=>{r===void 0&&T(U),o?.(U);},te=U=>{let lt=U.target.value;q(lt),lt.length>=c&&x(true);},$=U=>{q(U.label),a?.(U),x(false);},O=()=>{q(""),V.current?.focus();},j=()=>{H(true),x(true);},z=()=>{H(false);},Y=U=>{U.key==="Escape"&&x(false),U.key==="ArrowDown"&&!C&&F.length>0&&x(true);},ie=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ce=p&&B?"pr-8":"pr-3";return jsxs(tt,{open:C,onOpenChange:x,children:[jsxs(Jn,{ref:A,className:u("relative",v?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:B,onChange:te,onFocus:j,onBlur:z,onKeyDown:Y,disabled:w,placeholder:d,className:u(qg({size:t,fullWidth:v}),Ce,e),style:{borderColor:S?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...y}),p&&B&&!w&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:ie})})]}),jsx(rt,{className:"p-0",align:"start",style:{width:L>0?L:void 0},onOpenAutoFocus:U=>U.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Ae,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:P?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(ie,"animate-spin")}),f]}):F.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):F.map(U=>jsxs(Command.Item,{value:U.value,disabled:U.disabled,onSelect:()=>$(U),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",B===U.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(zT,{text:U.label,query:B}):U.label})]},U.value))})})})})]})});Zg.displayName="Autocomplete";var bl=W.createContext(null),vl=W.createContext(null),hl=()=>{let e=W.useContext(bl);if(!e)throw new Error("useFormContext must be used within a Form");return e},hs=()=>{let e=W.useContext(vl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},BT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:r=>typeof r=="string"&&r.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:r=>typeof r=="string"&&r.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:r=>typeof r=="number"&&r>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:r=>typeof r=="number"&&r<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:r=>typeof r=="string"&&e.test(r),message:t}),custom:(e,t)=>({validate:e,message:t})},Qg=W.forwardRef(({defaultValues:e={},onSubmit:t,onError:r,validateOnBlur:n=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=W.useState(e),[m,f]=W.useState({}),[p,g]=W.useState({}),[h,b]=W.useState({}),[v,w]=W.useState(false),y=W.useRef(new Map),R=W.useCallback((L,D)=>{y.current.set(L,D);},[]),C=W.useCallback(L=>{y.current.delete(L);},[]),x=W.useCallback(L=>{let D=y.current.get(L)||[],V=c[L];for(let A of D)if(!A.validate(V))return f(B=>({...B,[L]:A.message})),false;return f(A=>({...A,[L]:null})),true},[c]),N=W.useCallback(()=>{let L=true,D={};return y.current.forEach((V,A)=>{let B=c[A];for(let I of V)if(!I.validate(B)){D[A]=I.message,L=false;break}D[A]||(D[A]=null);}),f(D),L},[c]),T=W.useCallback((L,D)=>{d(V=>({...V,[L]:D})),b(V=>({...V,[L]:true})),o&&setTimeout(()=>{x(L);},0);},[o,x]),k=W.useCallback((L,D)=>{f(V=>({...V,[L]:D}));},[]),M=W.useCallback((L,D)=>{g(V=>({...V,[L]:D})),D&&n&&x(L);},[n,x]),P=W.useCallback(L=>({value:c[L],error:m[L]??null,touched:p[L]??false,dirty:h[L]??false}),[c,m,p,h]),E=W.useCallback(()=>{d(e),f({}),g({}),b({});},[e]),S=async L=>{L.preventDefault();let D={};if(y.current.forEach((A,B)=>{D[B]=true;}),g(D),!N()){r?.(m);return}if(t){w(true);try{await t(c);}finally{w(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:v,setValue:T,setError:k,setTouched:M,validateField:x,validateAll:N,registerField:R,unregisterField:C,getFieldState:P,reset:E};return jsx(bl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:S,className:u("space-y-4",s),...i,children:a})})});Qg.displayName="Form";var Jg=({name:e,rules:t=[],defaultValue:r,children:n})=>{let o=hl(),a=W.useId();W.useEffect(()=>(o.registerField(e,t),r!==void 0&&o.values[e]===void 0&&o.setValue(e,r),()=>{o.unregisterField(e);}),[e,t,r,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(vl.Provider,{value:i,children:n})};Jg.displayName="FormField";var eb=W.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("space-y-1.5",e),...t}));eb.displayName="FormItem";var tb=W.forwardRef(({className:e,required:t,children:r,...n},o)=>{let{id:a,error:s,touched:i}=hs();return jsxs(xn,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...n,children:[r,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});tb.displayName="FormLabel";var rb=({children:e})=>{let{name:t,id:r,error:n,touched:o}=hs(),a=hl(),s=a.getFieldState(t),i=c=>{let d=c.target,m=d.type==="checkbox"?d.checked:d.value;a.setValue(t,m);},l=()=>{a.setTouched(t,true);};return W.cloneElement(e,{id:r,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":n&&o?"true":void 0,"aria-describedby":n&&o?`${r}-error`:void 0})};rb.displayName="FormControl";var nb=W.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:u("text-xs text-muted-foreground",e),...t}));nb.displayName="FormDescription";var ob=W.forwardRef(({className:e,message:t,...r},n)=>{let{id:o,error:a,touched:s}=hs(),i=t??(s?a:null);return i?jsx("p",{ref:n,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...r,children:i}):null});ob.displayName="FormMessage";var sb=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),ib=W.forwardRef(({className:e,size:t,name:r,description:n,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||r.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(sb({size:t,className:e})),...i,children:[jsxs(yn,{"data-user-avatar":true,children:[o&&jsx(Zn,{src:o,alt:r}),jsx(Rn,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:r}),n&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:n})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});ib.displayName="User";var cb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),db=W.forwardRef(({className:e,variant:t,size:r,radius:n,...o},a)=>jsx("code",{ref:a,className:u(cb({variant:t,size:r,radius:n,className:e})),...o}));db.displayName="Code";function fb(e){let[t,r]=useState(false);return useEffect(()=>{if(e){r(e==="dark");return}let n=()=>{r(document.documentElement.classList.contains("dark"));};n();let o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var gb=W.forwardRef(({code:e,language:t="bash",showLineNumbers:r=false,className:n,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=fb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",n),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((v,w)=>jsxs("div",{...h({line:v}),children:[r&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:w+1}),v.map((y,R)=>jsx("span",{...b({token:y})},R))]},w))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});gb.displayName="CodeBlock";var bb=W.forwardRef(({tabs:e,className:t,theme:r},n)=>{let[o,a]=useState(0),[s,i]=useState(false),c=fb(r)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:n,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((b,v)=>jsx("div",{...g({line:b}),children:b.map((w,y)=>jsx("span",{...h({token:w})},y))},v))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});bb.displayName="TabbedCodeBlock";var vb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),hb=W.forwardRef(({className:e,variant:t,size:r,code:n,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=W.useState(false),p=async()=>{try{await navigator.clipboard.writeText(n),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(vb({variant:t,size:r,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:n}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":m?"Copied":a,children:m?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});hb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),xb=W.forwardRef(({className:e,radius:t,src:r,alt:n,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=W.useState("loading");W.useEffect(()=>{r&&g("loading");},[r]);let h=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},v={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:u(wl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:u(wl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(za,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:r,alt:n,onLoad:h,onError:b,className:u("h-full w-full transition-opacity duration-300",v,p==="loading"?"opacity-0":"opacity-100"),...m})]})});xb.displayName="Image";var wb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),Cb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),Tb=W.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),Mb=W.forwardRef(({className:e,size:t="md",value:r,defaultValue:n="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=W.useState(n),m=r??c,f=p=>{let g;if(a){let h=Array.isArray(m)?m:[m].filter(Boolean);h.includes(p)?g=h.filter(b=>b!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(Tb.Provider,{value:{value:m,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:u(wb({size:t,className:e})),...i,children:s})})});Mb.displayName="Listbox";var Nb=W.forwardRef(({className:e,value:t,disabled:r,icon:n,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:m}=W.useContext(Tb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{r||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!r&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":r?"":void 0,tabIndex:r?-1:0,className:u(Cb({size:m}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[n&&jsx("span",{className:"mr-2 flex-shrink-0",children:n}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});Nb.displayName="ListboxItem";var Pb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Eb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function JT({className:e,variant:t,size:r,items:n,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=W.useState(null),[f,p]=W.useState(null),g=(y,R)=>{i||(m(R),y.dataTransfer.effectAllowed="move",y.dataTransfer.setData("text/plain",String(R)));},h=(y,R)=>{y.preventDefault(),!(i||d===null||d===R)&&p(R);},b=()=>{p(null);},v=(y,R)=>{if(y.preventDefault(),i||d===null||d===R){m(null),p(null);return}let C=[...n],[x]=C.splice(d,1);C.splice(R,0,x),o?.(C),m(null),p(null);},w=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(Pb({variant:t,size:r,className:e})),...l,children:n.map((y,R)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,R),onDragOver:C=>h(C,R),onDragLeave:b,onDrop:C=>v(C,R),onDragEnd:w,className:u(Eb({variant:t,size:r,isDragging:d===R,isDragOver:f===R}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(y,R)})]},y.id))})}var eM=W.forwardRef(JT);var Db=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),oM={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Hb=W.forwardRef(({className:e,variant:t,loading:r=true,size:n="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:u("relative",e),...i,children:[s,jsx("div",{className:u(Db({variant:t,visible:r})),"aria-hidden":!r,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:u(oM[n],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Hb.displayName="LoadingOverlay";var Ib=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Vb=W.forwardRef(({className:e,color:t,isLoading:r=false,progress:n,showSpinner:o=false,...a},s)=>{let[i,l]=W.useState(0),[c,d]=W.useState(false),m=W.useRef(null);return W.useEffect(()=>{if(n!==void 0){l(n),d(n>0&&n<100);return}return r?(d(true),l(10),m.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{m.current&&clearInterval(m.current);}},[r,n]),!c&&n===void 0||n!==void 0&&(n<=0||n>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:u(Ib({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:u("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Vb.displayName="NProgress";var Bb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),Ab={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},dM={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Fb=W.forwardRef(({className:e,variant:t="spinner",size:r="md",fullScreen:n,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:u(dM[r||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:u(Ab[r||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:u(Ab[r||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:u(Bb({variant:t,size:r,fullScreen:n,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:u("text-sm",l),children:o})]})})});Fb.displayName="Loading";var Ml=class extends W.Component{constructor(t){super(t),this.state={hasError:false,error:null};}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){this.props.onError?.(t,r);}componentDidUpdate(t){this.state.hasError&&this.props.resetKeys&&this.props.resetKeys.some((n,o)=>n!==t.resetKeys?.[o])&&this.reset();}reset=()=>{this.props.onReset?.(),this.setState({hasError:false,error:null});};render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsx(Nl,{error:this.state.error,onReset:this.reset}):this.props.children}},Nl=W.forwardRef(({error:e,onReset:t,className:r},n)=>jsxs("div",{ref:n,className:u("flex min-h-[200px] flex-col items-center justify-center gap-4 rounded-lg border border-danger/20 bg-danger/5 p-6 text-center",r),role:"alert",children:[jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger/10",children:jsx(AlertTriangle,{className:"h-6 w-6 text-danger"})}),jsxs("div",{className:"space-y-2",children:[jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Something went wrong"}),e&&jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:e.message||"An unexpected error occurred"})]}),t&&jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-md bg-danger px-4 py-2 text-sm font-medium text-danger-foreground hover:bg-danger/90 transition-colors",children:[jsx(RefreshCw,{className:"h-4 w-4"}),"Try again"]})]}));Nl.displayName="DefaultErrorFallback";var pM=Ml;var $b=W.forwardRef(({value:e,defaultValue:t,onValueChange:r,placeholder:n="Pick a date range",dateFormat:o="LLL dd, y",disabled:a=false,minDate:s,maxDate:i,numberOfMonths:l=2,className:c,align:d="start"},m)=>{let[f,p]=W.useState(false),[g,h]=W.useState(t),b=e!==void 0,v=b?e:g,w=R=>{b||h(R),r?.(R);},y=R=>{if(!R)return n;let{from:C,to:x}=R;return C&&x?`${format(C,o)} - ${format(x,o)}`:C?format(C,o):n};return jsxs(tt,{open:f,onOpenChange:p,children:[jsxs(St,{ref:m,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!v?.from&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",c),children:[jsx(Calendar,{className:"h-4 w-4"}),y(v)]}),jsx(rt,{className:"w-auto p-0",align:d,children:jsx(to,{mode:"range",defaultMonth:v?.from,selected:v,onSelect:w,numberOfMonths:l,disabled:R=>!!(s&&R<s||i&&R>i),initialFocus:true})})]})});$b.displayName="DateRangePicker";var uo=e=>String(e).padStart(2,"0"),Gb=W.forwardRef(({value:e,onValueChange:t,placeholder:r="Pick a time",use24Hour:n=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=W.useState(false),d=n?Array.from({length:24},(y,R)=>R):Array.from({length:12},(y,R)=>R+1),m=Array.from({length:Math.floor(60/o)},(y,R)=>R*o),f=y=>{if(!y)return r;if(n)return `${uo(y.hours)}:${uo(y.minutes)}`;let R=y.hours%12||12,C=y.hours>=12?"PM":"AM";return `${uo(R)}:${uo(y.minutes)} ${C}`},p=y=>{let R=e?.minutes??0,C=y;if(!n&&e){let x=e.hours>=12;x&&y!==12?C=y+12:!x&&y===12&&(C=0);}t?.({hours:C,minutes:R});},g=y=>{let R=e?.hours??0;t?.({hours:R,minutes:y});},h=y=>{if(!e)return;let R=e.hours;y==="AM"&&e.hours>=12?R=e.hours-12:y==="PM"&&e.hours<12&&(R=e.hours+12),t?.({hours:R,minutes:e.minutes});},b=()=>{let y=new Date;t?.({hours:y.getHours(),minutes:y.getMinutes()});},v=e?e.hours>=12?"PM":"AM":void 0,w=e?n?e.hours:e.hours%12||12:void 0;return jsxs(tt,{open:l,onOpenChange:c,children:[jsxs(St,{ref:i,disabled:a,className:u("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(rt,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(y=>jsx(oe,{variant:w===y?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(y),children:uo(y)},y))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(Ae,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(y=>jsx(oe,{variant:e?.minutes===y?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(y),children:uo(y)},y))})})]}),!n&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(oe,{variant:v==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(oe,{variant:v==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(oe,{variant:"ghost",size:"sm",onClick:b,children:"Now"}),jsx(oe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Gb.displayName="TimePicker";var Ub=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function vM({className:e,variant:t,items:r,itemHeight:n,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=W.useRef(null),[p,g]=W.useState(0);W.useImperativeHandle(m,()=>f.current);let h=r.length*(n+l)-l,b=n+l,v=Math.max(0,Math.floor(p/b)-a),w=Math.ceil(o/b)+2*a,y=Math.min(r.length-1,v+w),R=x=>{let N=x.currentTarget.scrollTop;g(N),c?.(N);},C=W.useMemo(()=>{let x=[];for(let N=v;N<=y;N++)r[N]!==void 0&&x.push({item:r[N],index:N,style:{position:"absolute",top:N*b,left:0,right:0,height:n}});return x},[r,v,y,b,n]);return jsx("div",{ref:f,className:u(Ub({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:R,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:x,index:N,style:T})=>jsx("div",{style:T,children:s(x,N)},i?i(x,N):N))})})}var hM=W.forwardRef(vM);var jb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ll=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Yb=W.forwardRef(({className:e,variant:t,size:r,children:n,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,...f},p)=>{let g=W.useRef(null),h=W.useRef(null),b=W.useRef(false);W.useImperativeHandle(p,()=>g.current),W.useEffect(()=>{let w=h.current;if(!w)return;let y=new IntersectionObserver(R=>{let[C]=R;C.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return y.observe(w),()=>{y.disconnect();}},[a,s,o,l,c,d]);let v=jsx("div",{className:u(Ll({size:r})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:u(jb({variant:t,className:e})),...f,children:[n,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||v),!a&&!s&&m&&jsx("div",{className:u(Ll({size:r}),"text-muted-foreground text-sm"),children:m})]})});Yb.displayName="InfiniteScroll";var na=W.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,className:u("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));na.displayName="VisuallyHidden";var Xb={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},wM={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"},qb=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"),Sl=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"}}),Ps=W.createContext(null),Sn=()=>{let e=W.useContext(Ps);if(!e)throw new Error("Modal components must be used within a Modal");return e},Qb=W.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:m,className:f},p)=>{let[g,h]=W.useState(false),b=e!==void 0,v=b?e:g,[w,y]=W.useState(false),R=W.useRef(null),C=W.useId(),x=W.useId();W.useEffect(()=>{y(true);},[]);let N=W.useCallback(P=>{b||h(P),t?.(P);},[b,t]);W.useEffect(()=>{if(v)return yt(),()=>Rt()},[v]),W.useEffect(()=>{if(!v||i)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[v,i,N]);let T=P=>{s&&P.target===P.currentTarget&&N(false);},k=r?W.isValidElement(r)?W.cloneElement(r,{onClick:P=>{r.props.onClick?.(P),N(true);}}):jsx("button",{type:"button",onClick:()=>N(true),children:r}):null,M=()=>!w||!v?null:d==="outside"?$a.createPortal(jsx("div",{"data-state":v?"open":"closed",className:u(qb(),Xb[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:T,children:jsxs("div",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",m==="xs"&&"w-full max-w-xs",m==="sm"&&"w-full max-w-sm",m==="md"&&"w-full max-w-md",m==="lg"&&"w-full max-w-lg",m==="xl"&&"w-full max-w-xl",m==="2xl"&&"w-full max-w-2xl",m==="3xl"&&"w-full max-w-3xl",m==="4xl"&&"w-full max-w-4xl",m==="5xl"&&"w-full max-w-5xl",m==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!m&&"w-full max-w-md",f),children:[jsx(na,{children:jsx("h2",{id:C,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>N(false)})]})}),document.body):$a.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":v?"open":"closed",className:u(qb(),Xb[l]),onClick:T,"aria-hidden":"true"}),jsxs("div",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},role:"dialog","aria-modal":"true","aria-labelledby":C,"aria-describedby":x,"data-state":v?"open":"closed",className:u(Sl({size:m}),wM[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",f),children:[jsx(na,{children:jsx("h2",{id:C,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>N(false)})]})]}),document.body);return jsxs(Ps.Provider,{value:{open:v,onOpenChange:N,scrollBehavior:d,titleId:C,descriptionId:x},children:[k,M()]})});Qb.displayName="Modal";var Jb=({children:e,open:t,defaultOpen:r=false,onOpenChange:n,scrollBehavior:o="inside"})=>{let[a,s]=W.useState(r),i=t!==void 0,l=i?t:a,c=W.useId(),d=W.useId(),m=W.useCallback(f=>{i||s(f),n?.(f);},[i,n]);return jsx(Ps.Provider,{value:{open:l,onOpenChange:m,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};Jb.displayName="ModalRoot";var ev=W.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=Sn();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(true);},...r,children:e})});ev.displayName="ModalTrigger";var Dl=({children:e,container:t})=>{let[r,n]=W.useState(false);return W.useEffect(()=>{n(true);},[]),r?$a.createPortal(e,t||document.body):null};Dl.displayName="ModalPortal";var Hl=W.forwardRef(({className:e,...t},r)=>{let{open:n,onOpenChange:o}=Sn();return n?jsx("div",{ref:r,"data-state":n?"open":"closed",className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Hl.displayName="ModalOverlay";var tv=W.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=Sn();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(false);},...r,children:e})});tv.displayName="ModalClose";var rv=W.forwardRef(({className:e,children:t,size:r,showCloseButton:n=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:m}=Sn(),[f,p]=W.useState(false);return W.useEffect(()=>{p(true);},[]),W.useEffect(()=>{if(l)return yt(),()=>Rt()},[l]),W.useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,c,o]),!f||!l?null:jsxs(Dl,{children:[jsx(Hl,{}),jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":m,"data-state":l?"open":"closed",className:u(Sl({size:r}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,n&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});rv.displayName="ModalContent";var nv=({className:e,...t})=>jsx("div",{className:u("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nv.displayName="ModalHeader";var ov=({className:e,children:t})=>(W.useContext(Ps)?.scrollBehavior??"inside")==="inside"?jsx(Ae,{className:u("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:u(e),children:t});ov.displayName="ModalBody";var av=({className:e,children:t,...r})=>{let{onOpenChange:n}=Sn();return jsx("div",{className:u("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r,children:W.Children.map(t,o=>W.isValidElement(o)?W.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n(false);}}):o)})};av.displayName="ModalFooter";var sv=W.forwardRef(({className:e,...t},r)=>{let{titleId:n}=Sn();return jsx("h2",{ref:r,id:n,className:u("text-lg font-semibold leading-none tracking-tight",e),...t})});sv.displayName="ModalTitle";var iv=W.forwardRef(({className:e,...t},r)=>{let{descriptionId:n}=Sn();return jsx("p",{ref:r,id:n,className:u("text-sm text-muted-foreground",e),...t})});iv.displayName="ModalDescription";var HM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Il=W.forwardRef(({images:e,open:t,onOpenChange:r,initialIndex:n=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let b=W.useMemo(()=>HM(e),[e]),[v,w]=W.useState(n),[y,R]=W.useState(1),[C,x]=W.useState(0),[N,T]=W.useState(false),[k,M]=W.useState(false),[P,E]=W.useState({x:0,y:0}),[S,H]=W.useState({x:0,y:0}),[L,D]=W.useState(false),V=W.useRef(null),A=b[v];W.useEffect(()=>{D(true);},[]),W.useEffect(()=>{w(n);},[n]),W.useEffect(()=>{o?.(v);},[v,o]),W.useEffect(()=>{R(1),x(0),E({x:0,y:0});},[v]),W.useEffect(()=>{if(t)return yt(),()=>Rt()},[t]);let B=W.useCallback(()=>{w(J=>J>0?J-1:b.length-1);},[b.length]),I=W.useCallback(()=>{w(J=>J<b.length-1?J+1:0);},[b.length]),K=()=>{R(J=>Math.min(J+.5,4));},F=()=>{R(J=>{let et=Math.max(J-.5,.5);return et===1&&E({x:0,y:0}),et});},q=()=>{x(J=>(J+90)%360);},te=async()=>{if(A)try{let et=await(await fetch(A.src)).blob(),Or=URL.createObjectURL(et),pt=document.createElement("a");pt.href=Or,pt.download=A.alt||`image-${v+1}`,document.body.appendChild(pt),pt.click(),document.body.removeChild(pt),URL.revokeObjectURL(Or);}catch{window.open(A.src,"_blank");}},$=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=J=>{y>1&&(M(true),H({x:J.clientX-P.x,y:J.clientY-P.y}));},j=J=>{k&&y>1&&E({x:J.clientX-S.x,y:J.clientY-S.y});},z=()=>{M(false);},Y=()=>{r?.(false);},ie=J=>{p&&J.target===J.currentTarget&&Y();},Ce=W.useCallback(J=>{switch(J.key){case "ArrowLeft":B();break;case "ArrowRight":I();break;case "Escape":r?.(false);break;case "+":case "=":K();break;case "-":F();break}},[B,I,r]);if(W.useEffect(()=>{if(t)return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[t,Ce]),W.useEffect(()=>{let J=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",J),()=>document.removeEventListener("fullscreenchange",J)},[]),b.length===0)return null;let U=a?W.isValidElement(a)?W.cloneElement(a,{onClick:J=>{a.props.onClick?.(J),r?.(true);}}):jsx("button",{type:"button",onClick:()=>r?.(true),children:a}):null;return jsxs(Fragment,{children:[U,!L||!t?null:$a.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:ie}),jsxs("div",{ref:h,className:u("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&b.length>1&&jsxs("span",{className:"text-sm",children:[v+1," / ",b.length]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(y*100),"%"]}),jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:te,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:j,onMouseUp:z,onMouseLeave:z,children:[m&&b.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":y>1?"cursor-grab":""),style:{transform:`translate(${P.x}px, ${P.y}px) scale(${y}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((J,et)=>jsx("button",{onClick:()=>w(et),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",v===et?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:J.src,alt:J.alt||`Thumbnail ${et+1}`,className:"h-full w-full object-cover"})},et))})]})]}),document.body)]})});Il.displayName="ImageViewer";var cv=({children:e,images:t,index:r=0,className:n})=>{let[o,a]=W.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",n),children:e}),jsx(Il,{images:t,open:o,onOpenChange:a,initialIndex:r})]})};cv.displayName="ImageViewerTrigger";var dv=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),uv=W.forwardRef(({className:e,color:t,size:r,position:n,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let m=a!=null;return jsxs("span",{ref:d,className:u(dv({color:t,size:m?void 0:r,position:n,ping:o}),m&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${n?.includes("right")?i:-i}px, ${n?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});uv.displayName="Indicator";var mv=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("relative inline-flex",e),...r,children:t}));mv.displayName="IndicatorWrapper";var fv=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),gv=W.forwardRef(({className:e,orientation:t,size:r,hideScrollbar:n=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=W.useRef(null),[c,d]=W.useState({top:false,bottom:false,left:false,right:false});W.useImperativeHandle(i,()=>l.current);let m=W.useCallback(()=>{let v=l.current;if(!v)return;let{scrollTop:w,scrollLeft:y,scrollHeight:R,scrollWidth:C,clientHeight:x,clientWidth:N}=v;d({top:w>0,bottom:w<R-x-1,left:y>0,right:y<C-N-1});},[]);W.useEffect(()=>{let v=l.current;if(v)return m(),v.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{v.removeEventListener("scroll",m),window.removeEventListener("resize",m);}},[m]);let p={sm:"20px",md:"40px",lg:"60px"}[r??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",b={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:u(fv({orientation:t,size:r}),n&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:b,...s,children:a})});gv.displayName="ScrollShadow";var bv=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",bordered:"rounded border border-current text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),BM={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},FM={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},KM=e=>{let t=e.toLowerCase();return BM[t]||e.toUpperCase()},aa=e=>{let t=e.toLowerCase();return FM[t]||t},Es=e=>{let t=aa(e);return ["meta","control","alt","shift"].includes(t)},vv=W.forwardRef(({className:e,variant:t,size:r,keys:n,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{W.useEffect(()=>{if(!a||!n||s)return;let m=Array.isArray(n)?n:[n],f=m.filter(Es).map(aa),p=m.filter(h=>!Es(h)).map(aa),g=h=>{let b=f.includes("meta")===h.metaKey,v=f.includes("control")===h.ctrlKey,w=f.includes("alt")===h.altKey,y=f.includes("shift")===h.shiftKey,R=p.length===0||p.includes(h.key.toLowerCase());b&&v&&w&&y&&R&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,a,s,i]);let d=()=>n?(Array.isArray(n)?n:[n]).map((f,p)=>jsxs(W.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:KM(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(bv({variant:t,size:r}),s&&"opacity-50",e),...l,children:d()})});vv.displayName="Kbd";function $M(e,t,r={}){let{disabled:n=false,preventDefault:o=true}=r;W.useEffect(()=>{if(n)return;let a=Array.isArray(e)?e:[e],s=a.filter(Es).map(aa),i=a.filter(c=>!Es(c)).map(aa),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,n,o]);}var hv=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),xv=W.forwardRef(({className:e,size:t,value:r,successDuration:n=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,m]=W.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(r),m(!0),o?.(),setTimeout(()=>{m(!1);},n);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:u(hv({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:p,height:p}}):s??jsx(Copy,{style:{width:p,height:p}})})});xv.displayName="CopyButton";var Rv=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),qM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function QM(e,t,r){let n=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=n.getDay()-r;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function JM(e,t){let r=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),r.push(i);}return r}function Ds(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ss(e){return Ds(e,new Date)}function yv(e,t){return e.filter(r=>{let n=new Date(r.start),o=new Date(r.end);return Ds(n,t)||Ds(o,t)||n<t&&o>t})}var wv=W.forwardRef(({className:e,variant:t,size:r,events:n=[],view:o="month",onViewChange:a,date:s,onDateChange:i,onEventClick:l,onSlotClick:c,weekStartsOn:d=0,locale:m="en-US",...f},p)=>{let[g,h]=W.useState(new Date),b=s??g,v=M=>{i?i(M):h(M);},w=d===1?ZM:qM,y=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),v(M);},R=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),v(M);},C=()=>{v(new Date);},x=()=>o==="day"?b.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(m,{year:"numeric",month:"long"}),N=()=>{let M=QM(b.getFullYear(),b.getMonth(),d);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,E)=>{let S=yv(n,P),H=P.getMonth()===b.getMonth();return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!H&&"bg-muted/30"),onClick:()=>c?.(P),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Ss(P)&&"bg-primary text-primary-foreground",!H&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[S.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:D=>{D.stopPropagation(),l?.(L);},children:L.title},L.id)),S.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",S.length-3," more"]})]})]},E)})})]})},T=()=>{let M=JM(b,d),P=Array.from({length:24},(E,S)=>S);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((E,S)=>jsxs("div",{className:u("p-2 text-center border-l",Ss(E)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[S]}),jsx("div",{className:u("text-lg font-semibold",Ss(E)&&"text-primary"),children:E.getDate()})]},S))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(E=>jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),M.map((S,H)=>{let L=new Date(S);L.setHours(E,0,0,0);let D=n.filter(V=>{let A=new Date(V.start);return Ds(A,S)&&A.getHours()===E});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(L),children:D.map(V=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:V.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),l?.(V);},children:V.title},V.id))},H)})]},E))})})]})},k=()=>{let M=Array.from({length:24},(E,S)=>S),P=yv(n,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Ss(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(E=>{let S=new Date(b);S.setHours(E,0,0,0);let H=P.filter(L=>new Date(L.start).getHours()===E);return jsxs(W.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[E.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>c?.(S),children:H.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:D=>{D.stopPropagation(),l?.(L);},children:L.title},L.id))})]},E)})})})]})};return jsxs("div",{ref:p,className:u(Rv({variant:t,size:r,className:e})),...f,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(oe,{variant:"bordered",size:"sm",onClick:C,children:"Today"}),jsx(oe,{variant:"ghost",size:"icon",onClick:y,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(oe,{variant:"ghost",size:"icon",onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx("h2",{className:"text-lg font-semibold ml-2",children:x()})]}),jsx("div",{className:"flex items-center gap-1 border rounded-lg p-1",children:["month","week","day"].map(M=>jsx(oe,{variant:o===M?"solid":"ghost",size:"sm",onClick:()=>a?.(M),children:M.charAt(0).toUpperCase()+M.slice(1)},M))})]}),o==="month"&&N(),o==="week"&&T(),o==="day"&&k()]})});wv.displayName="FullCalendar";var As=({active:e,payload:t,label:r})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[r&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:r}),jsx("div",{className:"space-y-1",children:t.map((n,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:n.color},children:n.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof n.value=="number"?n.value.toLocaleString():n.value})]},o))})]}),ia=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),la=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],Cv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ia({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:r,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));Cv.displayName="LineChart";var Tv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:r,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));Tv.displayName="BarChart";var Mv=W.forwardRef(({className:e,size:t,data:r,dataKey:n="value",nameKey:o="name",colors:a=la,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(As,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:r,dataKey:n,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:r.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Mv.displayName="PieChart";var Nv=W.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=la,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...m},f)=>jsx("div",{ref:f,className:u(ia({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:r,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(As,{})}),s&&jsx(Legend,{}),n.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));Nv.displayName="AreaChart";var Ev=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),Lv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),$l=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function wN({card:e,columnId:t,variant:r,renderCard:n,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u($l({variant:r,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:n?n(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function CN({column:e,variant:t,renderCard:r,onCardClick:n,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:u(Lv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(Ae,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(wN,{card:i,columnId:e.id,variant:t,renderCard:r,onCardClick:n},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var Sv=W.forwardRef(({className:e,variant:t,columns:r,onCardMove:n,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[m,f]=W.useState(null),[p,g]=W.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),b=R=>r.find(C=>C.cards.some(x=>x.id===R));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:R=>{let{active:C}=R,x=b(C.id);if(x){let N=x.cards.find(T=>T.id===C.id);N&&(f(N),g(x.id));}},onDragOver:R=>{let{active:C,over:x}=R;if(!x)return;let N=C.id,T=x.id,k=b(N),M=b(T)||r.find(S=>S.id===T);if(!k||!M||k.id===M.id)return;let P=M.cards.findIndex(S=>S.id===T),E=P===-1?M.cards.length:P;n?.(N,k.id,M.id,E);},onDragEnd:R=>{let{active:C,over:x}=R;if(x&&C.id!==x.id){let N=b(C.id),T=b(x.id)||r.find(k=>k.id===x.id);if(N&&T){let k=T.cards.findIndex(P=>P.id===x.id),M=k===-1?T.cards.length:k;n?.(C.id,N.id,T.id,M);}}f(null),g(null);},children:[jsx("div",{ref:d,className:u(Ev({variant:t,className:e})),...c,children:r.map(R=>jsx(CN,{column:R,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},R.id))}),jsx(DragOverlay,{children:m&&p&&jsx("div",{className:u($l({variant:t,isDragging:true})),children:s?s(m,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:m.title}),m.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:m.description})]})]})})})]})});Sv.displayName="KanbanBoard";var Dv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Hv=W.createContext(null);function Os(){let e=W.useContext(Hv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Iv=W.forwardRef(({className:e,variant:t,children:r,opts:n,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=TN({...n,axis:a==="horizontal"?"x":"y"},o),[p,g]=W.useState(false),[h,b]=W.useState(false),[v,w]=W.useState(0),[y,R]=W.useState([]),C=W.useCallback(M=>{M&&(w(M.selectedScrollSnap()),g(M.canScrollPrev()),b(M.canScrollNext()));},[]),x=W.useCallback(()=>{f?.scrollPrev();},[f]),N=W.useCallback(()=>{f?.scrollNext();},[f]),T=W.useCallback(M=>{f?.scrollTo(M);},[f]),k=W.useCallback(M=>{M.key==="ArrowLeft"?(M.preventDefault(),x()):M.key==="ArrowRight"&&(M.preventDefault(),N());},[x,N]);return W.useEffect(()=>{!f||!l||l(f);},[f,l]),W.useEffect(()=>{if(f)return R(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Hv.Provider,{value:{carouselRef:m,api:f,scrollPrev:x,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:v,scrollSnaps:y,scrollTo:T,orientation:a},children:jsxs("div",{ref:d,className:u(Dv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:r})}),s&&jsxs(Fragment,{children:[jsx(Gl,{}),jsx(Ul,{})]}),i&&y.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:y.map((M,P)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",P===v?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(P),"aria-label":`Go to slide ${P+1}`},P))})]})})});Iv.displayName="Carousel";var Vv=W.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("flex",e),...t}));Vv.displayName="CarouselContent";var Av=W.forwardRef(({className:e,basis:t="basis-full",...r},n)=>{let{orientation:o}=Os();return jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...r})});Av.displayName="CarouselItem";var Gl=W.forwardRef(({className:e,variant:t="bordered",size:r="icon",...n},o)=>{let{scrollPrev:a,canScrollPrev:s}=Os();return jsxs(oe,{ref:o,variant:t,size:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...n,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Gl.displayName="CarouselPrevious";var Ul=W.forwardRef(({className:e,variant:t="bordered",size:r="icon",...n},o)=>{let{scrollNext:a,canScrollNext:s}=Os();return jsxs(oe,{ref:o,variant:t,size:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!s,onClick:a,...n,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Ul.displayName="CarouselNext";var zv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),Bs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},jl={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u{1F44D}","\u{1F44E}","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9BF}","\u{1F9B5}","\u{1F9B6}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F94C}","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},Ov=W.forwardRef(({className:e,size:t,onEmojiSelect:r,recentEmojis:n=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=W.useState(n.length>0?"recent":o),[m,f]=W.useState(""),g=m?Object.values(jl).flat().filter(b=>b.toLowerCase().includes(m.toLowerCase())):c==="recent"?n:jl[c]||[],h=b=>{r?.(b);};return jsxs("div",{ref:l,className:u(zv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(Da,{placeholder:"Search emojis...",value:m,onChange:b=>f(b.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx("div",{className:"flex border-b px-1",children:Object.entries(Bs).map(([b,{icon:v}])=>b==="recent"&&n.length===0?null:jsx("button",{className:u("flex-1 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Bs[b].name,children:v},b))}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Bs[c].name}),jsx(Ae,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,v)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(b),children:b},`${b}-${v}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});Ov.displayName="EmojiPicker";var Bv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),rk=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),nk=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),We=({icon:e,title:t,isActive:r,onClick:n,disabled:o})=>jsxs(Ur,{children:[jsx(Wr,{children:jsx(oe,{type:"button",variant:r?"solid":"ghost",size:"icon",className:"h-7 w-7",onClick:n,disabled:o,children:e})}),jsx(jr,{side:"top",className:"text-xs",children:t})]}),Fv=W.forwardRef(({className:e,variant:t,size:r,value:n="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[HN.configure({heading:{levels:[1,2,3]}}),IN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),VN,AN.configure({types:["heading","paragraph"]}),zN.configure({placeholder:a})],content:n,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});W.useEffect(()=>{p&&n!==p.getHTML()&&p.commands.setContent(n);},[n,p]),W.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,b=window.prompt("URL",h);if(b!==null){if(b===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:b}).run();}};return p?jsx(Gr,{children:jsxs("div",{ref:f,className:u(Bv({variant:t,size:r,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(rk({size:r})),children:[jsx(We,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(We,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(We,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(We,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(We,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(We,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(We,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(We,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(We,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(We,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(We,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx($r,{orientation:"vertical",className:"h-6 mx-1"}),jsx(We,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(We,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:u(nk({size:r})),style:{minHeight:l,maxHeight:c}})]})}):null});Fv.displayName="RichTextEditor";var $v=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function uk(e,t,r){return centerCrop(makeAspectCrop({unit:"%",width:90},r,e,t),e,t)}async function Kv(e,t,r=0,n=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=r*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(n,n),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var Gv=W.forwardRef(({className:e,variant:t,src:r,aspectRatio:n,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=W.useRef(null),[h,b]=W.useState(),[v,w]=W.useState(),[y,R]=W.useState(1),[C,x]=W.useState(0),N=P=>{let{width:E,height:S}=P.currentTarget;if(n){let H=uk(E,S,n);b(H);}else b(m||{unit:"%",x:10,y:10,width:80,height:80});},T=P=>{b(P),o?.(P);},k=async P=>{if(w(P),a&&g.current&&P.width&&P.height){let E=await Kv(g.current,P,C,y);a(E);}},M=()=>{x(P=>(P+90)%360);};return W.useEffect(()=>{v&&g.current&&a&&Kv(g.current,v,C,y).then(P=>{a(P);});},[y,C,v,a]),jsxs("div",{ref:p,className:u($v({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(ok,{crop:h,onChange:T,onComplete:k,aspect:n,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:r,alt:"Crop preview",onLoad:N,style:{transform:`scale(${y}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Ya,{value:[y],onValueChange:([P])=>R(P),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(oe,{variant:"bordered",size:"icon",onClick:M,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Gv.displayName="ImageCropper";var ql=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),fk={sm:96,md:128,lg:192},Wv=W.forwardRef(({className:e,variant:t,size:r,value:n,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let b=o??fk[r??"md"];return n?jsx("div",{ref:h,className:u(ql({variant:t,size:r,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(mk,{value:n,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:u(ql({variant:t,size:r,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});Wv.displayName="QRCode";var jv=({children:e,defaultTheme:t="system",storageKey:r="reever-ui-theme",enableSystem:n=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:r,enableSystem:n,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});jv.displayName="ThemeProvider";var Rk=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Yv=W.forwardRef(({className:e,variant:t="ghost",size:r="md",mode:n="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=W.useState(false);W.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?n==="cycle"?jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(br,{children:[jsx(vr,{children:jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(hr,{align:"end",children:[jsxs(Ut,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Ut,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Ut,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(oe,{ref:o,variant:t==="default"?"bordered":t,size:"icon",className:u("h-9 w-9",e),disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Yv.displayName="ThemeToggle";var _v=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Xv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),qv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Zv=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let b=W.useId(),v=p||b,w=`${v}-description`,y=`${v}-error`,R=a&&n;return jsxs("div",{className:u(_v({size:s}),e),children:[t&&jsxs("label",{htmlFor:v,className:u(qv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[m&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:m}),jsx("input",{ref:h,id:v,"aria-invalid":a,"aria-describedby":R?y:r?w:void 0,"aria-required":o,className:u(Xv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),r&&!R&&jsx("p",{id:w,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),R&&jsx("p",{id:y,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});Zv.displayName="TextField";var eh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Tk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Qv=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Jv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Mk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),th=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:m,max:f,step:p=1,value:g,defaultValue:h,onChange:b,showButtons:v=true,formatOptions:w,fullWidth:y=false,disabled:R,id:C,...x},N)=>{let T=W.useId(),k=C||T,M=`${k}-description`,P=`${k}-error`,[E,S]=W.useState(h),[H,L]=W.useState(false),D=g!==void 0?g:E,V=a&&n,A=W.useCallback(O=>{O!==void 0&&(m!==void 0&&O<m&&(O=m),f!==void 0&&O>f&&(O=f)),g===void 0&&S(O),b?.(O);},[g,m,f,b]),B=()=>{let O=(D??0)+p;A(O);},I=()=>{let O=(D??0)-p;A(O);},K=O=>{let j=O.target.value;if(j==="")A(void 0);else {let z=parseFloat(j);isNaN(z)||A(z);}},F=O=>{O.key==="ArrowUp"?(O.preventDefault(),B()):O.key==="ArrowDown"&&(O.preventDefault(),I());},q=W.useMemo(()=>D===void 0?"":w?new Intl.NumberFormat(void 0,w).format(D):D.toString(),[D,w]),te=m!==void 0&&D!==void 0&&D<=m,$=f!==void 0&&D!==void 0&&D>=f;return jsxs("div",{className:u(eh({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(Mk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx("button",{type:"button",onClick:I,disabled:R||te,className:u(Qv({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:u(Jv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:q,onChange:K,onKeyDown:F,onFocus:()=>L(true),onBlur:()=>L(false),"aria-invalid":a,"aria-describedby":V?P:r?M:void 0,"aria-required":o,"aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":D,disabled:R,className:u(Tk({size:s,isInvalid:a,fullWidth:y}),!v&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...x}),v&&jsx("button",{type:"button",onClick:B,disabled:R||$,className:u(Qv({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:u(Jv({size:s}))})})]}),r&&!V&&jsx("p",{id:M,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),V&&jsx("p",{id:P,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});th.displayName="NumberField";var nh=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Pk=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),rh=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Ek=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Lk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),oh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:b=true,showSearchIcon:v=true,disabled:w,placeholder:y="Search...",id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,[P,E]=W.useState(f),S=m!==void 0?m:P,H=a&&n,L=S.length>0,D=B=>{let I=B.target.value;m===void 0&&E(I),p?.(I);},V=()=>{m===void 0&&E(""),p?.(""),g?.();},A=B=>{B.key==="Enter"?(B.preventDefault(),h?.(S)):B.key==="Escape"&&L&&(B.preventDefault(),V());};return jsxs("div",{className:u(nh({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Ek({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[v&&jsx(Search,{className:u(rh({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:x,id:T,type:"search",value:S,onChange:D,onKeyDown:A,placeholder:y,"aria-invalid":a,"aria-describedby":H?M:r?k:void 0,"aria-required":o,disabled:w,className:u(Pk({size:s,isInvalid:a}),!v&&"pl-3",!b&&"pr-3",l),...C}),b&&L&&!w&&jsx("button",{type:"button",onClick:V,className:u(Lk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(rh({size:s}))})})]}),r&&!H&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),H&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});oh.displayName="SearchField";var ah=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Dk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-calendar-picker-indicator]:hidden",{variants:{size:{sm:"h-8 pl-3 pr-8 py-1.5 text-xs",md:"h-10 pl-3 pr-10 py-2 text-sm",lg:"h-12 pl-4 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Hk=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Ik=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),rc=(e,t="yyyy-MM-dd")=>{if(!e)return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return t.replace("yyyy",String(r)).replace("MM",n).replace("dd",o)},Vk=e=>{if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},sh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:b="yyyy-MM-dd",showIcon:v=true,fullWidth:w=false,disabled:y,id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=x||P,[S,H]=W.useState(f??null),[L,D]=W.useState(false),V=()=>{!y&&E.current&&E.current.showPicker?.();},A=m!==void 0?m:S,B=a&&n,I=te=>{let $=Vk(te.target.value);m===void 0&&H($),p?.($);},K=A?rc(A,"yyyy-MM-dd"):"",F=g?rc(g,"yyyy-MM-dd"):void 0,q=h?rc(h,"yyyy-MM-dd"):void 0;return jsxs("div",{className:u(ah({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:u(Ik({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u("relative",w?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:T,type:"date",value:K,onChange:I,onFocus:()=>D(true),onBlur:()=>D(false),min:F,max:q,"aria-invalid":a,"aria-describedby":B?M:r?k:void 0,"aria-required":o,disabled:y,className:u(Dk({size:s,isInvalid:a,fullWidth:w}),!v&&"pr-3",l),style:{borderColor:L?"var(--color-foreground)":void 0},...C}),v&&jsx("button",{type:"button",onClick:V,disabled:y,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(Hk({size:s}))})})]}),r&&!B&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),B&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});sh.displayName="DateField";var ih=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Ak=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),zk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),lh=W.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:b=false,hourCycle:v=24,disabled:w,fullWidth:y=false,id:R,...C},x)=>{let N=W.useId(),T=R||N,k=`${T}-description`,M=`${T}-error`,P=W.useRef(null),E=W.useRef(null),S=W.useRef(null),H=W.useRef(null),[L,D]=W.useState(f??null),V=m!==void 0?m:L,A=a&&n,B=G=>v===24?G:G===0?12:G>12?G-12:G,I=G=>G>=12?"PM":"AM",K=(G,ne)=>ne==="AM"?G===12?0:G:G===12?12:G+12,[F,q]=W.useState(V?String(B(V.hour)).padStart(2,"0"):""),[te,$]=W.useState(V?String(V.minute).padStart(2,"0"):""),[O,j]=W.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[z,Y]=W.useState(V?I(V.hour):"AM"),[ie,Ce]=W.useState(false);W.useEffect(()=>{m!==void 0&&(m?(q(String(B(m.hour)).padStart(2,"0")),$(String(m.minute).padStart(2,"0")),m.second!==void 0&&j(String(m.second).padStart(2,"0")),Y(I(m.hour))):(q(""),$(""),j("")));},[m,v]);let U=(G,ne,_,Ee)=>{let ce=parseInt(G,10),Ke=parseInt(ne,10),$e=b?parseInt(_,10):void 0;if(isNaN(ce)||isNaN(Ke)||b&&isNaN($e)){m===void 0&&D(null),p?.(null);return}let pe={hour:v===12?K(ce,Ee):ce,minute:Ke,...b&&$e!==void 0&&{second:$e}};m===void 0&&D(pe),p?.(pe);},lt=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);q(ne);let _=v===24?23:12,Ee=v===24?0:1;if(ne.length===2){let ce=parseInt(ne,10);ce>=Ee&&ce<=_&&(E.current?.focus(),E.current?.select());}},J=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);if($(ne),ne.length===2){let _=parseInt(ne,10);_>=0&&_<=59&&(b?(S.current?.focus(),S.current?.select()):v===12&&H.current?.focus());}},et=G=>{let ne=G.target.value.replace(/\D/g,"").slice(0,2);j(ne),ne.length===2&&v===12&&H.current?.focus();},Or=()=>{if(F){let G=parseInt(F,10),ne=v===24?23:12,Ee=Math.min(Math.max(G,v===24?0:1),ne),ce=String(Ee).padStart(2,"0");q(ce),U(ce,te,O,z);}},pt=()=>{if(te){let G=parseInt(te,10),ne=Math.min(Math.max(G,0),59),_=String(ne).padStart(2,"0");$(_),U(F,_,O,z);}},fn=()=>{if(O){let G=parseInt(O,10),ne=Math.min(Math.max(G,0),59),_=String(ne).padStart(2,"0");j(_),U(F,te,_,z);}},Br=()=>{let G=z==="AM"?"PM":"AM";Y(G),U(F,te,O,G);},Ao=G=>{let ne=G.key.toLowerCase();ne==="a"?(G.preventDefault(),z!=="AM"&&(Y("AM"),U(F,te,O,"AM"))):ne==="p"?(G.preventDefault(),z!=="PM"&&(Y("PM"),U(F,te,O,"PM"))):ne==="arrowup"||ne==="arrowdown"?(G.preventDefault(),Br()):ne==="arrowleft"&&(G.preventDefault(),b?(S.current?.focus(),S.current?.select()):(E.current?.focus(),E.current?.select()));},Kt=(G,ne)=>{if(G.key==="ArrowUp"||G.key==="ArrowDown"){G.preventDefault();let _=G.key==="ArrowUp"?1:-1;if(ne==="hour"){let Ee=parseInt(F,10)||0,ce=v===24?23:12,Ke=v===24?0:1,$e=Ee+_;$e>ce&&($e=Ke),$e<Ke&&($e=ce);let Fr=String($e).padStart(2,"0");q(Fr),U(Fr,te,O,z);}else if(ne==="minute"){let ce=(parseInt(te,10)||0)+_;ce>59&&(ce=0),ce<0&&(ce=59);let Ke=String(ce).padStart(2,"0");$(Ke),U(F,Ke,O,z);}else if(ne==="second"){let ce=(parseInt(O,10)||0)+_;ce>59&&(ce=0),ce<0&&(ce=59);let Ke=String(ce).padStart(2,"0");j(Ke),U(F,te,Ke,z);}}G.key==="ArrowRight"&&(G.preventDefault(),ne==="hour"?(E.current?.focus(),E.current?.select()):ne==="minute"&&b?(S.current?.focus(),S.current?.select()):(ne==="minute"&&!b&&v===12||ne==="second"&&v===12)&&H.current?.focus()),G.key==="ArrowLeft"&&(G.preventDefault(),ne==="minute"?(P.current?.focus(),P.current?.select()):ne==="second"&&(E.current?.focus(),E.current?.select())),G.key==="Backspace"&&G.currentTarget.value===""&&(ne==="minute"?P.current?.focus():ne==="second"&&E.current?.focus());},gn=u((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",w&&"cursor-not-allowed");return jsxs("div",{ref:x,className:u(ih({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:u(zk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(Ak({size:s,isInvalid:a,disabled:w,fullWidth:y}),l),style:{borderColor:ie?"var(--color-foreground)":void 0},onFocus:()=>Ce(true),onBlur:G=>{G.currentTarget.contains(G.relatedTarget)||Ce(false);},children:[jsx("input",{ref:P,id:T,type:"text",inputMode:"numeric",placeholder:v===24?"HH":"hh",value:F,onChange:lt,onBlur:Or,onKeyDown:G=>Kt(G,"hour"),onFocus:G=>G.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?M:r?k:void 0,"aria-required":o,disabled:w,className:gn}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:E,type:"text",inputMode:"numeric",placeholder:"mm",value:te,onChange:J,onBlur:pt,onKeyDown:G=>Kt(G,"minute"),onFocus:G=>G.target.select(),"aria-label":"Minute",disabled:w,className:gn}),b&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:S,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:et,onBlur:fn,onKeyDown:G=>Kt(G,"second"),onFocus:G=>G.target.select(),"aria-label":"Second",disabled:w,className:gn})]}),v===12&&jsx("button",{ref:H,type:"button",onClick:Br,onKeyDown:Ao,disabled:w,className:u("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",w&&"cursor-not-allowed"),"aria-label":"AM/PM",children:z})]}),r&&!A&&jsx("p",{id:k,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),A&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});lh.displayName="TimeField";var dh=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),uh=W.forwardRef(({className:e,variant:t,orientation:r,size:n,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[n??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[n??"md"],v={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[n??"md"],w=(R,C)=>{C&&C(),l&&l(R);},y=R=>jsxs("button",{type:"button",disabled:i||R.isDisabled,onClick:()=>w(R.key,R.onPress),className:u("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:b),"aria-label":R.label,children:[R.icon&&jsx("span",{className:v,children:R.icon}),c&&jsx("span",{children:R.label})]},R.key);return jsxs("div",{ref:f,role:"group",className:u(dh({variant:t,orientation:r,size:n,density:o,className:e})),...m,children:[p.map(R=>d?d(R):y(R)),g.length>0&&jsxs(br,{children:[jsx(vr,{"aria-label":"More actions",className:u("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",b),children:jsx(MoreHorizontal,{className:v})}),jsx(hr,{align:"end",children:g.map(R=>jsxs(Ut,{disabled:R.isDisabled,onClick:()=>w(R.key,R.onPress),children:[R.icon&&jsx("span",{className:u(v,"mr-2"),children:R.icon}),R.label]},R.key))})]})]})});uh.displayName="ActionGroup";var gh=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),Kk=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),bh=W.forwardRef(({className:e,variant:t,size:r,pulse:n=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(gh({variant:t,size:r,className:e})),...s,children:[jsx("span",{className:u(Kk({size:r,pulse:n})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));bh.displayName="StatusLight";var hh=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),Gk=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),Uk=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),Wk=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),xh=W.forwardRef(({className:e,size:t,illustration:r,heading:n,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:u(hh({size:t,className:e})),...s,children:[r&&jsx("div",{className:u(Gk({size:t})),"aria-hidden":"true",children:r}),n&&jsx("h3",{className:u(Uk({size:t})),children:n}),o&&jsx("p",{className:u(Wk({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));xh.displayName="IllustratedMessage";var wh=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),Qk={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Ch=W.forwardRef(({className:e,variant:t,title:r,icon:n,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[m,f]=W.useState(true);if(!m)return null;let p=Qk[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:u(wh({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:n||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[r&&jsx("div",{className:"font-medium",children:r}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Ch.displayName="InlineAlert";var Th=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),Mh=W.forwardRef(({className:e,position:t,size:r,selectedCount:n=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||n===0)return null;let m=()=>typeof i=="function"?i(n):i||`${n} item${n>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Th({position:t,size:r,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx(Ct,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});Mh.displayName="ActionBar";var Nh=W.forwardRef(({className:e,icon:t,children:r,...n},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),r]}));Nh.displayName="ActionBarButton";var Eh=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),Lh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Sh({className:e,variant:t,size:r,items:n,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),[h,b]=W.useState(null),[v,w]=W.useState(null),y=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),R=T=>{if(a==="none")return;let k;a==="single"?k=y.has(T)?new Set:new Set([T]):(k=new Set(y),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{b(k),T.dataTransfer.effectAllowed="move";},x=(T,k)=>{T.preventDefault(),h!==k&&w(k);},N=()=>{if(h&&v&&h!==v){let T=n.findIndex(E=>E.key===h),k=n.findIndex(E=>E.key===v),M=[...n],[P]=M.splice(T,1);M.splice(k,0,P),l?.(M);}b(null),w(null);};return n.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:u(Eh({variant:t,size:r,className:e})),...f,children:n.map(T=>{let k=y.has(T.key),M=h===T.key,P=v===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>R(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:E=>C(E,T.key),onDragOver:E=>x(E,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&R(T.key),className:u(Lh({variant:t,size:r,isSelected:k,isDisabled:T.isDisabled}),M&&"opacity-50",P&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:u("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}Sh.displayName="ListView";var Dh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),nP=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),oP=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),Hh=W.forwardRef(({className:e,orientation:t="horizontal",size:r="md",value:n,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=v=>String(v),trackColor:p="primary",name:g,...h},b)=>{let[v,w]=W.useState(o),y=n!==void 0,R=y?n:v,C=W.useRef(null),[x,N]=W.useState(false),[T,k]=W.useState(null),M=(I,K)=>{if(!C.current)return R[0];let F=C.current.getBoundingClientRect(),q;t==="horizontal"?q=(I-F.left)/F.width:q=1-(K-F.top)/F.height,q=Math.max(0,Math.min(1,q));let te=i+q*(l-i),$=Math.round(te/c)*c;return Math.max(i,Math.min(l,$))},P=(I,K)=>{let F=[...R];F[K]=I,K===0&&I>R[1]&&(F[0]=R[1]),K===1&&I<R[0]&&(F[1]=R[0]),y||w(F),a?.(F);},E=(I,K)=>{d||(I.preventDefault(),N(true),k(K),I.target.setPointerCapture(I.pointerId));},S=I=>{if(!x||T===null||d)return;let K=M(I.clientX,I.clientY);P(K,T);},H=()=>{x&&(N(false),k(null),s?.(R));},L=I=>{if(d)return;let K=M(I.clientX,I.clientY),F=Math.abs(R[0]-K),q=Math.abs(R[1]-K),te=F<=q?0:1;P(K,te);let $=[...R];$[te]=K,s?.($);},D=(I,K)=>{if(d)return;let F=R[K];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),F=Math.min(l,R[K]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),F=Math.max(i,R[K]-c);break;case "Home":I.preventDefault(),F=i;break;case "End":I.preventDefault(),F=l;break;default:return}P(F,K);let q=[...R];q[K]=F,s?.(q);},V=I=>(I-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],B={sm:14,md:20,lg:24}[r||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(R[0])}),jsx("span",{children:f(R[1])})]}),jsxs("div",{ref:b,className:u(Dh({orientation:t,size:r}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u(nP({orientation:t,size:r})),onClick:L,children:jsx("div",{className:u("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(R[0])}%`,right:`${100-V(R[1])}%`,top:0,bottom:0}:{bottom:`${V(R[0])}%`,top:`${100-V(R[1])}%`,left:0,right:0}})}),R.map((I,K)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:u(oP({size:r}),x&&T===K&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${B/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${B/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:F=>E(F,K),onPointerMove:S,onPointerUp:H,onPointerCancel:H,onKeyDown:F=>D(F,K)},K)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:R[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:R[1]})]})]})]})});Hh.displayName="RangeSlider";var cc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),cP=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),dP={help:HelpCircle,info:Info,warning:AlertCircle},Ah=W.forwardRef(({variant:e="help",size:t,title:r,children:n,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=W.useState(false),[b,v]=W.useState(false),[w,y]=W.useState({top:0,left:0}),R=W.useRef(null),C=W.useRef(null),x=i!==void 0?i:g,N=W.useCallback(P=>{i===void 0&&h(P),l?.(P);},[i,l]);W.useEffect(()=>{v(true);},[]),W.useEffect(()=>{if(!x||!R.current)return;let P=()=>{let E=R.current.getBoundingClientRect(),S=C.current?.getBoundingClientRect(),H=S?.width||288,L=S?.height||100,D=8,V=0,A=0;switch(a){case "top":V=E.top-L-D,A=E.left+E.width/2-H/2;break;case "bottom":V=E.bottom+D,A=E.left+E.width/2-H/2;break;case "left":V=E.top+E.height/2-L/2,A=E.left-H-D;break;case "right":V=E.top+E.height/2-L/2,A=E.right+D;break}if(a==="top"||a==="bottom")switch(s){case "start":A=E.left;break;case "center":A=E.left+E.width/2-H/2;break;case "end":A=E.right-H;break}if(a==="left"||a==="right")switch(s){case "start":V=E.top;break;case "center":V=E.top+E.height/2-L/2;break;case "end":V=E.bottom-L;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),V=Math.max(8,Math.min(V,window.innerHeight-L-8)),y({top:V,left:A});};return P(),requestAnimationFrame(P),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true);}},[x,a,s]),W.useEffect(()=>{if(!x)return;let P=E=>{C.current&&!C.current.contains(E.target)&&R.current&&!R.current.contains(E.target)&&N(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[x,N]),W.useEffect(()=>{if(!x)return;let P=E=>{E.key==="Escape"&&N(false);};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[x,N]);let T=dP[e??"help"],k=()=>{N(!x);},M=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?W.isValidElement(o)?W.cloneElement(o,{ref:R,onClick:P=>{o.props.onClick?.(P),k();}}):jsx("button",{ref:R,type:"button",onClick:k,className:u(cc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:P=>{R.current=P,typeof p=="function"?p(P):p&&(p.current=P);},type:"button",onClick:k,className:u(cc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),b&&x&&$a.createPortal(jsxs("div",{ref:C,className:u(cP({size:t}),f),style:{position:"fixed",top:w.top,left:w.left,transformOrigin:M()},role:"tooltip",children:[r&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:r}),jsx("div",{className:"text-muted-foreground",children:n}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Ah.displayName="ContextualHelp";var Oh=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),dc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Bh({className:e,spacing:t,variant:r,size:n,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,b]=W.useState(new Set),v=W.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),w=x=>{if(s==="none")return;let N;s==="single"?N=v.has(x)?new Set:new Set([x]):(N=new Set(v),N.has(x)?N.delete(x):N.add(x)),a||b(N),i?.(N);},y=(x,N)=>{N.stopPropagation(),c?.(x);},R=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u(Oh({spacing:t}),e),...g,children:[R.map(x=>{let N=v.has(x.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!x.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!x.isDisabled&&w(x.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!x.isDisabled&&(k.preventDefault(),w(x.key));},style:x.color?{backgroundColor:x.color}:void 0,className:u(dc({variant:x.color?void 0:r,size:n,isSelected:N,isDisabled:x.isDisabled}),T&&!x.isDisabled&&"cursor-pointer hover:opacity-80",x.color&&"text-white"),children:[x.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:x.icon}),x.label,l&&!x.isDisabled&&jsx("button",{type:"button",onClick:k=>y(x.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${x.label}`,children:jsx(X,{className:"h-3 w-3"})})]},x.key)}),C>0&&jsxs("span",{className:u(dc({variant:"surface",size:n}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Bh.displayName="TagGroup";var $h=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),Gh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function Uh({className:e,columns:t,gap:r,items:n,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=W.useState(new Set),h=W.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),b=v=>{if(a==="none")return;let w;a==="single"?w=h.has(v)?new Set:new Set([v]):(w=new Set(h),w.has(v)?w.delete(v):w.add(v)),o||g(w),s?.(w);};return n.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u($h({columns:t,gap:r,className:e})),...f,children:n.map(v=>{let w=h.has(v.key);return d?jsx("div",{role:"gridcell","aria-selected":w,onClick:()=>b(v.key),children:d(v,w)},v.key):jsxs("div",{role:"gridcell","aria-selected":w,"aria-disabled":v.isDisabled,onClick:()=>!v.isDisabled&&b(v.key),className:u(Gh({variant:l,size:c,isSelected:w,isDisabled:v.isDisabled})),children:[i&&a!=="none"&&w&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),v.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:v.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:v.label}),v.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:v.description})]})]},v.key)})})}Uh.displayName="GridList";var jh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),fP=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),gP=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),Js=W.forwardRef(({className:e,size:t,value:r,min:n=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:m="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(r-n)/(o-n)*100)),b=()=>{if(m!=="auto")return "";let w=(r-n)/(o-n),y=s!==void 0?(s-n)/(o-n):.25,R=i!==void 0?(i-n)/(o-n):.75;return (a!==void 0?(a-n)/(o-n):1)>=.5?w<=y?"bg-red-500":w<=R?"bg-yellow-500":"bg-green-500":w>=R?"bg-red-500":w>=y?"bg-yellow-500":"bg-green-500"},v=d?d(r,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:u("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:v})]}),jsx("div",{role:"meter","aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":o,"aria-label":l,className:u(jh({size:t})),children:jsx("div",{className:u(fP({variant:f})),children:jsx("div",{className:u(gP({color:m==="auto"?void 0:m,rounded:h>=100}),m==="auto"&&b()),style:{width:`${h}%`}})})})]})});Js.displayName="Meter";var Yh=W.forwardRef((e,t)=>jsx(Js,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Yh.displayName="DiskUsageMeter";var _h=W.forwardRef((e,t)=>jsx(Js,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));_h.displayName="BatteryMeter";var Xh=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ti=(e,t,r)=>{let n=o=>{let a=(o+e/60)%6;return r-r*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(n(5)*255),Math.round(n(3)*255),Math.round(n(1)*255)]},qh=(e,t,r)=>{e/=255,t/=255,r/=255;let n=Math.max(e,t,r),o=Math.min(e,t,r),a=n-o,s=0,i=n===0?0:a/n,l=n;if(a!==0)switch(n){case e:s=((t-r)/a+(t<r?6:0))*60;break;case t:s=((r-e)/a+2)*60;break;case r:s=((e-t)/a+4)*60;break}return [s,i,l]},Zh=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},Qh=(e,t,r)=>"#"+[e,t,r].map(n=>n.toString(16).padStart(2,"0")).join(""),Jh=W.forwardRef(({hue:e,saturation:t,brightness:r,value:n,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=W.useCallback(I=>{let K=Zh(I);return K?qh(...K):[0,1,1]},[]),[v,w]=W.useState(()=>b(n||o)),y=e??v[0],R=t??v[1],C=r??v[2];W.useEffect(()=>{if(n){let I=b(n);w(I);}},[n,b]);let x=W.useCallback((I,K)=>{if(l||!p.current)return;let F=p.current.getBoundingClientRect(),q=Math.max(0,Math.min(1,(I-F.left)/F.width)),te=Math.max(0,Math.min(1,(K-F.top)/F.height)),$=q,O=1-te;t===void 0&&r===void 0&&w([y,$,O]),a?.({hue:y,saturation:$,brightness:O});let j=ti(y,$,O);s?.(Qh(...j));},[l,y,t,r,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),x(I.clientX,I.clientY));},T=I=>{g&&x(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[M,P,E]=ti(y,1,1),S=`rgb(${M}, ${P}, ${E})`,H=R*100,L=(1-C)*100,[D,V,A]=ti(y,R,C),B=`rgb(${D}, ${V}, ${A})`;return jsx("div",{ref:f,className:u(Xh({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:S},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${L}% - ${c/2}px)`,backgroundColor:B,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Jh.displayName="ColorArea";var tx=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),xP=`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")`,ex="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",rx=W.forwardRef(({value:e,defaultValue:t,onChange:r,channel:n="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=W.useRef(null),[g,h]=W.useState(false),b=()=>{switch(n){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[v,w]=W.useState(t??b()),y=e??v,R=n==="hue"?y/360:y,C=W.useCallback((S,H)=>{if(i||!p.current)return;let L=p.current.getBoundingClientRect(),D=a!=="vertical",V;D?V=Math.max(0,Math.min(1,(S-L.left)/L.width)):V=Math.max(0,Math.min(1,1-(H-L.top)/L.height));let A=n==="hue"?V*360:V;e===void 0&&w(A),r?.(A);},[i,a,n,e,r]),x=S=>{i||(S.preventDefault(),h(true),S.target.setPointerCapture(S.pointerId),C(S.clientX,S.clientY));},N=S=>{g&&C(S.clientX,S.clientY);},T=S=>{h(false),S.target.releasePointerCapture(S.pointerId);},k=()=>{let S=a!=="vertical",H=S?"to right":"to top";switch(n){case "hue":return S?ex:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return ex}},M=()=>n==="hue"?`hsl(${y}, 100%, 50%)`:o,P=a!=="vertical",E=R*100;return jsx("div",{ref:f,className:u(tx({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:n==="alpha"?xP:void 0,backgroundSize:n==="alpha"?"8px 8px":void 0},onPointerDown:x,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...P?{left:`calc(${E}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${E}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:M(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});rx.displayName="ColorSlider";var nx=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),wP=(e,t,r)=>{let n=e-r,o=t-r,a=Math.atan2(o,n)*180/Math.PI+90;return a<0&&(a+=360),a},ox=W.forwardRef(({value:e,defaultValue:t=0,onChange:r,size:n,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=W.useRef(null),[f,p]=W.useState(false),[g,h]=W.useState(t),b=e??g,v=W.useCallback((x,N)=>{if(o||!m.current)return;let T=m.current.getBoundingClientRect(),k=T.width/2,M=x-T.left,P=N-T.top,E=wP(M,P,k);e===void 0&&h(E),r?.(E);},[o,e,r]),w=x=>{o||(x.preventDefault(),p(true),x.target.setPointerCapture(x.pointerId),v(x.clientX,x.clientY));},y=x=>{f&&v(x.clientX,x.clientY);},R=x=>{p(false),x.target.releasePointerCapture(x.pointerId);},C=()=>{let x=[];for(let N=0;N<=360;N+=30)x.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${x.join(", ")})`};return jsx("div",{ref:d,className:u(nx({size:n}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:w,onPointerMove:y,onPointerUp:R,onPointerLeave:R,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(CP,{hue:b,innerRadius:a,thumbSize:s})]})})});ox.displayName="ColorWheel";var CP=({hue:e,innerRadius:t,thumbSize:r})=>{let n=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+n*Math.cos(o),s=50+n*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:r,height:r,left:`calc(${a}% - ${r/2}px)`,top:`calc(${s}% - ${r/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var sx=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),MP=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),NP=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),ix=W.forwardRef(({className:e,orientation:t,size:r,align:n,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:m=false,copyable:f=false,onCopy:p,...g},h)=>{let b=async()=>{if(!(!f||a===null||a===void 0))try{let v=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(v),p?.();}catch{}};return jsxs("div",{ref:h,className:u(sx({orientation:t,size:r,align:n,className:e})),...g,children:[jsxs("span",{className:u(MP({size:r}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,m&&":"]}),jsx("span",{className:u(NP({size:r,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?b:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b());}:void 0,children:a})]})});ix.displayName="LabeledValue";var lx=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),cx=W.forwardRef(({className:e,orientation:t,gap:r,...n},o)=>jsx("div",{ref:o,className:u(lx({orientation:t,gap:r,className:e})),...n}));cx.displayName="LabeledValueGroup";var px=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),To=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),fx=W.forwardRef(({value:e,defaultValue:t="",onChange:r,onSearch:n,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:b,placeholder:v="Search...",disabled:w,...y},R)=>{let[C,x]=W.useState(false),[N,T]=W.useState(t),k=e!==void 0?e:N,M=W.useRef(null);W.useImperativeHandle(R,()=>M.current);let P=k.length>0,E=C&&(a.length>0||s.length>0||l.length>0||P),S=I=>{e===void 0&&T(I),r?.(I);},H=()=>{S(""),M.current?.focus();},L=I=>{I?.preventDefault(),k.trim()&&(n?.(k.trim()),x(false));},D=I=>{S(I.label),o?.(I),x(false);},V=I=>{S(I),n?.(I),x(false);},A=I=>{S(I),n?.(I),x(false);},B=W.useMemo(()=>{let I={};return a.forEach(K=>{let F=K.category||"Results";I[F]||(I[F]=[]),I[F].push(K);}),I},[a]);return jsxs(tt,{open:E,onOpenChange:x,children:[jsx(Jn,{children:jsxs("form",{onSubmit:L,className:u(px({size:g,variant:h}),b),children:[m&&jsx(Search,{className:u(To({size:g}),"ml-3")}),jsx("input",{ref:M,type:"text",value:k,onChange:I=>S(I.target.value),onFocus:()=>x(true),placeholder:v,disabled:w,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...y}),d&&P&&!w&&jsx("button",{type:"button",onClick:H,className:u("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",To({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(rt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!P&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,K)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(To({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:u(To({size:g}),"opacity-0 group-hover:opacity-100")})]},K))]}),l.length>0&&!P&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,K)=>jsxs("button",{type:"button",onClick:()=>A(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(To({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},K))]}),P&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(B).map(([I,K])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),K.map(F=>jsxs("button",{type:"button",onClick:()=>D(F),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[F.icon||jsx(Search,{className:u(To({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:F.label}),F.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:F.description})]})]},F.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});fx.displayName="SearchBar";var gx={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},hx=W.forwardRef(({open:e,onOpenChange:t,items:r=[],recentItems:n=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=W.useState(""),g=W.useRef(null),[h,b]=W.useState(false);W.useEffect(()=>{b(true);},[]),W.useEffect(()=>{e||p("");},[e]),W.useEffect(()=>{if(!e)return;let x=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t]),W.useEffect(()=>{if(e)return yt(),()=>Rt()},[e]);let v=W.useMemo(()=>{let x={};return r.forEach(N=>{let T=N.category||"Results";x[T]||(x[T]=[]),x[T].push(N);}),x},[r]),w=x=>{x.onSelect?.(),c?.(x),t?.(false);},y=()=>{t?.(false);},R=f.length>0,C=!R&&n.length>0;return !h||!e?null:$a.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:y}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),n.map(x=>jsxs(Command.Item,{value:x.label,onSelect:()=>w(x),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:x.icon||gx[x.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:x.label}),x.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:x.description})]}),x.shortcut&&jsx("div",{className:"flex items-center gap-1",children:x.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},x.id))]}),R&&Object.entries(v).map(([x,N])=>jsxs(Command.Group,{heading:x,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:x}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>w(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||gx[x]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},x)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});hx.displayName="SpotlightSearch";function BP(e="k"){let[t,r]=W.useState(false);return W.useEffect(()=>{let n=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),r(a=>!a));};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),{open:t,setOpen:r,toggle:()=>r(n=>!n)}}var Rx=W.createContext(null),ni=()=>{let e=W.useContext(Rx);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},YP=({children:e,notifications:t,onNotificationsChange:r})=>{let[n,o]=W.useState([]),[a,s]=W.useState(false),i=W.useRef(null),l=t!==void 0,c=l?t:n,d=W.useCallback(b=>{l?r?.(b):o(b);},[l,r]),m=c.filter(b=>!b.read).length,f=W.useCallback(b=>{d(c.map(v=>v.id===b?{...v,read:true}:v));},[c,d]),p=W.useCallback(()=>{d(c.map(b=>({...b,read:true})));},[c,d]),g=W.useCallback(b=>{d(c.filter(v=>v.id!==b));},[c,d]),h=W.useCallback(()=>{d([]);},[d]);return jsx(Rx.Provider,{value:{notifications:c,unreadCount:m,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},wx=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("relative inline-block",e),...r,children:t}));wx.displayName="NotificationCenter";var Cx=W.forwardRef(({className:e,showBadge:t=true,children:r,onClick:n,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=ni(),d=f=>{n?.(f),l(!i);},m=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:u("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[r||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:m})]})});Cx.displayName="NotificationCenterTrigger";var Tx=W.forwardRef(({className:e,align:t="end",sideOffset:r=8,emptyMessage:n="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:m,triggerRef:f}=ni(),[p,g]=W.useState(false),h=W.useRef(null),[b,v]=W.useState({top:0,left:0});return W.useEffect(()=>{g(true);},[]),W.useEffect(()=>{if(!i||!f.current||!h.current)return;let w=()=>{if(!f.current||!h.current)return;let y=f.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),C=y.bottom+r,x=y.left;t==="center"?x=y.left+y.width/2-R.width/2:t==="end"&&(x=y.right-R.width),x+R.width>window.innerWidth-16&&(x=window.innerWidth-R.width-16),x<16&&(x=16),v({top:C,left:x});};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,true),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,true);}},[i,f,t,r]),W.useEffect(()=>{if(!i)return;let w=R=>{h.current&&!h.current.contains(R.target)&&f.current&&!f.current.contains(R.target)&&l(false);},y=R=>{R.key==="Escape"&&l(false);};return document.addEventListener("mousedown",w),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",y);}},[i,l,f]),!p||!i?null:$a.createPortal(jsxs("div",{ref:w=>{h.current=w,typeof s=="function"?s(w):s&&(s.current=w);},className:u("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:b.top,left:b.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:n})]}):c.map(w=>jsx(gc,{notification:w},w.id)))})]}),document.body)});Tx.displayName="NotificationCenterContent";var _P={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},XP={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},gc=({notification:e,onMarkAsRead:t,onRemove:r})=>{let{markAsRead:n,removeNotification:o}=ni(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:m,action:f}=e,p=XP[l],g=()=>{t?t():n(a);},h=()=>{r?r():o(a);},b=v=>{if(!v)return null;let w=typeof v=="string"?new Date(v):v,R=new Date().getTime()-w.getTime(),C=Math.floor(R/6e4),x=Math.floor(R/36e5),N=Math.floor(R/864e5);return C<1?"Just now":C<60?C+"m ago":x<24?x+"h ago":N<7?N+"d ago":w.toLocaleDateString()};return jsxs("div",{className:u("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",_P[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:m||jsx("div",{className:u("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:u("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:b(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};gc.displayName="NotificationItem";var Mx=W.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:u("divide-y",e),...r,children:t}));Mx.displayName="NotificationList";var Nx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),nE={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},kx=W.forwardRef(({message:e,type:t="default",variant:r="solid",showIcon:n=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,b]=W.useState(true),[v,w]=W.useState(false);W.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&b(false);},[m]),W.useEffect(()=>{if(d&&h){let x=setTimeout(()=>{y();},d);return ()=>clearTimeout(x)}},[d,h]);let y=()=>{w(true),setTimeout(()=>{b(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let R=nE[t],C=n?o!==void 0?o:R?jsx(R,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(Nx({variant:r,type:t,position:l}),c&&"animate-pulse",v&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:y,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});kx.displayName="Banner";var ga=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-current bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-current bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),sE=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),vc=W.forwardRef(({icon:e,label:t="Action button",extended:r,extendedLabel:n,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},b)=>{let[v,w]=W.useState(false),y=o&&o.length>0,R=k=>{y&&w(!v),p?.(k);},C=k=>{k.onClick?.(),w(false);},x={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&v?"rotate-45":"",T=l==="scale"&&v?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&ga({position:m})),children:[y&&v&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",x[a].container),children:o.map((k,M)=>jsxs("div",{className:u("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${M*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:u(ga({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:u(ga({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:b,type:"button",onClick:R,disabled:g,className:u(ga({variant:c,size:d,position:"relative"}),r&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":y?v:void 0,...h,children:[v&&i?i:jsx("span",{className:u(sE({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),r&&n&&jsx("span",{className:"font-medium",children:n})]}),y&&v&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>w(false)})]})});vc.displayName="FloatingActionButton";var iE=vc;var Dx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),Ex=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Hx=W.forwardRef(({className:e,variant:t,size:r,items:n,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[m,f]=W.useState(a||n[0]?.key),p=o!==void 0,g=p?o:m,h=y=>{y.disabled||(p||f(y.key),s?.(y.key));},b=y=>t==="filled"?y?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":y?"text-primary":"text-muted-foreground hover:text-foreground",v=()=>{switch(r){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},w=()=>{switch(r){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(Dx({variant:t,size:r}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:n.map(y=>{let R=g===y.key,C=i==="all"||i==="active"&&R,x=R&&y.activeIcon?y.activeIcon:y.icon;if(l)return jsx("div",{onClick:()=>h(y),className:u(Ex({variant:t}),y.disabled&&"opacity-50 cursor-not-allowed"),children:l(y,R)},y.key);let N=jsxs("div",{onClick:()=>!y.href&&h(y),className:u(Ex({variant:t}),b(R),y.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":R?"page":void 0,"aria-disabled":y.disabled,tabIndex:y.disabled?-1:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),h(y));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(v(),"[&>svg]:h-full [&>svg]:w-full"),children:x}),y.badge!==void 0&&y.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:y.badge>99?"99+":y.badge}),y.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&y.label&&jsx("span",{className:u(w(),"font-medium truncate max-w-full px-1"),children:y.label})]},y.key);return y.href&&!y.disabled?jsx("a",{href:y.href,onClick:()=>h(y),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(R)),children:N},y.key):N})})});Hx.displayName="BottomNavigation";var cE="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",Vx=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),Ax=W.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[r&&jsx(Drawer.Trigger,{asChild:true,children:r}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:cE,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(n||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[n&&jsx(Drawer.Title,{className:"text-base font-semibold",children:n}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(Vx({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});Ax.displayName="ActionSheet";var Ox=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),xc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Bx=W.forwardRef(({className:e,variant:t,leftActions:r=[],rightActions:n=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=W.useRef(null),[p,g]=W.useState(0),[h,b]=W.useState(false),v=W.useRef(0),w=W.useRef(0),y=r.length*(o==="sm"?64:o==="lg"?96:80),R=n.length*(o==="sm"?64:o==="lg"?96:80),C=M=>{i||(b(true),v.current=M.touches[0].clientX,w.current=p);},x=M=>{if(!h||i)return;let E=M.touches[0].clientX-v.current,S=w.current+E;(S>0&&r.length===0||S<0&&n.length===0)&&(S=0),S>y?S=y+(S-y)*.3:S<-R&&(S=-R+(S+R)*.3),g(S);},N=()=>{if(!h)return;b(false);let M=f.current?.offsetWidth||0,P=Math.abs(p)/M;if(l&&P>.6){l==="right"&&p>0&&r[0]?(r[0].onAction?.(),s?.("right",r[0].key)):l==="left"&&p<0&&n[0]&&(n[0].onAction?.(),s?.("left",n[0].key)),g(0);return}p>y*a&&r.length>0?(g(y),s?.("right")):p<-R*a&&n.length>0?(g(-R),s?.("left")):g(0);},T=(M,P)=>{M.onAction?.(),s?.(P,M.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:m,className:u(Ox({variant:t,className:e})),...d,children:[r.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:y},children:r.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"right"),className:u(xc({variant:M.variant,size:o})),style:{opacity:Math.min(1,p/y)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),n.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:R},children:n.map(M=>jsxs("button",{type:"button",onClick:()=>T(M,"left"),className:u(xc({variant:M.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/R)},children:[M.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:M.icon}),!M.icon&&M.label]},M.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:x,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});Bx.displayName="SwipeActions";var Kx=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),mE=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),$x=W.forwardRef(({className:e,variant:t,onRefresh:r,pullThreshold:n=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=W.useRef(null),[b,v]=W.useState(0),[w,y]=W.useState("idle"),R=W.useRef(0),C=W.useRef(false),x=()=>l||w==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=E=>{x()&&(R.current=E.touches[0].clientY,C.current=true);},T=E=>{if(!C.current||!x())return;let H=E.touches[0].clientY-R.current;if(H<0){v(0),y("idle");return}let D=Math.min(H*.5,o);v(D),y(D>=n?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,w==="ready"){y("refreshing"),v(n*.6);try{await r();}finally{y("idle"),v(0);}}else y("idle"),v(0);},M={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],P=()=>{if(w==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(M,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let E=Math.min(b/n*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(M,"text-muted-foreground transition-transform"),style:{transform:`rotate(${E}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:w==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(Kx({variant:t,className:e})),...p,children:[jsx("div",{className:u(mE({size:i}),"z-10",w==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(n*.5),1)},children:P()}),jsx("div",{ref:h,className:u("transition-transform duration-200",w==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});$x.displayName="PullToRefresh";var Fn=(e,t,r)=>({duration:e,delay:t,ease:r||[.4,0,.2,1]}),pE={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},Gx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:pE,custom:i,transition:Fn(r,n,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});Gx.displayName="Fade";var fE=(e,t)=>{let r=typeof t=="number"?`${t}px`:t,n={up:{y:r},down:{y:`-${r}`},left:{x:r},right:{x:`-${r}`}};return {hidden:{opacity:0,...n[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...n[e]}}},Ux=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=W.useMemo(()=>fE(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Fn(r,n,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Ux.displayName="Slide";var gE={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},bE={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Wx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:bE,custom:i,transition:Fn(r,n,o),className:u(a),style:{transformOrigin:gE[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Wx.displayName="Scale";var jx=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Fn(r,n,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});jx.displayName="Collapse";var Yx=W.forwardRef(({show:e=true,children:t,duration:r=.4,delay:n=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Fn(r,n,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Yx.displayName="Expand";var _x=W.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Fn(r,n,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});_x.displayName="Rotate";var Xx=W.forwardRef(({front:e,back:t,direction:r="horizontal",flipped:n=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=r==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:n?180:0},transition:Fn(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${m}(180deg)`},children:t})]})})});Xx.displayName="Flip";var qx=W.forwardRef(({color:e="currentColor",duration:t=.6,children:r,className:n,disabled:o=false},a)=>{let[s,i]=W.useState([]),l=W.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,b=Math.max(p.width,p.height)*2,v={id:Date.now(),x:g,y:h,size:b};i(w=>[...w,v]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",n),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:r}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});qx.displayName="Ripple";var Zx=W.forwardRef(({children:e,animate:t=true,height:r=10,duration:n=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-r,0],transition:{duration:n,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Zx.displayName="Bounce";var xE={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Qx=W.forwardRef(({children:e,animate:t=true,intensity:r="normal",duration:n=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:xE[r],transition:{duration:n,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Qx.displayName="Shake";var yE={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Jx=W.forwardRef(({children:e,animate:t=true,speed:r="normal",className:n},o)=>jsx("div",{ref:o,className:u(t&&yE[r],n),children:e}));Jx.displayName="Pulse";var ey=W.forwardRef(({children:e,animate:t=true,angle:r=10,duration:n=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=W.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-r,r,-r,r,0],transition:{duration:n,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});ey.displayName="Wiggle";var ty=W.forwardRef(({children:e,animate:t=false,scale:r=1.2,duration:n=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=W.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:n},f=()=>{s&&(c(true),setTimeout(()=>c(false),n*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?r:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});ty.displayName="Pop";var NE=(e,t,r,n)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,r);return s?`${i}${n}${s}`:i},ry=W.forwardRef(({value:e,from:t=0,duration:r=2,decimals:n=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=W.useRef(null),g=useInView(p,{once:true}),[h,b]=W.useState(!l);W.useEffect(()=>{if(l&&g){let y=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(y)}},[l,g,c]);let v=useMotionValue(t),w=useTransform(v,y=>NE(y,n,s,i));return W.useEffect(()=>{if(h){let y=animate(v,e,{duration:r,ease:"easeOut",onComplete:m});return ()=>y.stop()}},[h,e,r,v,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:w}),a]})})});ry.displayName="Counter";var ny=W.forwardRef(({text:e,speed:t=50,delay:r=0,pauseBetween:n=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=W.useState(""),[b,v]=W.useState(0),[w,y]=W.useState(false),[R,C]=W.useState(false),x=W.useRef(null),N=useInView(x,{once:true}),[T,k]=W.useState(!l);return W.useEffect(()=>{if(l&&N){let M=setTimeout(()=>k(true),r*1e3);return ()=>clearTimeout(M)}},[l,N,r]),W.useEffect(()=>{if(!T||R)return;let M=p[b],P;return w?g.length>0?P=setTimeout(()=>{h(g.slice(0,-1));},i):(y(false),v(E=>(E+1)%p.length)):g.length<M.length?P=setTimeout(()=>{h(M.slice(0,g.length+1));},t):b<p.length-1||s?P=setTimeout(()=>{y(true);},n):(C(true),m?.()),()=>clearTimeout(P)},[T,g,b,w,R,p,t,i,n,s,m]),jsxs("span",{ref:x,className:u(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:u("ml-0.5",d),children:a})]})});ny.displayName="Typewriter";var oy=W.forwardRef(({children:e,direction:t="up",stagger:r=.05,duration:n=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=W.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:r,delayChildren:o}}},b={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:n,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((v,w)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[v,a==="word"&&w<p.length-1&&"\xA0"]},w))})})});oy.displayName="TextReveal";var ay=W.forwardRef(({words:e,duration:t=2,animation:r="slide",animationDuration:n=.5,className:o,loop:a=true},s)=>{let[i,l]=W.useState(0);W.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(r){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:n},className:"inline-block",children:e[i]},e[i])})})});ay.displayName="WordRotate";var cy=W.forwardRef(({children:e,direction:t="up",distance:r=50,duration:n=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=W.useRef(null),g=useInView(p,{once:a,amount:s}),b={up:{x:0,y:r},down:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0},none:{x:0,y:0}}[t],v={hidden:{opacity:0,x:b.x,y:b.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:n,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:v,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});cy.displayName="ScrollReveal";var dy=W.forwardRef(({position:e="top",size:t=4,color:r="hsl(var(--primary))",backgroundColor:n="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",b=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:n},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:b,backgroundColor:r}}),i&&jsx(PE,{progress:f,position:e})]})});dy.displayName="ScrollProgress";var PE=({progress:e,position:t})=>{let r=useTransform(e,s=>Math.round(s*100)),[n,o]=W.useState(0);return W.useEffect(()=>{let s=r.on("change",o);return ()=>s()},[r]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[n,"%"]})},uy=W.forwardRef(({children:e,speed:t=.5,direction:r="vertical",className:n,container:o},a)=>{let s=W.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=r==="horizontal"?d:0,f=r==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",n),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});uy.displayName="Parallax";var fy=W.forwardRef(({children:e,width:t,height:r,duration:n=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:r,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${n}s infinite`}}),jsx("style",{children:`
56
56
  @keyframes shimmer-right {
57
57
  0% { transform: translateX(-100%); }
58
58
  100% { transform: translateX(100%); }