@reeverdev/ui 0.2.231 → 0.2.232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ import*as Z from'react';import {createContext,useState,useEffect,useContext,useC
|
|
|
52
52
|
width: ${J.offsetWidth}px;
|
|
53
53
|
opacity: 1;
|
|
54
54
|
z-index: 9999;
|
|
55
|
-
`,document.body.appendChild(ee),q.dataTransfer.setDragImage(ee,20,15),setTimeout(()=>{document.body.removeChild(ee);},0),h(e),C?.({event:q,node:e});},me=q=>{if(q.preventDefault(),q.stopPropagation(),!g||g.key===e.key||X)return;let J=q.currentTarget.getBoundingClientRect(),ee=q.clientY-J.top,Ae=J.height,Le;ee<Ae*.25?Le=-1:ee>Ae*.75?Le=1:Le=0,!(w&&!w({dropNode:e,dropPosition:Le,dragNode:g}))&&(y(e.key,Le),R?.({event:q,node:e}));},Ye=q=>{q.preventDefault(),q.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:q,node:e,expandedKeys:F()});},Ze=q=>{q.stopPropagation(),P?.({event:q,node:e});},Mt=q=>{q.preventDefault(),q.stopPropagation(),!(!g||g.key===e.key||X)&&(b!==null&&x(e,b),h(null),y(null,null));},Se=q=>{h(null),y(null,null),S?.({event:q,node:e});},at=q=>{X||te&&i(e.key,e,q);},ne=q=>{q.stopPropagation(),!X&&!G&&a(e.key,e);},W=Z.useMemo(()=>{if(!$||b===null)return "";switch(b){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[$,b]),ae=[...r,n];return jsxs("div",{className:"relative",children:[k&&t>0&&jsxs(Fragment,{children:[r.map((q,J)=>!q&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${J} * var(--tree-indent) + 12px)`,top:0,bottom:0}},J)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":G?void 0:j,"aria-selected":te?O:void 0,"aria-disabled":X,draggable:ve,onDragStart:Te,onDragOver:me,onDragEnter:Ye,onDragLeave:Ze,onDrop:Mt,onDragEnd:Se,onClick:at,className:u("relative",Gg({size:V,isSelected:O,isDragging:U,isDisabled:X,isHoverable:te&&!X}),W,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[ve&&M&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:ne,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",j&&"rotate-90")})}),Y&&jsx(OC,{checked:B,indeterminate:_,disabled:X,onClick:q=>m(e.key,e,q)}),E&&oe&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:oe}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),z&&j&&jsx("div",{role:"group",children:e.children.map((q,J)=>jsx(jg,{node:q,level:t+1,isLast:J===e.children.length-1,parentIsLastPath:ae},q.key))})]})},BC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},FC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},_g=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||_g(n,t))return true;return false},Wg=Z.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:v=false,checkedKeys:b,defaultCheckedKeys:y=[],onCheck:x,showLine:w=false,showIcon:C=false,showHandle:R=true,dragIcon:T,icon:P,leafIcon:S=jsx(File,{className:"h-4 w-4"}),folderIcon:k=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:E=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:M,onDragEnter:N,onDragOver:H,onDragLeave:D,onDragEnd:L,onDrop:I,blockNode:A=false,disabled:K=false,...V},F)=>{let z=Z.useCallback(()=>l?new Set(BC(r)):new Set(i),[l,i,r]),[G,j]=Z.useState(z),O=s!==void 0,B=O?new Set(s):G,_=Z.useCallback((ye,Qe)=>{let Ft=new Set(B),Ge=!Ft.has(ye);Ge?Ft.add(ye):Ft.delete(ye),O||j(Ft),c?.(Array.from(Ft),{expanded:Ge,node:Qe});},[B,O,c]),[U,$]=Z.useState(new Set(p)),X=f!==void 0,te=X?new Set(f):U,Y=Z.useCallback((ye,Qe,Ft)=>{let Ge=new Set(te),se=!Ge.has(ye);m?se?Ge.add(ye):Ge.delete(ye):(Ge.clear(),se&&Ge.add(ye)),X||$(Ge);let Re=[],kr=Da=>{for(let eo of Da)Ge.has(eo.key)&&Re.push(eo),eo.children&&kr(eo.children);};kr(r),g?.(Array.from(Ge),{selected:se,selectedNodes:Re,node:Qe,event:Ft});},[te,m,X,g,r]),[ve,Q]=Z.useState(new Set(y)),[oe,Te]=Z.useState(new Set),me=b!==void 0,Ye=me?new Set(Array.isArray(b)?b:b.checked):ve,Ze=me&&!Array.isArray(b)?new Set(b.halfChecked):oe,Mt=Z.useCallback((ye,Qe,Ft)=>{let Ge=new Set(Ye),se=new Set(Ze),Re=!Ge.has(ye);if(Re?(Ge.add(ye),se.delete(ye)):Ge.delete(ye),!v&&Qe.children){let yi=FC(Qe);for(let tr of yi)Re?(Ge.add(tr),se.delete(tr)):Ge.delete(tr);}me||(Q(Ge),Te(se));let kr=[],Da=yi=>{for(let tr of yi)Ge.has(tr.key)&&kr.push(tr),tr.children&&Da(tr.children);};Da(r);let eo=v?{checked:Array.from(Ge),halfChecked:Array.from(se)}:Array.from(Ge);x?.(eo,{checked:Re,checkedNodes:kr,node:Qe,event:Ft,halfCheckedKeys:Array.from(se)});},[Ye,Ze,v,me,x,r]),[Se,at]=Z.useState(null),[ne,W]=Z.useState(null),[ae,q]=Z.useState(null),J=Z.useCallback((ye,Qe)=>{W(ye),q(Qe);},[]),ee=Z.useCallback((ye,Qe)=>{!Se||!I||Qe===0&&_g(Se,ye.key)||I({event:{},node:ye,dragNode:Se,dropPosition:Qe,dropToGap:Qe!==0});},[Se,I]),Ae=Z.useCallback(()=>Array.from(B),[B]),Le={expandedKeys:B,toggleExpand:_,selectedKeys:te,handleSelect:Y,selectable:d,multiple:m,checkedKeys:Ye,halfCheckedKeys:Ze,handleCheck:Mt,checkable:h,checkStrictly:v,draggable:o,draggedNode:Se,setDraggedNode:at,dragOverKey:ne,dragOverPosition:ae,setDragOver:J,handleDrop:ee,allowDrop:a,onDragStart:M,onDragEnter:N,onDragOver:H,onDragLeave:D,onDragEnd:L,showLine:w,showIcon:C,showHandle:R,dragIcon:T,icon:P,leafIcon:S,folderIcon:k,folderOpenIcon:E,blockNode:A,disabled:K,size:n,data:r,getAllKeys:Ae},wn=ye=>{let Qe=ye.relatedTarget,Ft=ye.currentTarget;(!Qe||!Ft.contains(Qe))&&J(null,null);};return jsx(Ug.Provider,{value:Le,children:jsx("div",{ref:F,role:"tree","aria-multiselectable":m||h,className:u($g({variant:t,size:n,className:e})),onDragLeave:wn,...V,children:r.map((ye,Qe)=>jsx(jg,{node:ye,level:0,isLast:Qe===r.length-1},ye.key))})})});Wg.displayName="Tree";var Xg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),_C=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},WC=(e,t)=>{let[n,r]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},qg=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:v=true,fullWidth:b=false,disabled:y,...x},w)=>{let[C,R]=Z.useState(false),[T,P]=Z.useState(r),[S,k]=Z.useState([]),[E,M]=Z.useState(false),[N,H]=Z.useState(false),[D,L]=Z.useState(0),I=Z.useRef(null),A=Z.useRef(null),K=n!==void 0?n:T,V=WC(K,l);Z.useEffect(()=>{let Y=A.current;if(!Y)return;let ve=()=>{L(Y.offsetWidth);};ve();let Q=new ResizeObserver(ve);return Q.observe(Y),()=>{Q.disconnect();}},[]),Z.useImperativeHandle(w,()=>I.current);let F=i?S:s,z=Z.useMemo(()=>i?F:F.filter(Y=>Y.label.toLowerCase().includes(K.toLowerCase())),[F,K,i]);Z.useEffect(()=>{if(!i)return;if(V.length<c){k([]);return}let Y=false;return (async()=>{M(true);try{let Q=await i(V);Y||k(Q);}catch{Y||k([]);}finally{Y||M(false);}})(),()=>{Y=true;}},[V,i,c]);let G=Y=>{n===void 0&&P(Y),o?.(Y);},j=Y=>{let ve=Y.target.value;G(ve),ve.length>=c&&R(true);},O=Y=>{G(Y.label),a?.(Y),R(false);},B=()=>{G(""),I.current?.focus();},_=()=>{H(true),R(true);},U=()=>{H(false);},$=Y=>{Y.key==="Escape"&&R(false),Y.key==="ArrowDown"&&!C&&z.length>0&&R(true);},X$1=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",te=p&&K?"pr-8":"pr-3";return jsxs(ht,{open:C,onOpenChange:R,children:[jsxs(Nn,{ref:A,className:u("relative",b?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:K,onChange:j,onFocus:_,onBlur:U,onKeyDown:$,disabled:y,placeholder:d,className:u(Xg({size:t,fullWidth:b}),te,e),style:{borderColor:N?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&K&&!y&&jsx("button",{type:"button",onClick:B,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:X$1})})]}),jsx(xt,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:Y=>Y.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Oe,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:E?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(X$1,"animate-spin")}),f]}):z.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):z.map(Y=>jsxs(Command.Item,{value:Y.value,disabled:Y.disabled,onSelect:()=>O(Y),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",K===Y.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:v?jsx(_C,{text:Y.label,query:K}):Y.label})]},Y.value))})})})})]})});qg.displayName="Autocomplete";var bl=Z.createContext(null),vl=Z.createContext(null),hl=()=>{let e=Z.useContext(bl);if(!e)throw new Error("useFormContext must be used within a Form");return e},Ms=()=>{let e=Z.useContext(vl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},YC={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},Zg=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[m,f]=Z.useState({}),[p,g]=Z.useState({}),[h,v]=Z.useState({}),[b,y]=Z.useState(false),x=Z.useRef(new Map),w=Z.useCallback((D,L)=>{x.current.set(D,L);},[]),C=Z.useCallback(D=>{x.current.delete(D);},[]),R=Z.useCallback(D=>{let L=x.current.get(D)||[],I=c[D];for(let A of L)if(!A.validate(I))return f(K=>({...K,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),T=Z.useCallback(()=>{let D=true,L={};return x.current.forEach((I,A)=>{let K=c[A];for(let V of I)if(!V.validate(K)){L[A]=V.message,D=false;break}L[A]||(L[A]=null);}),f(L),D},[c]),P=Z.useCallback((D,L)=>{d(I=>({...I,[D]:L})),v(I=>({...I,[D]:true})),o&&setTimeout(()=>{R(D);},0);},[o,R]),S=Z.useCallback((D,L)=>{f(I=>({...I,[D]:L}));},[]),k=Z.useCallback((D,L)=>{g(I=>({...I,[D]:L})),L&&r&&R(D);},[r,R]),E=Z.useCallback(D=>({value:c[D],error:m[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,m,p,h]),M=Z.useCallback(()=>{d(e),f({}),g({}),v({});},[e]),N=async D=>{D.preventDefault();let L={};if(x.current.forEach((A,K)=>{L[K]=true;}),g(L),!T()){n?.(m);return}if(t){y(true);try{await t(c);}finally{y(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:b,setValue:P,setError:S,setTouched:k,validateField:R,validateAll:T,registerField:w,unregisterField:C,getFieldState:E,reset:M};return jsx(bl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:N,className:u("space-y-4",s),...i,children:a})})});Zg.displayName="Form";var Qg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=hl(),a=Z.useId();Z.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(vl.Provider,{value:i,children:r})};Qg.displayName="FormField";var Jg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));Jg.displayName="FormItem";var eb=Z.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Ms();return jsxs(Lr,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});eb.displayName="FormLabel";var tb=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Ms(),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 Z.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};tb.displayName="FormControl";var nb=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));nb.displayName="FormDescription";var rb=Z.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=Ms(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...n,children:i}):null});rb.displayName="FormMessage";var ab=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"}}),sb=Z.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(ab({size:t,className:e})),...i,children:[jsxs(Dr,{"data-user-avatar":true,children:[o&&jsx(io,{src:o,alt:n}),jsx(Hr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});sb.displayName="User";var lb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),cb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:u(lb({variant:t,size:n,radius:r,className:e})),...o}));cb.displayName="Code";function pb(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var fb=Z.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=pb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((b,y)=>jsxs("div",{...h({line:b}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:y+1}),b.map((x,w)=>jsx("span",{...v({token:x})},w))]},y))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});fb.displayName="CodeBlock";var gb=Z.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=pb(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:r,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((v,b)=>jsx("div",{...g({line:v}),children:v.map((y,x)=>jsx("span",{...h({token:y})},x))},b))})}),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"})})]})]})});gb.displayName="TabbedCodeBlock";var bb=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"}}),vb=Z.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=Z.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(bb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":m?"Copied":a,children:m?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});vb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),hb=Z.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=Z.useState("loading");Z.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},v=()=>{g("error"),i?.();},b={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(Ka,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:v,className:u("h-full w-full transition-opacity duration-300",b,p==="loading"?"opacity-0":"opacity-100"),...m})]})});hb.displayName="Image";var yb=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"}}),Rb=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 iT({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=Z.useState(null),[f,p]=Z.useState(null),g=(x,w)=>{i||(m(w),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(w)));},h=(x,w)=>{x.preventDefault(),!(i||d===null||d===w)&&p(w);},v=()=>{p(null);},b=(x,w)=>{if(x.preventDefault(),i||d===null||d===w){m(null),p(null);return}let C=[...r],[R]=C.splice(d,1);C.splice(w,0,R),o?.(C),m(null),p(null);},y=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(yb({variant:t,size:n,className:e})),...l,children:r.map((x,w)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,w),onDragOver:C=>h(C,w),onDragLeave:v,onDrop:C=>b(C,w),onDragEnd:y,className:u(Rb({variant:t,size:n,isDragging:d===w,isDragOver:f===w}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(x,w)})]},x.id))})}var lT=Z.forwardRef(iT);var Mb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{variant:"spinner",size:"md"}}),wb={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},mT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Cb={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},Nb=Z.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in Cb,l=i?Cb[o]:"",c=i?void 0:{color:o},d=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",style:c,children:[0,1,2].map(m=>jsx("div",{className:u(mT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${m*.15}s`}},m))});case "pulse":return jsx("div",{className:u(wb[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:u(wb[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:u(Mb({variant:t,size:n,className:e})),role:"status","aria-label":r||"Loading",...a,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[d(),r&&jsx("span",{className:u("text-sm",l),style:c,children:r})]})})});Nb.displayName="Loading";var gT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),bT=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),vT=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"}}),hT=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"}}),Hs={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Tl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Cl=(e,t)=>String(e).padStart(t,"0"),kb=(e,t)=>{if(!e)return "";let n=Cl(e.getDate(),2),r=Cl(e.getMonth()+1,2),o=Cl(e.getFullYear(),4),a=Hs[t],s=Tl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ss=(e,t)=>{let n=Hs[t],r=e.split(n);if(r.length!==3)return null;let o=Tl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},xT=e=>{let t=Hs[e];return Tl[e].map(r=>r==="year"?"####":"##").join(t)},ua=(e,t)=>{if(!e?.from)return "";let n=kb(e.from,t),r=e.to?kb(e.to,t):"";return n&&r?`${n} - ${r}`:n},Pb=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:y="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:R,placeholder:T,id:P,...S},k)=>{let E=Z.useId(),M=P||E,N=`${M}-description`,H=`${M}-error`,[D,L]=Z.useState(f),[I,A]=Z.useState(""),[K,V]=Z.useState(false),[F,z]=Z.useState(false),G=m!==void 0?m:D,j=a&&r,O=xT(v),B=Hs[v],_=" - ";Z.useEffect(()=>{F||A(ua(G,v));},[G,v,F]);let U=oe=>{m===void 0&&L(oe),p?.(oe);},$=oe=>{U(oe),A(ua(oe,v)),oe?.from&&oe?.to&&V(false);},X=oe=>{let Te=oe.target.value;Te=Te.replace(new RegExp(`[^0-9\\${B}\\s-]`,"g"),"");let me=`${O}${_}${O}`,Ye=Te.replace(new RegExp(`[\\${B}\\s-]`,"g"),""),Ze="",Mt=0;for(let Se=0;Se<me.length&&Mt<Ye.length;Se++)me[Se]==="#"?(Ze+=Ye[Mt],Mt++):Ze+=me[Se];if(A(Ze),Ze.length===me.length){let Se=Ze.split(_);if(Se.length===2){let at=Ss(Se[0].trim(),v),ne=Ss(Se[1].trim(),v);if(at&&ne){if(g&&(at<g||ne<g)||h&&(at>h||ne>h))return;at<=ne&&U({from:at,to:ne});}}}},te=()=>{z(true);},Y=()=>{z(false);let oe=`${O}${_}${O}`;if(I.length!==oe.length)A(ua(G,v));else {let Te=I.split(_);if(Te.length!==2)A(ua(G,v));else {let me=Ss(Te[0].trim(),v),Ye=Ss(Te[1].trim(),v);(!me||!Ye||me>Ye)&&A(ua(G,v));}}},ve=()=>{R||V(true);},Q=()=>{!R&&y==="picker"&&b&&V(true);};return jsxs("div",{className:u(gT({size:s}),e),children:[t&&jsxs("label",{htmlFor:M,className:u(hT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ht,{open:b&&K,onOpenChange:V,children:[jsxs(Nn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:M,type:"text",inputMode:y==="text"?"numeric":void 0,value:I,onChange:y==="text"?X:void 0,onClick:Q,onFocus:te,onBlur:Y,readOnly:y==="picker","aria-invalid":a,"aria-describedby":j?H:n?N:void 0,"aria-required":o,disabled:R,placeholder:T||`${v.toLowerCase()} - ${v.toLowerCase()}`,className:u(bT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),y==="picker"&&b&&"cursor-pointer",l),style:{borderColor:F||b&&K?"var(--color-foreground)":void 0},...S}),b&&jsx("button",{type:"button",onClick:ve,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(vT({size:s}))})})]}),b&&jsx(xt,{className:"w-auto p-0",align:C,children:jsx(lo,{mode:"range",selected:G,onSelect:$,numberOfMonths:w,disabled:oe=>!!(g&&oe<g||h&&oe>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!j&&jsx("p",{id:N,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),j&&jsx("p",{id:H,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Pb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),Eb=Z.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=Z.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),m=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${ho(x.hours)}:${ho(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${ho(w)}:${ho(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let R=e.hours>=12;R&&x!==12?C=x+12:!R&&x===12&&(C=0);}t?.({hours:C,minutes:w});},g=x=>{let w=e?.hours??0;t?.({hours:w,minutes:x});},h=x=>{if(!e)return;let w=e.hours;x==="AM"&&e.hours>=12?w=e.hours-12:x==="PM"&&e.hours<12&&(w=e.hours+12),t?.({hours:w,minutes:e.minutes});},v=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},b=e?e.hours>=12?"PM":"AM":void 0,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(ht,{open:l,onOpenChange:c,children:[jsxs(or,{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(xt,{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(Oe,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(pe,{variant:y===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:ho(x)},x))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(x=>jsx(pe,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:ho(x)},x))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(pe,{variant:b==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(pe,{variant:b==="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(pe,{variant:"ghost",size:"sm",onClick:v,children:"Now"}),jsx(pe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Eb.displayName="TimePicker";var Sb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function wT({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=Z.useRef(null),[p,g]=Z.useState(0);Z.useImperativeHandle(m,()=>f.current);let h=n.length*(r+l)-l,v=r+l,b=Math.max(0,Math.floor(p/v)-a),y=Math.ceil(o/v)+2*a,x=Math.min(n.length-1,b+y),w=R=>{let T=R.currentTarget.scrollTop;g(T),c?.(T);},C=Z.useMemo(()=>{let R=[];for(let T=b;T<=x;T++)n[T]!==void 0&&R.push({item:n[T],index:T,style:{position:"absolute",top:T*v,left:0,right:0,height:r}});return R},[n,b,x,v,r]);return jsx("div",{ref:f,className:u(Sb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:R,index:T,style:P})=>jsx("div",{style:P,children:s(R,T)},i?i(R,T):T))})})}var CT=Z.forwardRef(wT);var Nl=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),kl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Db=Z.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,scrollbarVisibility:f="visible",...p},g)=>{let h=Z.useRef(null),v=Z.useRef(null),b=Z.useRef(false);Z.useImperativeHandle(g,()=>h.current),Z.useEffect(()=>{let w=v.current;if(!w)return;let C=new IntersectionObserver(R=>{let[T]=R;T.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:h.current,rootMargin:c||`${l}px`,threshold:0});return C.observe(w),()=>{C.disconnect();}},[a,s,o,l,c,d]);let y=jsx("div",{className:u(kl({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),x=jsxs(Fragment,{children:[r,jsx("div",{ref:v,className:"h-px w-full"}),s&&(i||y),!a&&!s&&m&&jsx("div",{className:u(kl({size:n}),"text-muted-foreground text-sm"),children:m})]});return d?jsx("div",{ref:h,className:u(Nl({variant:t,className:e})),...p,children:x}):jsx(Oe,{ref:h,visibility:f,className:u(Nl({variant:t,className:e})),...p,children:x})});Db.displayName="InfiniteScroll";var AT=e=>e.map(t=>typeof t=="string"?{src:t}:t),Pl=Z.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let v=Z.useMemo(()=>AT(e),[e]),[b,y]=Z.useState(r),[x,w]=Z.useState(1),[C,R]=Z.useState(0),[T,P]=Z.useState(false),[S,k]=Z.useState(false),[E,M]=Z.useState({x:0,y:0}),[N,H]=Z.useState({x:0,y:0}),[D,L]=Z.useState(false),I=Z.useRef(null),A=v[b];Z.useEffect(()=>{L(true);},[]),Z.useEffect(()=>{y(r);},[r]),Z.useEffect(()=>{o?.(b);},[b,o]),Z.useEffect(()=>{w(1),R(0),M({x:0,y:0});},[b]),Z.useEffect(()=>{if(t)return ln(),()=>cn()},[t]);let K=Z.useCallback(()=>{y(Q=>Q>0?Q-1:v.length-1);},[v.length]),V=Z.useCallback(()=>{y(Q=>Q<v.length-1?Q+1:0);},[v.length]),F=()=>{w(Q=>Math.min(Q+.5,4));},z=()=>{w(Q=>{let oe=Math.max(Q-.5,.5);return oe===1&&M({x:0,y:0}),oe});},G=()=>{R(Q=>(Q+90)%360);},j=async()=>{if(A)try{let oe=await(await fetch(A.src)).blob(),Te=URL.createObjectURL(oe),me=document.createElement("a");me.href=Te,me.download=A.alt||`image-${b+1}`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Te);}catch{window.open(A.src,"_blank");}},O=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),P(!1);}catch{}else try{await I.current.requestFullscreen(),P(!0);}catch{}},B=Q=>{x>1&&(k(true),H({x:Q.clientX-E.x,y:Q.clientY-E.y}));},_=Q=>{S&&x>1&&M({x:Q.clientX-N.x,y:Q.clientY-N.y});},U=()=>{k(false);},$=()=>{n?.(false);},X$1=Q=>{p&&Q.target===Q.currentTarget&&$();},te=Z.useCallback(Q=>{switch(Q.key){case "ArrowLeft":K();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":F();break;case "-":z();break}},[K,V,n]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[t,te]),Z.useEffect(()=>{let Q=()=>{P(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),v.length===0)return null;let Y=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[Y,!D||!t?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:X$1}),jsxs("div",{ref:h,className: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&&v.length>1&&jsxs("span",{className:"text-sm",children:[b+1," / ",v.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:z,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(x*100),"%"]}),jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:G,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:j,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:O,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:T?"Exit fullscreen":"Fullscreen",children:T?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:I,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:B,onMouseMove:_,onMouseUp:U,onMouseLeave:U,children:[m&&v.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:K,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:V,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",S?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${E.x}px, ${E.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&v.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:v.map((Q,oe)=>jsx("button",{onClick:()=>y(oe),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",b===oe?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${oe+1}`,className:"h-full w-full object-cover"})},oe))})]})]}),document.body)]})});Pl.displayName="ImageViewer";var Ib=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=Z.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(Pl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Ib.displayName="ImageViewerTrigger";var Vb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),OT={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"},BT={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"},FT=e=>{let t=e.toLowerCase();return OT[t]||e.toUpperCase()},pa=e=>{let t=e.toLowerCase();return BT[t]||t},Vs=e=>{let t=pa(e);return ["meta","control","alt","shift"].includes(t)},Ab=Z.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Vs).map(pa),p=m.filter(h=>!Vs(h)).map(pa),g=h=>{let v=f.includes("meta")===h.metaKey,b=f.includes("control")===h.ctrlKey,y=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());v&&b&&y&&x&&w&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(Z.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:FT(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(Vb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Ab.displayName="Kbd";function KT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;Z.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Vs).map(pa),i=a.filter(c=>!Vs(c)).map(pa),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var zb=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"}}),Ob=Z.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,m]=Z.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),m(!0),o?.(),setTimeout(()=>{m(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:u(zb({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}})})});Ob.displayName="CopyButton";var Fb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),XT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],qT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function QT(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function JT(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Bb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ro(r,t)||Ro(o,t)||r<t&&o>t})}var Kb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=XT,date:l,onDateChange:c,onEventClick:d,onSlotClick:m,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[v,b]=Z.useState(new Date),y=l??v,x=M=>{c?c(M):b(M);},w=f===1?ZT:qT,C=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()-1):a==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),x(M);},R=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()+1):a==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),x(M);},T=()=>{x(new Date);},P=()=>a==="day"?y.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):y.toLocaleDateString(p,{year:"numeric",month:"long"}),S=()=>{let M=QT(y.getFullYear(),y.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(N=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:N},N))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((N,H)=>{let D=Bb(o,N),L=N.getMonth()===y.getMonth(),I=Ro(N,y);return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!L&&"bg-muted/30",I&&"bg-accent"),onClick:()=>m?.(N),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(N)&&"bg-primary text-primary-foreground",!L&&"text-muted-foreground"),children:N.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:K=>{K.stopPropagation(),d?.(A);},children:A.title},A.id)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},H)})})]})},k=()=>{let M=JT(y,f),N=Array.from({length:24},(H,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((H,D)=>{let L=Ro(H,y);return jsxs("div",{className:u("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(H)&&"bg-primary/10",L&&!yo(H)&&"bg-accent"),onClick:()=>m?.(H),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[D]}),jsx("div",{className:u("text-lg font-semibold",yo(H)&&"text-primary",L&&!yo(H)&&"text-primary"),children:H.getDate()})]},D)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:N.map(H=>jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),M.map((D,L)=>{let I=new Date(D);I.setHours(H,0,0,0);let A=o.filter(K=>{let V=new Date(K.start);return Ro(V,D)&&V.getHours()===H});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(I),children:A.map(K=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:K.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),d?.(K);},children:K.title},K.id))},L)})]},H))})})]})},E=()=>{let M=Array.from({length:24},(H,D)=>D),N=Bb(o,y);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",yo(y)&&"bg-primary text-primary-foreground"),children:y.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(H=>{let D=new Date(y);D.setHours(H,0,0,0);let L=N.filter(I=>new Date(I.start).getHours()===H);return jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(D),children:L.map(I=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:I.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(I);},children:I.title},I.id))})]},H)})})})]})};return jsxs("div",{ref:h,className:u(Fb({variant:t,size:n,radius:r,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:P()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(pe,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx(Ua,{options:i,value:a,onValueChange:M=>s?.(M),size:"sm",radius:"md",className:"w-[120px]"}),jsx(pe,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(pe,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&S(),a==="week"&&k(),a==="day"&&E()]})});Kb.displayName="FullCalendar";var Fs=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),ga=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),ba=["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%))"],$b=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ga({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));$b.displayName="LineChart";var Gb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,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(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));Gb.displayName="BarChart";var Ub=Z.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=ba,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Fs,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Ub.displayName="PieChart";var jb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,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(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));jb.displayName="AreaChart";var Il={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function wM({card:e,columnId:t,radius:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",Il[n]),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function Wb({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:u("flex flex-col min-w-[280px] w-[280px]",Il[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("div",{className:"flex items-center justify-between p-3 border-b",children:jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]})}),jsx(Oe,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(wM,{card:l,columnId:e.id,radius:t,renderCard:n,onCardClick:r},l.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(pe,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Xb=Z.forwardRef(({className:e,columns:t,onCardMove:n,onCardClick:r,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},m)=>{let[f,p]=Z.useState(false),[g,h]=Z.useState(null),[v,b]=Z.useState(null);Z.useEffect(()=>{p(true);},[]);let y=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Wb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(P=>P.cards.some(S=>S.id===T));return jsxs(DndContext,{sensors:y,collisionDetection:closestCorners,onDragStart:T=>{let{active:P}=T,S=x(P.id);if(S){let k=S.cards.find(E=>E.id===P.id);k&&(h(k),b(S.id));}},onDragOver:T=>{let{active:P,over:S}=T;if(!S)return;let k=P.id,E=S.id,M=x(k),N=x(E)||t.find(L=>L.id===E);if(!M||!N||M.id===N.id)return;let H=N.cards.findIndex(L=>L.id===E),D=H===-1?N.cards.length:H;n?.(k,M.id,N.id,D);},onDragEnd:T=>{let{active:P,over:S}=T;if(S&&P.id!==S.id){let k=x(P.id),E=x(S.id)||t.find(M=>M.id===S.id);if(k&&E){let M=E.cards.findIndex(H=>H.id===S.id),N=M===-1?E.cards.length:M;n?.(P.id,k.id,E.id,N);}}h(null),b(null);},children:[jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Wb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))}),jsx(DragOverlay,{children:g&&v&&jsx("div",{className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",Il[c]),children:a?a(g,v):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Xb.displayName="KanbanBoard";var qb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Zb=Z.createContext(null);function $s(){let e=Z.useContext(Zb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Qb=Z.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=CM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=Z.useState(false),[h,v]=Z.useState(false),[b,y]=Z.useState(0),[x,w]=Z.useState([]),C=Z.useCallback(k=>{k&&(y(k.selectedScrollSnap()),g(k.canScrollPrev()),v(k.canScrollNext()));},[]),R=Z.useCallback(()=>{f?.scrollPrev();},[f]),T=Z.useCallback(()=>{f?.scrollNext();},[f]),P=Z.useCallback(k=>{f?.scrollTo(k);},[f]),S=Z.useCallback(k=>{k.key==="ArrowLeft"?(k.preventDefault(),R()):k.key==="ArrowRight"&&(k.preventDefault(),T());},[R,T]);return Z.useEffect(()=>{!f||!l||l(f);},[f,l]),Z.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Zb.Provider,{value:{carouselRef:m,api:f,scrollPrev:R,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:b,scrollSnaps:x,scrollTo:P,orientation:a},children:jsxs("div",{ref:d,className:u(qb({variant:t,className:e})),onKeyDownCapture:S,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Vl,{}),jsx(Al,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((k,E)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",E===b?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>P(E),"aria-label":`Go to slide ${E+1}`},E))})]})})});Qb.displayName="Carousel";var Jb=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));Jb.displayName="CarouselContent";var ev=Z.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=$s();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});ev.displayName="CarouselItem";var Vl=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=$s();return jsxs(pe,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Vl.displayName="CarouselPrevious";var Al=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=$s();return jsxs(pe,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Al.displayName="CarouselNext";var tv=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"}}),Gs={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"}},Ol={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}"]},nv=Z.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(r.length>0?"recent":o),[m,f]=Z.useState(""),g=m?Object.values(Ol).flat().filter(v=>v.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:Ol[c]||[],h=v=>{n?.(v);};return jsxs("div",{ref:l,className:u(tv({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(so,{placeholder:"Search emojis...",value:m,onChange:v=>f(v.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx(Oe,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Gs).map(([v,{icon:b}])=>v==="recent"&&r.length===0?null:jsx("button",{className:u("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===v&&"bg-accent"),onClick:()=>d(v),title:Gs[v].name,children:b},v))})}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Gs[c].name}),jsx(Oe,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((v,b)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(v),children:v},`${v}-${b}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});nv.displayName="EmojiPicker";var rv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),tN=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"}}),nN=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"}}),it=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Cn,{children:[jsx(Tn,{children:jsx(pe,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Mn,{side:"top",className:"text-xs",children:t})]}),ov=Z.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[DM.configure({heading:{levels:[1,2,3]}}),HM.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),IM,VM.configure({types:["heading","paragraph"]}),AM.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});Z.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),Z.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,v=window.prompt("URL",h);if(v!==null){if(v===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:v}).run();}};return p?jsx(rr,{children:jsxs("div",{ref:f,className:u(rv({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(tN({size:n})),children:[jsx(it,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(it,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{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(it,{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(it,{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(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(it,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(it,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(it,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(it,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(it,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(it,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(it,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(it,{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(nN({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});ov.displayName="RichTextEditor";var sv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function dN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function av(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var iv=Z.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=Z.useRef(null),[h,v]=Z.useState(),[b,y]=Z.useState(),[x,w]=Z.useState(1),[C,R]=Z.useState(0),T=E=>{let{width:M,height:N}=E.currentTarget;if(r){let H=dN(M,N,r);v(H);}else v(m||{unit:"%",x:10,y:10,width:80,height:80});},P=E=>{v(E),o?.(E);},S=async E=>{if(y(E),a&&g.current&&E.width&&E.height){let M=await av(g.current,E,C,x);a(M);}},k=()=>{R(E=>(E+90)%360);};return Z.useEffect(()=>{b&&g.current&&a&&av(g.current,b,C,x).then(E=>{a(E);});},[x,C,b,a]),jsxs("div",{ref:p,className:u(sv({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(rN,{crop:h,onChange:P,onComplete:S,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",crossOrigin:"anonymous",onLoad:T,style:{transform:`scale(${x}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(tn,{value:[x],onValueChange:([E])=>w(E),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(pe,{variant:"bordered",size:"sm",isIconOnly:true,onClick:k,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});iv.displayName="ImageCropper";var $l=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"}}),pN={sm:96,md:128,lg:192},lv=Z.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let v=Z.useRef(null),b=o??pN[n??"md"];return Z.useImperativeHandle(h,()=>({download:(y="qrcode.png")=>{let x=v.current?.querySelector("svg");if(!x)return;let w=new XMLSerializer().serializeToString(x),C=document.createElement("canvas"),R=C.getContext("2d"),T=new Image,P=l?32:0;C.width=b+P,C.height=b+P,T.onload=()=>{if(!R)return;R.fillStyle=s==="transparent"?"#ffffff":s,R.fillRect(0,0,C.width,C.height),R.drawImage(T,0,0);let S=document.createElement("a");S.download=y.endsWith(".png")?y:`${y}.png`,S.href=C.toDataURL("image/png"),S.click();},T.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(w)));}})),r?jsx("div",{ref:v,className:u($l({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(uN,{value:r,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:v,className:u($l({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});lv.displayName="QRCode";var cv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});cv.displayName="ThemeProvider";var yN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),dv=Z.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?r==="cycle"?jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(Qt,{children:[jsx(Jt,{children:jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(en,{align:"end",children:[jsxs(Dt,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Dt,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Dt,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});dv.displayName="ThemeToggle";var uv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),mv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),pv=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"}}),fv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let v=Z.useId(),b=p||v,y=`${b}-description`,x=`${b}-error`,w=a&&r;return jsxs("div",{className:u(uv({size:s}),e),children:[t&&jsxs("label",{htmlFor:b,className:u(pv({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:b,"aria-invalid":a,"aria-describedby":w?x:n?y:void 0,"aria-required":o,className:u(mv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!w&&jsx("p",{id:y,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});fv.displayName="TextField";var bv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),CN=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-11 pl-12 pr-12 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),gv=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),TN=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),MN=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"}}),vv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:v=true,showSearchIcon:b=true,disabled:y,placeholder:x="Search...",id:w,...C},R)=>{let T=Z.useId(),P=w||T,S=`${P}-description`,k=`${P}-error`,[E,M]=Z.useState(f),N=m!==void 0?m:E,H=a&&r,D=N.length>0,L=K=>{let V=K.target.value;m===void 0&&M(V),p?.(V);},I=()=>{m===void 0&&M(""),p?.(""),g?.();},A=K=>{K.key==="Enter"?(K.preventDefault(),h?.(N)):K.key==="Escape"&&D&&(K.preventDefault(),I());};return jsxs("div",{className:u(bv({size:s}),e),children:[t&&jsxs("label",{htmlFor:P,className:u(TN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx(Search,{className:u(gv({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:R,id:P,type:"search",value:N,onChange:L,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?k:n?S:void 0,"aria-required":o,disabled:y,className:u(CN({size:s,isInvalid:a}),!b&&"pl-3",!v&&"pr-3",l),...C}),v&&D&&!y&&jsx("button",{type:"button",onClick:I,className:u(MN({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(gv({size:s}))})})]}),n&&!H&&jsx("p",{id:S,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:k,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});vv.displayName="SearchField";var hv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),kN=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),PN=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"}}),EN=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"}}),Ys={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Xl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Wl=(e,t)=>String(e).padStart(t,"0"),ya=(e,t)=>{if(!e)return "";let n=Wl(e.getDate(),2),r=Wl(e.getMonth()+1,2),o=Wl(e.getFullYear(),4),a=Ys[t],s=Xl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Yl=(e,t)=>{let n=Ys[t],r=e.split(n);if(r.length!==3)return null;let o=Xl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},SN=e=>{let t=Ys[e];return Xl[e].map(r=>r==="year"?"####":"##").join(t)},Xs=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:y="text",fullWidth:x=false,disabled:w,placeholder:C,id:R,...T},P)=>{let S=Z.useId(),k=R||S,E=`${k}-description`,M=`${k}-error`,[N,H]=Z.useState(f??null),[D,L]=Z.useState(""),[I,A]=Z.useState(false),[K,V]=Z.useState(false),F=m!==void 0?m:N,z=a&&r,G=Ys[v],j=SN(v);Z.useEffect(()=>{K||L(ya(F,v));},[F,v,K]);let O=Y=>{m===void 0&&H(Y),p?.(Y);},B=Y=>{let ve=Y??null;O(ve),L(ya(ve,v)),A(false);},_=Y=>{let ve=Y.target.value;ve=ve.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=ve.replace(new RegExp(`\\${G}`,"g"),""),oe="",Te=0;for(let me=0;me<j.length&&Te<Q.length;me++)j[me]==="#"?(oe+=Q[Te],Te++):oe+=j[me];if(L(oe),oe.length===j.length){let me=Yl(oe,v);if(me){if(g&&me<g||h&&me>h)return;O(me);}}},U=()=>{V(true);},$=()=>{V(false),D.length!==j.length?L(ya(F,v)):Yl(D,v)||L(ya(F,v));},X=()=>{w||A(true);},te=()=>{!w&&y==="picker"&&b&&A(true);};return jsxs("div",{className:u(hv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(EN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ht,{open:b&&I,onOpenChange:A,children:[jsxs(Nn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:P,id:k,type:"text",inputMode:y==="text"?"numeric":void 0,value:D,onChange:y==="text"?_:void 0,onClick:te,onFocus:U,onBlur:$,readOnly:y==="picker","aria-invalid":a,"aria-describedby":z?M:n?E:void 0,"aria-required":o,disabled:w,placeholder:C||v.toLowerCase(),className:u(kN({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),y==="picker"&&b&&"cursor-pointer",l),style:{borderColor:K||b&&I?"var(--color-foreground)":void 0},...T}),b&&jsx("button",{type:"button",onClick:X,disabled:w,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(PN({size:s}))})})]}),b&&jsx(xt,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:F??void 0,onSelect:B,disabled:Y=>!!(g&&Y<g||h&&Y>h),defaultMonth:F??void 0,showMonthAndYearPickers:true})})]}),n&&!z&&jsx("p",{id:E,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),z&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Xs.displayName="DatePicker";var LN=Xs,DN=Xs;var xv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),HN=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}}),IN=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"}}),yv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:v=false,hourCycle:b=24,disabled:y,fullWidth:x=false,id:w,...C},R)=>{let T=Z.useId(),P=w||T,S=`${P}-description`,k=`${P}-error`,E=Z.useRef(null),M=Z.useRef(null),N=Z.useRef(null),H=Z.useRef(null),[D,L]=Z.useState(f??null),I=m!==void 0?m:D,A=a&&r,K=W=>b===24?W:W===0?12:W>12?W-12:W,V=W=>W>=12?"PM":"AM",F=(W,ae)=>ae==="AM"?W===12?0:W:W===12?12:W+12,[z,G]=Z.useState(I?String(K(I.hour)).padStart(2,"0"):""),[j,O]=Z.useState(I?String(I.minute).padStart(2,"0"):""),[B,_]=Z.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[U,$]=Z.useState(I?V(I.hour):"AM"),[X,te]=Z.useState(false);Z.useEffect(()=>{m!==void 0&&(m?(G(String(K(m.hour)).padStart(2,"0")),O(String(m.minute).padStart(2,"0")),m.second!==void 0&&_(String(m.second).padStart(2,"0")),$(V(m.hour))):(G(""),O(""),_("")));},[m,b]);let Y=(W,ae,q,J)=>{let ee=parseInt(W,10),Ae=parseInt(ae,10),Le=v?parseInt(q,10):void 0;if(isNaN(ee)||isNaN(Ae)||v&&isNaN(Le)){m===void 0&&L(null),p?.(null);return}let ye={hour:b===12?F(ee,J):ee,minute:Ae,...v&&Le!==void 0&&{second:Le}};m===void 0&&L(ye),p?.(ye);},ve=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);G(ae);let q=b===24?23:12,J=b===24?0:1;if(ae.length===2){let ee=parseInt(ae,10);ee>=J&&ee<=q&&(M.current?.focus(),M.current?.select());}},Q=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);if(O(ae),ae.length===2){let q=parseInt(ae,10);q>=0&&q<=59&&(v?(N.current?.focus(),N.current?.select()):b===12&&H.current?.focus());}},oe=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);_(ae),ae.length===2&&b===12&&H.current?.focus();},Te=()=>{if(z){let W=parseInt(z,10),ae=b===24?23:12,J=Math.min(Math.max(W,b===24?0:1),ae),ee=String(J).padStart(2,"0");G(ee),Y(ee,j,B,U);}},me=()=>{if(j){let W=parseInt(j,10),ae=Math.min(Math.max(W,0),59),q=String(ae).padStart(2,"0");O(q),Y(z,q,B,U);}},Ye=()=>{if(B){let W=parseInt(B,10),ae=Math.min(Math.max(W,0),59),q=String(ae).padStart(2,"0");_(q),Y(z,j,q,U);}},Ze=()=>{let W=U==="AM"?"PM":"AM";$(W),Y(z,j,B,W);},Mt=W=>{let ae=W.key.toLowerCase();ae==="a"?(W.preventDefault(),U!=="AM"&&($("AM"),Y(z,j,B,"AM"))):ae==="p"?(W.preventDefault(),U!=="PM"&&($("PM"),Y(z,j,B,"PM"))):ae==="arrowup"||ae==="arrowdown"?(W.preventDefault(),Ze()):ae==="arrowleft"&&(W.preventDefault(),v?(N.current?.focus(),N.current?.select()):(M.current?.focus(),M.current?.select()));},Se=(W,ae)=>{if(W.key==="ArrowUp"||W.key==="ArrowDown"){W.preventDefault();let q=W.key==="ArrowUp"?1:-1;if(ae==="hour"){let J=parseInt(z,10)||0,ee=b===24?23:12,Ae=b===24?0:1,Le=J+q;Le>ee&&(Le=Ae),Le<Ae&&(Le=ee);let wn=String(Le).padStart(2,"0");G(wn),Y(wn,j,B,U);}else if(ae==="minute"){let ee=(parseInt(j,10)||0)+q;ee>59&&(ee=0),ee<0&&(ee=59);let Ae=String(ee).padStart(2,"0");O(Ae),Y(z,Ae,B,U);}else if(ae==="second"){let ee=(parseInt(B,10)||0)+q;ee>59&&(ee=0),ee<0&&(ee=59);let Ae=String(ee).padStart(2,"0");_(Ae),Y(z,j,Ae,U);}}W.key==="ArrowRight"&&(W.preventDefault(),ae==="hour"?(M.current?.focus(),M.current?.select()):ae==="minute"&&v?(N.current?.focus(),N.current?.select()):(ae==="minute"&&!v&&b===12||ae==="second"&&b===12)&&H.current?.focus()),W.key==="ArrowLeft"&&(W.preventDefault(),ae==="minute"?(E.current?.focus(),E.current?.select()):ae==="second"&&(M.current?.focus(),M.current?.select())),W.key==="Backspace"&&W.currentTarget.value===""&&(ae==="minute"?E.current?.focus():ae==="second"&&M.current?.focus());},ne=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",y&&"cursor-not-allowed");return jsxs("div",{ref:R,className:u(xv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:P,className:u(IN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(HN({size:s,isInvalid:a,disabled:y,fullWidth:x}),l),style:{borderColor:X?"var(--color-foreground)":void 0},onFocus:()=>te(true),onBlur:W=>{W.currentTarget.contains(W.relatedTarget)||te(false);},children:[jsx("input",{ref:E,id:P,type:"text",inputMode:"numeric",placeholder:b===24?"HH":"hh",value:z,onChange:ve,onBlur:Te,onKeyDown:W=>Se(W,"hour"),onFocus:W=>W.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?k:n?S:void 0,"aria-required":o,disabled:y,className:ne}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"mm",value:j,onChange:Q,onBlur:me,onKeyDown:W=>Se(W,"minute"),onFocus:W=>W.target.select(),"aria-label":"Minute",disabled:y,className:ne}),v&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:N,type:"text",inputMode:"numeric",placeholder:"ss",value:B,onChange:oe,onBlur:Ye,onKeyDown:W=>Se(W,"second"),onFocus:W=>W.target.select(),"aria-label":"Second",disabled:y,className:ne})]}),b===12&&jsx("button",{ref:H,type:"button",onClick:Ze,onKeyDown:Mt,disabled:y,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",y&&"cursor-not-allowed"),"aria-label":"AM/PM",children:U})]}),n&&!A&&jsx("p",{id:S,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:k,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});yv.displayName="TimeField";var wv=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"}}),Cv=Z.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],v={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],b={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],y=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>y(w.key,w.onPress),className: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:v),"aria-label":w.label,children:[w.icon&&jsx("span",{className:b,children:w.icon}),c&&jsx("span",{children:w.label})]},w.key);return jsxs("div",{ref:f,role:"group",className:u(wv({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(Qt,{children:[jsx(Jt,{"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",v),children:jsx(MoreHorizontal,{className:b})}),jsx(en,{align:"end",children:g.map(w=>jsxs(Dt,{disabled:w.isDisabled,onClick:()=>y(w.key,w.onPress),children:[w.icon&&jsx("span",{className:u(b,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});Cv.displayName="ActionGroup";var kv=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"}}),ON=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}}),Pv=Z.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(kv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(ON({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));Pv.displayName="StatusLight";var Ev=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"}}),Sv=Z.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let m=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Ev({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx($t,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});Sv.displayName="ActionBar";var Lv=Z.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));Lv.displayName="ActionBarButton";var Dv=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"}}),$N=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),GN=cva("block rounded-full border-2 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"},color:{primary:"border-primary",success:"border-green-500",warning:"border-yellow-500",danger:"border-red-500",custom:""}},defaultVariants:{size:"md",color:"primary"}}),Hv=Z.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=b=>String(b),trackColor:p="primary",name:g,...h},v)=>{let[b,y]=Z.useState(o),x=r!==void 0,w=x?r:b,C=Z.useRef(null),[R,T]=Z.useState(false),[P,S]=Z.useState(null),k=(O,B)=>{if(!C.current)return w[0];let _=C.current.getBoundingClientRect(),U;t==="horizontal"?U=(O-_.left)/_.width:U=1-(B-_.top)/_.height,U=Math.max(0,Math.min(1,U));let $=i+U*(l-i),X=Math.round($/c)*c;return Math.max(i,Math.min(l,X))},E=(O,B)=>{let _=[...w];_[B]=O,B===0&&O>w[1]&&(_[0]=w[1]),B===1&&O<w[0]&&(_[1]=w[0]),x||y(_),a?.(_);},M=(O,B)=>{d||(O.preventDefault(),T(true),S(B),O.target.setPointerCapture(O.pointerId));},N=O=>{if(!R||P===null||d)return;let B=k(O.clientX,O.clientY);E(B,P);},H=()=>{R&&(T(false),S(null),s?.(w));},D=O=>{if(d)return;let B=k(O.clientX,O.clientY),_=Math.abs(w[0]-B),U=Math.abs(w[1]-B),$=_<=U?0:1;E(B,$);let X=[...w];X[$]=B,s?.(X);},L=(O,B)=>{if(d)return;let _=w[B];switch(O.key){case "ArrowRight":case "ArrowUp":O.preventDefault(),_=Math.min(l,w[B]+c);break;case "ArrowLeft":case "ArrowDown":O.preventDefault(),_=Math.max(i,w[B]-c);break;case "Home":O.preventDefault(),_=i;break;case "End":O.preventDefault(),_=l;break;default:return}E(_,B);let U=[...w];U[B]=_,s?.(U);},I=O=>(O-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},K=!(p in A),V=K?"":A[p],F=K?{backgroundColor:p}:void 0,z=K?{borderColor:p}:void 0,G=K?"custom":p,j={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(w[0])}),jsx("span",{children:f(w[1])})]}),jsxs("div",{ref:v,className:u(Dv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u($N({orientation:t,size:n})),onClick:D,children:jsx("div",{className:u("absolute rounded-full",V,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${I(w[0])}%`,right:`${100-I(w[1])}%`,top:0,bottom:0,...F}:{bottom:`${I(w[0])}%`,top:`${100-I(w[1])}%`,left:0,right:0,...F}})}),w.map((O,B)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":O,"aria-orientation":t||void 0,"aria-disabled":d,className:u(GN({size:n,color:G}),R&&P===B&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${I(O)}% - ${j/2}px)`,top:"50%",transform:"translateY(-50%)",...z}:{position:"absolute",bottom:`calc(${I(O)}% - ${j/2}px)`,left:"50%",transform:"translateX(-50%)",...z},onPointerDown:_=>M(_,B),onPointerMove:N,onPointerUp:H,onPointerCancel:H,onKeyDown:_=>L(_,B)},B)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});Hv.displayName="RangeSlider";var tc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),YN=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),XN={help:HelpCircle,info:Info,warning:AlertCircle},Av=Z.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=Z.useState(false),[v,b]=Z.useState(false),[y,x]=Z.useState({top:0,left:0}),w=Z.useRef(null),C=Z.useRef(null),R=i!==void 0?i:g,T=Z.useCallback(E=>{i===void 0&&h(E),l?.(E);},[i,l]);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!R||!w.current)return;let E=()=>{let M=w.current.getBoundingClientRect(),N=C.current?.getBoundingClientRect(),H=N?.width||288,D=N?.height||100,L=8,I=0,A=0;switch(a){case "top":I=M.top-D-L,A=M.left+M.width/2-H/2;break;case "bottom":I=M.bottom+L,A=M.left+M.width/2-H/2;break;case "left":I=M.top+M.height/2-D/2,A=M.left-H-L;break;case "right":I=M.top+M.height/2-D/2,A=M.right+L;break}if(a==="top"||a==="bottom")switch(s){case "start":A=M.left;break;case "center":A=M.left+M.width/2-H/2;break;case "end":A=M.right-H;break}if(a==="left"||a==="right")switch(s){case "start":I=M.top;break;case "center":I=M.top+M.height/2-D/2;break;case "end":I=M.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),I=Math.max(8,Math.min(I,window.innerHeight-D-8)),x({top:I,left:A});};return E(),requestAnimationFrame(E),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true);}},[R,a,s]),Z.useEffect(()=>{if(!R)return;let E=M=>{C.current&&!C.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&T(false);};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[R,T]),Z.useEffect(()=>{if(!R)return;let E=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[R,T]);let P=XN[e??"help"],S=()=>{T(!R);},k=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?Z.isValidElement(o)?Z.cloneElement(o,{ref:w,onClick:E=>{o.props.onClick?.(E),S();}}):jsx("button",{ref:w,type:"button",onClick:S,className:u(tc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},type:"button",onClick:S,className:u(tc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(P,{className:"h-full w-full"})}),v&&R&&Wa.createPortal(jsxs("div",{ref:C,className:u(YN({size:t}),f),style:{position:"fixed",top:y.top,left:y.left,transformOrigin:k()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Av.displayName="ContextualHelp";var Ov=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),nc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Bv({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,v]=Z.useState(new Set),b=Z.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),y=R=>{if(s==="none")return;let T;s==="single"?T=b.has(R)?new Set:new Set([R]):(T=new Set(b),T.has(R)?T.delete(R):T.add(R)),a||v(T),i?.(T);},x=(R,T)=>{T.stopPropagation(),c?.(R);},w=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u(Ov({spacing:t}),e),...g,children:[w.map(R=>{let T=b.has(R.key),P=s!=="none";return jsxs("span",{role:P?"button":void 0,tabIndex:P&&!R.isDisabled?0:void 0,"aria-pressed":P?T:void 0,onClick:()=>!R.isDisabled&&y(R.key),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&!R.isDisabled&&(S.preventDefault(),y(R.key));},style:R.color?{backgroundColor:R.color}:void 0,className:u(nc({variant:R.color?void 0:n,size:r,isSelected:T,isDisabled:R.isDisabled}),P&&!R.isDisabled&&"cursor-pointer hover:opacity-80",R.color&&"text-white"),children:[R.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:R.icon}),R.label,l&&!R.isDisabled&&jsx("button",{type:"button",onClick:S=>x(R.key,S),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${R.label}`,children:jsx(X,{className:"h-3 w-3"})})]},R.key)}),C>0&&jsxs("span",{className:u(nc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Bv.displayName="TagGroup";var $v=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"}}),Gv=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 Uv({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=Z.useState(new Set),h=Z.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),v=b=>{if(a==="none")return;let y;a==="single"?y=h.has(b)?new Set:new Set([b]):(y=new Set(h),y.has(b)?y.delete(b):y.add(b)),o||g(y),s?.(y);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u($v({columns:t,gap:n,className:e})),...f,children:r.map(b=>{let y=h.has(b.key);return d?jsx("div",{role:"gridcell","aria-selected":y,onClick:()=>v(b.key),children:d(b,y)},b.key):jsxs("div",{role:"gridcell","aria-selected":y,"aria-disabled":b.isDisabled,onClick:()=>!b.isDisabled&&v(b.key),className:u(Gv({variant:l,size:c,isSelected:y,isDisabled:b.isDisabled})),children:[i&&a!=="none"&&y&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),b.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:b.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:b.label}),b.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:b.description})]})]},b.key)})})}Uv.displayName="GridList";var jv=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"}}),ri=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},_v=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},Wv=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},Yv=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Xv=Z.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=Z.useRef(null),[g,h]=Z.useState(false),v=Z.useCallback(V=>{let F=Wv(V);return F?_v(...F):[0,1,1]},[]),[b,y]=Z.useState(()=>v(r||o)),x=e??b[0],w=t??b[1],C=n??b[2];Z.useEffect(()=>{if(r){let V=v(r);y(V);}},[r,v]);let R=Z.useCallback((V,F)=>{if(l||!p.current)return;let z=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-z.left)/z.width)),j=Math.max(0,Math.min(1,(F-z.top)/z.height)),O=G,B=1-j;t===void 0&&n===void 0&&y([x,O,B]),a?.({hue:x,saturation:O,brightness:B});let _=ri(x,O,B);s?.(Yv(..._));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),R(V.clientX,V.clientY));},P=V=>{g&&R(V.clientX,V.clientY);},S=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[k,E,M]=ri(x,1,1),N=`rgb(${k}, ${E}, ${M})`,H=w*100,D=(1-C)*100,[L,I,A]=ri(x,w,C),K=`rgb(${L}, ${I}, ${A})`;return jsx("div",{ref:f,className:u(jv({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:N},onPointerDown:T,onPointerMove:P,onPointerUp:S,onPointerLeave:S,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${c/2}px)`,backgroundColor:K,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Xv.displayName="ColorArea";var Zv=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"}}),nk=`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")`,qv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Qv=Z.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=Z.useRef(null),[g,h]=Z.useState(false),v=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[b,y]=Z.useState(t??v()),x=e??b,w=r==="hue"?x/360:x,C=Z.useCallback((N,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),L=a!=="vertical",I;L?I=Math.max(0,Math.min(1,(N-D.left)/D.width)):I=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?I*360:I;e===void 0&&y(A),n?.(A);},[i,a,r,e,n]),R=N=>{i||(N.preventDefault(),h(true),N.target.setPointerCapture(N.pointerId),C(N.clientX,N.clientY));},T=N=>{g&&C(N.clientX,N.clientY);},P=N=>{h(false),N.target.releasePointerCapture(N.pointerId);},S=()=>{let N=a!=="vertical",H=N?"to right":"to top";switch(r){case "hue":return N?qv:"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 qv}},k=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,E=a!=="vertical",M=w*100;return jsx("div",{ref:f,className:u(Zv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?nk:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:R,onPointerMove:T,onPointerUp:P,onPointerLeave:P,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:S()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...E?{left:`calc(${M}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:k(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Qv.displayName="ColorSlider";var Jv=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"}}),ak=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},eh=Z.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=Z.useRef(null),[f,p]=Z.useState(false),[g,h]=Z.useState(t),v=e??g,b=Z.useCallback((R,T)=>{if(o||!m.current)return;let P=m.current.getBoundingClientRect(),S=P.width/2,k=R-P.left,E=T-P.top,M=ak(k,E,S);e===void 0&&h(M),n?.(M);},[o,e,n]),y=R=>{o||(R.preventDefault(),p(true),R.target.setPointerCapture(R.pointerId),b(R.clientX,R.clientY));},x=R=>{f&&b(R.clientX,R.clientY);},w=R=>{p(false),R.target.releasePointerCapture(R.pointerId);},C=()=>{let R=[];for(let T=0;T<=360;T+=30)R.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${R.join(", ")})`};return jsx("div",{ref:d,className:u(Jv({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:y,onPointerMove:x,onPointerUp:w,onPointerLeave:w,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(sk,{hue:v,innerRadius:a,thumbSize:s})]})})});eh.displayName="ColorWheel";var sk=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var rh=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-9 text-xs",md:"h-10 text-sm",lg:"h-11 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Do=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"}}),oh=Z.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:v,placeholder:b="Search...",disabled:y,...x},w)=>{let[C,R]=Z.useState(false),[T,P]=Z.useState(t),S=e!==void 0?e:T,k=Z.useRef(null);Z.useImperativeHandle(w,()=>k.current);let E=S.length>0,M=C&&(a.length>0||s.length>0||l.length>0||E),N=V=>{e===void 0&&P(V),n?.(V);},H=()=>{N(""),k.current?.focus();},D=V=>{V?.preventDefault(),S.trim()&&(r?.(S.trim()),R(false));},L=V=>{N(V.label),o?.(V),R(false);},I=V=>{N(V),r?.(V),R(false);},A=V=>{N(V),r?.(V),R(false);},K=Z.useMemo(()=>{let V={};return a.forEach(F=>{let z=F.category||"Results";V[z]||(V[z]=[]),V[z].push(F);}),V},[a]);return jsxs(ht,{open:M,onOpenChange:R,children:[jsx(Nn,{children:jsxs("form",{onSubmit:D,className:u(rh({size:g,variant:h}),v),children:[m&&jsx(Search,{className:u(Do({size:g}),"ml-3")}),jsx("input",{ref:k,type:"text",value:S,onChange:V=>N(V.target.value),onFocus:()=>R(true),placeholder:b,disabled:y,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...x}),d&&E&&!y&&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",Do({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(xt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:V=>V.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!E&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((V,F)=>jsxs("button",{type:"button",onClick:()=>I(V),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(Do({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:u(Do({size:g}),"opacity-0 group-hover:opacity-100")})]},F))]}),l.length>0&&!E&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((V,F)=>jsxs("button",{type:"button",onClick:()=>A(V),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(Do({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},F))]}),E&&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(K).map(([V,F])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),F.map(z=>jsxs("button",{type:"button",onClick:()=>L(z),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[z.icon||jsx(Search,{className:u(Do({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:z.label}),z.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:z.description})]})]},z.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});oh.displayName="SearchBar";var ah={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"})},lh=Z.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=Z.useState(""),g=Z.useRef(null),[h,v]=Z.useState(false);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{e||p("");},[e]),Z.useEffect(()=>{if(!e)return;let R=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[e,t]),Z.useEffect(()=>{if(e)return ln(),()=>cn()},[e]);let b=Z.useMemo(()=>{let R={};return n.forEach(T=>{let P=T.category||"Results";R[P]||(R[P]=[]),R[P].push(T);}),R},[n]),y=R=>{R.onSelect?.(),c?.(R),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:x}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(R=>jsxs(Command.Item,{value:R.label,onSelect:()=>y(R),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:R.icon||ah[R.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:R.label}),R.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:R.description})]}),R.shortcut&&jsx("div",{className:"flex items-center gap-1",children:R.shortcut.map((T,P)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},P))})]},R.id))]}),w&&Object.entries(b).map(([R,T])=>jsxs(Command.Group,{heading:R,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:R}),T.map(P=>jsxs(Command.Item,{value:`${P.label} ${P.keywords?.join(" ")||""}`,onSelect:()=>y(P),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:P.icon||ah[R]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:P.label}),P.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:P.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},P.id))]},R)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});lh.displayName="SpotlightSearch";function yk(e="k"){let[t,n]=Z.useState(false);return Z.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var ch=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"}}),kk={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},dh=Z.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,v]=Z.useState(true),[b,y]=Z.useState(false);Z.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&v(false);},[m]),Z.useEffect(()=>{if(d&&h){let R=setTimeout(()=>{x();},d);return ()=>clearTimeout(R)}},[d,h]);let x=()=>{y(true),setTimeout(()=>{v(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let w=kk[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(ch({variant:n,type:t,position:l}),c&&"animate-pulse",b&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:x,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});dh.displayName="Banner";var wa=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),Sk=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"}}),sc=Z.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},v)=>{let[b,y]=Z.useState(false),x=o&&o.length>0,w=S=>{x&&y(!b),p?.(S);},C=S=>{S.onClick?.(),y(false);},R={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},T=l==="rotate"&&b?"rotate-45":"",P=l==="scale"&&b?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&wa({position:m})),children:[x&&b&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",R[a].container),children:o.map((S,k)=>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:`${k*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:S.label}),S.href?jsx("a",{href:S.href,className:u(wa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.icon}):jsx("button",{type:"button",onClick:()=>C(S),className:u(wa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:S.label})]},S.id))}),jsxs("button",{ref:v,type:"button",onClick:w,disabled:g,className:u(wa({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":x?b:void 0,...h,children:[b&&i?i:jsx("span",{className:u(Sk({size:d}),T,P,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&b&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>y(false)})]})});sc.displayName="FloatingActionButton";var Lk=sc;var gh=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"}}),mh=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),bh=Z.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[m,f]=Z.useState(a||r[0]?.key),p=o!==void 0,g=p?o:m,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},v=x=>t==="filled"?x?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":x?"text-primary":"text-muted-foreground hover:text-foreground",b=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},y=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(gh({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let w=g===x.key,C=i==="all"||i==="active"&&w,R=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:u(mh({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,w)},x.key);let T=jsxs("div",{onClick:()=>!x.href&&h(x),className:u(mh({variant:t}),v(w),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":w?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(b(),"[&>svg]:h-full [&>svg]:w-full"),children:R}),x.badge!==void 0&&x.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:x.badge>99?"99+":x.badge}),x.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&x.label&&jsx("span",{className:u(y(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",v(w)),children:T},x.key):T})})});bh.displayName="BottomNavigation";var Hk="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",hh=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"}}),xh=Z.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:Hk,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(hh({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})})})]})]})]})});xh.displayName="ActionSheet";var Rh=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),lc=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"}}),wh=Z.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=Z.useRef(null),[p,g]=Z.useState(0),[h,v]=Z.useState(false),b=Z.useRef(0),y=Z.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=k=>{i||(v(true),b.current=k.touches[0].clientX,y.current=p);},R=k=>{if(!h||i)return;let M=k.touches[0].clientX-b.current,N=y.current+M;(N>0&&n.length===0||N<0&&r.length===0)&&(N=0),N>x?N=x+(N-x)*.3:N<-w&&(N=-w+(N+w)*.3),g(N);},T=()=>{if(!h)return;v(false);let k=f.current?.offsetWidth||0,E=Math.abs(p)/k;if(l&&E>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},P=(k,E)=>{k.onAction?.(),s?.(E,k.key),g(0);},S=()=>{g(0);};return jsxs("div",{ref:m,className:u(Rh({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(k=>jsxs("button",{type:"button",onClick:()=>P(k,"right"),className:u(lc({variant:k.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(k=>jsxs("button",{type:"button",onClick:()=>P(k,"left"),className:u(lc({variant:k.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:R,onTouchEnd:T,onClick:p!==0?S:void 0,children:c})]})});wh.displayName="SwipeActions";var Th=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),Ak=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"}}),Mh=Z.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=Z.useRef(null),[v,b]=Z.useState(0),[y,x]=Z.useState("idle"),w=Z.useRef(0),C=Z.useRef(false),R=()=>l||y==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=M=>{R()&&(w.current=M.touches[0].clientY,C.current=true);},P=M=>{if(!C.current||!R())return;let H=M.touches[0].clientY-w.current;if(H<0){b(0),x("idle");return}let L=Math.min(H*.5,o);b(L),x(L>=r?"ready":"pulling");},S=async()=>{if(C.current)if(C.current=false,y==="ready"){x("refreshing"),b(r*.6);try{await n();}finally{x("idle"),b(0);}}else x("idle"),b(0);},k={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],E=()=>{if(y==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(k,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let M=Math.min(v/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(k,"text-muted-foreground transition-transform"),style:{transform:`rotate(${M}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:y==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(Th({variant:t,className:e})),...p,children:[jsx("div",{className:u(Ak({size:i}),"z-10",y==="idle"&&v===0&&"opacity-0"),style:{top:Math.max(v-60,-60),opacity:Math.min(v/(r*.5),1)},children:E()}),jsx("div",{ref:h,className:u("transition-transform duration-200",y==="refreshing"&&"ease-out"),style:{transform:`translateY(${v}px)`,transition:C.current?"none":void 0},onTouchStart:T,onTouchMove:P,onTouchEnd:S,children:f})]})});Mh.displayName="PullToRefresh";var Zr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),zk={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},Nh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:zk,custom:i,transition:Zr(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});Nh.displayName="Fade";var Ok=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},kh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=Z.useMemo(()=>Ok(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Zr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});kh.displayName="Slide";var Bk={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"},Fk={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Ph=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:Fk,custom:i,transition:Zr(n,r,o),className:u(a),style:{transformOrigin:Bk[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Ph.displayName="Scale";var Eh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Zr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Eh.displayName="Collapse";var Sh=Z.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Zr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Sh.displayName="Expand";var Lh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Zr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Lh.displayName="Rotate";var Dh=Z.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:r?180:0},transition:Zr(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})]})})});Dh.displayName="Flip";var Hh=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,v=Math.max(p.width,p.height)*2,b={id:Date.now(),x:g,y:h,size:v};i(y=>[...y,b]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});Hh.displayName="Ripple";var Ih=Z.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Ih.displayName="Bounce";var Gk={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Vh=Z.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:Gk[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Vh.displayName="Shake";var Uk={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Ah=Z.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&Uk[n],r),children:e}));Ah.displayName="Pulse";var zh=Z.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});zh.displayName="Wiggle";var Oh=Z.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=Z.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});Oh.displayName="Pop";var qk=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Bh=Z.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=Z.useRef(null),g=useInView(p,{once:true}),[h,v]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let x=setTimeout(()=>v(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let b=useMotionValue(t),y=useTransform(b,x=>qk(x,r,s,i));return Z.useEffect(()=>{if(h){let x=animate(b,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>x.stop()}},[h,e,n,b,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:y}),a]})})});Bh.displayName="Counter";var Fh=Z.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=Z.useState(""),[v,b]=Z.useState(0),[y,x]=Z.useState(false),[w,C]=Z.useState(false),R=Z.useRef(null),T=useInView(R,{once:true}),[P,S]=Z.useState(!l);return Z.useEffect(()=>{if(l&&T){let k=setTimeout(()=>S(true),n*1e3);return ()=>clearTimeout(k)}},[l,T,n]),Z.useEffect(()=>{if(!P||w)return;let k=p[v],E;return y?g.length>0?E=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),b(M=>(M+1)%p.length)):g.length<k.length?E=setTimeout(()=>{h(k.slice(0,g.length+1));},t):v<p.length-1||s?E=setTimeout(()=>{x(true);},r):(C(true),m?.()),()=>clearTimeout(E)},[P,g,v,y,w,p,t,i,r,s,m]),jsxs("span",{ref:R,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})]})});Fh.displayName="Typewriter";var Kh=Z.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=Z.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},v={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((b,y)=>jsxs(motion.span,{variants:v,className:"inline-block",children:[b,a==="word"&&y<p.length-1&&"\xA0"]},y))})})});Kh.displayName="TextReveal";var $h=Z.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});$h.displayName="WordRotate";var _h=Z.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=Z.useRef(null),g=useInView(p,{once:a,amount:s}),v={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],b={hidden:{opacity:0,x:v.x,y:v.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:b,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});_h.displayName="ScrollReveal";var Wh=Z.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",v=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:v,backgroundColor:n}}),i&&jsx(Qk,{progress:f,position:e})]})});Wh.displayName="ScrollProgress";var Qk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=Z.useState(0);return Z.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},Yh=Z.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=Z.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});Yh.displayName="Parallax";var Zh=Z.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
|
|
55
|
+
`,document.body.appendChild(ee),q.dataTransfer.setDragImage(ee,20,15),setTimeout(()=>{document.body.removeChild(ee);},0),h(e),C?.({event:q,node:e});},me=q=>{if(q.preventDefault(),q.stopPropagation(),!g||g.key===e.key||X)return;let J=q.currentTarget.getBoundingClientRect(),ee=q.clientY-J.top,Ae=J.height,Le;ee<Ae*.25?Le=-1:ee>Ae*.75?Le=1:Le=0,!(w&&!w({dropNode:e,dropPosition:Le,dragNode:g}))&&(y(e.key,Le),R?.({event:q,node:e}));},Ye=q=>{q.preventDefault(),q.stopPropagation(),!(!g||g.key===e.key)&&T?.({event:q,node:e,expandedKeys:F()});},Ze=q=>{q.stopPropagation(),P?.({event:q,node:e});},Mt=q=>{q.preventDefault(),q.stopPropagation(),!(!g||g.key===e.key||X)&&(b!==null&&x(e,b),h(null),y(null,null));},Se=q=>{h(null),y(null,null),S?.({event:q,node:e});},at=q=>{X||te&&i(e.key,e,q);},ne=q=>{q.stopPropagation(),!X&&!G&&a(e.key,e);},W=Z.useMemo(()=>{if(!$||b===null)return "";switch(b){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[$,b]),ae=[...r,n];return jsxs("div",{className:"relative",children:[k&&t>0&&jsxs(Fragment,{children:[r.map((q,J)=>!q&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${J} * var(--tree-indent) + 12px)`,top:0,bottom:0}},J)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":G?void 0:j,"aria-selected":te?O:void 0,"aria-disabled":X,draggable:ve,onDragStart:Te,onDragOver:me,onDragEnter:Ye,onDragLeave:Ze,onDrop:Mt,onDragEnd:Se,onClick:at,className:u("relative",Gg({size:V,isSelected:O,isDragging:U,isDisabled:X,isHoverable:te&&!X}),W,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[ve&&M&&Q!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Q}),jsx("button",{type:"button",onClick:ne,className:u("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",G&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:u("h-4 w-4 transition-transform duration-200",j&&"rotate-90")})}),Y&&jsx(OC,{checked:B,indeterminate:_,disabled:X,onClick:q=>m(e.key,e,q)}),E&&oe&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:oe}),jsx("div",{className:u("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),z&&j&&jsx("div",{role:"group",children:e.children.map((q,J)=>jsx(jg,{node:q,level:t+1,isLast:J===e.children.length-1,parentIsLastPath:ae},q.key))})]})},BC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},FC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},_g=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||_g(n,t))return true;return false},Wg=Z.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:m=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:v=false,checkedKeys:b,defaultCheckedKeys:y=[],onCheck:x,showLine:w=false,showIcon:C=false,showHandle:R=true,dragIcon:T,icon:P,leafIcon:S=jsx(File,{className:"h-4 w-4"}),folderIcon:k=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:E=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:M,onDragEnter:N,onDragOver:H,onDragLeave:D,onDragEnd:L,onDrop:I,blockNode:A=false,disabled:K=false,...V},F)=>{let z=Z.useCallback(()=>l?new Set(BC(r)):new Set(i),[l,i,r]),[G,j]=Z.useState(z),O=s!==void 0,B=O?new Set(s):G,_=Z.useCallback((ye,Qe)=>{let Ft=new Set(B),Ge=!Ft.has(ye);Ge?Ft.add(ye):Ft.delete(ye),O||j(Ft),c?.(Array.from(Ft),{expanded:Ge,node:Qe});},[B,O,c]),[U,$]=Z.useState(new Set(p)),X=f!==void 0,te=X?new Set(f):U,Y=Z.useCallback((ye,Qe,Ft)=>{let Ge=new Set(te),se=!Ge.has(ye);m?se?Ge.add(ye):Ge.delete(ye):(Ge.clear(),se&&Ge.add(ye)),X||$(Ge);let Re=[],kr=Da=>{for(let eo of Da)Ge.has(eo.key)&&Re.push(eo),eo.children&&kr(eo.children);};kr(r),g?.(Array.from(Ge),{selected:se,selectedNodes:Re,node:Qe,event:Ft});},[te,m,X,g,r]),[ve,Q]=Z.useState(new Set(y)),[oe,Te]=Z.useState(new Set),me=b!==void 0,Ye=me?new Set(Array.isArray(b)?b:b.checked):ve,Ze=me&&!Array.isArray(b)?new Set(b.halfChecked):oe,Mt=Z.useCallback((ye,Qe,Ft)=>{let Ge=new Set(Ye),se=new Set(Ze),Re=!Ge.has(ye);if(Re?(Ge.add(ye),se.delete(ye)):Ge.delete(ye),!v&&Qe.children){let yi=FC(Qe);for(let tr of yi)Re?(Ge.add(tr),se.delete(tr)):Ge.delete(tr);}me||(Q(Ge),Te(se));let kr=[],Da=yi=>{for(let tr of yi)Ge.has(tr.key)&&kr.push(tr),tr.children&&Da(tr.children);};Da(r);let eo=v?{checked:Array.from(Ge),halfChecked:Array.from(se)}:Array.from(Ge);x?.(eo,{checked:Re,checkedNodes:kr,node:Qe,event:Ft,halfCheckedKeys:Array.from(se)});},[Ye,Ze,v,me,x,r]),[Se,at]=Z.useState(null),[ne,W]=Z.useState(null),[ae,q]=Z.useState(null),J=Z.useCallback((ye,Qe)=>{W(ye),q(Qe);},[]),ee=Z.useCallback((ye,Qe)=>{!Se||!I||Qe===0&&_g(Se,ye.key)||I({event:{},node:ye,dragNode:Se,dropPosition:Qe,dropToGap:Qe!==0});},[Se,I]),Ae=Z.useCallback(()=>Array.from(B),[B]),Le={expandedKeys:B,toggleExpand:_,selectedKeys:te,handleSelect:Y,selectable:d,multiple:m,checkedKeys:Ye,halfCheckedKeys:Ze,handleCheck:Mt,checkable:h,checkStrictly:v,draggable:o,draggedNode:Se,setDraggedNode:at,dragOverKey:ne,dragOverPosition:ae,setDragOver:J,handleDrop:ee,allowDrop:a,onDragStart:M,onDragEnter:N,onDragOver:H,onDragLeave:D,onDragEnd:L,showLine:w,showIcon:C,showHandle:R,dragIcon:T,icon:P,leafIcon:S,folderIcon:k,folderOpenIcon:E,blockNode:A,disabled:K,size:n,data:r,getAllKeys:Ae},wn=ye=>{let Qe=ye.relatedTarget,Ft=ye.currentTarget;(!Qe||!Ft.contains(Qe))&&J(null,null);};return jsx(Ug.Provider,{value:Le,children:jsx("div",{ref:F,role:"tree","aria-multiselectable":m||h,className:u($g({variant:t,size:n,className:e})),onDragLeave:wn,...V,children:r.map((ye,Qe)=>jsx(jg,{node:ye,level:0,isLast:Qe===r.length-1},ye.key))})})});Wg.displayName="Tree";var Xg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),_C=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},WC=(e,t)=>{let[n,r]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},qg=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:m="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:v=true,fullWidth:b=false,disabled:y,...x},w)=>{let[C,R]=Z.useState(false),[T,P]=Z.useState(r),[S,k]=Z.useState([]),[E,M]=Z.useState(false),[N,H]=Z.useState(false),[D,L]=Z.useState(0),I=Z.useRef(null),A=Z.useRef(null),K=n!==void 0?n:T,V=WC(K,l);Z.useEffect(()=>{let Y=A.current;if(!Y)return;let ve=()=>{L(Y.offsetWidth);};ve();let Q=new ResizeObserver(ve);return Q.observe(Y),()=>{Q.disconnect();}},[]),Z.useImperativeHandle(w,()=>I.current);let F=i?S:s,z=Z.useMemo(()=>i?F:F.filter(Y=>Y.label.toLowerCase().includes(K.toLowerCase())),[F,K,i]);Z.useEffect(()=>{if(!i)return;if(V.length<c){k([]);return}let Y=false;return (async()=>{M(true);try{let Q=await i(V);Y||k(Q);}catch{Y||k([]);}finally{Y||M(false);}})(),()=>{Y=true;}},[V,i,c]);let G=Y=>{n===void 0&&P(Y),o?.(Y);},j=Y=>{let ve=Y.target.value;G(ve),ve.length>=c&&R(true);},O=Y=>{G(Y.label),a?.(Y),R(false);},B=()=>{G(""),I.current?.focus();},_=()=>{H(true),R(true);},U=()=>{H(false);},$=Y=>{Y.key==="Escape"&&R(false),Y.key==="ArrowDown"&&!C&&z.length>0&&R(true);},X$1=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",te=p&&K?"pr-8":"pr-3";return jsxs(ht,{open:C,onOpenChange:R,children:[jsxs(Nn,{ref:A,className:u("relative",b?"w-full":"w-fit"),children:[jsx("input",{ref:I,type:"text",value:K,onChange:j,onFocus:_,onBlur:U,onKeyDown:$,disabled:y,placeholder:d,className:u(Xg({size:t,fullWidth:b}),te,e),style:{borderColor:N?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&K&&!y&&jsx("button",{type:"button",onClick:B,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:X$1})})]}),jsx(xt,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:Y=>Y.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(Oe,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:E?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:u(X$1,"animate-spin")}),f]}):z.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):z.map(Y=>jsxs(Command.Item,{value:Y.value,disabled:Y.disabled,onSelect:()=>O(Y),className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:u("mr-2 h-4 w-4 shrink-0",K===Y.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:v?jsx(_C,{text:Y.label,query:K}):Y.label})]},Y.value))})})})})]})});qg.displayName="Autocomplete";var bl=Z.createContext(null),vl=Z.createContext(null),hl=()=>{let e=Z.useContext(bl);if(!e)throw new Error("useFormContext must be used within a Form");return e},Ms=()=>{let e=Z.useContext(vl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},YC={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},Zg=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[m,f]=Z.useState({}),[p,g]=Z.useState({}),[h,v]=Z.useState({}),[b,y]=Z.useState(false),x=Z.useRef(new Map),w=Z.useCallback((D,L)=>{x.current.set(D,L);},[]),C=Z.useCallback(D=>{x.current.delete(D);},[]),R=Z.useCallback(D=>{let L=x.current.get(D)||[],I=c[D];for(let A of L)if(!A.validate(I))return f(K=>({...K,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),T=Z.useCallback(()=>{let D=true,L={};return x.current.forEach((I,A)=>{let K=c[A];for(let V of I)if(!V.validate(K)){L[A]=V.message,D=false;break}L[A]||(L[A]=null);}),f(L),D},[c]),P=Z.useCallback((D,L)=>{d(I=>({...I,[D]:L})),v(I=>({...I,[D]:true})),o&&setTimeout(()=>{R(D);},0);},[o,R]),S=Z.useCallback((D,L)=>{f(I=>({...I,[D]:L}));},[]),k=Z.useCallback((D,L)=>{g(I=>({...I,[D]:L})),L&&r&&R(D);},[r,R]),E=Z.useCallback(D=>({value:c[D],error:m[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,m,p,h]),M=Z.useCallback(()=>{d(e),f({}),g({}),v({});},[e]),N=async D=>{D.preventDefault();let L={};if(x.current.forEach((A,K)=>{L[K]=true;}),g(L),!T()){n?.(m);return}if(t){y(true);try{await t(c);}finally{y(false);}}},H={values:c,errors:m,touched:p,dirty:h,isSubmitting:b,setValue:P,setError:S,setTouched:k,validateField:R,validateAll:T,registerField:w,unregisterField:C,getFieldState:E,reset:M};return jsx(bl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:N,className:u("space-y-4",s),...i,children:a})})});Zg.displayName="Form";var Qg=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=hl(),a=Z.useId();Z.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(vl.Provider,{value:i,children:r})};Qg.displayName="FormField";var Jg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("space-y-1.5",e),...t}));Jg.displayName="FormItem";var eb=Z.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Ms();return jsxs(Lr,{ref:o,htmlFor:a,className:u(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});eb.displayName="FormLabel";var tb=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Ms(),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 Z.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};tb.displayName="FormControl";var nb=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:u("text-xs text-muted-foreground",e),...t}));nb.displayName="FormDescription";var rb=Z.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=Ms(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:u("text-xs text-danger",e),role:"alert",...n,children:i}):null});rb.displayName="FormMessage";var ab=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"}}),sb=Z.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:u(ab({size:t,className:e})),...i,children:[jsxs(Dr,{"data-user-avatar":true,children:[o&&jsx(io,{src:o,alt:n}),jsx(Hr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});sb.displayName="User";var lb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),cb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:u(lb({variant:t,size:n,radius:r,className:e})),...o}));cb.displayName="Code";function pb(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var fb=Z.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=pb(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:u("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((b,y)=>jsxs("div",{...h({line:b}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:y+1}),b.map((x,w)=>jsx("span",{...v({token:x})},w))]},y))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});fb.displayName="CodeBlock";var gb=Z.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=pb(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},m=e[o],f=m.language||"bash";return jsxs("div",{ref:r,className:u("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:u("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:m.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((v,b)=>jsx("div",{...g({line:v}),children:v.map((y,x)=>jsx("span",{...h({token:y})},x))},b))})}),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"})})]})]})});gb.displayName="TabbedCodeBlock";var bb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900 border-transparent",bordered:"bg-transparent border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-white",flat:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white border-transparent"},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:"flat",size:"md"}}),vb=Z.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[m,f]=Z.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:u(bb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:u("flex-shrink-0 rounded p-1 transition-colors cursor-pointer","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"})})]})});vb.displayName="Snippet";var wl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),hb=Z.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...m},f)=>{let[p,g]=Z.useState("loading");Z.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},v=()=>{g("error"),i?.();},b={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(Ka,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:v,className:u("h-full w-full transition-opacity duration-300",b,p==="loading"?"opacity-0":"opacity-100"),...m})]})});hb.displayName="Image";var yb=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"}}),Rb=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 iT({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,m]=Z.useState(null),[f,p]=Z.useState(null),g=(x,w)=>{i||(m(w),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(w)));},h=(x,w)=>{x.preventDefault(),!(i||d===null||d===w)&&p(w);},v=()=>{p(null);},b=(x,w)=>{if(x.preventDefault(),i||d===null||d===w){m(null),p(null);return}let C=[...r],[R]=C.splice(d,1);C.splice(w,0,R),o?.(C),m(null),p(null);},y=()=>{m(null),p(null);};return jsx("div",{ref:c,className:u(yb({variant:t,size:n,className:e})),...l,children:r.map((x,w)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,w),onDragOver:C=>h(C,w),onDragLeave:v,onDrop:C=>b(C,w),onDragEnd:y,className:u(Rb({variant:t,size:n,isDragging:d===w,isDragOver:f===w}),!i&&"cursor-move"),children:[s&&jsx("div",{className:u("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(x,w)})]},x.id))})}var lT=Z.forwardRef(iT);var Mb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{variant:"spinner",size:"md"}}),wb={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},mT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Cb={primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger",muted:"text-muted-foreground"},Nb=Z.forwardRef(({className:e,variant:t="spinner",size:n="md",text:r,color:o="primary",...a},s)=>{let i=o in Cb,l=i?Cb[o]:"",c=i?void 0:{color:o},d=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",style:c,children:[0,1,2].map(m=>jsx("div",{className:u(mT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${m*.15}s`}},m))});case "pulse":return jsx("div",{className:u(wb[n||"md"],"animate-pulse rounded-full bg-current",l),style:c});default:return jsx(Loader2,{className:u(wb[n||"md"],"animate-spin",l),style:c})}};return jsx("div",{ref:s,className:u(Mb({variant:t,size:n,className:e})),role:"status","aria-label":r||"Loading",...a,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[d(),r&&jsx("span",{className:u("text-sm",l),style:c,children:r})]})})});Nb.displayName="Loading";var gT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),bT=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),vT=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"}}),hT=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"}}),Hs={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Tl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Cl=(e,t)=>String(e).padStart(t,"0"),kb=(e,t)=>{if(!e)return "";let n=Cl(e.getDate(),2),r=Cl(e.getMonth()+1,2),o=Cl(e.getFullYear(),4),a=Hs[t],s=Tl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ss=(e,t)=>{let n=Hs[t],r=e.split(n);if(r.length!==3)return null;let o=Tl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},xT=e=>{let t=Hs[e];return Tl[e].map(r=>r==="year"?"####":"##").join(t)},ua=(e,t)=>{if(!e?.from)return "";let n=kb(e.from,t),r=e.to?kb(e.to,t):"";return n&&r?`${n} - ${r}`:n},Pb=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:y="text",fullWidth:x=false,numberOfMonths:w=2,align:C="start",disabled:R,placeholder:T,id:P,...S},k)=>{let E=Z.useId(),M=P||E,N=`${M}-description`,H=`${M}-error`,[D,L]=Z.useState(f),[I,A]=Z.useState(""),[K,V]=Z.useState(false),[F,z]=Z.useState(false),G=m!==void 0?m:D,j=a&&r,O=xT(v),B=Hs[v],_=" - ";Z.useEffect(()=>{F||A(ua(G,v));},[G,v,F]);let U=oe=>{m===void 0&&L(oe),p?.(oe);},$=oe=>{U(oe),A(ua(oe,v)),oe?.from&&oe?.to&&V(false);},X=oe=>{let Te=oe.target.value;Te=Te.replace(new RegExp(`[^0-9\\${B}\\s-]`,"g"),"");let me=`${O}${_}${O}`,Ye=Te.replace(new RegExp(`[\\${B}\\s-]`,"g"),""),Ze="",Mt=0;for(let Se=0;Se<me.length&&Mt<Ye.length;Se++)me[Se]==="#"?(Ze+=Ye[Mt],Mt++):Ze+=me[Se];if(A(Ze),Ze.length===me.length){let Se=Ze.split(_);if(Se.length===2){let at=Ss(Se[0].trim(),v),ne=Ss(Se[1].trim(),v);if(at&&ne){if(g&&(at<g||ne<g)||h&&(at>h||ne>h))return;at<=ne&&U({from:at,to:ne});}}}},te=()=>{z(true);},Y=()=>{z(false);let oe=`${O}${_}${O}`;if(I.length!==oe.length)A(ua(G,v));else {let Te=I.split(_);if(Te.length!==2)A(ua(G,v));else {let me=Ss(Te[0].trim(),v),Ye=Ss(Te[1].trim(),v);(!me||!Ye||me>Ye)&&A(ua(G,v));}}},ve=()=>{R||V(true);},Q=()=>{!R&&y==="picker"&&b&&V(true);};return jsxs("div",{className:u(gT({size:s}),e),children:[t&&jsxs("label",{htmlFor:M,className:u(hT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ht,{open:b&&K,onOpenChange:V,children:[jsxs(Nn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:M,type:"text",inputMode:y==="text"?"numeric":void 0,value:I,onChange:y==="text"?X:void 0,onClick:Q,onFocus:te,onBlur:Y,readOnly:y==="picker","aria-invalid":a,"aria-describedby":j?H:n?N:void 0,"aria-required":o,disabled:R,placeholder:T||`${v.toLowerCase()} - ${v.toLowerCase()}`,className:u(bT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),y==="picker"&&b&&"cursor-pointer",l),style:{borderColor:F||b&&K?"var(--color-foreground)":void 0},...S}),b&&jsx("button",{type:"button",onClick:ve,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(vT({size:s}))})})]}),b&&jsx(xt,{className:"w-auto p-0",align:C,children:jsx(lo,{mode:"range",selected:G,onSelect:$,numberOfMonths:w,disabled:oe=>!!(g&&oe<g||h&&oe>h),defaultMonth:G?.from,showMonthAndYearPickers:true})})]}),n&&!j&&jsx("p",{id:N,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),j&&jsx("p",{id:H,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Pb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),Eb=Z.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=Z.useState(false),d=r?Array.from({length:24},(x,w)=>w):Array.from({length:12},(x,w)=>w+1),m=Array.from({length:Math.floor(60/o)},(x,w)=>w*o),f=x=>{if(!x)return n;if(r)return `${ho(x.hours)}:${ho(x.minutes)}`;let w=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${ho(w)}:${ho(x.minutes)} ${C}`},p=x=>{let w=e?.minutes??0,C=x;if(!r&&e){let R=e.hours>=12;R&&x!==12?C=x+12:!R&&x===12&&(C=0);}t?.({hours:C,minutes:w});},g=x=>{let w=e?.hours??0;t?.({hours:w,minutes:x});},h=x=>{if(!e)return;let w=e.hours;x==="AM"&&e.hours>=12?w=e.hours-12:x==="PM"&&e.hours<12&&(w=e.hours+12),t?.({hours:w,minutes:e.minutes});},v=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},b=e?e.hours>=12?"PM":"AM":void 0,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(ht,{open:l,onOpenChange:c,children:[jsxs(or,{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(xt,{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(Oe,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(pe,{variant:y===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:ho(x)},x))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(Oe,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:m.map(x=>jsx(pe,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:ho(x)},x))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(pe,{variant:b==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(pe,{variant:b==="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(pe,{variant:"ghost",size:"sm",onClick:v,children:"Now"}),jsx(pe,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Eb.displayName="TimePicker";var Sb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function wT({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},m){let f=Z.useRef(null),[p,g]=Z.useState(0);Z.useImperativeHandle(m,()=>f.current);let h=n.length*(r+l)-l,v=r+l,b=Math.max(0,Math.floor(p/v)-a),y=Math.ceil(o/v)+2*a,x=Math.min(n.length-1,b+y),w=R=>{let T=R.currentTarget.scrollTop;g(T),c?.(T);},C=Z.useMemo(()=>{let R=[];for(let T=b;T<=x;T++)n[T]!==void 0&&R.push({item:n[T],index:T,style:{position:"absolute",top:T*v,left:0,right:0,height:r}});return R},[n,b,x,v,r]);return jsx("div",{ref:f,className:u(Sb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:w,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:R,index:T,style:P})=>jsx("div",{style:P,children:s(R,T)},i?i(R,T):T))})})}var CT=Z.forwardRef(wT);var Nl=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),kl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Db=Z.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:m,scrollbarVisibility:f="visible",...p},g)=>{let h=Z.useRef(null),v=Z.useRef(null),b=Z.useRef(false);Z.useImperativeHandle(g,()=>h.current),Z.useEffect(()=>{let w=v.current;if(!w)return;let C=new IntersectionObserver(R=>{let[T]=R;T.isIntersecting&&a&&!s&&!b.current&&(b.current=true,Promise.resolve(o()).finally(()=>{b.current=false;}));},{root:d?null:h.current,rootMargin:c||`${l}px`,threshold:0});return C.observe(w),()=>{C.disconnect();}},[a,s,o,l,c,d]);let y=jsx("div",{className:u(kl({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),x=jsxs(Fragment,{children:[r,jsx("div",{ref:v,className:"h-px w-full"}),s&&(i||y),!a&&!s&&m&&jsx("div",{className:u(kl({size:n}),"text-muted-foreground text-sm"),children:m})]});return d?jsx("div",{ref:h,className:u(Nl({variant:t,className:e})),...p,children:x}):jsx(Oe,{ref:h,visibility:f,className:u(Nl({variant:t,className:e})),...p,children:x})});Db.displayName="InfiniteScroll";var AT=e=>e.map(t=>typeof t=="string"?{src:t}:t),Pl=Z.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:m=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let v=Z.useMemo(()=>AT(e),[e]),[b,y]=Z.useState(r),[x,w]=Z.useState(1),[C,R]=Z.useState(0),[T,P]=Z.useState(false),[S,k]=Z.useState(false),[E,M]=Z.useState({x:0,y:0}),[N,H]=Z.useState({x:0,y:0}),[D,L]=Z.useState(false),I=Z.useRef(null),A=v[b];Z.useEffect(()=>{L(true);},[]),Z.useEffect(()=>{y(r);},[r]),Z.useEffect(()=>{o?.(b);},[b,o]),Z.useEffect(()=>{w(1),R(0),M({x:0,y:0});},[b]),Z.useEffect(()=>{if(t)return ln(),()=>cn()},[t]);let K=Z.useCallback(()=>{y(Q=>Q>0?Q-1:v.length-1);},[v.length]),V=Z.useCallback(()=>{y(Q=>Q<v.length-1?Q+1:0);},[v.length]),F=()=>{w(Q=>Math.min(Q+.5,4));},z=()=>{w(Q=>{let oe=Math.max(Q-.5,.5);return oe===1&&M({x:0,y:0}),oe});},G=()=>{R(Q=>(Q+90)%360);},j=async()=>{if(A)try{let oe=await(await fetch(A.src)).blob(),Te=URL.createObjectURL(oe),me=document.createElement("a");me.href=Te,me.download=A.alt||`image-${b+1}`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Te);}catch{window.open(A.src,"_blank");}},O=async()=>{if(I.current)if(T)try{await document.exitFullscreen(),P(!1);}catch{}else try{await I.current.requestFullscreen(),P(!0);}catch{}},B=Q=>{x>1&&(k(true),H({x:Q.clientX-E.x,y:Q.clientY-E.y}));},_=Q=>{S&&x>1&&M({x:Q.clientX-N.x,y:Q.clientY-N.y});},U=()=>{k(false);},$=()=>{n?.(false);},X$1=Q=>{p&&Q.target===Q.currentTarget&&$();},te=Z.useCallback(Q=>{switch(Q.key){case "ArrowLeft":K();break;case "ArrowRight":V();break;case "Escape":n?.(false);break;case "+":case "=":F();break;case "-":z();break}},[K,V,n]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[t,te]),Z.useEffect(()=>{let Q=()=>{P(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Q),()=>document.removeEventListener("fullscreenchange",Q)},[]),v.length===0)return null;let Y=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:Q=>{a.props.onClick?.(Q),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[Y,!D||!t?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:X$1}),jsxs("div",{ref:h,className: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&&v.length>1&&jsxs("span",{className:"text-sm",children:[b+1," / ",v.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:z,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(x*100),"%"]}),jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:G,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:j,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:O,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:T?"Exit fullscreen":"Fullscreen",children:T?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:I,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:B,onMouseMove:_,onMouseUp:U,onMouseLeave:U,children:[m&&v.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:K,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:V,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:u("max-h-full max-w-full object-contain transition-transform duration-200",S?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${E.x}px, ${E.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&v.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:v.map((Q,oe)=>jsx("button",{onClick:()=>y(oe),className:u("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",b===oe?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Q.src,alt:Q.alt||`Thumbnail ${oe+1}`,className:"h-full w-full object-cover"})},oe))})]})]}),document.body)]})});Pl.displayName="ImageViewer";var Ib=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=Z.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:u("cursor-zoom-in",r),children:e}),jsx(Pl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Ib.displayName="ImageViewerTrigger";var Vb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),OT={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"},BT={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"},FT=e=>{let t=e.toLowerCase();return OT[t]||e.toUpperCase()},pa=e=>{let t=e.toLowerCase();return BT[t]||t},Vs=e=>{let t=pa(e);return ["meta","control","alt","shift"].includes(t)},Ab=Z.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!r||s)return;let m=Array.isArray(r)?r:[r],f=m.filter(Vs).map(pa),p=m.filter(h=>!Vs(h)).map(pa),g=h=>{let v=f.includes("meta")===h.metaKey,b=f.includes("control")===h.ctrlKey,y=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,w=p.length===0||p.includes(h.key.toLowerCase());v&&b&&y&&x&&w&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(Z.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:FT(f)})]},p)):o;return jsx("kbd",{ref:c,className:u(Vb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Ab.displayName="Kbd";function KT(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;Z.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Vs).map(pa),i=a.filter(c=>!Vs(c)).map(pa),l=c=>{let d=s.includes("meta")===c.metaKey,m=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&m&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var zb=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"}}),Ob=Z.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,m]=Z.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),m(!0),o?.(),setTimeout(()=>{m(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:u(zb({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}})})});Ob.displayName="CopyButton";var Fb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),XT=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],qT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function QT(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function JT(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Bb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ro(r,t)||Ro(o,t)||r<t&&o>t})}var Kb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=XT,date:l,onDateChange:c,onEventClick:d,onSlotClick:m,weekStartsOn:f=0,locale:p="en-US",...g},h)=>{let[v,b]=Z.useState(new Date),y=l??v,x=M=>{c?c(M):b(M);},w=f===1?ZT:qT,C=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()-1):a==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),x(M);},R=()=>{let M=new Date(y);a==="month"?M.setMonth(M.getMonth()+1):a==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),x(M);},T=()=>{x(new Date);},P=()=>a==="day"?y.toLocaleDateString(p,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):y.toLocaleDateString(p,{year:"numeric",month:"long"}),S=()=>{let M=QT(y.getFullYear(),y.getMonth(),f);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:w.map(N=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:N},N))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((N,H)=>{let D=Bb(o,N),L=N.getMonth()===y.getMonth(),I=Ro(N,y);return jsxs("div",{className:u("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!L&&"bg-muted/30",I&&"bg-accent"),onClick:()=>m?.(N),children:[jsx("div",{className:u("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(N)&&"bg-primary text-primary-foreground",!L&&"text-muted-foreground"),children:N.getDate()}),jsxs("div",{className:"space-y-0.5",children:[D.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:K=>{K.stopPropagation(),d?.(A);},children:A.title},A.id)),D.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",D.length-3," more"]})]})]},H)})})]})},k=()=>{let M=JT(y,f),N=Array.from({length:24},(H,D)=>D);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((H,D)=>{let L=Ro(H,y);return jsxs("div",{className:u("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(H)&&"bg-primary/10",L&&!yo(H)&&"bg-accent"),onClick:()=>m?.(H),children:[jsx("div",{className:"text-xs text-muted-foreground",children:w[D]}),jsx("div",{className:u("text-lg font-semibold",yo(H)&&"text-primary",L&&!yo(H)&&"text-primary"),children:H.getDate()})]},D)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:N.map(H=>jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),M.map((D,L)=>{let I=new Date(D);I.setHours(H,0,0,0);let A=o.filter(K=>{let V=new Date(K.start);return Ro(V,D)&&V.getHours()===H});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(I),children:A.map(K=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:K.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),d?.(K);},children:K.title},K.id))},L)})]},H))})})]})},E=()=>{let M=Array.from({length:24},(H,D)=>D),N=Bb(o,y);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:u("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",yo(y)&&"bg-primary text-primary-foreground"),children:y.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(H=>{let D=new Date(y);D.setHours(H,0,0,0);let L=N.filter(I=>new Date(I.start).getHours()===H);return jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[H.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>m?.(D),children:L.map(I=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:I.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(I);},children:I.title},I.id))})]},H)})})})]})};return jsxs("div",{ref:h,className:u(Fb({variant:t,size:n,radius:r,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:P()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(pe,{variant:"bordered",size:"sm",radius:"md",onClick:T,children:"Today"}),jsx(Ua,{options:i,value:a,onValueChange:M=>s?.(M),size:"sm",radius:"md",className:"w-[120px]"}),jsx(pe,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:C,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(pe,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:R,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&S(),a==="week"&&k(),a==="day"&&E()]})});Kb.displayName="FullCalendar";var Fs=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),ga=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),ba=["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%))"],$b=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},m)=>jsx("div",{ref:m,className:u(ga({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));$b.displayName="LineChart";var Gb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,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(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));Gb.displayName="BarChart";var Ub=Z.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=ba,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...m},f)=>jsx("div",{ref:f,className:u(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Fs,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Ub.displayName="PieChart";var jb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ba,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(ga({size:t,className:e})),...m,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Fs,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));jb.displayName="AreaChart";var Il={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function wM({card:e,columnId:t,radius:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),m={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:m,className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",Il[n]),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function Wb({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:u("flex flex-col min-w-[280px] w-[280px]",Il[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("div",{className:"flex items-center justify-between p-3 border-b",children:jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]})}),jsx(Oe,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(wM,{card:l,columnId:e.id,radius:t,renderCard:n,onCardClick:r},l.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(pe,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Xb=Z.forwardRef(({className:e,columns:t,onCardMove:n,onCardClick:r,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},m)=>{let[f,p]=Z.useState(false),[g,h]=Z.useState(null),[v,b]=Z.useState(null);Z.useEffect(()=>{p(true);},[]);let y=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!f)return jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Wb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))});let x=T=>t.find(P=>P.cards.some(S=>S.id===T));return jsxs(DndContext,{sensors:y,collisionDetection:closestCorners,onDragStart:T=>{let{active:P}=T,S=x(P.id);if(S){let k=S.cards.find(E=>E.id===P.id);k&&(h(k),b(S.id));}},onDragOver:T=>{let{active:P,over:S}=T;if(!S)return;let k=P.id,E=S.id,M=x(k),N=x(E)||t.find(L=>L.id===E);if(!M||!N||M.id===N.id)return;let H=N.cards.findIndex(L=>L.id===E),D=H===-1?N.cards.length:H;n?.(k,M.id,N.id,D);},onDragEnd:T=>{let{active:P,over:S}=T;if(S&&P.id!==S.id){let k=x(P.id),E=x(S.id)||t.find(M=>M.id===S.id);if(k&&E){let M=E.cards.findIndex(H=>H.id===S.id),N=M===-1?E.cards.length:M;n?.(P.id,k.id,E.id,N);}}h(null),b(null);},children:[jsx("div",{ref:m,className:u("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(T=>jsx(Wb,{column:T,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},T.id))}),jsx(DragOverlay,{children:g&&v&&jsx("div",{className:u("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",Il[c]),children:a?a(g,v):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Xb.displayName="KanbanBoard";var qb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Zb=Z.createContext(null);function $s(){let e=Z.useContext(Zb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var Qb=Z.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[m,f]=CM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=Z.useState(false),[h,v]=Z.useState(false),[b,y]=Z.useState(0),[x,w]=Z.useState([]),C=Z.useCallback(k=>{k&&(y(k.selectedScrollSnap()),g(k.canScrollPrev()),v(k.canScrollNext()));},[]),R=Z.useCallback(()=>{f?.scrollPrev();},[f]),T=Z.useCallback(()=>{f?.scrollNext();},[f]),P=Z.useCallback(k=>{f?.scrollTo(k);},[f]),S=Z.useCallback(k=>{k.key==="ArrowLeft"?(k.preventDefault(),R()):k.key==="ArrowRight"&&(k.preventDefault(),T());},[R,T]);return Z.useEffect(()=>{!f||!l||l(f);},[f,l]),Z.useEffect(()=>{if(f)return w(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(Zb.Provider,{value:{carouselRef:m,api:f,scrollPrev:R,scrollNext:T,canScrollPrev:p,canScrollNext:h,selectedIndex:b,scrollSnaps:x,scrollTo:P,orientation:a},children:jsxs("div",{ref:d,className:u(qb({variant:t,className:e})),onKeyDownCapture:S,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:m,className:"overflow-hidden",children:jsx("div",{className:u("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Vl,{}),jsx(Al,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((k,E)=>jsx("button",{className:u("w-2 h-2 rounded-full transition-all",E===b?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>P(E),"aria-label":`Go to slide ${E+1}`},E))})]})})});Qb.displayName="Carousel";var Jb=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:u("flex",e),...t}));Jb.displayName="CarouselContent";var ev=Z.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=$s();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:u("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});ev.displayName="CarouselItem";var Vl=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=$s();return jsxs(pe,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Vl.displayName="CarouselPrevious";var Al=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=$s();return jsxs(pe,{ref:a,variant:t,size:n,isIconOnly:r,className:u("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Al.displayName="CarouselNext";var tv=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"}}),Gs={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"}},Ol={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}"]},nv=Z.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(r.length>0?"recent":o),[m,f]=Z.useState(""),g=m?Object.values(Ol).flat().filter(v=>v.toLowerCase().includes(m.toLowerCase())):c==="recent"?r:Ol[c]||[],h=v=>{n?.(v);};return jsxs("div",{ref:l,className:u(tv({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(so,{placeholder:"Search emojis...",value:m,onChange:v=>f(v.target.value),className:"pl-8 h-8"})]})}),s&&!m&&jsx(Oe,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Gs).map(([v,{icon:b}])=>v==="recent"&&r.length===0?null:jsx("button",{className:u("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===v&&"bg-accent"),onClick:()=>d(v),title:Gs[v].name,children:b},v))})}),!m&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Gs[c].name}),jsx(Oe,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((v,b)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(v),children:v},`${v}-${b}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});nv.displayName="EmojiPicker";var rv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),tN=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"}}),nN=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"}}),it=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(Cn,{children:[jsx(Tn,{children:jsx(pe,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Mn,{side:"top",className:"text-xs",children:t})]}),ov=Z.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...m},f)=>{let p=useEditor({extensions:[DM.configure({heading:{levels:[1,2,3]}}),HM.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),IM,VM.configure({types:["heading","paragraph"]}),AM.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});Z.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),Z.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,v=window.prompt("URL",h);if(v!==null){if(v===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:v}).run();}};return p?jsx(rr,{children:jsxs("div",{ref:f,className:u(rv({variant:t,size:n,className:e})),...m,children:[i&&!s&&jsxs("div",{className:u(tN({size:n})),children:[jsx(it,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(it,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{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(it,{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(it,{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(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(it,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(it,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(it,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(it,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(it,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(it,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(it,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(nr,{orientation:"vertical",className:"h-6 mx-1"}),jsx(it,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(it,{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(nN({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});ov.displayName="RichTextEditor";var sv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function dN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function av(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,m=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(m),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var iv=Z.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:m,...f},p)=>{let g=Z.useRef(null),[h,v]=Z.useState(),[b,y]=Z.useState(),[x,w]=Z.useState(1),[C,R]=Z.useState(0),T=E=>{let{width:M,height:N}=E.currentTarget;if(r){let H=dN(M,N,r);v(H);}else v(m||{unit:"%",x:10,y:10,width:80,height:80});},P=E=>{v(E),o?.(E);},S=async E=>{if(y(E),a&&g.current&&E.width&&E.height){let M=await av(g.current,E,C,x);a(M);}},k=()=>{R(E=>(E+90)%360);};return Z.useEffect(()=>{b&&g.current&&a&&av(g.current,b,C,x).then(E=>{a(E);});},[x,C,b,a]),jsxs("div",{ref:p,className:u(sv({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(rN,{crop:h,onChange:P,onComplete:S,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",crossOrigin:"anonymous",onLoad:T,style:{transform:`scale(${x}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(tn,{value:[x],onValueChange:([E])=>w(E),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(pe,{variant:"bordered",size:"sm",isIconOnly:true,onClick:k,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});iv.displayName="ImageCropper";var $l=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"}}),pN={sm:96,md:128,lg:192},lv=Z.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:m=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let v=Z.useRef(null),b=o??pN[n??"md"];return Z.useImperativeHandle(h,()=>({download:(y="qrcode.png")=>{let x=v.current?.querySelector("svg");if(!x)return;let w=new XMLSerializer().serializeToString(x),C=document.createElement("canvas"),R=C.getContext("2d"),T=new Image,P=l?32:0;C.width=b+P,C.height=b+P,T.onload=()=>{if(!R)return;R.fillStyle=s==="transparent"?"#ffffff":s,R.fillRect(0,0,C.width,C.height),R.drawImage(T,0,0);let S=document.createElement("a");S.download=y.endsWith(".png")?y:`${y}.png`,S.href=C.toDataURL("image/png"),S.click();},T.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(w)));}})),r?jsx("div",{ref:v,className:u($l({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(uN,{value:r,size:b,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:m,height:m,objectFit:"contain"}})})]})}):jsx("div",{ref:v,className:u($l({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:b,height:b},children:"No data"})})});lv.displayName="QRCode";var cv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});cv.displayName="ThemeProvider";var yN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),dv=Z.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.useEffect(()=>{c(true);},[]);let d=()=>{let m=["light","dark","system"],p=(m.indexOf(a||"system")+1)%m.length;s(m[p]);};return l?r==="cycle"?jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(Qt,{children:[jsx(Jt,{children:jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(en,{align:"end",children:[jsxs(Dt,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Dt,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Dt,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(pe,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});dv.displayName="ThemeToggle";var uv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),mv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),pv=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"}}),fv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:m,endContent:f,id:p,...g},h)=>{let v=Z.useId(),b=p||v,y=`${b}-description`,x=`${b}-error`,w=a&&r;return jsxs("div",{className:u(uv({size:s}),e),children:[t&&jsxs("label",{htmlFor:b,className:u(pv({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:b,"aria-invalid":a,"aria-describedby":w?x:n?y:void 0,"aria-required":o,className:u(mv({size:s,isInvalid:a}),m&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!w&&jsx("p",{id:y,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),w&&jsx("p",{id:x,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});fv.displayName="TextField";var bv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),CN=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-11 pl-12 pr-12 py-2.5 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),gv=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),TN=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),MN=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"}}),vv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:v=true,showSearchIcon:b=true,disabled:y,placeholder:x="Search...",id:w,...C},R)=>{let T=Z.useId(),P=w||T,S=`${P}-description`,k=`${P}-error`,[E,M]=Z.useState(f),N=m!==void 0?m:E,H=a&&r,D=N.length>0,L=K=>{let V=K.target.value;m===void 0&&M(V),p?.(V);},I=()=>{m===void 0&&M(""),p?.(""),g?.();},A=K=>{K.key==="Enter"?(K.preventDefault(),h?.(N)):K.key==="Escape"&&D&&(K.preventDefault(),I());};return jsxs("div",{className:u(bv({size:s}),e),children:[t&&jsxs("label",{htmlFor:P,className:u(TN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx(Search,{className:u(gv({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:R,id:P,type:"search",value:N,onChange:L,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?k:n?S:void 0,"aria-required":o,disabled:y,className:u(CN({size:s,isInvalid:a}),!b&&"pl-3",!v&&"pr-3",l),...C}),v&&D&&!y&&jsx("button",{type:"button",onClick:I,className:u(MN({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:u(gv({size:s}))})})]}),n&&!H&&jsx("p",{id:S,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:k,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});vv.displayName="SearchField";var hv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),kN=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),PN=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"}}),EN=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"}}),Ys={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Xl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Wl=(e,t)=>String(e).padStart(t,"0"),ya=(e,t)=>{if(!e)return "";let n=Wl(e.getDate(),2),r=Wl(e.getMonth()+1,2),o=Wl(e.getFullYear(),4),a=Ys[t],s=Xl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Yl=(e,t)=>{let n=Ys[t],r=e.split(n);if(r.length!==3)return null;let o=Xl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},SN=e=>{let t=Ys[e];return Xl[e].map(r=>r==="year"?"####":"##").join(t)},Xs=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:y="text",fullWidth:x=false,disabled:w,placeholder:C,id:R,...T},P)=>{let S=Z.useId(),k=R||S,E=`${k}-description`,M=`${k}-error`,[N,H]=Z.useState(f??null),[D,L]=Z.useState(""),[I,A]=Z.useState(false),[K,V]=Z.useState(false),F=m!==void 0?m:N,z=a&&r,G=Ys[v],j=SN(v);Z.useEffect(()=>{K||L(ya(F,v));},[F,v,K]);let O=Y=>{m===void 0&&H(Y),p?.(Y);},B=Y=>{let ve=Y??null;O(ve),L(ya(ve,v)),A(false);},_=Y=>{let ve=Y.target.value;ve=ve.replace(new RegExp(`[^0-9\\${G}]`,"g"),"");let Q=ve.replace(new RegExp(`\\${G}`,"g"),""),oe="",Te=0;for(let me=0;me<j.length&&Te<Q.length;me++)j[me]==="#"?(oe+=Q[Te],Te++):oe+=j[me];if(L(oe),oe.length===j.length){let me=Yl(oe,v);if(me){if(g&&me<g||h&&me>h)return;O(me);}}},U=()=>{V(true);},$=()=>{V(false),D.length!==j.length?L(ya(F,v)):Yl(D,v)||L(ya(F,v));},X=()=>{w||A(true);},te=()=>{!w&&y==="picker"&&b&&A(true);};return jsxs("div",{className:u(hv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:u(EN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ht,{open:b&&I,onOpenChange:A,children:[jsxs(Nn,{className:u("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:P,id:k,type:"text",inputMode:y==="text"?"numeric":void 0,value:D,onChange:y==="text"?_:void 0,onClick:te,onFocus:U,onBlur:$,readOnly:y==="picker","aria-invalid":a,"aria-describedby":z?M:n?E:void 0,"aria-required":o,disabled:w,placeholder:C||v.toLowerCase(),className:u(kN({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),y==="picker"&&b&&"cursor-pointer",l),style:{borderColor:K||b&&I?"var(--color-foreground)":void 0},...T}),b&&jsx("button",{type:"button",onClick:X,disabled:w,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:u(PN({size:s}))})})]}),b&&jsx(xt,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:F??void 0,onSelect:B,disabled:Y=>!!(g&&Y<g||h&&Y>h),defaultMonth:F??void 0,showMonthAndYearPickers:true})})]}),n&&!z&&jsx("p",{id:E,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),z&&jsx("p",{id:M,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Xs.displayName="DatePicker";var LN=Xs,DN=Xs;var xv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),HN=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}}),IN=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"}}),yv=Z.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:m,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:v=false,hourCycle:b=24,disabled:y,fullWidth:x=false,id:w,...C},R)=>{let T=Z.useId(),P=w||T,S=`${P}-description`,k=`${P}-error`,E=Z.useRef(null),M=Z.useRef(null),N=Z.useRef(null),H=Z.useRef(null),[D,L]=Z.useState(f??null),I=m!==void 0?m:D,A=a&&r,K=W=>b===24?W:W===0?12:W>12?W-12:W,V=W=>W>=12?"PM":"AM",F=(W,ae)=>ae==="AM"?W===12?0:W:W===12?12:W+12,[z,G]=Z.useState(I?String(K(I.hour)).padStart(2,"0"):""),[j,O]=Z.useState(I?String(I.minute).padStart(2,"0"):""),[B,_]=Z.useState(I?.second!==void 0?String(I.second).padStart(2,"0"):""),[U,$]=Z.useState(I?V(I.hour):"AM"),[X,te]=Z.useState(false);Z.useEffect(()=>{m!==void 0&&(m?(G(String(K(m.hour)).padStart(2,"0")),O(String(m.minute).padStart(2,"0")),m.second!==void 0&&_(String(m.second).padStart(2,"0")),$(V(m.hour))):(G(""),O(""),_("")));},[m,b]);let Y=(W,ae,q,J)=>{let ee=parseInt(W,10),Ae=parseInt(ae,10),Le=v?parseInt(q,10):void 0;if(isNaN(ee)||isNaN(Ae)||v&&isNaN(Le)){m===void 0&&L(null),p?.(null);return}let ye={hour:b===12?F(ee,J):ee,minute:Ae,...v&&Le!==void 0&&{second:Le}};m===void 0&&L(ye),p?.(ye);},ve=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);G(ae);let q=b===24?23:12,J=b===24?0:1;if(ae.length===2){let ee=parseInt(ae,10);ee>=J&&ee<=q&&(M.current?.focus(),M.current?.select());}},Q=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);if(O(ae),ae.length===2){let q=parseInt(ae,10);q>=0&&q<=59&&(v?(N.current?.focus(),N.current?.select()):b===12&&H.current?.focus());}},oe=W=>{let ae=W.target.value.replace(/\D/g,"").slice(0,2);_(ae),ae.length===2&&b===12&&H.current?.focus();},Te=()=>{if(z){let W=parseInt(z,10),ae=b===24?23:12,J=Math.min(Math.max(W,b===24?0:1),ae),ee=String(J).padStart(2,"0");G(ee),Y(ee,j,B,U);}},me=()=>{if(j){let W=parseInt(j,10),ae=Math.min(Math.max(W,0),59),q=String(ae).padStart(2,"0");O(q),Y(z,q,B,U);}},Ye=()=>{if(B){let W=parseInt(B,10),ae=Math.min(Math.max(W,0),59),q=String(ae).padStart(2,"0");_(q),Y(z,j,q,U);}},Ze=()=>{let W=U==="AM"?"PM":"AM";$(W),Y(z,j,B,W);},Mt=W=>{let ae=W.key.toLowerCase();ae==="a"?(W.preventDefault(),U!=="AM"&&($("AM"),Y(z,j,B,"AM"))):ae==="p"?(W.preventDefault(),U!=="PM"&&($("PM"),Y(z,j,B,"PM"))):ae==="arrowup"||ae==="arrowdown"?(W.preventDefault(),Ze()):ae==="arrowleft"&&(W.preventDefault(),v?(N.current?.focus(),N.current?.select()):(M.current?.focus(),M.current?.select()));},Se=(W,ae)=>{if(W.key==="ArrowUp"||W.key==="ArrowDown"){W.preventDefault();let q=W.key==="ArrowUp"?1:-1;if(ae==="hour"){let J=parseInt(z,10)||0,ee=b===24?23:12,Ae=b===24?0:1,Le=J+q;Le>ee&&(Le=Ae),Le<Ae&&(Le=ee);let wn=String(Le).padStart(2,"0");G(wn),Y(wn,j,B,U);}else if(ae==="minute"){let ee=(parseInt(j,10)||0)+q;ee>59&&(ee=0),ee<0&&(ee=59);let Ae=String(ee).padStart(2,"0");O(Ae),Y(z,Ae,B,U);}else if(ae==="second"){let ee=(parseInt(B,10)||0)+q;ee>59&&(ee=0),ee<0&&(ee=59);let Ae=String(ee).padStart(2,"0");_(Ae),Y(z,j,Ae,U);}}W.key==="ArrowRight"&&(W.preventDefault(),ae==="hour"?(M.current?.focus(),M.current?.select()):ae==="minute"&&v?(N.current?.focus(),N.current?.select()):(ae==="minute"&&!v&&b===12||ae==="second"&&b===12)&&H.current?.focus()),W.key==="ArrowLeft"&&(W.preventDefault(),ae==="minute"?(E.current?.focus(),E.current?.select()):ae==="second"&&(M.current?.focus(),M.current?.select())),W.key==="Backspace"&&W.currentTarget.value===""&&(ae==="minute"?E.current?.focus():ae==="second"&&M.current?.focus());},ne=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",y&&"cursor-not-allowed");return jsxs("div",{ref:R,className:u(xv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:P,className:u(IN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:u(HN({size:s,isInvalid:a,disabled:y,fullWidth:x}),l),style:{borderColor:X?"var(--color-foreground)":void 0},onFocus:()=>te(true),onBlur:W=>{W.currentTarget.contains(W.relatedTarget)||te(false);},children:[jsx("input",{ref:E,id:P,type:"text",inputMode:"numeric",placeholder:b===24?"HH":"hh",value:z,onChange:ve,onBlur:Te,onKeyDown:W=>Se(W,"hour"),onFocus:W=>W.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?k:n?S:void 0,"aria-required":o,disabled:y,className:ne}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:M,type:"text",inputMode:"numeric",placeholder:"mm",value:j,onChange:Q,onBlur:me,onKeyDown:W=>Se(W,"minute"),onFocus:W=>W.target.select(),"aria-label":"Minute",disabled:y,className:ne}),v&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:N,type:"text",inputMode:"numeric",placeholder:"ss",value:B,onChange:oe,onBlur:Ye,onKeyDown:W=>Se(W,"second"),onFocus:W=>W.target.select(),"aria-label":"Second",disabled:y,className:ne})]}),b===12&&jsx("button",{ref:H,type:"button",onClick:Ze,onKeyDown:Mt,disabled:y,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",y&&"cursor-not-allowed"),"aria-label":"AM/PM",children:U})]}),n&&!A&&jsx("p",{id:S,className:u("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:k,role:"alert",className:u("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});yv.displayName="TimeField";var wv=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"}}),Cv=Z.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...m},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],v={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],b={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],y=(w,C)=>{C&&C(),l&&l(w);},x=w=>jsxs("button",{type:"button",disabled:i||w.isDisabled,onClick:()=>y(w.key,w.onPress),className: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:v),"aria-label":w.label,children:[w.icon&&jsx("span",{className:b,children:w.icon}),c&&jsx("span",{children:w.label})]},w.key);return jsxs("div",{ref:f,role:"group",className:u(wv({variant:t,orientation:n,size:r,density:o,className:e})),...m,children:[p.map(w=>d?d(w):x(w)),g.length>0&&jsxs(Qt,{children:[jsx(Jt,{"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",v),children:jsx(MoreHorizontal,{className:b})}),jsx(en,{align:"end",children:g.map(w=>jsxs(Dt,{disabled:w.isDisabled,onClick:()=>y(w.key,w.onPress),children:[w.icon&&jsx("span",{className:u(b,"mr-2"),children:w.icon}),w.label]},w.key))})]})]})});Cv.displayName="ActionGroup";var kv=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"}}),ON=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}}),Pv=Z.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:u(kv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:u(ON({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));Pv.displayName="StatusLight";var Ev=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"}}),Sv=Z.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let m=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:u(Ev({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:m()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx($t,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});Sv.displayName="ActionBar";var Lv=Z.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:u("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));Lv.displayName="ActionBarButton";var Dv=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"}}),$N=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),GN=cva("block rounded-full border-2 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"},color:{primary:"border-primary",success:"border-green-500",warning:"border-yellow-500",danger:"border-red-500",custom:""}},defaultVariants:{size:"md",color:"primary"}}),Hv=Z.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:m=false,formatLabel:f=b=>String(b),trackColor:p="primary",name:g,...h},v)=>{let[b,y]=Z.useState(o),x=r!==void 0,w=x?r:b,C=Z.useRef(null),[R,T]=Z.useState(false),[P,S]=Z.useState(null),k=(O,B)=>{if(!C.current)return w[0];let _=C.current.getBoundingClientRect(),U;t==="horizontal"?U=(O-_.left)/_.width:U=1-(B-_.top)/_.height,U=Math.max(0,Math.min(1,U));let $=i+U*(l-i),X=Math.round($/c)*c;return Math.max(i,Math.min(l,X))},E=(O,B)=>{let _=[...w];_[B]=O,B===0&&O>w[1]&&(_[0]=w[1]),B===1&&O<w[0]&&(_[1]=w[0]),x||y(_),a?.(_);},M=(O,B)=>{d||(O.preventDefault(),T(true),S(B),O.target.setPointerCapture(O.pointerId));},N=O=>{if(!R||P===null||d)return;let B=k(O.clientX,O.clientY);E(B,P);},H=()=>{R&&(T(false),S(null),s?.(w));},D=O=>{if(d)return;let B=k(O.clientX,O.clientY),_=Math.abs(w[0]-B),U=Math.abs(w[1]-B),$=_<=U?0:1;E(B,$);let X=[...w];X[$]=B,s?.(X);},L=(O,B)=>{if(d)return;let _=w[B];switch(O.key){case "ArrowRight":case "ArrowUp":O.preventDefault(),_=Math.min(l,w[B]+c);break;case "ArrowLeft":case "ArrowDown":O.preventDefault(),_=Math.max(i,w[B]-c);break;case "Home":O.preventDefault(),_=i;break;case "End":O.preventDefault(),_=l;break;default:return}E(_,B);let U=[...w];U[B]=_,s?.(U);},I=O=>(O-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},K=!(p in A),V=K?"":A[p],F=K?{backgroundColor:p}:void 0,z=K?{borderColor:p}:void 0,G=K?"custom":p,j={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[m&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(w[0])}),jsx("span",{children:f(w[1])})]}),jsxs("div",{ref:v,className:u(Dv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:u($N({orientation:t,size:n})),onClick:D,children:jsx("div",{className:u("absolute rounded-full",V,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${I(w[0])}%`,right:`${100-I(w[1])}%`,top:0,bottom:0,...F}:{bottom:`${I(w[0])}%`,top:`${100-I(w[1])}%`,left:0,right:0,...F}})}),w.map((O,B)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":O,"aria-orientation":t||void 0,"aria-disabled":d,className:u(GN({size:n,color:G}),R&&P===B&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${I(O)}% - ${j/2}px)`,top:"50%",transform:"translateY(-50%)",...z}:{position:"absolute",bottom:`calc(${I(O)}% - ${j/2}px)`,left:"50%",transform:"translateX(-50%)",...z},onPointerDown:_=>M(_,B),onPointerMove:N,onPointerUp:H,onPointerCancel:H,onKeyDown:_=>L(_,B)},B)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:w[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:w[1]})]})]})]})});Hv.displayName="RangeSlider";var tc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),YN=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),XN={help:HelpCircle,info:Info,warning:AlertCircle},Av=Z.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:m,contentClassName:f},p)=>{let[g,h]=Z.useState(false),[v,b]=Z.useState(false),[y,x]=Z.useState({top:0,left:0}),w=Z.useRef(null),C=Z.useRef(null),R=i!==void 0?i:g,T=Z.useCallback(E=>{i===void 0&&h(E),l?.(E);},[i,l]);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!R||!w.current)return;let E=()=>{let M=w.current.getBoundingClientRect(),N=C.current?.getBoundingClientRect(),H=N?.width||288,D=N?.height||100,L=8,I=0,A=0;switch(a){case "top":I=M.top-D-L,A=M.left+M.width/2-H/2;break;case "bottom":I=M.bottom+L,A=M.left+M.width/2-H/2;break;case "left":I=M.top+M.height/2-D/2,A=M.left-H-L;break;case "right":I=M.top+M.height/2-D/2,A=M.right+L;break}if(a==="top"||a==="bottom")switch(s){case "start":A=M.left;break;case "center":A=M.left+M.width/2-H/2;break;case "end":A=M.right-H;break}if(a==="left"||a==="right")switch(s){case "start":I=M.top;break;case "center":I=M.top+M.height/2-D/2;break;case "end":I=M.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),I=Math.max(8,Math.min(I,window.innerHeight-D-8)),x({top:I,left:A});};return E(),requestAnimationFrame(E),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true);}},[R,a,s]),Z.useEffect(()=>{if(!R)return;let E=M=>{C.current&&!C.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&T(false);};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[R,T]),Z.useEffect(()=>{if(!R)return;let E=M=>{M.key==="Escape"&&T(false);};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[R,T]);let P=XN[e??"help"],S=()=>{T(!R);},k=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?Z.isValidElement(o)?Z.cloneElement(o,{ref:w,onClick:E=>{o.props.onClick?.(E),S();}}):jsx("button",{ref:w,type:"button",onClick:S,className:u(tc({variant:e,size:t}),m),"aria-label":"Help",children:o}):jsx("button",{ref:E=>{w.current=E,typeof p=="function"?p(E):p&&(p.current=E);},type:"button",onClick:S,className:u(tc({variant:e,size:t}),m),"aria-label":"Help",children:jsx(P,{className:"h-full w-full"})}),v&&R&&Wa.createPortal(jsxs("div",{ref:C,className:u(YN({size:t}),f),style:{position:"fixed",top:y.top,left:y.left,transformOrigin:k()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});Av.displayName="ContextualHelp";var Ov=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),nc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function Bv({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:m,errorMessage:f,maxTags:p,...g}){let[h,v]=Z.useState(new Set),b=Z.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),y=R=>{if(s==="none")return;let T;s==="single"?T=b.has(R)?new Set:new Set([R]):(T=new Set(b),T.has(R)?T.delete(R):T.add(R)),a||v(T),i?.(T);},x=(R,T)=>{T.stopPropagation(),c?.(R);},w=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),m&&jsx("span",{className:"text-sm text-muted-foreground",children:m}),jsxs("div",{role:"group","aria-label":d,className:u(Ov({spacing:t}),e),...g,children:[w.map(R=>{let T=b.has(R.key),P=s!=="none";return jsxs("span",{role:P?"button":void 0,tabIndex:P&&!R.isDisabled?0:void 0,"aria-pressed":P?T:void 0,onClick:()=>!R.isDisabled&&y(R.key),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&!R.isDisabled&&(S.preventDefault(),y(R.key));},style:R.color?{backgroundColor:R.color}:void 0,className:u(nc({variant:R.color?void 0:n,size:r,isSelected:T,isDisabled:R.isDisabled}),P&&!R.isDisabled&&"cursor-pointer hover:opacity-80",R.color&&"text-white"),children:[R.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:R.icon}),R.label,l&&!R.isDisabled&&jsx("button",{type:"button",onClick:S=>x(R.key,S),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${R.label}`,children:jsx(X,{className:"h-3 w-3"})})]},R.key)}),C>0&&jsxs("span",{className:u(nc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}Bv.displayName="TagGroup";var $v=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"}}),Gv=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 Uv({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:m,...f}){let[p,g]=Z.useState(new Set),h=Z.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),v=b=>{if(a==="none")return;let y;a==="single"?y=h.has(b)?new Set:new Set([b]):(y=new Set(h),y.has(b)?y.delete(b):y.add(b)),o||g(y),s?.(y);};return r.length===0?jsx("div",{className:u("flex items-center justify-center p-8 text-muted-foreground",e),children:m||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:u($v({columns:t,gap:n,className:e})),...f,children:r.map(b=>{let y=h.has(b.key);return d?jsx("div",{role:"gridcell","aria-selected":y,onClick:()=>v(b.key),children:d(b,y)},b.key):jsxs("div",{role:"gridcell","aria-selected":y,"aria-disabled":b.isDisabled,onClick:()=>!b.isDisabled&&v(b.key),className:u(Gv({variant:l,size:c,isSelected:y,isDisabled:b.isDisabled})),children:[i&&a!=="none"&&y&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),b.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:b.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:b.label}),b.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:b.description})]})]},b.key)})})}Uv.displayName="GridList";var jv=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"}}),ri=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},_v=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},Wv=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},Yv=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Xv=Z.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...m},f)=>{let p=Z.useRef(null),[g,h]=Z.useState(false),v=Z.useCallback(V=>{let F=Wv(V);return F?_v(...F):[0,1,1]},[]),[b,y]=Z.useState(()=>v(r||o)),x=e??b[0],w=t??b[1],C=n??b[2];Z.useEffect(()=>{if(r){let V=v(r);y(V);}},[r,v]);let R=Z.useCallback((V,F)=>{if(l||!p.current)return;let z=p.current.getBoundingClientRect(),G=Math.max(0,Math.min(1,(V-z.left)/z.width)),j=Math.max(0,Math.min(1,(F-z.top)/z.height)),O=G,B=1-j;t===void 0&&n===void 0&&y([x,O,B]),a?.({hue:x,saturation:O,brightness:B});let _=ri(x,O,B);s?.(Yv(..._));},[l,x,t,n,a,s]),T=V=>{l||(V.preventDefault(),h(true),V.target.setPointerCapture(V.pointerId),R(V.clientX,V.clientY));},P=V=>{g&&R(V.clientX,V.clientY);},S=V=>{h(false),V.target.releasePointerCapture(V.pointerId);},[k,E,M]=ri(x,1,1),N=`rgb(${k}, ${E}, ${M})`,H=w*100,D=(1-C)*100,[L,I,A]=ri(x,w,C),K=`rgb(${L}, ${I}, ${A})`;return jsx("div",{ref:f,className:u(jv({size:i}),l&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:N},onPointerDown:T,onPointerMove:P,onPointerUp:S,onPointerLeave:S,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${c/2}px)`,backgroundColor:K,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Xv.displayName="ColorArea";var Zv=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"}}),nk=`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")`,qv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Qv=Z.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...m},f)=>{let p=Z.useRef(null),[g,h]=Z.useState(false),v=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[b,y]=Z.useState(t??v()),x=e??b,w=r==="hue"?x/360:x,C=Z.useCallback((N,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),L=a!=="vertical",I;L?I=Math.max(0,Math.min(1,(N-D.left)/D.width)):I=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?I*360:I;e===void 0&&y(A),n?.(A);},[i,a,r,e,n]),R=N=>{i||(N.preventDefault(),h(true),N.target.setPointerCapture(N.pointerId),C(N.clientX,N.clientY));},T=N=>{g&&C(N.clientX,N.clientY);},P=N=>{h(false),N.target.releasePointerCapture(N.pointerId);},S=()=>{let N=a!=="vertical",H=N?"to right":"to top";switch(r){case "hue":return N?qv:"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 qv}},k=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,E=a!=="vertical",M=w*100;return jsx("div",{ref:f,className:u(Zv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...m,children:jsxs("div",{ref:p,className:u("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?nk:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:R,onPointerMove:T,onPointerUp:P,onPointerLeave:P,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:S()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...E?{left:`calc(${M}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${M}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:k(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Qv.displayName="ColorSlider";var Jv=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"}}),ak=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},eh=Z.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let m=Z.useRef(null),[f,p]=Z.useState(false),[g,h]=Z.useState(t),v=e??g,b=Z.useCallback((R,T)=>{if(o||!m.current)return;let P=m.current.getBoundingClientRect(),S=P.width/2,k=R-P.left,E=T-P.top,M=ak(k,E,S);e===void 0&&h(M),n?.(M);},[o,e,n]),y=R=>{o||(R.preventDefault(),p(true),R.target.setPointerCapture(R.pointerId),b(R.clientX,R.clientY));},x=R=>{f&&b(R.clientX,R.clientY);},w=R=>{p(false),R.target.releasePointerCapture(R.pointerId);},C=()=>{let R=[];for(let T=0;T<=360;T+=30)R.push(`hsl(${T}, 100%, 50%) ${T}deg`);return `conic-gradient(from 270deg, ${R.join(", ")})`};return jsx("div",{ref:d,className:u(Jv({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:m,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:y,onPointerMove:x,onPointerUp:w,onPointerLeave:w,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(sk,{hue:v,innerRadius:a,thumbSize:s})]})})});eh.displayName="ColorWheel";var sk=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var rh=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-9 text-xs",md:"h-10 text-sm",lg:"h-11 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Do=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"}}),oh=Z.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:m=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:v,placeholder:b="Search...",disabled:y,...x},w)=>{let[C,R]=Z.useState(false),[T,P]=Z.useState(t),S=e!==void 0?e:T,k=Z.useRef(null);Z.useImperativeHandle(w,()=>k.current);let E=S.length>0,M=C&&(a.length>0||s.length>0||l.length>0||E),N=V=>{e===void 0&&P(V),n?.(V);},H=()=>{N(""),k.current?.focus();},D=V=>{V?.preventDefault(),S.trim()&&(r?.(S.trim()),R(false));},L=V=>{N(V.label),o?.(V),R(false);},I=V=>{N(V),r?.(V),R(false);},A=V=>{N(V),r?.(V),R(false);},K=Z.useMemo(()=>{let V={};return a.forEach(F=>{let z=F.category||"Results";V[z]||(V[z]=[]),V[z].push(F);}),V},[a]);return jsxs(ht,{open:M,onOpenChange:R,children:[jsx(Nn,{children:jsxs("form",{onSubmit:D,className:u(rh({size:g,variant:h}),v),children:[m&&jsx(Search,{className:u(Do({size:g}),"ml-3")}),jsx("input",{ref:k,type:"text",value:S,onChange:V=>N(V.target.value),onFocus:()=>R(true),placeholder:b,disabled:y,className:u("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!m&&"pl-3"),...x}),d&&E&&!y&&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",Do({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(xt,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:V=>V.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!E&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((V,F)=>jsxs("button",{type:"button",onClick:()=>I(V),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:u(Do({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V}),jsx(ArrowRight,{className:u(Do({size:g}),"opacity-0 group-hover:opacity-100")})]},F))]}),l.length>0&&!E&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((V,F)=>jsxs("button",{type:"button",onClick:()=>A(V),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:u(Do({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:V})]},F))]}),E&&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(K).map(([V,F])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:V})}),F.map(z=>jsxs("button",{type:"button",onClick:()=>L(z),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[z.icon||jsx(Search,{className:u(Do({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:z.label}),z.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:z.description})]})]},z.id))]},V)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});oh.displayName="SearchBar";var ah={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"})},lh=Z.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},m)=>{let[f,p]=Z.useState(""),g=Z.useRef(null),[h,v]=Z.useState(false);Z.useEffect(()=>{v(true);},[]),Z.useEffect(()=>{e||p("");},[e]),Z.useEffect(()=>{if(!e)return;let R=T=>{T.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[e,t]),Z.useEffect(()=>{if(e)return ln(),()=>cn()},[e]);let b=Z.useMemo(()=>{let R={};return n.forEach(T=>{let P=T.category||"Results";R[P]||(R[P]=[]),R[P].push(T);}),R},[n]),y=R=>{R.onSelect?.(),c?.(R),t?.(false);},x=()=>{t?.(false);},w=f.length>0,C=!w&&r.length>0;return !h||!e?null:Wa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:x}),jsx("div",{ref:m,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(R=>jsxs(Command.Item,{value:R.label,onSelect:()=>y(R),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:R.icon||ah[R.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:R.label}),R.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:R.description})]}),R.shortcut&&jsx("div",{className:"flex items-center gap-1",children:R.shortcut.map((T,P)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:T},P))})]},R.id))]}),w&&Object.entries(b).map(([R,T])=>jsxs(Command.Group,{heading:R,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:R}),T.map(P=>jsxs(Command.Item,{value:`${P.label} ${P.keywords?.join(" ")||""}`,onSelect:()=>y(P),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:P.icon||ah[R]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:P.label}),P.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:P.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},P.id))]},R)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});lh.displayName="SpotlightSearch";function yk(e="k"){let[t,n]=Z.useState(false);return Z.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var ch=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"}}),kk={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},dh=Z.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:m,className:f,...p},g)=>{let[h,v]=Z.useState(true),[b,y]=Z.useState(false);Z.useEffect(()=>{m&&localStorage.getItem(`banner-${m}`)==="true"&&v(false);},[m]),Z.useEffect(()=>{if(d&&h){let R=setTimeout(()=>{x();},d);return ()=>clearTimeout(R)}},[d,h]);let x=()=>{y(true),setTimeout(()=>{v(false),m&&localStorage.setItem(`banner-${m}`,"true"),s?.();},200);};if(!h)return null;let w=kk[t],C=r?o!==void 0?o:w?jsx(w,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:u(ch({variant:n,type:t,position:l}),c&&"animate-pulse",b&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:x,className:u("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});dh.displayName="Banner";var wa=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),Sk=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"}}),sc=Z.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:m,className:f,onClick:p,disabled:g,...h},v)=>{let[b,y]=Z.useState(false),x=o&&o.length>0,w=S=>{x&&y(!b),p?.(S);},C=S=>{S.onClick?.(),y(false);},R={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},T=l==="rotate"&&b?"rotate-45":"",P=l==="scale"&&b?"scale-0":"scale-100";return jsxs("div",{className:u("relative z-50",m!=="relative"&&m&&wa({position:m})),children:[x&&b&&jsx("div",{className:u("absolute left-1/2 -translate-x-1/2 flex items-center",R[a].container),children:o.map((S,k)=>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:`${k*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:S.label}),S.href?jsx("a",{href:S.href,className:u(wa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.icon}):jsx("button",{type:"button",onClick:()=>C(S),className:u(wa({variant:S.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":S.label,children:S.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:S.label})]},S.id))}),jsxs("button",{ref:v,type:"button",onClick:w,disabled:g,className:u(wa({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":x?b:void 0,...h,children:[b&&i?i:jsx("span",{className:u(Sk({size:d}),T,P,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&b&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>y(false)})]})});sc.displayName="FloatingActionButton";var Lk=sc;var gh=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"}}),mh=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),bh=Z.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[m,f]=Z.useState(a||r[0]?.key),p=o!==void 0,g=p?o:m,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},v=x=>t==="filled"?x?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":x?"text-primary":"text-muted-foreground hover:text-foreground",b=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},y=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:u(gh({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let w=g===x.key,C=i==="all"||i==="active"&&w,R=w&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:u(mh({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,w)},x.key);let T=jsxs("div",{onClick:()=>!x.href&&h(x),className:u(mh({variant:t}),v(w),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":w?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:u(b(),"[&>svg]:h-full [&>svg]:w-full"),children:R}),x.badge!==void 0&&x.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:x.badge>99?"99+":x.badge}),x.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&x.label&&jsx("span",{className:u(y(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:u("flex flex-1 flex-col items-center justify-center gap-1 no-underline",v(w)),children:T},x.key):T})})});bh.displayName="BottomNavigation";var Hk="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",hh=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"}}),xh=Z.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:m},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),m?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:Hk,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:u(hh({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})})})]})]})]})});xh.displayName="ActionSheet";var Rh=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),lc=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"}}),wh=Z.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},m)=>{let f=Z.useRef(null),[p,g]=Z.useState(0),[h,v]=Z.useState(false),b=Z.useRef(0),y=Z.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),w=r.length*(o==="sm"?64:o==="lg"?96:80),C=k=>{i||(v(true),b.current=k.touches[0].clientX,y.current=p);},R=k=>{if(!h||i)return;let M=k.touches[0].clientX-b.current,N=y.current+M;(N>0&&n.length===0||N<0&&r.length===0)&&(N=0),N>x?N=x+(N-x)*.3:N<-w&&(N=-w+(N+w)*.3),g(N);},T=()=>{if(!h)return;v(false);let k=f.current?.offsetWidth||0,E=Math.abs(p)/k;if(l&&E>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-w*a&&r.length>0?(g(-w),s?.("left")):g(0);},P=(k,E)=>{k.onAction?.(),s?.(E,k.key),g(0);},S=()=>{g(0);};return jsxs("div",{ref:m,className:u(Rh({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(k=>jsxs("button",{type:"button",onClick:()=>P(k,"right"),className:u(lc({variant:k.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:w},children:r.map(k=>jsxs("button",{type:"button",onClick:()=>P(k,"left"),className:u(lc({variant:k.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/w)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),jsx("div",{ref:f,className:u("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:R,onTouchEnd:T,onClick:p!==0?S:void 0,children:c})]})});wh.displayName="SwipeActions";var Th=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),Ak=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"}}),Mh=Z.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:m="Refreshing...",children:f,...p},g)=>{let h=Z.useRef(null),[v,b]=Z.useState(0),[y,x]=Z.useState("idle"),w=Z.useRef(0),C=Z.useRef(false),R=()=>l||y==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,T=M=>{R()&&(w.current=M.touches[0].clientY,C.current=true);},P=M=>{if(!C.current||!R())return;let H=M.touches[0].clientY-w.current;if(H<0){b(0),x("idle");return}let L=Math.min(H*.5,o);b(L),x(L>=r?"ready":"pulling");},S=async()=>{if(C.current)if(C.current=false,y==="ready"){x("refreshing"),b(r*.6);try{await n();}finally{x("idle"),b(0);}}else x("idle"),b(0);},k={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],E=()=>{if(y==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:u(k,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:m})]});let M=Math.min(v/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:u(k,"text-muted-foreground transition-transform"),style:{transform:`rotate(${M}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:y==="ready"?d:c})]})};return jsxs("div",{ref:g,className:u(Th({variant:t,className:e})),...p,children:[jsx("div",{className:u(Ak({size:i}),"z-10",y==="idle"&&v===0&&"opacity-0"),style:{top:Math.max(v-60,-60),opacity:Math.min(v/(r*.5),1)},children:E()}),jsx("div",{ref:h,className:u("transition-transform duration-200",y==="refreshing"&&"ease-out"),style:{transform:`translateY(${v}px)`,transition:C.current?"none":void 0},onTouchStart:T,onTouchMove:P,onTouchEnd:S,children:f})]})});Mh.displayName="PullToRefresh";var Zr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),zk={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},Nh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:zk,custom:i,transition:Zr(n,r,o),className:u(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&m}):m});Nh.displayName="Fade";var Ok=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},kh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=Z.useMemo(()=>Ok(i,l),[i,l]),p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Zr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});kh.displayName="Slide";var Bk={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"},Fk={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Ph=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},m)=>{let f=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:Fk,custom:i,transition:Zr(n,r,o),className:u(a),style:{transformOrigin:Bk[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Ph.displayName="Scale";var Eh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Zr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Eh.displayName="Collapse";var Sh=Z.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:m,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Zr(n,r,o),className:u("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Sh.displayName="Expand";var Lh=Z.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},m)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:m,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Zr(n,r,o),className:u(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Lh.displayName="Rotate";var Dh=Z.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let m=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:u("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[m]:r?180:0},transition:Zr(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})]})})});Dh.displayName="Flip";var Hh=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.useRef(null),c=m=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=m.clientX-p.left,h=m.clientY-p.top,v=Math.max(p.width,p.height)*2,b={id:Date.now(),x:g,y:h,size:v};i(y=>[...y,b]);},d=m=>{i(f=>f.filter(p=>p.id!==m));};return jsxs("div",{ref:a,className:u("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(m=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(m.id),className:"pointer-events-none absolute rounded-full",style:{left:m.x-m.size/2,top:m.y-m.size/2,width:m.size,height:m.size,backgroundColor:e}},m.id))})]})});Hh.displayName="Ripple";var Ih=Z.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"bounce":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Ih.displayName="Bounce";var Gk={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Vh=Z.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{x:0},shake:{x:Gk[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"shake":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Vh.displayName="Shake";var Uk={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Ah=Z.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:u(t&&Uk[n],r),children:e}));Ah.displayName="Pulse";var zh=Z.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,m={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:m,initial:"idle",animate:d?"wiggle":"idle",className:u(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});zh.displayName="Wiggle";var Oh=Z.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=Z.useState(false),d=t||l,m={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:m,className:u(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});Oh.displayName="Pop";var qk=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Bh=Z.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:m},f)=>{let p=Z.useRef(null),g=useInView(p,{once:true}),[h,v]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let x=setTimeout(()=>v(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let b=useMotionValue(t),y=useTransform(b,x=>qk(x,r,s,i));return Z.useEffect(()=>{if(h){let x=animate(b,e,{duration:n,ease:"easeOut",onComplete:m});return ()=>x.stop()}},[h,e,n,b,m]),jsx("span",{ref:p,className:u(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:y}),a]})})});Bh.displayName="Counter";var Fh=Z.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:m},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=Z.useState(""),[v,b]=Z.useState(0),[y,x]=Z.useState(false),[w,C]=Z.useState(false),R=Z.useRef(null),T=useInView(R,{once:true}),[P,S]=Z.useState(!l);return Z.useEffect(()=>{if(l&&T){let k=setTimeout(()=>S(true),n*1e3);return ()=>clearTimeout(k)}},[l,T,n]),Z.useEffect(()=>{if(!P||w)return;let k=p[v],E;return y?g.length>0?E=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),b(M=>(M+1)%p.length)):g.length<k.length?E=setTimeout(()=>{h(k.slice(0,g.length+1));},t):v<p.length-1||s?E=setTimeout(()=>{x(true);},r):(C(true),m?.()),()=>clearTimeout(E)},[P,g,v,y,w,p,t,i,r,s,m]),jsxs("span",{ref:R,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})]})});Fh.displayName="Typewriter";var Kh=Z.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=Z.useRef(null),d=useInView(c,{once:true,amount:.5}),m=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},v={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:u("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:m?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((b,y)=>jsxs(motion.span,{variants:v,className:"inline-block",children:[b,a==="word"&&y<p.length-1&&"\xA0"]},y))})})});Kh.displayName="TextReveal";var $h=Z.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(m=>(m+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:u("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});$h.displayName="WordRotate";var _h=Z.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:m=[.4,0,.2,1]},f)=>{let p=Z.useRef(null),g=useInView(p,{once:a,amount:s}),v={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],b={hidden:{opacity:0,x:v.x,y:v.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:m}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:b,initial:"hidden",animate:g?"visible":"hidden",className:u(i),children:e})})});_h.displayName="ScrollReveal";var Wh=Z.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),m=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?m:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",v=p?"left":"top";return jsxs("div",{ref:c,className:u("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:v,backgroundColor:n}}),i&&jsx(Qk,{progress:f,position:e})]})});Wh.displayName="ScrollProgress";var Qk=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=Z.useState(0);return Z.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:u("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},Yh=Z.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=Z.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),m=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:u("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:m,y:f},children:e})})});Yh.displayName="Parallax";var Zh=Z.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let m={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:u("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${m[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
|
|
56
56
|
@keyframes shimmer-right {
|
|
57
57
|
0% { transform: translateX(-100%); }
|
|
58
58
|
100% { transform: translateX(100%); }
|